/* ==========================================================================
   Daily Health Report — Shared Stylesheet
   Mobile-First: base styles target mobile; min-width queries enhance for
   larger screens (tablet ≥768px, desktop ≥1024px).
   ========================================================================== */

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

:root {
    --primary-teal: #00A0A0;
    --dark-teal: #007878;
    --light-teal: #E6F7F7;
    --text-dark: #222222;
    --text-gray: #4A4A4A;
    --text-light: #767676;
    --border-color: #E0E0E0;
    --bg-white: #FFFFFF;
    --bg-gray: #F8F9FA;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-white);
}

a {
    color: var(--primary-teal);
}

img {
    max-width: 100%;
}

/* ===== Top Bar ===== */
.top-bar {
    background: var(--primary-teal);
    color: white;
    padding: 0.5rem 0;
    font-size: 0.78rem;
}

.top-bar-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

/* ===== Header ===== */
header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: relative;
}

/* Hamburger toggle — visible on mobile only */
.nav-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.logo img {
    height: 56px;
    width: auto;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-teal);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

/* ===== Navigation — base = mobile + tablet (< 1024px): hamburger dropdown ===== */
nav.site-nav { display: none; }
nav.site-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    z-index: 1500;
    padding: 0.5rem 0;
}

/* Search field — pinned to the TOP of the mobile dropdown */
.nav-search { order: -1; padding: 0.5rem 1.25rem 0.75rem; }
.nav-search-field { position: relative; display: flex; align-items: center; }
.nav-search-field > svg {
    position: absolute; left: 0.85rem; width: 18px; height: 18px;
    stroke: var(--text-light); stroke-width: 2; fill: none; pointer-events: none;
}
.nav-search-input {
    width: 100%;
    padding: 0.7rem 0.9rem 0.7rem 2.6rem;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-dark);
}
.nav-search-input:focus { outline: none; border-color: var(--primary-teal); }

.nav-search-results:not(:empty) { padding: 0.25rem 0.75rem 0.5rem; }
.nsr-item { display: block; padding: 0.5rem 0.6rem; border-radius: 6px; text-decoration: none; }
.nsr-item:hover { background: var(--light-teal); }
.nsr-type { display: block; font-size: 0.66rem; font-weight: 600; color: var(--dark-teal); text-transform: uppercase; letter-spacing: 0.04em; }
.nsr-title { display: block; font-size: 0.92rem; color: var(--text-dark); font-weight: 600; line-height: 1.3; }
.nsr-hint { color: var(--text-light); font-size: 0.85rem; padding: 0.5rem 0.6rem; }
.nsr-all { display: block; text-align: center; padding: 0.6rem; color: var(--primary-teal); font-weight: 600; font-size: 0.85rem; text-decoration: none; border-top: 1px solid var(--border-color); }
.nsr-all:hover { background: var(--bg-gray); }

nav.site-nav ul { display: flex; flex-direction: column; gap: 0; list-style: none; padding: 0; }
nav.site-nav li { width: 100%; }
nav.site-nav a {
    display: block;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    text-decoration: none;
    color: var(--text-gray);
    font-weight: 500;
    transition: color 0.2s;
}
nav.site-nav a:hover { color: var(--primary-teal); }

/* ===== Search button (magnifier) ===== */
.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--text-gray);
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.search-btn:hover { background: var(--light-teal); color: var(--dark-teal); }
.search-btn svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }

/* ===== Breadcrumb ===== */
.breadcrumb {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 1.25rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--primary-teal);
    text-decoration: none;
}

/* ===== Meta items (date / read time / review) ===== */
.article-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.meta-item svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    flex-shrink: 0;
}

/* ===== Tags ===== */
.article-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--light-teal);
    color: var(--dark-teal);
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    text-decoration: none;
}

/* ==========================================================================
   Article Detail Page
   ========================================================================== */
.article-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
}

.article-page .article-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.article-page .article-dek {
    font-size: 1.1rem;
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.byline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.byline-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--light-teal);
    color: var(--dark-teal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.byline-info {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.4;
}

.byline-info strong {
    color: var(--text-dark);
    display: block;
    font-size: 0.95rem;
}

.article-hero {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.article-hero-caption {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.article-body {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-gray);
}

.article-body h2 {
    font-size: 1.4rem;
    color: var(--text-dark);
    margin: 2.5rem 0 1rem;
    line-height: 1.3;
}

.article-body h3 {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin: 1.75rem 0 0.75rem;
}

.article-body p {
    margin-bottom: 1.25rem;
}

.article-body ul,
.article-body ol {
    margin: 0 0 1.25rem 1.5rem;
}

.article-body li {
    margin-bottom: 0.6rem;
}

.article-body blockquote {
    border-left: 4px solid var(--primary-teal);
    background: var(--light-teal);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-dark);
}

.key-takeaways {
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem 1.75rem;
    margin: 2rem 0;
}

.key-takeaways h2 {
    font-size: 1.2rem;
    margin: 0 0 0.75rem;
}

.key-takeaways ul {
    margin-left: 1.25rem;
    margin-bottom: 0;
}

.medical-note {
    font-size: 0.9rem;
    color: var(--text-light);
    background: var(--bg-gray);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin: 2.5rem 0 1rem;
    line-height: 1.6;
}

.references {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.references h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.references ol {
    margin-left: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.references li {
    margin-bottom: 0.5rem;
}

/* ===== Related articles ===== */
.related-section {
    max-width: 1280px;
    margin: 3rem auto 0;
    padding: 2rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

.related-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Mobile: single column */
.related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.related-card {
    text-decoration: none;
    color: inherit;
}

.related-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.related-card h3 {
    font-size: 1.05rem;
    line-height: 1.4;
    color: var(--text-dark);
    transition: color 0.2s;
}

.related-card:hover h3 {
    color: var(--primary-teal);
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
    background: #2C2C2C;
    color: #CCCCCC;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Mobile: two columns (2x2) for a balanced footer */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem 1.25rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: white;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #CCCCCC;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: var(--primary-teal);
}

.footer-disclaimer {
    background: rgba(0,0,0,0.2);
    padding: 1.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.6;
    margin: 2rem 0;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #444;
    font-size: 0.85rem;
    color: #999;
}

/* ===== Footer social icons ===== */
.footer-social {
    display: flex;
    gap: 0.85rem;
    margin: 0 0 1.5rem;
}

.footer-social a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #CCCCCC;
    transition: background 0.2s, color 0.2s;
}

.footer-social a:hover {
    background: var(--primary-teal);
    color: #fff;
}

.footer-social svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ==========================================================================
   Legal / Static Content Pages
   ========================================================================== */
.legal-page {
    max-width: 820px;
    margin: 0 auto;
    padding: 2rem 1.25rem 1rem;
}

.legal-page h1 {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.legal-updated {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.legal-page h2 {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin: 2rem 0 0.75rem;
}

.legal-page h3 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin: 1.5rem 0 0.5rem;
}

.legal-page p,
.legal-page li {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-gray);
}

.legal-page p {
    margin-bottom: 1rem;
}

.legal-page ul,
.legal-page ol {
    margin: 0 0 1rem 1.5rem;
}

.legal-page li {
    margin-bottom: 0.5rem;
}

.legal-page a {
    color: var(--primary-teal);
}

.legal-callout {
    background: var(--light-teal);
    border-left: 4px solid var(--primary-teal);
    border-radius: 0 8px 8px 0;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-dark);
    line-height: 1.7;
}

/* ==========================================================================
   Tablet and up (≥768px)
   ========================================================================== */
@media (min-width: 768px) {
    .top-bar {
        font-size: 0.85rem;
    }
    .top-bar-content,
    .header-container,
    .breadcrumb,
    .footer-content,
    .related-section {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    .header-container {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    .logo img {
        height: 72px;
    }
    .logo-text {
        font-size: 1.6rem;
    }
    .article-page {
        padding: 2rem;
    }
    .article-page .article-header h1 {
        font-size: 2.4rem;
    }
    .article-page .article-dek {
        font-size: 1.2rem;
    }
    .article-body {
        font-size: 1.08rem;
    }
    .article-body h2 {
        font-size: 1.6rem;
    }
    .article-body h3 {
        font-size: 1.25rem;
    }
    .legal-page {
        padding: 2.5rem 2rem 1rem;
    }
    .legal-page h1 {
        font-size: 2.2rem;
    }
    .legal-page h2 {
        font-size: 1.4rem;
    }
    /* Footer: two columns on tablet */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   Desktop and up (≥1024px)
   ========================================================================== */
@media (min-width: 1024px) {
    .related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* ===== Desktop header: hamburger off, nav inline & left-aligned by the logo ===== */
    .nav-toggle { display: none; }
    .header-container {
        justify-content: flex-start;
        gap: 2.5rem;
    }
    nav.site-nav {
        display: flex;
        align-items: center;
        position: static;
        background: none;
        border: none;
        box-shadow: none;
        padding: 0;
    }
    nav.site-nav ul {
        flex-direction: row;
        gap: 2rem;
    }
    nav.site-nav li { width: auto; }
    nav.site-nav a {
        display: inline;
        padding: 0;
        font-size: 0.95rem;
        position: relative;
    }
    nav.site-nav a::after {
        content: '';
        position: absolute;
        bottom: -4px;
        left: 0;
        width: 0;
        height: 2px;
        background: var(--primary-teal);
        transition: width 0.3s;
    }
    nav.site-nav a:hover::after { width: 100%; }

    /* Push the search button to the far right */
    .search-btn { margin-left: auto; }
    .header-container { position: relative; }

    /* Search field: hidden until toggled, then expands inline at the RIGHT, left of the button */
    .nav-search {
        order: 2;
        display: none;
        padding: 0;
        margin: 0;
        position: absolute;
        top: 50%;
        right: 3.25rem;
        transform: translateY(-50%);
    }
    nav.site-nav.search-open .nav-search { display: block; }
    .nav-search-field > svg { left: 0.75rem; }
    nav.site-nav.search-open .nav-search-input {
        width: 240px;
        padding: 0.5rem 0.9rem 0.5rem 2.3rem;
    }
    .nav-search-results:not(:empty) {
        position: absolute;
        top: 100%;
        right: 0;
        left: auto;
        width: 320px;
        margin-top: 0.5rem;
        padding: 0.4rem;
        background: var(--bg-white);
        border: 1px solid var(--border-color);
        border-radius: 10px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.12);
        z-index: 1600;
    }
}
