/* ==================== VARIABLES ==================== */
:root {
    --color-rust: #C4553A;
    --color-rust-light: #D4756A;
    --color-rust-dark: #A3432D;
    --color-cream: #FFF8F0;
    --color-cream-dark: #F5EDDF;
    --color-dark: #2D2926;
    --color-dark-soft: #4A4340;
    --color-warm-grey: #8A7E7A;
    --color-green: #5B8A5E;
    --color-green-light: #E8F0E8;
    --color-amber: #D4A24E;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --max-width: 800px;
    --section-padding: 5rem 1.5rem;
}

/* ==================== RESET & BASE ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    color: var(--color-dark);
    background-color: var(--color-cream);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* ==================== LANGUAGE TOGGLE ==================== */
/* Dutch visible by default, English hidden */
[lang="en"] {
    display: none;
}

body.lang-en [lang="en"] {
    display: inline;
}

body.lang-en [lang="nl"] {
    display: none;
}

/* Toggle button: show opposite language label
   Dutch mode: show "EN" (lang=nl span), hide "NL" (lang=en span)
   English mode: show "NL" (lang=en span), hide "EN" (lang=nl span)
   This is handled by the general [lang] rules above — no overrides needed */

.lang-toggle {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 100;
    background: var(--color-dark);
    color: var(--color-cream);
    border: none;
    border-radius: 2rem;
    padding: 0.5rem 1.1rem;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: background 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.lang-toggle:hover {
    background: var(--color-dark-soft);
    transform: scale(1.05);
}

/* ==================== LAYOUT ==================== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: var(--section-padding);
}

.section-alt {
    background-color: var(--color-cream-dark);
}

/* ==================== TYPOGRAPHY ==================== */
h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
}

h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
    color: var(--color-rust-dark);
}

h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-dark);
}

p {
    margin-bottom: 1rem;
    color: var(--color-dark-soft);
}

strong {
    color: var(--color-dark);
}

/* ==================== HERO ==================== */
.hero {
    padding: 8rem 1.5rem 5rem;
    background: linear-gradient(135deg, var(--color-cream) 0%, var(--color-cream-dark) 100%);
    text-align: center;
}

.hero h1 {
    color: var(--color-rust-dark);
}

.hero-sub {
    font-size: 1.15rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    color: var(--color-dark-soft);
}

.disclaimer-banner {
    background-color: var(--color-cream-dark);
    border-top: 3px solid var(--color-rust);
    border-bottom: 1px solid rgba(196, 85, 58, 0.2);
    padding: 1.25rem 0;
    text-align: center;
}

.disclaimer-banner .container {
    padding-top: 0;
}

.disclaimer-banner p {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--color-dark);
    margin: 0;
    line-height: 1.5;
}

.disclaimer-banner strong {
    color: var(--color-rust-dark);
}

.cta-button {
    display: inline-block;
    background: var(--color-rust);
    color: white;
    text-decoration: none;
    padding: 0.9rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1.05rem;
    transition: background 0.2s ease, transform 0.15s ease;
}

.cta-button:hover {
    background: var(--color-rust-dark);
    transform: translateY(-1px);
}

/* ==================== KEY INSIGHTS ==================== */
.key-insights-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin: 1.5rem 0;
}

@media (min-width: 600px) {
    .key-insights-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.key-insight-card {
    display: flex;
    gap: 1rem;
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.key-insight-number {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--color-rust);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    background: var(--color-rust);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    margin-right: 0.5rem;
    vertical-align: middle;
    flex-shrink: 0;
}

.key-insight-content h3 {
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
    color: var(--color-rust-dark);
}

.key-insight-content p {
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* Expandable explainer */
.explainer {
    margin-top: 1.5rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
}

.explainer summary {
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-dark);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s ease;
}

.explainer summary:hover {
    background: var(--color-cream-dark);
}

.explainer summary::-webkit-details-marker {
    display: none;
}

.explainer summary::after {
    content: '+';
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--color-warm-grey);
    transition: transform 0.2s ease;
}

.explainer[open] summary::after {
    content: '−';
}

.explainer-content {
    padding: 0 1.5rem 1.5rem;
}

.explainer-content p {
    font-size: 0.95rem;
}

.explainer-content p:last-child {
    margin-bottom: 0;
}

.explainer-inline {
    background: var(--color-cream-dark);
    box-shadow: none;
    border-radius: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 0;
}

.explainer-inline summary {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-warm-grey);
}

.explainer-inline summary:hover {
    background: transparent;
    color: var(--color-rust);
}

.explainer-inline summary::after {
    font-size: 1.1rem;
}

.explainer-inline .explainer-content {
    padding: 0 1rem 0.75rem;
}

.explainer-inline .explainer-content p {
    font-size: 0.85rem;
    color: var(--color-dark-soft);
}

/* ==================== FERRITIN SCALE ==================== */
.ferritin-scale {
    margin: 2.5rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.ferritin-track {
    position: relative;
    height: 4px;
    background: #D5CEC8;
    border-radius: 2px;
    margin: 3rem 0 1.5rem;
}

/* Old "normal" range bar */
.ferritin-old-range {
    position: absolute;
    top: -8px;
    height: 20px;
    background: #E8E2DC;
    border-radius: 10px;
    z-index: 1;
}

/* New corrected range bar */
.ferritin-new-range {
    position: absolute;
    top: -8px;
    height: 20px;
    background: #C8DCCA;
    border-radius: 10px;
    z-index: 2;
}

/* Optimal zone (50+) */
.ferritin-optimal-zone {
    position: absolute;
    top: -12px;
    height: 28px;
    background: rgba(91, 138, 94, 0.2);
    border: 2px dashed rgba(91, 138, 94, 0.4);
    border-radius: 14px;
    z-index: 3;
}

/* Markers on the scale */
.ferritin-marker {
    position: absolute;
    top: 50%;
    transform: translateX(-50%);
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ferritin-marker::before {
    content: '';
    display: block;
    width: 2px;
    height: 28px;
    border-radius: 1px;
    position: relative;
    top: -14px;
}

.ferritin-marker-old::before {
    background: var(--color-warm-grey);
}

.ferritin-marker-new::before {
    background: #5B8A5E;
}

.ferritin-marker-optimal::before {
    background: #5B8A5E;
}

.ferritin-marker-label {
    position: absolute;
    top: 18px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-dark);
    white-space: nowrap;
}

.ferritin-marker-old .ferritin-marker-label {
    color: var(--color-warm-grey);
}

.ferritin-marker-new .ferritin-marker-label {
    color: #5B8A5E;
}

.ferritin-marker-optimal .ferritin-marker-label {
    color: #5B8A5E;
}

/* Tick labels — positioned absolutely to match track percentages */
.ferritin-ticks {
    position: relative;
    height: 1.2rem;
    margin-top: 2.5rem;
    font-size: 0.7rem;
    color: var(--color-warm-grey);
}

.ferritin-ticks span {
    position: absolute;
    transform: translateX(-50%);
}

.ferritin-scale-unit {
    text-align: right;
    font-size: 0.7rem;
    color: var(--color-warm-grey);
    margin-top: 0.25rem;
}

/* Legend */
.ferritin-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-cream-dark);
}

.ferritin-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--color-dark-soft);
}

.ferritin-legend-swatch {
    width: 20px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.ferritin-swatch-old {
    background: #E8E2DC;
}

.ferritin-swatch-new {
    background: #C8DCCA;
}

.ferritin-swatch-optimal {
    background: rgba(91, 138, 94, 0.15);
    border: 1.5px dashed rgba(91, 138, 94, 0.4);
}

/* ==================== INSIGHT BOX ==================== */
.insight-box {
    background: white;
    border-left: 4px solid var(--color-rust);
    padding: 1.25rem 1.5rem;
    border-radius: 0 0.5rem 0.5rem 0;
    margin-top: 1.5rem;
}

.insight-box p {
    margin-bottom: 0;
}

/* ==================== HEMOGLOBIN EXAMPLE ==================== */
.hb-example {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin: 2rem 0;
}

.hb-example-header {
    background: var(--color-dark);
    color: var(--color-cream);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.hb-example-body {
    padding: 2.5rem 1.5rem 1.5rem;
}

/* Scale container */
.hb-scale {
    position: relative;
    margin-bottom: 1.5rem;
}

/* The track line */
.hb-track {
    position: relative;
    height: 4px;
    background: #D5CEC8;
    border-radius: 2px;
    margin: 3rem 0 1.5rem;
}

/* Population "normal" range */
.hb-population-range {
    position: absolute;
    top: -6px;
    height: 16px;
    background: #C8DCCA;
    border-radius: 8px;
    z-index: 1;
}

/* Personal variation band around setpoint */
.hb-personal-band {
    position: absolute;
    top: -14px;
    height: 32px;
    background: rgba(91, 123, 165, 0.15);
    border: 2px dashed rgba(91, 123, 165, 0.4);
    border-radius: 16px;
    z-index: 2;
}

/* Dots */
.hb-dot {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
}

.hb-dot::before {
    content: '';
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.hb-dot-setpoint::before {
    background: #5B7BA5;
}

.hb-dot-current::before {
    background: var(--color-rust);
}

.hb-dot-label {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
}

.hb-dot-setpoint .hb-dot-label {
    color: #5B7BA5;
}

.hb-dot-current .hb-dot-label {
    color: var(--color-rust);
}

/* Scale tick labels */
.hb-scale-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--color-warm-grey);
    margin-top: 0.5rem;
}

.hb-scale-unit {
    text-align: right;
    font-size: 0.7rem;
    color: var(--color-warm-grey);
    margin-top: 0.25rem;
}

/* Legend */
.hb-legend {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-cream-dark);
}

.hb-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--color-dark-soft);
}

.hb-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hb-legend-setpoint {
    background: #5B7BA5;
}

.hb-legend-current {
    background: var(--color-rust);
}

.hb-legend-band {
    width: 20px;
    height: 10px;
    border: 1.5px dashed rgba(91, 123, 165, 0.5);
    background: rgba(91, 123, 165, 0.1);
    border-radius: 3px;
    flex-shrink: 0;
}

.hb-legend-range {
    width: 20px;
    height: 10px;
    background: #C8DCCA;
    border-radius: 3px;
    flex-shrink: 0;
}

.hb-example-text {
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    border-top: 1px solid var(--color-cream-dark);
    margin-bottom: 0;
}

/* ==================== PODCAST CALLOUT ==================== */
.podcast-callout {
    border-left-color: var(--color-green);
    background: var(--color-green-light);
}

.podcast-callout a {
    color: var(--color-rust-dark);
    font-weight: 500;
}

.podcast-callout a:hover {
    color: var(--color-rust);
}

/* ==================== FOOTER LINKS ==================== */
.footer a {
    color: var(--color-rust-light);
    text-decoration: none;
}

.footer a:hover {
    color: var(--color-cream);
    text-decoration: underline;
}

/* ==================== CHECKLIST ==================== */
.checklist {
    display: grid;
    gap: 0.75rem;
    margin: 2rem 0;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: white;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: box-shadow 0.2s ease;
    user-select: none;
}

.check-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.check-item input[type="checkbox"] {
    display: none;
}

.checkmark {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--color-warm-grey);
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    position: relative;
}

.check-item input:checked ~ .checkmark {
    background: var(--color-rust);
    border-color: var(--color-rust);
}

.check-item input:checked ~ .checkmark::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 7px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.check-item input:checked ~ .check-text {
    color: var(--color-dark);
}

.check-text {
    font-size: 1rem;
    color: var(--color-dark-soft);
    transition: color 0.2s ease;
}

.checklist-note {
    text-align: center;
    font-weight: 500;
    color: var(--color-rust-dark);
    margin-top: 1rem;
}

/* ==================== RISK CARDS ==================== */
.risk-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin: 2rem 0;
}

@media (min-width: 600px) {
    .risk-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.risk-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.risk-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.risk-card h3 {
    color: var(--color-rust-dark);
}

.risk-card p {
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* ==================== BLOCKER TABLE ==================== */
.blocker-table-wrapper {
    margin: 2rem 0;
    overflow-x: auto;
}

.blocker-table {
    width: 100%;
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    border-collapse: collapse;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.blocker-table thead {
    background: var(--color-rust);
    color: white;
}

.blocker-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.blocker-table td {
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid var(--color-cream-dark);
    font-size: 0.95rem;
}

.blocker-table tbody tr:last-child td {
    border-bottom: none;
}

.blocker-table tbody tr:hover {
    background: var(--color-cream);
}

/* ==================== ACTION STEPS ==================== */
.steps {
    display: grid;
    gap: 2rem;
    margin: 2rem 0;
}

.step {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    background: var(--color-rust);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.step-content {
    flex: 1;
}

.step-content h3 {
    font-size: 1.1rem;
}

.step-content p {
    font-size: 0.95rem;
}

.step-tip {
    background: var(--color-cream-dark);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem !important;
}

/* ==================== FOOD TABLE ==================== */
.food-table td:nth-child(2) {
    white-space: nowrap;
}

.iron-type {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
}

.iron-heme {
    background: #F0E0D8;
    color: var(--color-rust-dark);
}

.iron-nonheme {
    background: var(--color-green-light);
    color: var(--color-green);
}

/* ==================== RESOURCES ==================== */
.resources-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-top: 2rem;
}

@media (min-width: 600px) {
    .resources-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.resource-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-top: 3px solid var(--color-warm-grey);
    display: flex;
    flex-direction: column;
}

.resource-listen {
    border-top-color: var(--color-green);
}

.resource-science {
    border-top-color: #5B7BA5;
}

.resource-medical {
    border-top-color: var(--color-rust);
}

.resource-guideline {
    border-top-color: var(--color-amber);
}

.resource-type {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-warm-grey);
    margin-bottom: 0.5rem;
}

.resource-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.resource-card h3 a {
    color: var(--color-dark);
    text-decoration: none;
}

.resource-card h3 a:hover {
    color: var(--color-rust);
    text-decoration: underline;
}

.resource-card p {
    font-size: 0.9rem;
    color: var(--color-dark-soft);
    margin-bottom: 0.75rem;
    flex: 1;
}

.resource-meta {
    font-size: 0.75rem;
    color: var(--color-warm-grey);
    font-weight: 500;
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--color-dark);
    color: var(--color-warm-grey);
    padding: 3rem 1.5rem;
    text-align: center;
}

.footer p {
    color: var(--color-warm-grey);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.footer strong {
    color: var(--color-cream);
}

.disclaimer {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.disclaimer p {
    font-size: 1rem;
    color: rgba(255,255,255,0.85);
    line-height: 1.6;
}

.footer-credit p {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    margin-bottom: 0;
}

/* ==================== SCROLL ANIMATIONS ==================== */
.section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Hero is always visible */
.hero {
    opacity: 1;
    transform: none;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 480px) {
    :root {
        --section-padding: 3.5rem 1rem;
    }

    .hero {
        padding: 6rem 1rem 3.5rem;
    }

    .step {
        flex-direction: column;
        gap: 0.75rem;
    }

    .scale-labels {
        font-size: 0.65rem;
    }

    .scale-zone {
        font-size: 0.6rem;
    }
}

@media (min-width: 768px) {
    .checklist {
        grid-template-columns: 1fr 1fr;
    }
}
