/* ============================================================
   Sudoku2PDF – Main stylesheet
   Mobile-first, clean, print-focused design
   ============================================================ */

/* --- Custom properties --- */
:root {
    --color-bg:           #fafaf8;
    --color-surface:      #ffffff;
    --color-border:       #e2e0d8;
    --color-primary:      #1a1a2e;
    --color-accent:       #e06008;
    --color-accent-h:     #c45507;
    --color-text:         #1a1a2e;
    --color-text-muted:   #6b6b80;
    --color-beginner:     #86efac;
    --color-easy:         #22c55e;
    --color-medium:       #3b82f6;
    --color-hard:         #f97316;
    --color-expert:       #ef4444;

    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  16px;
    --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:  0 4px 12px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
    --shadow-lg:  0 10px 30px rgba(0,0,0,.12);

    --max-w:      880px;
    --spacing:    clamp(16px, 4vw, 32px);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--color-accent); }

/* --- Container --- */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--spacing);
}
.content-narrow { max-width: 700px; }

/* ============================================================
   Hero (light, no header — matches React preview)
   ============================================================ */
.hero {
    background: var(--color-bg);
    padding: clamp(48px, 8vw, 80px) 0 clamp(40px, 6vw, 64px);
    text-align: center;
}

.hero-inner { display: flex; flex-direction: column; align-items: center; }
.hero-text   { text-align: center; padding: 0 var(--spacing); }

.hero h1 {
    font-size: clamp(26px, 5vw, 48px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
    max-width: 760px;
    margin: 0 auto 16px;
    color: var(--color-accent);
}

.hero-subtitle {
    font-size: clamp(16px, 2.5vw, 20px);
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto 32px;
}

/* ============================================================
   Two-column tool layout (always two-col on desktop)
   ============================================================ */
.tool-layout {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
    gap: 28px;
    align-items: start;
}
@media (max-width: 960px) {
    .tool-layout {
        grid-template-columns: 1fr;
        max-width: 660px;
    }
}

/* ── Preview column: preview panel + download stacked ── */
.preview-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 24px;
}
@media (max-width: 960px) {
    .preview-column { position: static; }
}

/* ── Download section (below preview) ── */
.download-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.btn-full { width: 100%; justify-content: center; }

/* ── Tool sections within the card ── */
.tool-section { padding: 0; }
.tool-section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 16px;
}
.tool-section-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--color-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    border-radius: 50%;
    flex-shrink: 0;
}
.tool-section-num--sm {
    width: 18px;
    height: 18px;
    font-size: 10px;
}
.tool-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 20px 0;
}

/* ── Puzzle selection: clue range inputs ── */
.form-grid--selection {
    grid-template-columns: 1fr 1fr;
    margin-bottom: 12px;
}
@media (max-width: 540px) {
    .form-grid--selection { grid-template-columns: 1fr; }
}
.clue-range {
    display: flex;
    align-items: center;
    gap: 6px;
}
.clue-range .form-control {
    width: 0;
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
}
.clue-range-sep {
    font-size: 13px;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

/* ── Availability bar ── */
.availability-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    transition: background .2s, color .2s;
}
.availability-bar--loading {
    background: #f1f0ec;
    color: var(--color-text-muted);
}
.availability-bar--ok {
    background: #dcfce7;
    color: #15803d;
}
.availability-bar--empty {
    background: #fee2e2;
    color: #dc2626;
}

/* ============================================================
   Generator card (sits inside hero / tool-layout)
   ============================================================ */
.generator-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: clamp(20px, 4vw, 36px);
    box-shadow: var(--shadow-lg);
    width: 100%;
    text-align: left;
}

/* ============================================================
   PDF preview panel
   ============================================================ */
/* Ensure HTML [hidden] attribute is never overridden by display rules */
[hidden] { display: none !important; }

.pdf-preview-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: clamp(16px, 3vw, 28px);
    box-shadow: var(--shadow-lg);
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
/* Sticky is now handled by .preview-column */
.pdf-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.pdf-preview-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
}
.pdf-preview-count {
    font-weight: 400;
    color: var(--color-text-muted);
    margin-left: 4px;
}
.pdf-preview-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.pdf-canvas-wrap {
    background: #f3f2ee;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    overflow: hidden;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pdf-canvas-wrap canvas {
    width: 100%;
    height: auto;
    display: block;
}
.pdf-loading-msg {
    font-size: 13px;
    color: var(--color-text-muted);
    padding: 32px;
}
.pdf-preview-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.pdf-page-indicator {
    font-size: 13px;
    color: var(--color-text-muted);
    min-width: 56px;
    text-align: center;
}
.btn-small  { padding: 6px 14px; font-size: 13px; }
.btn-ghost  { background: transparent; border: none; color: var(--color-text-muted); box-shadow: none; }
.btn-ghost:hover { background: rgba(0,0,0,.06); color: var(--color-text); }
.btn-icon   { padding: 6px 10px; font-size: 15px; line-height: 1; }

/* Form grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.form-grid--2col {
    grid-template-columns: 1fr 1fr;
    margin-bottom: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
}
.hint {
    font-size: 12px;
    color: var(--color-text-muted);
}

.form-control {
    padding: 9px 12px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
    appearance: auto;
}
.form-control:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(224,96,8,.12);
}

/* Color picker */
.color-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.color-picker {
    width: 44px;
    height: 38px;
    padding: 2px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: none;
    flex-shrink: 0;
}
.color-label {
    font-size: 13px;
    font-family: monospace;
    color: var(--color-text-muted);
}

/* Checkbox */
.form-group--checkbox { justify-content: flex-start; }
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    padding: 10px 12px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
}
.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--color-accent);
    flex-shrink: 0;
}

/* Solution color group — hidden by default */
.solution-color-group {
    display: none;
    padding-left: 12px;
    border-left: 2px solid var(--color-border);
    margin-top: 4px;
}
.solution-color-group.visible { display: flex; }

/* Form actions */
.form-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 20px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background .15s, transform .1s, box-shadow .15s;
    text-decoration: none;
}
.btn-primary {
    background: var(--color-accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(224,96,8,.30);
}
.btn-primary:hover  { background: var(--color-accent-h); box-shadow: 0 4px 14px rgba(224,96,8,.35); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-large { padding: 14px 24px; font-size: 16px; }
.btn-full  { width: 100%; }
.btn-flex  { flex: 1; }
.btn-outline {
    background: transparent;
    color: var(--color-accent);
    border: 1.5px solid var(--color-accent);
    box-shadow: none;
}
.btn-outline:hover  { background: rgba(224,96,8,.08); }
.btn-outline:disabled { opacity: .55; cursor: not-allowed; }

.btn-row {
    display: flex;
    gap: 10px;
}

.status-msg {
    font-size: 13px;
    color: var(--color-text-muted);
    min-height: 18px;
    text-align: center;
}

/* Advanced toggle */
.advanced-section {
    border-top: 1px solid var(--color-border);
    padding-top: 16px;
    margin-bottom: 8px;
}
.adv-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 9px 14px;
    width: 100%;
    letter-spacing: .3px;
    transition: color .15s, background .15s;
}
.adv-toggle-btn:hover { color: var(--color-primary); background: var(--color-border); }
.adv-arrow { font-size: 10px; transition: transform .2s; margin-left: auto; }
.adv-body { margin-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.adv-body.hidden { display: none; }

/* Trust badges */
.trust-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 14px;
}
.trust-badge {
    font-size: 12px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}
.trust-badge::before { color: #22c55e; }

/* ============================================================
   Content / SEO sections
   ============================================================ */
.content-section {
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    padding: clamp(40px, 7vw, 72px) 0;
}

/* For the content section to contrast with the hero */
.content-section { background: #f1f0ec; }

.content-block {
    margin-bottom: 56px;
}
.content-block:last-child { margin-bottom: 0; }

/* Two-column split: text + image */
.content-block--split {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 48px;
    align-items: center;
}
.content-block--split .split-text { min-width: 0; }
.content-block--split .split-image img {
    width: 260px;
    height: 260px;
    display: block;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,.10);
}
@media (max-width: 640px) {
    .content-block--split {
        grid-template-columns: 1fr;
    }
    .content-block--split .split-image {
        display: flex;
        justify-content: center;
    }
    .content-block--split .split-image img {
        width: 220px;
        height: 220px;
    }
}

.content-block h2 {
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 20px;
}
.content-block p {
    color: var(--color-text-muted);
    line-height: 1.75;
    margin-bottom: 10px;
}

/* ============================================================
   Step cards (How to Generate)
   ============================================================ */
.step-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
@media (max-width: 560px) {
    .step-cards { grid-template-columns: 1fr; }
}
.step-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 24px 20px;
    text-align: center;
}
.step-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}
.step-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 8px;
}
.step-card p {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin: 0;
}

/* ============================================================
   Benefits highlight card
   ============================================================ */
.benefits-highlight {
    background: var(--color-accent);
    border-radius: var(--radius-lg);
    padding: clamp(24px, 4vw, 40px) clamp(24px, 4vw, 48px);
}
.benefits-highlight h2 {
    color: #fff;
    margin-bottom: 20px;
}
.benefits-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}
.benefits-list li {
    color: rgba(255,255,255,.90);
    padding-left: 24px;
    position: relative;
    line-height: 1.7;
    font-size: 15px;
}
.benefits-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 700;
    color: #fff;
}

/* ============================================================
   Difficulty cards
   ============================================================ */
.difficulty-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.difficulty-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
}
.difficulty-card h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 4px;
}
.difficulty-card p {
    font-size: 14px;
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.65;
}
.difficulty-card--beginner { border-left-color: var(--color-beginner); }
.difficulty-card--easy     { border-left-color: var(--color-easy); }
.difficulty-card--medium   { border-left-color: var(--color-medium); }
.difficulty-card--hard     { border-left-color: var(--color-hard); }
.difficulty-card--expert   { border-left-color: var(--color-expert); }

/* ============================================================
   FAQ
   ============================================================ */
.faq-block {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: clamp(20px, 3vw, 36px);
    overflow: hidden;
}
.faq-block h2 { padding: 0 0 4px; border: none; }
.faq-item {
    border-top: 1px solid var(--color-border);
}
.faq-item:first-of-type { border-top: none; margin-top: 16px; }
.faq-item summary {
    padding: 14px 4px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-primary);
    transition: color .15s;
}
.faq-item summary:hover { color: var(--color-accent); }
.label-hint { font-weight: 400; color: var(--color-text-muted); font-size: 0.85em; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '▼';
    font-size: 10px;
    transition: transform .2s;
    flex-shrink: 0;
    margin-left: 12px;
    color: var(--color-text-muted);
}
.faq-item[open] summary::after { transform: rotate(180deg); }
.faq-answer {
    padding: 0 4px 16px;
}
.faq-answer p { color: var(--color-text-muted); line-height: 1.75; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    padding: 28px 0;
    font-size: 13px;
}
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.footer-links {
    display: flex;
    gap: 16px;
}
.footer-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color .15s;
}
.footer-links a:hover { color: var(--color-accent); }

/* ============================================================
   Legal pages (privacy.php, terms.php)
   ============================================================ */
.legal-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 14px 0;
}
.legal-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.legal-logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-accent);
    text-decoration: none;
}
.legal-logo:hover { opacity: .8; }
.legal-back {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color .15s;
}
.legal-back:hover { color: var(--color-text); }

.legal-main {
    min-height: calc(100vh - 120px);
    padding: 56px 0 48px;
}
.legal-content {
    max-width: 780px;
    margin: 0 auto;
}
.legal-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 6px;
}
.legal-date {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 40px;
}
.legal-section {
    margin-bottom: 36px;
}
.legal-section h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 10px;
}
.legal-section p {
    color: var(--color-text-muted);
    line-height: 1.75;
    margin-bottom: 10px;
}
.legal-section ul {
    color: var(--color-text-muted);
    line-height: 1.75;
    padding-left: 1.5rem;
    margin-bottom: 10px;
}
.legal-section ul li { margin-bottom: 4px; }
.legal-section a {
    color: var(--color-accent);
    text-decoration: none;
}
.legal-section a:hover { text-decoration: underline; }

.legal-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 12px;
}
.legal-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}
.legal-card p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.7;
    margin: 0;
}

/* ============================================================
   Responsive tweaks
   ============================================================ */
@media (max-width: 540px) {
    .form-grid { grid-template-columns: 1fr; }
    .form-grid--2col { grid-template-columns: 1fr; }
    .trust-badges { gap: 10px; }
    .footer-inner { flex-direction: column; align-items: center; text-align: center; }
}

/* ============================================================
   Site header — shared nav (blog, solve, legal, home)
   ============================================================ */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 13px 0;
}
.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.site-logo {
    font-size: 1.18rem;
    font-weight: 800;
    color: var(--color-accent);
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: -.2px;
}
.site-logo span { color: var(--color-primary); }
.site-logo:hover { opacity: .82; }
.site-nav { display: flex; align-items: center; gap: 2px; }
.site-nav-link {
    font-size: .875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: color .15s, background .15s;
    white-space: nowrap;
}
.site-nav-link:hover  { color: var(--color-text); background: rgba(0,0,0,.045); }
.site-nav-link.active { color: var(--color-accent); font-weight: 700; }
@media (max-width: 380px) {
    .site-nav-link { padding: 5px 8px; font-size: .8rem; }
}

/* ============================================================
   Blog — hero banner
   ============================================================ */
.blog-hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, #2a2a4a 100%);
    padding: clamp(40px, 8vw, 72px) 0;
    text-align: center;
}
.blog-hero h1 {
    color: #fff;
    font-size: clamp(1.55rem, 4vw, 2.3rem);
    font-weight: 800;
    margin: 0 auto 10px;
    max-width: 600px;
    padding: 0 var(--spacing);
}
.blog-hero p {
    color: rgba(255,255,255,.65);
    font-size: clamp(.9rem, 2vw, 1.05rem);
    margin: 0;
    padding: 0 var(--spacing);
}

/* ============================================================
   Blog — article listing grid
   ============================================================ */
.blog-main { padding: clamp(40px, 6vw, 64px) 0; }
.blog-empty {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 1.05rem;
    padding: 60px 0;
}
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}
.article-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .15s, box-shadow .15s;
    box-shadow: var(--shadow-sm);
}
.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.article-card-body {
    padding: clamp(18px, 3vw, 26px);
    flex: 1;
    display: flex;
    flex-direction: column;
}
.article-card-meta {
    font-size: .74rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: 8px;
}
.article-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 10px;
    line-height: 1.35;
}
.article-card-excerpt {
    font-size: .875rem;
    color: var(--color-text-muted);
    line-height: 1.65;
    margin: 0 0 20px;
    flex: 1;
}
.article-card-link {
    display: inline-block;
    color: var(--color-accent);
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
    align-self: flex-start;
}
.article-card-link:hover { text-decoration: underline; }

/* ============================================================
   Blog — single article page
   ============================================================ */
.article-page { padding: clamp(40px, 6vw, 64px) 0; }
.article-page-inner { max-width: 720px; margin: 0 auto; }
.article-page-meta {
    font-size: .76rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: 12px;
}
.article-page-title {
    font-size: clamp(1.55rem, 4vw, 2.15rem);
    font-weight: 800;
    color: var(--color-text);
    margin: 0 0 40px;
    line-height: 1.2;
}
.article-body {
    font-size: 1.02rem;
    line-height: 1.82;
    color: #2c2c2c;
}
.article-body h2 {
    font-size: clamp(1.15rem, 3vw, 1.45rem);
    font-weight: 700;
    color: var(--color-text);
    margin: 2.2em 0 .6em;
    padding-bottom: .3em;
    border-bottom: 2px solid var(--color-border);
}
.article-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 1.8em 0 .5em;
}
.article-body p  { margin: 0 0 1.3em; }
.article-body ul,
.article-body ol { padding-left: 1.6em; margin: 0 0 1.3em; }
.article-body li { margin-bottom: .4em; }
.article-body a  { color: var(--color-accent); }
.article-body a:hover { text-decoration: none; }
.article-body strong  { color: var(--color-text); }
.article-body blockquote {
    border-left: 3px solid var(--color-accent);
    margin: 1.8em 0;
    padding: 12px 22px;
    background: #fef8f5;
    color: var(--color-text-muted);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article-body pre {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    overflow-x: auto;
    font-size: .875rem;
    line-height: 1.6;
}
.article-body code {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: .875em;
}
.article-body pre code { background: none; border: none; padding: 0; }
.article-body img { max-width: 100%; height: auto; border-radius: var(--radius-md); }
.puzzle-figure  { margin: 2.2em auto; text-align: center; }
.puzzle-figure figcaption {
    margin-top: 8px;
    font-size: .8rem;
    color: var(--color-text-muted);
    font-style: italic;
}
.article-footer {
    margin-top: 52px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
    font-size: .875rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.article-pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--color-accent);
    color: #fff;
    font-size: .875rem;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: 8px;
    text-decoration: none;
    transition: background .15s, box-shadow .15s;
}
.article-pdf-btn:hover {
    background: var(--color-accent-h);
    box-shadow: 0 4px 12px rgba(224,96,8,.3);
}
.article-back-link {
    color: var(--color-accent);
    text-decoration: none;
}
.article-back-link:hover { text-decoration: underline; }
