/* Neural Strip — Shared Styles */
/* Mobile-first. Single column, centered. */

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

:root {
    --bg: #faf9f7;
    --text: #1a1a1a;
    --accent: #2a2a2a;
    --muted: #888;
    --border: #e0ddd9;
    --card-bg: #fff;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.06);
    --card-shadow-hover: 0 3px 12px rgba(0,0,0,0.1);
    --serif: Georgia, 'Times New Roman', Times, serif;
    --sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --max-w: 800px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Header ──────────────────────────────────────────── */

.site-header {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.site-header h1 {
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.site-header .tagline {
    font-size: 0.95rem;
    color: var(--muted);
    margin-top: 0.3rem;
}

.site-header .header-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-instagram {
    display: inline-block;
    padding: 0.45rem 1.2rem;
    font-size: 0.85rem;
    font-family: var(--sans);
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.btn-instagram:hover {
    background: var(--accent);
    color: #fff;
}

/* ── Single Column Layout ────────────────────────────── */

.main-column {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ── Hero Cartoon ────────────────────────────────────── */

.hero {
    margin-bottom: 2rem;
}

.hero-image-wrap {
    position: relative;
    width: 100%;
    max-width: var(--max-w);
    aspect-ratio: 1;
    background: #e8e6e2;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    margin: 0 auto;
}

.hero-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-image-wrap .img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b0ada8;
    font-size: 3rem;
}

.hero-caption {
    text-align: center;
    padding: 1.25rem 0.5rem 0;
}

.hero-caption .setup {
    font-family: var(--serif);
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--text);
}

.hero-caption .punchline {
    font-family: var(--serif);
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text);
    margin-top: 0.25rem;
}

.hero-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.hero-date {
    font-size: 0.8rem;
    color: var(--muted);
}

/* ── Vote Buttons ────────────────────────────────────── */

.vote-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
    color: var(--muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    font-family: var(--sans);
}

.vote-btn:hover { border-color: var(--accent); color: var(--text); }
.vote-btn.voted { border-color: var(--accent); color: var(--text); cursor: default; }
.vote-btn:disabled { opacity: 0.5; cursor: default; }

/* ── Share Dropdown ───────────────────────────────────── */

.share-wrap {
    position: relative;
    display: inline-block;
}

.share-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
    color: var(--muted);
    cursor: pointer;
    font-family: var(--sans);
    transition: border-color 0.15s, color 0.15s;
}

.share-btn:hover { border-color: var(--accent); color: var(--text); }

.share-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.3rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--card-shadow-hover);
    min-width: 180px;
    z-index: 100;
    overflow: hidden;
}

.share-dropdown.open { display: block; }

.share-dropdown a,
.share-dropdown button {
    display: block;
    width: 100%;
    padding: 0.55rem 0.9rem;
    text-align: left;
    font-size: 0.85rem;
    font-family: var(--sans);
    color: var(--text);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.1s;
}

.share-dropdown a:hover,
.share-dropdown button:hover {
    background: #f0eeeb;
}

/* ── Calendar Section (inline, below hero) ────────────── */

.calendar-section {
    max-width: 600px;
    margin: 0 auto 2rem;
}

.calendar-jump {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.calendar-jump select {
    font-family: var(--sans);
    font-size: 0.85rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--card-bg);
    color: var(--text);
    cursor: pointer;
}

.calendar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem 1.25rem;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.calendar-header .month-label {
    font-family: var(--serif);
    font-size: 0.95rem;
    font-weight: 600;
}

.calendar-header button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--muted);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    transition: color 0.15s;
}

.calendar-header button:hover { color: var(--text); }
.calendar-header button:disabled { opacity: 0.3; cursor: default; }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
    font-size: 0.8rem;
}

.calendar-grid .day-label {
    font-weight: 600;
    color: var(--muted);
    padding: 0.3rem 0;
}

.calendar-grid .day {
    padding: 0.35rem 0;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2px auto;
    color: #bbb;
    font-size: 0.8rem;
}

.calendar-grid .day.has-cartoon {
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    transition: opacity 0.15s;
}

.calendar-grid .day.has-cartoon:hover { opacity: 0.8; }

.calendar-grid .day.today {
    box-shadow: 0 0 0 2px var(--border);
}

/* ── Archive Grid ────────────────────────────────────── */

.archive-heading {
    font-family: var(--serif);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.archive-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 520px) {
    .archive-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
    .archive-grid { grid-template-columns: repeat(3, 1fr); }
}

.archive-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.archive-card:hover { box-shadow: var(--card-shadow-hover); }
.archive-card.active { border-color: var(--accent); }

.archive-card .card-img {
    width: 100%;
    aspect-ratio: 1;
    background: #e8e6e2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b0ada8;
    font-size: 2rem;
    overflow: hidden;
}

.archive-card .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.archive-card .card-body {
    padding: 0.6rem 0.75rem;
}

.archive-card .card-caption {
    font-family: var(--serif);
    font-size: 0.85rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.archive-card .card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.4rem;
}

/* ── Lightbox ────────────────────────────────────────── */

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 2rem;
}

.lightbox.open { display: flex; }

.lightbox img {
    max-width: 90vw;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox .lb-placeholder {
    width: 60vw; height: 60vw;
    max-width: 500px; max-height: 500px;
    background: #333; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    color: #666; font-size: 3rem;
}

.lightbox .lb-caption {
    color: #ddd; font-family: var(--serif); font-size: 1.1rem;
    text-align: center; margin-top: 1rem; max-width: 600px; line-height: 1.5;
}

.lightbox .lb-punchline {
    color: #bbb; font-family: var(--serif); font-style: italic;
    font-size: 1rem; text-align: center; margin-top: 0.3rem;
}

.lightbox .lb-close {
    position: absolute; top: 1rem; right: 1.5rem;
    background: none; border: none; color: #999;
    font-size: 2rem; cursor: pointer; transition: color 0.15s;
}
.lightbox .lb-close:hover { color: #fff; }

.lightbox .lb-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: #777;
    font-size: 2.5rem; cursor: pointer; padding: 1rem; transition: color 0.15s;
}
.lightbox .lb-nav:hover { color: #fff; }
.lightbox .lb-prev { left: 0.5rem; }
.lightbox .lb-next { right: 0.5rem; }

/* ── Footer ──────────────────────────────────────────── */

.site-footer {
    text-align: center;
    padding: 2rem 1rem;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.site-footer .footer-tagline {
    font-family: var(--serif);
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.site-footer a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.15s;
}
.site-footer a:hover { color: var(--text); }

.site-footer .footer-links { margin: 0.5rem 0; }

.site-footer .footer-links a + a::before {
    content: " \00b7 ";
    color: var(--border);
    margin: 0 0.3rem;
}

/* ── How It Works (prose) ────────────────────────────── */

.prose {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}

.prose h1 { font-family: var(--serif); font-size: 2rem; margin-bottom: 0.3rem; }
.prose .subhead { font-size: 1rem; color: var(--muted); margin-bottom: 2rem; }

.prose h2 {
    font-family: var(--serif); font-size: 1.3rem;
    margin: 2rem 0 0.75rem; padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border);
}

.prose p { margin-bottom: 1rem; line-height: 1.7; }
.prose a { color: var(--text); }

.pipeline-flow {
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0; font-size: 0.85rem;
}

.pipeline-step {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 6px; padding: 0.6rem 1rem; text-align: center; min-width: 100px;
}
.pipeline-step .step-label { font-weight: 600; }
.pipeline-step .step-desc { font-size: 0.75rem; color: var(--muted); margin-top: 0.2rem; }
.pipeline-arrow { color: var(--muted); font-size: 1.2rem; }

.tools-grid {
    display: grid; grid-template-columns: 1fr; gap: 0.75rem; margin: 1rem 0;
}
@media (min-width: 520px) { .tools-grid { grid-template-columns: repeat(2, 1fr); } }

.tool-card {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 6px; padding: 0.8rem 1rem;
}
.tool-card .tool-name { font-weight: 600; font-size: 0.9rem; }
.tool-card .tool-desc { font-size: 0.82rem; color: var(--muted); margin-top: 0.2rem; }

.prose pre {
    background: #2a2a2a; color: #e0ddd9;
    padding: 1rem 1.25rem; border-radius: 6px;
    overflow-x: auto; font-size: 0.82rem; line-height: 1.6; margin: 1rem 0;
}

/* ── Print ───────────────────────────────────────────── */

@media print {
    .site-header, .site-footer, .hero-meta, .archive-heading,
    .archive-grid, .calendar-section,
    .share-wrap, .vote-btn, .lightbox { display: none !important; }
    .hero-image-wrap { max-width: 500px; margin: 0 auto; }
}
