/* ═══════════ FONTS ═══════════ */
@font-face {
    font-family: 'Mulish';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/Mulish-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Mulish';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/assets/fonts/Mulish-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Mulish';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/assets/fonts/Mulish-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Lora';
    font-style: normal;
    font-weight: 600 700;
    font-display: swap;
    src: url('/assets/fonts/Lora.woff2') format('woff2');
}

/* ═══════════ RESET ═══════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
nav ul, nav ol, .breadcrumb, .footer-links { list-style: none; }

/* ═══════════ DESIGN TOKENS ═══════════ */
:root {
    --cream: #fffdfb;
    --warm-bg: oklch(0.97 0.015 55);
    --midnight: #1b2b44;
    --text: #1f2933;
    --text-secondary: #475569;
    --text-tertiary: #647789;
    --accent: oklch(0.70 0.14 48);
    --accent-text: #a0603a;
    --accent-hover: oklch(0.63 0.16 48);
    --accent-light: oklch(0.94 0.04 48);
    --accent-subtle: oklch(0.97 0.02 48);
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --surface: white;
    /* Layered 3-shadow system instead of single shadow */
    --shadow-sm: 0 0 0 1px rgba(0,0,0,0.06), 0 1px 2px -1px rgba(0,0,0,0.06), 0 2px 4px 0 rgba(0,0,0,0.04);
    --shadow-md: 0 0 0 1px rgba(0,0,0,0.08), 0 2px 6px -1px rgba(0,0,0,0.08), 0 6px 16px 0 rgba(0,0,0,0.06);
    --shadow-lg: 0 0 0 1px rgba(0,0,0,0.06), 0 4px 12px -2px rgba(0,0,0,0.10), 0 12px 32px 0 rgba(0,0,0,0.08);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    /* Semantic colors */
    --warning: oklch(0.70 0.18 55);
    --warning-bg: #fff7ed;
    --warning-border: #f59e0b;
    --warning-text: #92400e;
    --danger: #dc2626;
    --danger-bg: oklch(0.95 0.04 10);
    --danger-border: oklch(0.55 0.20 25);
    --danger-text: oklch(0.35 0.15 25);
    --success: #16a34a;
    --whatsapp: #25D366;
    --whatsapp-hover: #20bd5a;

    /* Spacing scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 0.75rem;
    --space-lg: 1rem;
    --space-xl: 1.5rem;
    --space-2xl: 2rem;
    --space-3xl: 3rem;
    --space-section: 3.5rem;
}

/* ═══════════ TYPOGRAPHY ═══════════ */
body {
    font-family: 'Mulish', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.65;
    color: var(--text);
    background: var(--cream);
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
}

/* text-wrap pretty for better paragraph line breaks */
p { max-width: 65ch; text-wrap: pretty; }
html { scroll-behavior: smooth; }

/* text-wrap balance on headings to avoid orphans */
h1, h2, h3, .section-heading, .section-label {
    text-wrap: balance;
}

h1, h2, .section-heading {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    color: var(--midnight);
    letter-spacing: -0.025em;
    line-height: 1.15;
}

h3 {
    font-family: 'Mulish', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 700;
    color: var(--midnight);
    letter-spacing: -0.01em;
    line-height: 1.3;
}

/* Staggered fade-in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.container {
    max-width: 44rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Section labels — uppercase divider with line */
.section-label {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-text);
    margin-bottom: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.page-hero .section-label {
    border-top: none;
    padding-top: 0;
    margin-bottom: 0.75rem;
}

/* Section headings — large, dark, clear hierarchy */
.section-heading {
    font-size: clamp(1.625rem, 3.5vw, 2.125rem);
    font-weight: 700;
    color: var(--midnight);
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

/* ═══════════ HEADER ═══════════ */
header {
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: oklch(1 0 0 / 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1001;
    transition: padding 0.2s ease, box-shadow 0.2s ease;
}

header.scrolled {
    padding: 0.5rem 0;
    box-shadow: var(--shadow-sm);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.2;
    flex-shrink: 0;
}

.logo-icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 5px;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.byline {
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* ═══════════ BURGER (mobile only) ═══════════ */
.burger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.625rem;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 1001;
    position: relative;
}

.burger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--midnight);
    border-radius: 1px;
    transition: all 0.2s ease-out;
}

.burger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══════════ MOBILE NAV (slide-out) ═══════════ */
.nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(280px, 80vw);
    height: 100dvh;
    background: var(--cream);
    box-shadow: var(--shadow-lg);
    transition: right 0.25s ease-out;
    z-index: 1000;
    padding: 4.5rem 1.5rem 2rem;
    overflow-y: auto;
}

.nav-menu.active { right: 0; }

.nav-menu ul {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.nav-menu a {
    color: var(--midnight);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    display: block;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease-out, color 0.15s ease-out;
}

.nav-menu a:hover {
    color: var(--accent);
    background: var(--accent-subtle);
}

.nav-menu a[aria-current="page"] {
    color: var(--accent);
    font-weight: 700;
    background: var(--accent-subtle);
}

/* Overlay */
.menu-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100dvh;
    background: oklch(0.15 0 0 / 0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease-out, visibility 0.25s ease-out;
    z-index: 999;
}

.menu-overlay.active { opacity: 1; visibility: visible; }

/* ═══════════ DESKTOP NAV ═══════════ */
@media (min-width: 768px) {
    .burger,
    .menu-overlay { display: none !important; }

    .nav-menu {
        all: unset;
        display: flex;
    }

    .nav-menu ul {
        flex-direction: row;
        gap: 0.125rem;
        align-items: center;
    }

    .nav-menu a {
        font-size: 0.8125rem;
        font-weight: 600;
        padding: 0.375rem 0.75rem;
        border-radius: 999px;
        white-space: nowrap;
    }
}

@media print {
    header, .menu-overlay { display: none; }
}

/* ═══════════ CTA BUTTONS ═══════════ */
.cta-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.125rem 1.75rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1.0625rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px oklch(0.70 0.14 48 / 0.25);
}

.cta-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px oklch(0.70 0.14 48 / 0.35);
}

/* Active state scale-down for tactile feedback */
.cta-primary:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px oklch(0.70 0.14 48 / 0.2);
}

.cta-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    border: 1px solid var(--border);
    transition: border-color 0.2s ease-out, box-shadow 0.2s ease-out;
}

/* Shadow transition on hover instead of border-color change */
.cta-secondary:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.cta-secondary:active {
    transform: scale(0.97);
}

/* WhatsApp CTA */
.cta-wa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--whatsapp);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.25);
}

.cta-wa:hover {
    background: var(--whatsapp-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
}

.cta-wa:active {
    transform: scale(0.97);
}

/* ═══════════ FOOTER ═══════════ */
footer {
    background: var(--midnight);
    color: oklch(0.85 0 0);
    padding: 3rem 0 2rem;
    margin-top: var(--space-section);
    font-size: 0.875rem;
    line-height: 1.6;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 640px) {
    .footer-inner {
        grid-template-columns: 2fr 1fr 1fr;
        gap: 3rem;
    }
}

.footer-about p {
    color: oklch(0.80 0 0);
    font-size: 0.8125rem;
    max-width: 30rem;
}

.footer-brand {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.footer-orgs {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.footer-org {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    border: 1px solid oklch(0.4 0 0);
    color: oklch(0.75 0 0);
}

.footer-col-title {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: oklch(0.75 0 0);
    margin-bottom: 0.75rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    color: oklch(0.75 0 0);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: color 0.15s ease-out;
}

.footer-links a:hover { color: white; }

.footer-bottom {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid oklch(0.3 0 0);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: oklch(0.75 0 0);
}

.footer-bottom a {
    color: oklch(0.75 0 0);
    text-decoration: none;
}

.footer-bottom a:hover { color: oklch(0.8 0 0); }

/* ═══════════ MEDICAL REVIEW BADGE ═══════════ */

.medical-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.375rem 0.875rem;
    margin-top: 1rem;
    text-decoration: none;
    transition: border-color 0.15s ease-out;
}

.medical-badge:hover {
    border-color: var(--accent-text);
    color: var(--text-secondary);
}

.medical-badge svg {
    width: 14px;
    height: 14px;
    stroke: var(--accent-text);
    flex-shrink: 0;
}

/* ═══════════ PAGE LAYOUT (unified subpage template) ═══════════ */

/* Breadcrumb — consistent across all pages */
ul.breadcrumb,
ol.breadcrumb,
.breadcrumb {
    list-style: none !important;
    list-style-type: none !important;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    padding: 1.5rem 0 0.5rem;
    margin: 0;
}
.breadcrumb li {
    list-style: none;
    display: inline;
}
.breadcrumb a { color: var(--text-tertiary); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb li + li::before { content: "›"; margin-right: 0.5rem; color: var(--text-tertiary); }

/* Page hero — warm bg, consistent padding */
.page-hero {
    background: var(--warm-bg);
    padding: 2.5rem 0 3rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--space-section);
    position: relative;
    overflow: hidden;
}
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    background-size: 200px;
    pointer-events: none;
    z-index: 0;
}
.page-hero::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 60%;
    height: 140%;
    background: radial-gradient(ellipse, oklch(0.93 0.04 48 / 0.3) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.page-hero > * { position: relative; z-index: 1; }
.page-hero .container { text-align: left; }
.page-hero h1 {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    color: var(--midnight);
    line-height: 1.1;
    letter-spacing: -0.035em;
    margin-bottom: 1.25rem;
}
.page-hero .lead {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 40rem;
    line-height: 1.65;
}

/* Content sections — consistent spacing */
.content-section {
    margin-bottom: var(--space-section);
}

/* Final CTA — unified style */
.final-cta {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    margin-top: var(--space-section);
    margin-bottom: 2rem;
}
.final-cta h2 {
    font-size: clamp(1.375rem, 3vw, 1.75rem);
    font-weight: 700;
    color: white;
    margin-bottom: 0.75rem;
}
.final-cta > p {
    color: oklch(1 0 0 / 0.85);
    max-width: 26rem;
    margin: 0 auto 2rem;
    font-size: 1rem;
}
.final-cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    max-width: 18rem;
    margin: 0 auto;
}
.final-cta-buttons a {
    display: block;
    padding: 0.875rem 1.5rem;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 700;
    text-align: center;
    font-size: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.final-cta-buttons a:hover { transform: translateY(-1px); }
.final-cta-buttons a:active { transform: translateY(-1px) scale(0.98); }
.final-cta-buttons .btn-white { background: white; color: var(--accent); }
.final-cta-buttons .btn-outline {
    background: transparent; color: white;
    border: 2px solid oklch(1 0 0 / 0.4);
}
.final-cta-buttons .btn-outline:hover { border-color: white; }

/* ═══════════ CONTACT PILLS ═══════════ */
.contact-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.contact-pills a,
.contact-pills a:hover,
.contact-pills a:visited {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.15s ease-out, color 0.15s ease-out, box-shadow 0.15s ease-out;
}

.contact-pills .cp-phone {
    background: var(--accent);
    color: white;
}

.contact-pills .cp-phone:hover {
    background: var(--accent-hover);
}

.contact-pills .cp-wa,
.contact-pills .cp-email,
.contact-pills .cp-chat {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.contact-pills a:active { transform: scale(0.97); }

.contact-pills .cp-wa:hover,
.contact-pills .cp-email:hover,
.contact-pills .cp-chat:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.contact-pills svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ═══════════ SPACING RHYTHM ═══════════ */
.section-gap { margin-top: var(--space-section); }
.section-gap-sm { margin-top: 3rem; }

/* ═══════════ LINKS ═══════════ */
.section-link {
    color: var(--accent-text);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.875rem;
}

.section-link:hover { text-decoration: underline; }

/* ═══════════ FOCUS & SELECTION ═══════════ */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

::selection {
    background: var(--accent-light);
    color: var(--midnight);
}

/* ═══════════ SCROLL REVEAL ═══════════ */
/* Only hide when JS is available (html.js class set by inline script) */
.js .reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.js .reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children when parent has .reveal-stagger */
.js .reveal-stagger > .reveal:nth-child(2) { transition-delay: 60ms; }
.js .reveal-stagger > .reveal:nth-child(3) { transition-delay: 120ms; }
.js .reveal-stagger > .reveal:nth-child(4) { transition-delay: 180ms; }
.js .reveal-stagger > .reveal:nth-child(5) { transition-delay: 240ms; }
.js .reveal-stagger > .reveal:nth-child(6) { transition-delay: 300ms; }

@media (prefers-reduced-motion: reduce) {
    .js .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ═══════════ SIDEBAR TOC (desktop only) ═══════════ */
.toc-sidebar {
    display: none;
}

@media (min-width: 1440px) {
    .toc-sidebar {
        display: block;
        position: fixed;
        top: 4rem;
        left: calc((100vw + 60rem) / 2 + 1.5rem);
        width: 12rem;
        max-height: calc(100dvh - 5rem);
        overflow-y: auto;
        padding: 0.75rem 0;
        z-index: 50;
        border-top: 1px solid var(--border-light);
        opacity: 0;
        transform: translateY(8px);
        transition: opacity 0.3s ease-out, transform 0.3s ease-out;
        pointer-events: none;
    }

    .toc-sidebar.toc-visible {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .toc-sidebar .toc-title {
        font-size: 0.6875rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--text-tertiary);
        margin-bottom: 0.75rem;
        padding-left: 0.75rem;
    }

    .toc-sidebar a {
        display: block;
        font-size: 0.8125rem;
        font-weight: 500;
        color: var(--text-tertiary);
        text-decoration: none;
        padding: 0.3rem 0.75rem;
        border-left: 2px solid transparent;
        transition: color 0.15s ease-out, border-color 0.15s ease-out;
        line-height: 1.4;
    }

    .toc-sidebar a:hover {
        color: var(--text);
    }

    .toc-sidebar a.active {
        color: var(--accent);
        border-left-color: var(--accent);
        font-weight: 600;
    }
}
