/* RestMap glossary — shared styles
   Dark-first warm-neutral palette with light-mode opt-in.
   Matches v2.9 Tier C aesthetic. */

:root {
    --brand: #30B0C7;
    --brand-dark: #28A0B5;
    --positive: #34C759;
    --warn: #E5A13D;
    --bg: #0B0B0F;
    --surface: #15151C;
    --surface-2: #1D1D26;
    --text: #F5F2EE;
    --text-secondary: #A6A29C;
    --text-faint: #6B6862;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #FAFBFC;
        --surface: #ffffff;
        --surface-2: #F4F5F7;
        --text: #15151C;
        --text-secondary: #575660;
        --text-faint: #98969C;
        --border: rgba(0, 0, 0, 0.08);
        --border-strong: rgba(0, 0, 0, 0.14);
    }
}

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

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand); text-decoration: none; transition: opacity 0.15s; }
a:hover { opacity: 0.8; text-decoration: underline; text-underline-offset: 3px; }

/* Header / Nav */
header.site-header {
    background: rgba(11, 11, 15, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 0.9rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
@media (prefers-color-scheme: light) {
    header.site-header { background: rgba(250, 251, 252, 0.82); }
}
.header-content {
    max-width: 880px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1.1rem;
}
.logo img { width: 30px; height: 30px; border-radius: 7px; }
nav.primary-nav a {
    color: var(--text-secondary);
    margin-left: 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
}
nav.primary-nav a:hover { color: var(--brand); text-decoration: none; opacity: 1; }
nav.primary-nav a.active { color: var(--brand); }
.nav-cta {
    background: var(--brand);
    color: white !important;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-left: 1.5rem;
}
.nav-cta:hover { background: var(--brand-dark); opacity: 1; text-decoration: none; }
@media (max-width: 640px) {
    nav.primary-nav a.hide-mobile { display: none; }
}

/* Breadcrumbs */
.breadcrumbs {
    max-width: 780px;
    margin: 1.5rem auto 0;
    padding: 0 2rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs .sep { margin: 0 0.4rem; color: var(--text-faint); }

/* Hero */
.glossary-hero {
    max-width: 780px;
    margin: 1.5rem auto 0;
    padding: 1.5rem 2rem 2rem;
}
.glossary-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--brand);
    margin-bottom: 0.85rem;
}
.glossary-hero h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 5.5vw, 3.1rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}
.glossary-hero .hero-summary {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 620px;
    margin-bottom: 0;
}

/* Main content */
main.glossary-main {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 2rem 5rem;
}
main.glossary-main > * + * { margin-top: 1.25rem; }

/* TL;DR / direct-answer box */
.tldr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand);
    border-radius: 0 12px 12px 0;
    padding: 1.25rem 1.5rem;
    margin-top: 1.5rem;
}
.tldr .tldr-label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--brand);
    margin-bottom: 0.5rem;
}
.tldr p { margin-bottom: 0.6rem; font-size: 1rem; }
.tldr p:last-child { margin-bottom: 0; }
.tldr .last-updated {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

/* Headings */
main.glossary-main h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.45rem, 3.4vw, 1.75rem);
    letter-spacing: -0.015em;
    line-height: 1.2;
    margin-top: 2.75rem;
    margin-bottom: 0.75rem;
}
main.glossary-main h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
}

main.glossary-main p,
main.glossary-main li {
    font-size: 1rem;
    color: var(--text);
    line-height: 1.7;
}
main.glossary-main p + p { margin-top: 0.85rem; }
main.glossary-main ul,
main.glossary-main ol {
    margin-top: 0.85rem;
    padding-left: 1.4rem;
}
main.glossary-main li + li { margin-top: 0.35rem; }
main.glossary-main strong { color: var(--text); font-weight: 700; }
main.glossary-main em { color: var(--text-secondary); font-style: italic; }

/* Spec / criteria table */
.spec-table-wrap {
    overflow-x: auto;
    margin-top: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}
.spec-table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.spec-table thead th {
    background: var(--surface-2);
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}
.spec-table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}
.spec-table tbody tr:last-child td { border-bottom: none; }
.spec-table tbody th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    background: transparent;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    min-width: 160px;
}
.spec-table .cite {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Myth / fact pair */
.myth-list {
    list-style: none;
    padding-left: 0;
    margin-top: 1rem;
}
.myth-list li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-top: 0.75rem;
}
.myth-list li .myth {
    font-weight: 600;
    color: var(--warn);
    display: block;
    margin-bottom: 0.3rem;
}
.myth-list li .fact {
    color: var(--text);
}

/* Callout box */
.callout {
    background: rgba(48, 176, 199, 0.08);
    border-left: 3px solid var(--brand);
    border-radius: 0 10px 10px 0;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
}
.callout strong { color: var(--brand); }

/* Source citation list */
.sources {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.sources h2 { margin-top: 0; }
.sources ol {
    padding-left: 1.35rem;
    margin-top: 0.75rem;
    counter-reset: source;
    list-style: decimal;
}
.sources li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.4rem;
    padding-left: 0.25rem;
}
.sources li a { color: var(--text); font-weight: 500; }
.sources li a:hover { color: var(--brand); }
.sources .meta {
    display: block;
    font-size: 0.82rem;
    color: var(--text-faint);
    margin-top: 0.15rem;
}

/* Related reading grid */
.related-reads {
    margin-top: 3rem;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}
.related-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.15rem;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.related-card:hover {
    text-decoration: none;
    transform: translateY(-2px);
    border-color: var(--brand);
    opacity: 1;
}
.related-card .card-kind {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--brand);
    margin-bottom: 0.35rem;
}
.related-card h4 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.3rem;
    line-height: 1.25;
}
.related-card p {
    font-size: 0.88rem !important;
    color: var(--text-secondary) !important;
    margin: 0 !important;
}

/* Footer */
footer.site-footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 2.5rem 2rem calc(4.5rem + env(safe-area-inset-bottom, 0px));
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
}
footer.site-footer a { color: var(--text); }
footer.site-footer a:hover { color: var(--brand); }
@media (min-width: 769px) {
    footer.site-footer { padding-bottom: 2.5rem; }
}

/* Sticky mobile CTA */
.mobile-sticky-cta {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    padding: 0.55rem 1rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
    background: var(--brand);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.22);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: background 0.2s, transform 0.25s ease;
}
.mobile-sticky-cta:hover,
.mobile-sticky-cta:active { background: var(--brand-dark); text-decoration: none; opacity: 1; }
.mobile-sticky-cta .sticky-arrow { transition: transform 0.2s; display: inline-block; }
.mobile-sticky-cta:active .sticky-arrow { transform: translateX(3px); }
.mobile-sticky-cta.hidden {
    transform: translateY(calc(100% + env(safe-area-inset-bottom, 0px)));
}
@media (max-width: 768px) {
    .mobile-sticky-cta { display: flex; }
}
