/* ============================================================
   MyCDLPractice - main.css (v2)
   Simpler, darker, more mobile-friendly.
   Deep navy (#0B2545), tight spacing, fewer cards stacked on cards.
   ============================================================ */

/* --- Tokens --- */
:root {
    --primary: #0B2545;          /* deep navy */
    --primary-hover: #133861;
    --primary-soft: #E8EEF5;
    --accent: #D8973C;           /* warm gold for CTAs / highlights */

    --ink: #0F1726;              /* near-black body text */
    --ink-muted: #5A6473;
    --ink-soft: #8A9099;

    --bg: #FAFAF7;               /* warm off-white, easier on eyes than pure white */
    --bg-card: #FFFFFF;
    --bg-soft: #F2F1EC;

    --border: #E4E2DA;
    --border-strong: #C8C5BA;

    --success: #2F7D5C;
    --error: #B8453B;

    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 14px;

    --container: 1100px;
    --header-h: 64px;

    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}
body {
    margin: 0;
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; display: block; }
a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover { color: var(--primary-hover); }
button { font-family: inherit; cursor: pointer; }
ul, ol { padding-left: 1.25rem; }

h1, h2, h3, h4 {
    margin: 0 0 0.4em;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--ink);
    font-weight: 700;
}
h1 { font-size: clamp(1.875rem, 5vw, 2.75rem); font-weight: 800; }
h2 { font-size: clamp(1.375rem, 3.5vw, 1.875rem); }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }

/* --- Skip link --- */
.skip-link {
    position: absolute; top: -40px; left: 0;
    background: var(--primary); color: white;
    padding: 0.5rem 1rem; z-index: 9999;
}
.skip-link:focus { top: 0; color: white; }

/* --- Container --- */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.25rem;
}
@media (min-width: 768px) { .container { padding: 0 2rem; } }

/* --- Header --- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(250, 250, 247, 0.92);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: var(--header-h);
}
.brand {
    display: inline-flex; align-items: center; gap: 0.5rem;
    color: var(--ink);
    font-weight: 700;
    font-size: 1.0625rem;
    letter-spacing: -0.01em;
}
.brand:hover { color: var(--primary); }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 6px;
}
.brand-text strong { color: var(--primary); font-weight: 700; }

.primary-nav { display: flex; align-items: center; }
.nav-menu {
    display: none;
    list-style: none; margin: 0; padding: 0;
    gap: 1.75rem;
}
.nav-menu li a {
    color: var(--ink-muted);
    font-weight: 500;
    font-size: 0.9375rem;
}
.nav-menu li a:hover { color: var(--primary); }
@media (min-width: 768px) {
    .nav-menu { display: flex; }
    .nav-toggle { display: none; }
}

.nav-toggle {
    display: flex; flex-direction: column; gap: 4px;
    background: none; border: none;
    width: 44px; height: 44px;
    align-items: center; justify-content: center;
}
.nav-toggle span {
    display: block; width: 22px; height: 2px;
    background: var(--ink); border-radius: 2px;
}

@media (max-width: 767px) {
    .nav-menu.open {
        display: flex;
        position: absolute; top: var(--header-h); left: 0; right: 0;
        background: var(--bg);
        flex-direction: column; gap: 0;
        padding: 0.5rem 1.25rem 1rem;
        border-bottom: 1px solid var(--border);
    }
    .nav-menu.open li {
        padding: 0.875rem 0;
        border-bottom: 1px solid var(--border);
    }
    .nav-menu.open li:last-child { border-bottom: none; }
    .nav-menu.open li a {
        font-size: 1rem;
        display: block;
    }
}

/* --- Buttons - bigger tap targets (min 48px on mobile) --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.875rem 1.5rem;
    min-height: 48px;
    border-radius: var(--radius);
    font-weight: 600; font-size: 1rem;
    text-decoration: none;
    border: 1.5px solid transparent;
    transition: all 0.15s ease;
    line-height: 1;
}
.btn-primary {
    background: var(--primary); color: white;
}
.btn-primary:hover {
    background: var(--primary-hover); color: white;
}
.btn-ghost {
    background: transparent; color: var(--ink);
    border-color: var(--border-strong);
}
.btn-ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.btn-lg { padding: 1.0625rem 1.875rem; font-size: 1.0625rem; min-height: 56px; }

/* --- Hero --- */
.hero {
    padding: 3rem 0 2.5rem;
    text-align: center;
}
@media (min-width: 768px) { .hero { padding: 5rem 0 4rem; } }

.hero-eyebrow {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 0.375rem 0.875rem;
    border-radius: 999px;
    margin-bottom: 1.5rem;
    letter-spacing: 0.01em;
}
.hero h1 {
    margin-bottom: 0.875rem;
    max-width: 18ch;
    margin-left: auto; margin-right: auto;
}
.hero h1 .accent { color: var(--primary); }
.hero-sub {
    font-size: 1.125rem;
    color: var(--ink-muted);
    max-width: 38ch;
    margin: 0 auto 2rem;
}
.hero-cta {
    display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center;
    margin-bottom: 2.5rem;
}
.hero-stats {
    display: flex; justify-content: center;
    gap: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    max-width: 480px;
    margin: 0 auto;
}
.stat strong {
    display: block;
    font-size: 1.625rem;
    color: var(--primary);
    font-weight: 800;
    line-height: 1;
}
.stat span {
    display: block;
    font-size: 0.8125rem;
    color: var(--ink-muted);
    margin-top: 0.25rem;
}

/* --- Sections --- */
.section { padding: 3rem 0; }
@media (min-width: 768px) { .section { padding: 4.5rem 0; } }

.section-head {
    text-align: center;
    max-width: 36rem;
    margin: 0 auto 2.5rem;
}
.section-head h2 { margin-bottom: 0.5rem; }
.section-head p {
    font-size: 1rem;
    color: var(--ink-muted);
    margin: 0;
}

/* --- Endorsement grid - simpler cards --- */
.endorsement-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    max-width: 720px;
    margin: 0 auto;
}
@media (min-width: 600px) {
    .endorsement-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
}

.endorsement-card {
    display: flex; align-items: center; gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.125rem 1.25rem;
    color: var(--ink);
    transition: border-color 0.15s, transform 0.15s;
    min-height: 80px;
}
.endorsement-card:hover {
    border-color: var(--primary);
    color: var(--ink);
    transform: translateY(-1px);
}
.endorsement-icon {
    flex-shrink: 0;
    width: 40px; height: 40px;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
}
.endorsement-body { flex: 1; min-width: 0; }
.endorsement-card h3 {
    font-size: 1rem;
    margin-bottom: 0.125rem;
    font-weight: 600;
}
.endorsement-card .endorsement-meta {
    font-size: 0.8125rem;
    color: var(--ink-muted);
}
.endorsement-card p { display: none; }  /* trimmed - title + meta is enough */

.endorsement-arrow {
    flex-shrink: 0;
    color: var(--ink-soft);
    transition: color 0.15s, transform 0.15s;
}
.endorsement-card:hover .endorsement-arrow {
    color: var(--primary);
    transform: translateX(2px);
}

/* --- How-to (numbered, simpler than separate cards) --- */
.howto {
    max-width: 600px;
    margin: 0 auto;
    counter-reset: step;
    list-style: none;
    padding: 0;
}
.howto li {
    counter-increment: step;
    position: relative;
    padding: 0 0 1.25rem 3rem;
    margin: 0;
}
.howto li::before {
    content: counter(step);
    position: absolute;
    left: 0; top: -2px;
    width: 32px; height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 0.9375rem;
}
.howto li:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 15px; top: 32px;
    width: 2px; bottom: 0.25rem;
    background: var(--border);
}
.howto h3 {
    font-size: 1rem;
    margin: 0.25rem 0 0.25rem;
    font-weight: 600;
}
.howto p {
    color: var(--ink-muted);
    font-size: 0.9375rem;
    margin: 0;
}

/* --- FAQ details --- */
.faq-list {
    max-width: 36rem;
    margin: 0 auto;
}
.faq-list details {
    border-bottom: 1px solid var(--border);
    padding: 1.125rem 0;
}
.faq-list details:first-child { border-top: 1px solid var(--border); }
.faq-list summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--ink);
    list-style: none;
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 1rem;
    font-size: 1rem;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
    content: '+';
    color: var(--primary);
    font-size: 1.5rem;
    line-height: 1;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list p {
    margin: 0.875rem 0 0;
    color: var(--ink-muted);
}

/* --- Cross-promo (smaller, less prominent) --- */
.cross-promo {
    padding: 3rem 0;
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
}
.cross-promo-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    max-width: 720px;
    margin: 0 auto;
}
@media (min-width: 600px) {
    .cross-promo-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
}
.promo-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    color: var(--ink);
    display: block;
    transition: border-color 0.15s, transform 0.15s;
}
.promo-card:hover {
    border-color: var(--primary);
    color: var(--ink);
    transform: translateY(-1px);
}
.promo-tag {
    display: inline-block;
    background: var(--primary-soft);
    color: var(--primary);
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.625rem;
}
.promo-card--alt .promo-tag {
    background: #FBE9D8;
    color: #8C5A1B;
}
.promo-card h3 { font-size: 1.0625rem; margin-bottom: 0.25rem; }
.promo-card p {
    color: var(--ink-muted);
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}
.promo-cta {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
}

/* --- Footer --- */
.site-footer {
    background: var(--ink);
    color: #B8BEC9;
    padding: 2.5rem 0 1.25rem;
}
.site-footer .brand { color: white; }
.site-footer .brand-text strong { color: #6FA3DD; }
.site-footer .brand-mark {
    background: rgba(255,255,255,0.1);
    color: white;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 0 0 2rem;
}
@media (min-width: 700px) {
    .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}
.footer-tagline {
    color: #8A92A0;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    max-width: 280px;
}
.footer-col h4 {
    color: white;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.875rem;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a {
    color: #B8BEC9;
    font-size: 0.875rem;
}
.footer-col a:hover { color: white; }
.footer-legal {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 1.25rem 0 0;
    font-size: 0.75rem;
    color: #6B7280;
}
.footer-legal p { margin: 0 0 0.375rem; }
.footer-disclaimer { max-width: 800px; }

/* --- Article (privacy, terms, study guides) --- */
.article {
    max-width: 38rem;
    margin: 0 auto;
    padding: 2rem 0 4rem;
}
@media (min-width: 768px) { .article { padding: 3rem 0 5rem; } }
.article h1 { margin-bottom: 0.375rem; }
.article-meta {
    color: var(--ink-soft);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}
.article h2 { margin-top: 2.25rem; font-size: 1.375rem; }
.article h3 { margin-top: 1.75rem; }
.article p, .article ul, .article ol {
    font-size: 1.0625rem;
    color: var(--ink);
}
.article ul li, .article ol li { margin-bottom: 0.4rem; }

/* --- Quiz engine (kept from v1, slightly adjusted to new palette) --- */
.quiz-shell {
    max-width: 640px; margin: 0 auto; padding: 1.5rem 0 4rem;
}
.quiz-progress {
    height: 4px; background: var(--border);
    border-radius: 999px; overflow: hidden;
    margin-bottom: 1.5rem;
}
.quiz-progress-fill {
    height: 100%; background: var(--primary);
    transition: width 0.4s ease;
}
.quiz-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
@media (min-width: 600px) { .quiz-card { padding: 2rem; } }
.quiz-card--center { text-align: center; }

.quiz-meta {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 0.875rem;
}
.quiz-q-num {
    font-size: 0.8125rem; color: var(--ink-muted); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.quiz-score-tag {
    font-size: 0.8125rem;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-weight: 600;
}
.quiz-q-text {
    font-size: 1.125rem; font-weight: 600;
    margin: 0 0 1.25rem; line-height: 1.45;
    color: var(--ink);
}
@media (min-width: 600px) { .quiz-q-text { font-size: 1.25rem; } }
.quiz-intro {
    color: var(--ink-muted); font-size: 0.9375rem;
    margin-bottom: 1.5rem;
}

.quiz-answers {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 0.625rem;
}
.quiz-answer {
    width: 100%;
    display: flex; align-items: flex-start; gap: 0.875rem;
    padding: 1rem 1.125rem;
    min-height: 56px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
    font-family: inherit; font-size: 0.9375rem;
    text-align: left;
    color: var(--ink);
    line-height: 1.5;
}
.quiz-answer:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--primary-soft);
}
.quiz-answer:disabled { cursor: default; }
.quiz-answer.is-correct {
    border-color: var(--success);
    background: rgba(47, 125, 92, 0.08);
}
.quiz-answer.is-wrong {
    border-color: var(--error);
    background: rgba(184, 69, 59, 0.06);
}
.quiz-letter {
    flex-shrink: 0;
    width: 26px; height: 26px;
    border-radius: 999px;
    background: var(--bg-soft);
    border: 1px solid var(--border-strong);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8125rem;
    color: var(--ink-muted);
    margin-top: 0.125rem;
}
.quiz-answer:hover:not(:disabled) .quiz-letter {
    background: var(--primary); color: white; border-color: var(--primary);
}
.quiz-answer.is-correct .quiz-letter {
    background: var(--success); color: white; border-color: var(--success);
}
.quiz-answer.is-wrong .quiz-letter {
    background: var(--error); color: white; border-color: var(--error);
}
.quiz-answer-text { flex: 1; }

.quiz-feedback {
    margin-top: 1.125rem;
    padding: 1rem 1.125rem;
    border-radius: var(--radius);
    border: 1px solid;
}
.quiz-feedback.is-right { background: rgba(47, 125, 92, 0.06); border-color: rgba(47, 125, 92, 0.25); }
.quiz-feedback.is-wrong { background: rgba(184, 69, 59, 0.04); border-color: rgba(184, 69, 59, 0.2); }
.quiz-feedback-head {
    font-weight: 700;
    margin-bottom: 0.4rem;
    font-size: 0.9375rem;
}
.quiz-feedback.is-right .quiz-feedback-head { color: var(--success); }
.quiz-feedback.is-wrong .quiz-feedback-head { color: var(--error); }
.quiz-feedback-body {
    color: var(--ink);
    font-size: 0.9375rem;
    line-height: 1.55;
    margin: 0 0 0.875rem;
}

.quiz-spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 999px;
    margin: 0.5rem auto 1rem;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Results --- */
.quiz-results { text-align: center; }
.quiz-result-tag {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 0.625rem;
}
.quiz-result-tag.is-pass { background: rgba(47, 125, 92, 0.12); color: var(--success); }
.quiz-result-tag.is-fail { background: rgba(184, 69, 59, 0.1); color: var(--error); }
.quiz-score-block {
    margin: 1.5rem 0;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.quiz-score-num {
    font-size: 2.75rem; font-weight: 800; color: var(--primary);
    line-height: 1;
}
.quiz-score-pct {
    font-size: 0.9375rem; color: var(--ink-muted);
    margin-top: 0.25rem;
}
.quiz-result-actions {
    display: flex; flex-wrap: wrap; gap: 0.625rem; justify-content: center;
}

.quiz-review {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}
.quiz-review h3 { font-size: 1rem; margin-bottom: 0.875rem; }
.quiz-review-item {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.125rem;
    margin-bottom: 0.625rem;
    text-align: left;
}
.quiz-review-q {
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.4rem;
    line-height: 1.45;
    font-size: 0.9375rem;
}
.quiz-review-line {
    color: var(--ink);
    font-size: 0.875rem;
}
.quiz-review-exp {
    margin: 0.4rem 0 0;
    font-size: 0.8125rem;
    color: var(--ink-muted);
}

/* --- AdSense slot --- */
.ad-slot {
    margin: 2rem auto;
    max-width: 728px;
    min-height: 90px;
    display: flex; align-items: center; justify-content: center;
}

/* --- Utility --- */
.text-center { text-align: center; }
.section-cta { text-align: center; margin-top: 2rem; }

/* --- Language toggle (site header) --- */
.nav-lang { display: flex; align-items: center; }
.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.lang-btn {
    display: inline-block;
    color: var(--ink-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    padding: 0.4rem 0.6rem;
    border-radius: 999px;
    transition: background 0.15s ease, color 0.15s ease;
}
.lang-btn:hover { color: var(--ink); }
.lang-btn.is-active {
    background: var(--primary);
    color: #fff;
}
.lang-btn.is-active:hover { color: #fff; }

/* --- Author / E-E-A-T box --- */
.author-box {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    margin: 0 0 1.75rem;
    padding: 0.95rem 1.1rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.author-box-avatar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
}
.author-box-body { min-width: 0; }
.author-box-head {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--ink);
    margin-bottom: 0.15rem;
}
.author-box-note {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--ink-muted);
}
.author-box-updated {
    margin: 0.4rem 0 0;
    font-size: 0.8rem;
    color: var(--ink-soft);
}
@media (max-width: 600px) {
    .author-box { flex-direction: column; gap: 0.6rem; }
}

/* --- Instructor note (first-hand school commentary on quiz pages) --- */
.instructor-note {
    margin: 1.75rem 0;
    padding: 1.25rem 1.4rem;
    background: #fff;
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
}
.instructor-note-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.6rem;
}
.instructor-note-lead {
    font-size: 1.075rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.85rem;
}
.instructor-note p:last-child { margin-bottom: 0; }