/*
Theme Name: Not Your Thyroid
Theme URI: https://notyourthyroid.com
Author: Medical Apps
Author URI: https://medicalapps.com
Description: Evidence-based medical education theme helping patients explore alternatives when thyroid labs are normal. Features interactive symptom checker, wellbeing comparisons, and myth-busting content.
Version: 1.3.3
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: notyourthyroid
Tags: health, medical, education, one-column, custom-colors, custom-menu, featured-images, full-width-template

Not Your Thyroid WordPress Theme
Copyright 2025 Medical Apps
*/

/* ==========================================================================
   Design tokens — from the Not Your Thyroid design system (tokens/*.css)
   ========================================================================== */

:root {
    --red: #E2001A;
    --red-press: #B00014;
    --ink: #1A1815;
    --ink-2: #57534C;
    --ink-3: #8C867C;
    --ink-4: #B6B0A6;
    --paper: #FFFFFF;
    --paper-warm: #F6F2EA;
    --ink-fill: #1A1815;
    --line: #E4DFD5;
    --line-soft: #EFEAE1;
    --blue: #2B4C8C;
    --focus: var(--blue);

    /* Data roles (fixed) */
    --data-reference: var(--ink-4);
    --data-condition: var(--ink);
    --data-highlight: var(--red);
    --data-thyroid: var(--blue);
    --data-track: var(--line-soft);

    --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
    --cond: "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;

    --fs-display: clamp(36px, 5vw, 64px);
    --fs-h1: clamp(28px, 3vw, 40px);
    --fs-h2: 24px;
    --fs-h3: 19px;
    --fs-body: 18px;
    --fs-stat: clamp(44px, 5vw, 64px);

    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
    --s-6: 32px; --s-7: 48px; --s-8: 64px;
    --r-1: 2px; --r-2: 4px; --r-3: 8px; --r-pill: 999px;
    --rule-heavy: 3px solid var(--ink);
    --rule-hair: 1px solid var(--line);
    --shadow-pop: 0 8px 28px rgba(26, 24, 21, .16);
    --maxw: 1200px;
    --maxw-text: 680px;
    --gutter: 24px;
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    margin: 0;
    font-family: var(--serif);
    font-size: var(--fs-body);
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
}

h1, h2, h3, h4, h5 {
    margin: 0;
    font-family: var(--serif);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -.008em;
    color: var(--ink);
    text-wrap: balance;
}

h1 { font-size: var(--fs-h1); font-weight: 800; }
h2 { font-size: var(--fs-h2); }
h3, h4 { font-size: var(--fs-h3); line-height: 1.2; }

p { margin: 0 0 var(--s-4); text-wrap: pretty; }

a { color: var(--red); transition: color .12s; }
a:hover { color: var(--red-press); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

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

/* Anchor targets clear the sticky header */
section[id] { scroll-margin-top: 96px; }

/* ==========================================================================
   Type furniture
   ========================================================================== */

.kicker,
.label-caps {
    font-family: var(--cond);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .06em;
    text-transform: uppercase;
    line-height: 1.1;
    color: var(--red);
}

.kicker--ink,
.label-caps { color: var(--ink); }

.label-caps { margin-right: 6px; }

.deck {
    margin: 0;
    font-size: 20px;
    line-height: 1.45;
    color: var(--ink-2);
    max-width: var(--maxw-text);
}

.meta {
    margin: 0;
    font-family: var(--cond);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: .01em;
    color: var(--ink-3);
}

.label {
    font-family: var(--cond);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: .01em;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.container--narrow { max-width: 880px; }

.section { padding: var(--s-7) 0; }

.section > .container {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.section > .container > * { margin-top: 0; margin-bottom: 0; }

.section-head {
    border-top: var(--rule-heavy);
    padding-top: var(--s-3);
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}

.section-head :is(h1, h2, h3) {
    font-weight: 800;
    font-size: var(--fs-h2);
    line-height: 1.08;
    letter-spacing: -.012em;
}

.section-head--lg :is(h1, h2, h3) { font-size: var(--fs-h1); }

.section-head :is(h1, h2, h3) a { color: inherit; text-decoration: none; }
.section-head :is(h1, h2, h3) a:hover { color: var(--red); }

.section-head .deck { font-size: 18px; }

.section-head--spaced { margin-top: var(--s-5); }

.section-head .btn { align-self: flex-start; }

/* ==========================================================================
   Buttons & tags
   ========================================================================== */

.btn {
    display: inline-block;
    font-family: var(--cond);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: .01em;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--r-1);
    cursor: pointer;
    transition: background .12s, color .12s;
}

.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--red-press); color: #fff; }

.btn--secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--secondary:hover:not(:disabled) { background: var(--paper-warm); color: var(--ink); }

.btn--ghost {
    background: transparent;
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.btn--ghost:hover:not(:disabled) { color: var(--red); }

.btn--sm { padding: 7px 14px; font-size: 14px; }
.btn--lg { padding: 14px 28px; font-size: 17px; }

.tag {
    display: inline-flex;
    align-items: center;
    font-family: var(--cond);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    line-height: 1.3;
    padding: 2px 6px;
    white-space: nowrap;
    border: 1px solid var(--ink);
    border-radius: var(--r-1);
    color: var(--ink);
}

.tag--red { background: var(--red); border-color: var(--red); color: #fff; }
.tag--ink { background: var(--ink); color: #fff; }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    background: var(--paper);
    border-bottom: var(--rule-hair);
}

@media (min-width: 768px) {
    .site-header { position: sticky; top: 0; z-index: 100; }
}

.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0 var(--s-4);
    padding-top: 18px;
}

.site-logo {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 14px;
    text-decoration: none;
    color: var(--ink);
}

.site-logo:hover { color: var(--ink); }

.site-logo__text {
    font-weight: 900;
    font-size: 30px;
    letter-spacing: -.02em;
    line-height: .9;
}

.site-logo__text em { font-style: normal; color: var(--red); }

.site-logo__tagline {
    font-family: var(--cond);
    font-weight: 500;
    font-size: 13px;
    color: var(--ink-3);
}

/* Scrolls sideways on narrow screens instead of a menu toggle */
.main-nav {
    display: flex;
    gap: var(--s-5);
    max-width: 100%;
    overflow-x: auto;
}

.main-nav__link {
    font-family: var(--cond);
    font-weight: 600;
    font-size: 15px;
    color: var(--ink-2);
    text-decoration: none;
    white-space: nowrap;
    padding-bottom: 11px;
    border-bottom: 3px solid transparent;
}

.main-nav__link:hover { color: var(--ink); }

.main-nav__link--active {
    color: var(--ink);
    border-bottom-color: var(--red);
}

/* ==========================================================================
   Hero, stats, key insight, notice
   ========================================================================== */

.hero { padding: 56px 0 var(--s-8); }

.hero > .container { gap: var(--s-7); }

.hero__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: var(--s-7);
    align-items: end;
}

.hero__lead {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
}

.hero__title {
    font-weight: 900;
    font-size: var(--fs-display);
    line-height: 1.02;
    letter-spacing: -.018em;
}

.hero__lead .deck { max-width: 560px; }

.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.stat {
    border-top: var(--rule-hair);
    padding-top: var(--s-3);
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}

.stat__value {
    font-weight: 900;
    font-size: var(--fs-stat);
    line-height: .95;
    letter-spacing: -.03em;
    font-variant-numeric: lining-nums tabular-nums;
}

.stat--accent .stat__value { color: var(--red); }

.stat__label { font-size: 16px; line-height: 1.35; color: var(--ink-2); }

.insight {
    background: var(--ink-fill);
    color: #fff;
    border-top: 3px solid var(--red);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.insight .kicker { color: #fff; }

.insight p, .insight ul { margin: 0; font-size: 20px; line-height: 1.45; }

.insight--paper {
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--ink);
    border-top: 3px solid var(--red);
}

.insight--paper .kicker { color: var(--red); }
.insight--paper p, .insight--paper ul { font-size: 17px; line-height: 1.5; }
.insight--paper ul { padding-left: 20px; color: var(--ink-2); }

.notice {
    background: var(--paper-warm);
    border: var(--rule-hair);
    border-radius: var(--r-2);
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.notice p { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink-2); }

/* ==========================================================================
   Compare: tabs and bars
   ========================================================================== */

.chart-tabs {
    display: flex;
    gap: var(--s-5);
    border-bottom: var(--rule-hair);
    overflow-x: auto;
}

.chart-tab {
    background: none;
    border: 0;
    border-bottom: 3px solid transparent;
    padding: 0 0 10px;
    cursor: pointer;
    font-family: var(--cond);
    font-weight: 600;
    font-size: 15px;
    color: var(--ink-3);
    white-space: nowrap;
}

.chart-tab:hover { color: var(--ink); }
.chart-tab--active { color: var(--ink); border-bottom-color: var(--red); }

.bars { display: flex; flex-direction: column; gap: 6px; }
.bars .kicker:not(:first-child) { margin-top: 18px; }
.bars > div:first-child { margin-bottom: 10px; }
.bars .meta { margin-top: var(--s-2); }

.bar-row {
    display: grid;
    grid-template-columns: minmax(120px, 240px) minmax(0, 1fr) 64px;
    gap: var(--s-4);
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--line-soft);
}

@media (max-width: 560px) {
    .bar-row { grid-template-columns: 104px minmax(0, 1fr) 56px; gap: 10px; }
}

.bar-row__label { font-family: var(--cond); font-weight: 600; font-size: 15px; line-height: 1.2; }

.bar-row__note {
    display: block;
    font-weight: 500;
    font-size: 12px;
    color: var(--ink-3);
}

.bar-row__track { position: relative; height: 16px; background: var(--data-track); }

.bar-row__fill { height: 100%; background: var(--data-condition); }

.bar-row__tick {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 2px;
    background: var(--ink);
}

.bar-row__value {
    font-weight: 700;
    font-size: 17px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.bar-row--reference .bar-row__fill,
.bar-row--muted .bar-row__fill { background: var(--data-reference); }
.bar-row--thyroid .bar-row__fill { background: var(--data-thyroid); }
.bar-row--highlight .bar-row__fill { background: var(--data-highlight); }
.bar-row--highlight .bar-row__label { color: var(--red); }

/* ==========================================================================
   Symptom checker
   ========================================================================== */

.symptom-checker { display: flex; flex-direction: column; gap: 28px; }

.symptom-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
    gap: 28px 40px;
}

.symptom-group {
    min-width: 0;
    margin: 0;
    padding: 14px 0 0;
    border: 0;
    border-top: var(--rule-hair);
}

.symptom-group legend {
    float: left;
    width: 100%;
    padding: 0;
    margin: 0 0 var(--s-3);
    display: flex;
    justify-content: space-between;
}

.symptom-group__count { color: var(--red); }

.symptom-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); clear: both; }

.symptom-chip {
    font-family: var(--cond);
    font-weight: 500;
    font-size: 15px;
    line-height: 1.2;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--paper);
    color: var(--ink);
    transition: all .12s;
}

button.symptom-chip { cursor: pointer; }
button.symptom-chip:hover { border-color: var(--ink); }

.symptom-chip--selected {
    font-weight: 600;
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.analyze-bar {
    position: sticky;
    bottom: 0;
    background: var(--paper);
    border-top: var(--rule-heavy);
    padding: 14px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-4);
}

.analyze-bar .btn--primary { margin-left: auto; }

.results-container { display: flex; flex-direction: column; gap: var(--s-5); align-items: flex-start; }
.results-container > * { margin: 0; }
.results-container > :not(.btn) { align-self: stretch; }

.match-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(80px, 220px) 56px;
    gap: var(--s-4);
    align-items: center;
    padding: 14px 0;
    border-top: var(--rule-hair);
}

.match-row__info { display: flex; flex-direction: column; gap: var(--s-1); }
.match-row__name { font-weight: 700; font-size: 19px; color: var(--ink); text-decoration: none; }
.match-row__name:hover { color: var(--red); }
.match-row__detail { font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.match-row__track { height: 8px; background: var(--data-track); }
.match-row__fill { height: 100%; background: var(--ink-4); }
.match-row--mid .match-row__fill { background: var(--ink-2); }
.match-row--high .match-row__fill { background: var(--red); }

.match-row__pct {
    font-weight: 800;
    font-size: 20px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Learn: myths, conditions
   ========================================================================== */

.myths-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 28px 40px;
}

.myth-card {
    border-top: var(--rule-hair);
    padding-top: var(--s-4);
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}

.myth-card__tags { display: flex; gap: 6px; }

.myth-card__claim {
    margin: 0;
    font-style: italic;
    font-weight: 600;
    font-size: 21px;
    line-height: 1.3;
}

.myth-card__truth { margin: 0; font-size: 16px; line-height: 1.55; color: var(--ink-2); }

.conditions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: var(--s-3) 40px;
}

.condition-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 0 6px;
    background: none;
    border: 0;
    border-top: var(--rule-hair);
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
}

.condition-card__name {
    font-weight: 700;
    font-size: 21px;
    line-height: 1.15;
    transition: color .12s;
}

.condition-card:hover .condition-card__name { color: var(--red); }

/* ==========================================================================
   References
   ========================================================================== */

.references {
    margin: 0;
    padding-left: var(--s-5);
    max-width: 860px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink-2);
}

.references li::marker { font-family: var(--cond); font-weight: 600; color: var(--ink-3); }
.references cite { font-style: normal; font-weight: 600; color: var(--ink); }
.references a { font-family: var(--cond); font-weight: 600; white-space: nowrap; }

/* Inline reference arrow: links a claim to its entry in the reference list */
.ref-link {
    font-family: var(--cond);
    font-weight: 700;
    font-size: .8em;
    text-decoration: none;
    white-space: nowrap;
}

.insight .ref-link { color: #fff; }
.insight--paper .ref-link { color: var(--red); }
.ref-link:hover { text-decoration: underline; }

.references li:target { background: var(--paper-warm); outline: 6px solid var(--paper-warm); }

/* ==========================================================================
   Content pages
   ========================================================================== */

.fact-list {
    margin: 0;
    padding-left: 20px;
    max-width: var(--maxw-text);
    line-height: 1.5;
    color: var(--ink-2);
}

.fact-list li + li { margin-top: var(--s-2); }

.prose { max-width: var(--maxw-text); }
.prose p:last-child { margin-bottom: 0; }

h2.myth-card__claim { letter-spacing: 0; }

.myth-card:target { border-top: var(--rule-heavy); }

.byline {
    margin: 0;
    padding-top: var(--s-4);
    border-top: var(--rule-hair);
    font-family: var(--cond);
    font-weight: 500;
    font-size: 14px;
    color: var(--ink-3);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer { background: var(--ink-fill); color: #fff; }

.site-footer__inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: var(--s-6);
    padding: 40px 0;
}

.site-footer__brand { display: flex; flex-direction: column; gap: var(--s-2); }

.site-footer__name {
    font-weight: 900;
    font-size: 26px;
    letter-spacing: -.02em;
    line-height: .9;
}

.site-footer .meta { color: var(--ink-4); }
.site-footer .meta a { color: #fff; }

.site-footer__disclaimer { margin: 0 0 10px; font-size: 15px; line-height: 1.5; }

/* ==========================================================================
   Posts & pages
   ========================================================================== */

.entry-content { max-width: var(--maxw-text); }

.not-found__code {
    font-weight: 900;
    font-size: var(--fs-stat);
    line-height: .95;
    letter-spacing: -.03em;
    color: var(--ink-4);
}

.nav-links {
    display: flex;
    gap: var(--s-4);
    font-family: var(--cond);
    font-weight: 600;
    font-size: 15px;
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.hidden { display: none !important; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
