/* ========================================
   RESET
======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    background: #ffffff;
    color: #222222;

    line-height: 1.6;
    min-height: 100vh;

    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}


/* ========================================
   HEADER
======================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;

    width: 100%;

    background: #ffffff;

    border-bottom: 1px solid #e5e5e5;
}

.header-container {
    width: 100%;
    max-width: 1200px;

    margin: 0 auto;

    min-height: 64px;

    padding: 0 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}


/* ========================================
   LOGO
======================================== */

.logo {
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: -0.6px;
    color: #222222;
}

.logo em {
    font-style: italic;
    font-weight: 500;
}


/* ========================================
   NAVIGATION
======================================== */

.main-nav {
    display: none;
}

.main-nav ul {
    list-style: none;

    display: flex;
    align-items: center;

    gap: 28px;
}

.main-nav a {
    position: relative;

    color: #444444;

    font-size: 0.95rem;
    font-weight: 500;

    transition: color 0.2s ease;
}

.main-nav a:hover {
    color: #000000;
}

.main-nav a.active {
    color: #000000;
    font-weight: 600;
}


/* ========================================
   MOBILE MENU BUTTON
======================================== */

.menu-toggle {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    padding: 0;

    border: none;
    background: transparent;

    cursor: pointer;
}


/* ========================================
   HAMBURGER ICON
======================================== */

.hamburger-icon {
    width: 24px;
    height: 18px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    position: relative;
}

.hamburger-icon span {
    display: block;

    width: 100%;
    height: 2px;

    background: #222222;

    border-radius: 2px;

    transition:
        transform 0.25s ease,
        opacity 0.2s ease;
}


/* ========================================
   HAMBURGER → X
======================================== */

.menu-toggle.menu-open .hamburger-icon span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.menu-open .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.menu-open .hamburger-icon span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}


/* ========================================
   MOBILE NAVIGATION
======================================== */

@media (max-width: 767px) {

    .main-nav {
        display: none;
    }

    .main-nav.mobile-open {
        display: block;

        position: absolute;

        top: 64px;
        left: 0;
        right: 0;

        background: #ffffff;

        border-bottom: 1px solid #e5e5e5;

        padding: 15px 20px;
    }

    .main-nav.mobile-open ul {
        flex-direction: column;

        align-items: flex-start;

        gap: 0;
    }

    .main-nav.mobile-open li {
        width: 100%;

        border-bottom: 1px solid #eeeeee;
    }

    .main-nav.mobile-open li:last-child {
        border-bottom: none;
    }

    .main-nav.mobile-open a {
        display: block;

        width: 100%;

        padding: 12px 0;
    }
}


/* ========================================
   MAIN CONTENT
======================================== */

main {
    flex: 1;
}

.page-container {
    width: 100%;
    max-width: 1200px;

    margin: 0 auto;

    padding: 24px 20px 48px 20px;
}

.page-title {
    color: #111111;

    font-size: 2rem;
    line-height: 1.2;

    margin-bottom: 8px;
}

.page-text {
    max-width: 800px;

    color: #555555;

    font-size: 1rem;
}


/* ========================================
   FOOTER
======================================== */

.site-footer {
    background: #f5f5f5;
    border-top: 1px solid #e5e5e5;
    padding: 18px 20px;
}

.footer-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    text-align: center;
}

.footer-links {
    display: flex;
    gap: 8px 18px;
}

.footer-links a {
    color: #555555;
    font-size: 0.85rem;
}

.footer-links a:hover {
    color: #000000;
}

.footer-copyright {
    color: #777777;

    font-size: 0.8rem;
}

@media (max-width: 600px) {

    .footer-container {
        flex-direction: column;
        gap: 8px;
    }

    .footer-links {
        gap: 15px;
    }

}

/* ========================================
   TABLET / DESKTOP
======================================== */

@media (min-width: 768px) {

    .header-container {
        min-height: 70px;

        padding: 0 30px;
    }

    .logo {
        font-size: 1.35rem;
    }

    /*
       Desktop navigation is always visible.
    */

    .main-nav {
        display: block;
    }

    /*
       Hamburger button is hidden on desktop.
    */

    .menu-toggle {
        display: none;
    }

    .page-container {
        padding: 36px 30px 60px 30px; /* 36px top, 30px sides, 60px bottom */
    }

    .page-title {
        font-size: 2.5rem;
    }

    .site-footer {
        padding: 20px 30px;
    }

    .footer-container {
        flex-direction: row;
    }

    .footer-links {
        order: 2;
    }

    .footer-copyright {
        order: 1;
    }
}

/* ========================================
   CONTENT LAYOUT & SIDEBAR
======================================== */

.content-layout {
    display: flex;
    flex-direction: column;
    gap: 36px;
    width: 100%;
}

.main-body {
    width: 100%;
    min-width: 0; /* Prevents overflow issues with code or pre elements */
}

/* Sidebar Container */
.right-sidebar {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Individual Sidebar Card/Widget Styling */
.sidebar-widget {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
}

.widget-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #111111;
    margin-bottom: 12px;
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 8px;
}

.widget-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.widget-list a {
    color: #444444;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.widget-list a:hover {
    color: #000000;
    text-decoration: underline;
}

/* ========================================
   DESKTOP / TABLET SIDEBAR MEDIA QUERY
======================================== */

@media (min-width: 900px) {
    .content-layout {
        flex-direction: row;
        align-items: flex-start;
        gap: 48px;
    }

    .main-body {
        flex: 1; /* Takes all remaining available width */
    }

    .right-sidebar {
        width: 300px; /* Fixed column width */
        flex-shrink: 0;
        position: sticky;
        top: 84px; /* Sticks cleanly below the 70px sticky header */
    }
}

/* ========================================
   HOME PAGE INTRODUCTION & CARDS
======================================== */

.home-intro {
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.intro-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.intro-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #15803d;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 14px;
}

/* Feature Cards Grid */
.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.feature-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 24px;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.feature-card:hover {
    border-color: #cccccc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.feature-icon {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.feature-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #111111;
    margin-bottom: 8px;
}

.feature-description {
    font-size: 0.92rem;
    color: #555555;
    line-height: 1.55;
}

/* Callout Banner */
.insights-banner {
    background-color: #fafafa;
    border-left: 4px solid #15803d;
    border-top: 1px solid #e5e5e5;
    border-right: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
    border-radius: 0 8px 8px 0;
    padding: 24px 26px;
}

.banner-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111111;
    margin-bottom: 8px;
}

.banner-text {
    font-size: 0.93rem;
    color: #444444;
    line-height: 1.6;
}

.banner-text strong {
    color: #111111;
}

/* Tablet & Desktop Grid Behavior */
@media (min-width: 680px) {
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

/* ========================================
   ABOUT PAGE STYLING
======================================== */

.about-container {
    display: flex;
    flex-direction: column;
    gap: 36px;
}

/* Header & Eyebrow */
.page-header {
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 28px;
}

.eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #15803d;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.page-header .page-title {
    margin-bottom: 12px;
}

.page-lead {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555555;
    max-width: 780px;
}

/* About Grid Layout */
.about-section {
    width: 100%;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: start;
}

/* Narrative Text Column */
.about-text h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #111111;
    margin-bottom: 14px;
}

.about-text p {
    font-size: 0.96rem;
    color: #444444;
    line-height: 1.65;
    margin-bottom: 16px;
}

.about-text p:last-child {
    margin-bottom: 0;
}

/* Approach / Pillars Card */
.about-card {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-left: 4px solid #15803d; /* Clinical green highlight */
    border-radius: 0 8px 8px 0;
    padding: 24px;
}

.about-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #111111;
    margin-bottom: 16px;
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 8px;
}

.about-card-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.about-card-list li {
    font-size: 0.92rem;
    color: #333333;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Subtle Green SVG Checkmark Bullet */
.about-card-list li::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2315803d'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* Tablet & Desktop Layout */
@media (min-width: 768px) {
    .about-content {
        grid-template-columns: 1.25fr 1fr; /* Two-column split */
        gap: 36px;
    }
}

/* ========================================
   DILI SEARCH & EXPANDED CARD STYLES
======================================== */

.dili-page-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dili-badge-pill {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #15803d;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
}

/* Search Container */
.dili-search-box {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
}

.dili-search-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dili-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #333333;
    margin-bottom: 6px;
}

.dili-input,
.dili-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.9rem;
    border: 1px solid #cccccc;
    border-radius: 5px;
    background: #ffffff;
    color: #222222;
}

.dili-input:focus,
.dili-select:focus {
    outline: none;
    border-color: #1e293b;
}

.dili-btn-group {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.dili-submit-btn {
    padding: 10px 24px;
}

.dili-reset-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    text-decoration: none;
}

/* Result Cards List */
.dili-results-summary {
    margin-bottom: 16px;
    font-size: 0.95rem;
    color: #444444;
}

.dili-cards-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Card Presentation */
.dili-result-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 22px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.dili-result-card.high { border-left: 5px solid #dc2626; }
.dili-result-card.moderate { border-left: 5px solid #d97706; }
.dili-result-card.neutral { border-left: 5px solid #64748b; }
.dili-result-card.safe { border-left: 5px solid #15803d; }

.dili-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.dili-compound-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

/* Badges */
.dili-status-badge {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 14px;
    letter-spacing: 0.3px;
}

.badge-danger { background-color: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-warning { background-color: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.badge-neutral { background-color: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }
.badge-success { background-color: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* Narrative Sections Inside Card */
.dili-section-block {
    margin-bottom: 16px;
}

.dili-section-block:last-child {
    margin-bottom: 0;
}

.dili-block-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
    margin-bottom: 6px;
}

.dili-narrative-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #1e293b;
    margin: 0;
}

.dili-fallback-text {
    color: #475569;
}

/* Legend Overview Banner */
.dili-overview-banner {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 24px;
}

.dili-overview-banner h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 14px;
    color: #111111;
}

.dili-tier-legend {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.legend-item {
    font-size: 0.9rem;
    color: #444444;
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-bullet {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.bullet-danger { background-color: #dc2626; }
.bullet-warning { background-color: #d97706; }
.bullet-neutral { background-color: #64748b; }
.bullet-success { background-color: #15803d; }

@media (min-width: 768px) {
    .dili-search-controls {
        flex-direction: row;
        align-items: flex-end;
    }

    .dili-input-group {
        flex: 2;
    }

    .dili-select-group {
        flex: 1;
    }

    .dili-tier-legend {
        grid-template-columns: 1fr 1fr;
    }
}

.dili-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e5e5;
}

.pagination-info {
    font-size: 0.9rem;
    color: #64748b;
}

.pagination-controls {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.dili-references-text p {
    margin-bottom: 12px;
    line-height: 1.6;
    color: #1e293b;
}

.dili-references-text p:last-child {
    margin-bottom: 0;
}