/* ==========================================================================
   The Kids Story — simple full-width theme
   White boxes on a light grey page, one font, one accent colour.
   ========================================================================== */

:root {
    --page: #f3f4f6;
    --box: #ffffff;
    --line: #e5e7eb;
    --line-2: #d1d5db;
    --text: #111827;
    --text-2: #374151;
    --muted: #6b7280;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-soft: #eef2ff;

    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --radius: 8px;
    --gap: 20px;
    --gutter: clamp(14px, 2.5vw, 40px);
    --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; color: var(--text); }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 10px; top: -50px; z-index: 200; background: var(--text); color: #fff; padding: 8px 14px; border-radius: var(--radius); }
.skip-link:focus { top: 10px; }
.icon { width: 18px; height: 18px; flex: none; }

/* Full-width container */
.container { width: 100%; padding-left: var(--gutter); padding-right: var(--gutter); }
.page { padding-top: var(--gap); padding-bottom: calc(var(--gap) * 2); }

/* ---------- Box: the basic building block ---------- */
.box { background: var(--box); border: 1px solid var(--line); border-radius: var(--radius); }
.stack > * + *, .sidebar > * + * { margin-top: var(--gap); }
.box-pad { padding: clamp(16px, 2vw, 24px); }
.box-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.box-head h2, .box-head h1 { font-size: 18px; }
.box-head a { font-size: 14px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.box-head a:hover { text-decoration: underline; }
.box-body { padding: 20px; }

/* ---------- Buttons, tags, forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--box); font-size: 14px; font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: var(--text); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 600; line-height: 1.6; }
a.tag:hover { background: var(--primary); color: #fff; }

.search-form { display: flex; gap: 8px; }
.search-form input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--box); font-size: 15px; outline: 0; }
.search-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--box); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.brand img { height: 40px; width: auto; }
.main-nav { flex: 1; }
.main-nav > ul { display: flex; gap: 4px; }
.nav-link { display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 12px; border: 0; background: none; border-radius: var(--radius); font-size: 15px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.nav-link:hover, .nav-item:focus-within > .nav-link { background: var(--page); color: var(--text); }
.nav-link.is-active { color: var(--primary); background: var(--primary-soft); }
.nav-link .caret { width: 14px; height: 14px; }
.nav-item { position: relative; }
.dropdown { position: absolute; top: 100%; left: 0; min-width: 180px; padding: 6px; margin-top: 4px; background: var(--box); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .08); display: none; }
.dropdown::before { content: ""; position: absolute; left: 0; right: 0; top: -6px; height: 6px; }
.nav-item:hover .dropdown, .nav-item:focus-within .dropdown { display: block; }
.dropdown a { display: block; padding: 8px 10px; border-radius: 6px; font-size: 14.5px; font-weight: 500; }
.dropdown a:hover, .dropdown a.is-active { background: var(--primary-soft); color: var(--primary); }
.header-search { width: 300px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--box); }
.menu-toggle, .search-toggle { display: none; }
.search-panel { border-top: 1px solid var(--line); padding: 12px 0; }

/* Mobile drawer */
.drawer { position: fixed; inset: 0; z-index: 100; visibility: hidden; }
.drawer.is-open { visibility: visible; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .4); opacity: 0; transition: opacity .2s; }
.drawer.is-open .drawer-backdrop { opacity: 1; }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(320px, 86vw); background: var(--box); padding: 16px; overflow-y: auto; transform: translateX(100%); transition: transform .2s; }
.drawer.is-open .drawer-panel { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.drawer-head img { height: 34px; width: auto; }
.drawer .search-form { margin-bottom: 12px; }
.drawer-nav a { display: block; padding: 10px 12px; border-radius: var(--radius); font-weight: 600; }
.drawer-nav a:hover, .drawer-nav a.is-active { background: var(--primary-soft); color: var(--primary); }
.drawer-label { margin: 14px 12px 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
body.no-scroll { overflow: hidden; }

/* ==========================================================================
   Story cards
   ========================================================================== */
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; }

.card {
    position: relative; display: flex; flex-direction: column;
    background: var(--box); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
    box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease, border-color .3s ease;
}
.card:hover { transform: translateY(-6px); border-color: transparent; box-shadow: 0 18px 40px -12px rgba(17, 24, 39, .22); }
.card-media { position: relative; aspect-ratio: 4 / 3; background: #e5e7eb; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.card:hover .card-media img { transform: scale(1.08); }
.card-media::after { /* soft shade at the bottom of the image */
    content: ""; position: absolute; inset: auto 0 0 0; height: 40%;
    background: linear-gradient(to top, rgba(0, 0, 0, .35), transparent); opacity: 0; transition: opacity .3s;
}
.card:hover .card-media::after { opacity: 1; }
.card-media .placeholder { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 32px; }
.card-media .tag { position: absolute; left: 12px; top: 12px; z-index: 2; background: rgba(255, 255, 255, .95); color: var(--primary); box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
.card-media .tag:hover { background: var(--primary); color: #fff; }
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; flex: 1; }
.card-title { font-size: 18px; line-height: 1.35; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card:hover .card-title a { color: var(--primary); }
.card-excerpt { font-size: 14.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.card-meta .read { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--primary); }
.card-meta .read .icon { width: 15px; height: 15px; transition: transform .25s; }
.card:hover .card-meta .read .icon { transform: translateX(4px); }

/* Scroll-in animation (only when JS is running, so content never stays hidden) */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--d, 0s); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* Small list item (sidebar) */
.mini-list li + li { border-top: 1px solid var(--line); }
.mini { display: flex; gap: 12px; align-items: center; padding: 12px 20px; }
.mini:hover h3 { color: var(--primary); }
.mini img, .mini .ph { width: 72px; height: 54px; flex: none; border-radius: 6px; object-fit: cover; background: #e5e7eb; }
.mini h3 { font-size: 14.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.cat-list a { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; font-size: 15px; font-weight: 500; }
.cat-list li + li a { border-top: 1px solid var(--line); }
.cat-list a:hover, .cat-list a.is-active { color: var(--primary); background: var(--primary-soft); }
.cat-list .count { font-size: 12.5px; color: var(--muted); background: var(--page); border-radius: 999px; padding: 1px 8px; }

/* ==========================================================================
   Layout: main + sidebar
   ========================================================================== */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--gap); align-items: start; }
.layout > * { min-width: 0; } /* let grid columns shrink below their content width (no sideways scroll) */
/* Sticky sidebar: stays in view while reading; scrolls inside itself when taller than the screen */
.sidebar {
    min-width: 0; position: sticky; top: calc(var(--header-h) + var(--gap));
    max-height: calc(100vh - var(--header-h) - var(--gap) * 2); overflow-y: auto;
    overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

/* ==========================================================================
   Home
   ========================================================================== */
.quick-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.home-hero {
    display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px; align-items: center;
    padding: clamp(24px, 4vw, 56px); border-radius: 16px;
    background: linear-gradient(135deg, #eef2ff 0%, #ffffff 60%, #fdf2f8 100%); border: 1px solid var(--line);
}
.home-hero h1 { font-size: clamp(28px, 3.6vw, 48px); letter-spacing: -.02em; line-height: 1.15; }
.home-hero h1 span { color: var(--primary); }
.home-hero p { color: var(--text-2); font-size: clamp(15px, 1.3vw, 18px); margin-top: 12px; max-width: 620px; }
.home-hero .search-form { margin-top: 22px; max-width: 560px; }
.home-hero .search-form input { height: 48px; font-size: 16px; }
.home-hero .search-form .btn { height: 48px; padding: 0 22px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat { background: var(--box); border: 1px solid var(--line); border-radius: 14px; padding: 20px; text-align: center; }
.stat strong { display: block; font-size: clamp(24px, 2.4vw, 34px); color: var(--primary); line-height: 1.1; }
.stat span { font-size: 14px; color: var(--muted); }

.home-section { margin-top: clamp(28px, 3vw, 44px); }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-title h2 { font-size: clamp(20px, 1.8vw, 26px); display: flex; align-items: center; gap: 10px; }
.section-title h2::before { content: ""; width: 5px; height: 1.05em; border-radius: 3px; background: var(--primary); }
.section-title p { color: var(--muted); font-size: 15px; margin-top: 4px; }
.section-title .more { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--box); font-size: 14px; font-weight: 600; white-space: nowrap; transition: all .2s; }
.section-title .more:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.section-title .more .icon { width: 16px; height: 16px; transition: transform .2s; }
.section-title .more:hover .icon { transform: translateX(3px); }

/* Category tiles */
.cat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.cat-tile {
    display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 14px;
    background: var(--box); border: 1px solid var(--line);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.cat-tile:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: 0 12px 28px -12px rgba(79, 70, 229, .35); }
.cat-tile .emoji { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--primary-soft); font-size: 26px; transition: transform .25s; }
.cat-tile:hover .emoji { transform: rotate(-8deg) scale(1.08); }
.cat-tile strong { display: block; font-size: 15.5px; line-height: 1.3; }
.cat-tile span { font-size: 13px; color: var(--muted); }

.faq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.faq-item { background: var(--box); border: 1px solid var(--line); border-radius: 12px; transition: border-color .2s, box-shadow .2s; }
.faq-item:hover { border-color: var(--line-2); }
.faq-item[open] { border-color: var(--primary); box-shadow: 0 8px 24px -14px rgba(79, 70, 229, .45); }
.faq-item summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 18px 20px; font-weight: 600; font-size: 16px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item .num { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-size: 14px; font-weight: 700; }
.faq-item .q { flex: 1; }
.faq-item summary .icon { color: var(--muted); transition: transform .25s; }
.faq-item[open] summary .icon { transform: rotate(45deg); color: var(--primary); }
.faq-item p { padding: 0 20px 18px 66px; color: var(--muted); font-size: 15px; }

/* ==========================================================================
   Archive (category / search)
   ========================================================================== */
.archive-head h1 { font-size: clamp(22px, 2.6vw, 30px); }
.archive-head p { color: var(--muted); margin-top: 6px; max-width: 760px; }
.archive-head .search-form { max-width: 560px; margin-top: 14px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs [aria-current] { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50ch; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h2 { font-size: 20px; margin-bottom: 6px; }
.empty .quick-links { justify-content: center; }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: var(--gap); }
.pagination a, .pagination span { min-width: 40px; height: 40px; padding: 0 12px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--box); font-size: 14px; font-weight: 600; }
.pagination a:hover { border-color: var(--text); }
.pagination .is-current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .gap { border: 0; background: none; min-width: 20px; padding: 0; }

/* ==========================================================================
   Single story
   ========================================================================== */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 60; background: var(--primary); }

.article { overflow: hidden; }
.article-inner { padding: clamp(18px, 3vw, 40px); }
.article-head h1 { overflow-wrap: break-word; font-size: clamp(26px, 3.4vw, 38px); margin-top: 10px; letter-spacing: -.01em; }
.article-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: 14px; color: var(--muted); }
.article-meta .item { display: inline-flex; align-items: center; gap: 6px; }
.article-meta strong { color: var(--text-2); font-weight: 600; }
.article-cover { margin: 22px 0 0; }
.article-cover img { width: 100%; max-height: 560px; border-radius: var(--radius); aspect-ratio: 16 / 9; object-fit: cover; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; padding: 10px 12px; background: var(--page); border: 1px solid var(--line); border-radius: var(--radius); }
.toolbar-group { display: flex; align-items: center; gap: 6px; }
.toolbar .label { font-size: 13.5px; color: var(--muted); margin-right: 2px; }
.toolbar .btn { height: 36px; padding: 0 12px; }
.toolbar .btn[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; }

.prose { overflow-wrap: break-word; word-break: break-word; }
.prose img, .prose video, .prose iframe, .prose embed, .prose object { max-width: 100% !important; height: auto; }
.prose table { display: block; overflow-x: auto; }
.prose pre { overflow-x: auto; white-space: pre-wrap; }
.prose [style*="width"] { max-width: 100% !important; }
.prose { margin-top: 26px; font-size: var(--story-size, 18px); line-height: 1.8; color: var(--text-2); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 1.4em; margin-top: 1.7em; }
.prose h3 { font-size: 1.2em; margin-top: 1.5em; }
.prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .35em; }
.prose blockquote { margin: 1.4em 0; padding: 12px 18px; border-left: 4px solid var(--primary); background: var(--page); border-radius: 0 var(--radius) var(--radius) 0; }
.prose figure { margin-left: 0; margin-right: 0; }
.prose img { border-radius: var(--radius); margin: 0 auto; }
.prose img[src=""], .prose img:not([src]), .prose figure:has(img[src=""]) { display: none; }
.prose figcaption { text-align: center; font-size: .8em; color: var(--muted); margin-top: .5em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9em; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose iframe { max-width: 100%; }

.article-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.article-foot .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.share { display: flex; align-items: center; gap: 6px; }
.share > span { font-size: 14px; color: var(--muted); margin-right: 4px; }
.share a, .share button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--box); }
.share a:hover, .share button:hover { border-color: var(--text); }
.share .icon { width: 16px; height: 16px; }

.author-box { display: flex; gap: 14px; align-items: center; margin-top: 20px; padding: 16px; background: var(--page); border-radius: var(--radius); }
.avatar { width: 48px; height: 48px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 700; font-size: 18px; }
.author-box strong { display: block; }
.author-box p { font-size: 14px; color: var(--muted); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-top: var(--gap); }
.post-nav a { display: block; padding: 16px 20px; }
.post-nav a:hover strong { color: var(--primary); }
.post-nav span { display: block; font-size: 13px; color: var(--muted); }
.post-nav strong { display: block; margin-top: 4px; font-size: 15px; line-height: 1.4; }
.post-nav .next { text-align: right; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--box); border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding: 36px 0; }
.footer-brand img { height: 40px; width: auto; }
.footer-brand p { margin-top: 12px; font-size: 14.5px; color: var(--muted); max-width: 420px; }
.footer-col h3 { font-size: 14px; margin-bottom: 10px; }
.footer-col li + li { margin-top: 6px; }
.footer-col a { font-size: 14.5px; color: var(--muted); }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { padding: 16px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
    .main-nav, .header-search { display: none; }
    .menu-toggle, .search-toggle { display: inline-grid; }
    .header-inner { justify-content: space-between; }
    .header-actions { display: flex; gap: 8px; }
}
@media (max-width: 1500px) {
    .grid-5 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
    .grid-5, .cat-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .home-hero { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .faq-grid { grid-template-columns: 1fr; }
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; max-height: none; overflow: visible; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
    :root { --gap: 14px; }
    .grid, .grid-4, .grid-5, .cat-tiles { grid-template-columns: 1fr 1fr; gap: 12px; }
    .card-body { padding: 10px 12px 12px; }
    .card-title { font-size: 14.5px; }
    .card-excerpt, .card-meta .read, .card-meta .dot, .card-meta .date { display: none; }
    .card-media .tag { left: 8px; top: 8px; font-size: 11px; }
    .cat-tile { padding: 12px; gap: 10px; }
    .cat-tile .emoji { width: 40px; height: 40px; font-size: 20px; }
    .cat-tile strong { font-size: 13.5px; }
    .stats { gap: 8px; }
    .stat { padding: 12px 8px; }
    .section-title p { display: none; }
    .faq-item summary { padding: 14px; gap: 10px; font-size: 15px; }
    .faq-item p { padding: 0 14px 14px; }
    .post-nav { grid-template-columns: 1fr; }
    .post-nav .next { text-align: left; }
    .footer-grid { grid-template-columns: 1fr; }
    .box-head, .mini, .cat-list a { padding-left: 14px; padding-right: 14px; }
    .box-body { padding: 14px; }
}
@media (max-width: 380px) {
    .grid, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
    .js .reveal { opacity: 1; transform: none; }
}

/* Homepage About (SEO text block) */
.about-box { padding: clamp(20px, 3vw, 40px); }
.about-box h2 { font-size: clamp(20px, 2vw, 26px); }
.about-lead { margin-top: 12px; color: var(--text-2); font-size: 16.5px; max-width: 1100px; }
.about-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.about-grid > div { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--page); }
.about-grid h3, .about-sub { font-size: 17px; }
.about-grid p { margin-top: 6px; font-size: 15px; color: var(--text-2); }
.about-box a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.about-sub { margin-top: 28px; }
.about-list { margin-top: 10px; padding-left: 20px; list-style: disc; color: var(--text-2); display: grid; gap: 6px; }
.faq-item summary h3.q { font-size: inherit; font-weight: 600; line-height: 1.4; }
@media (max-width: 1000px) { .about-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .about-grid { grid-template-columns: 1fr; } }

/* Story page: answer box, chapters, moral */
.meta-link { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.glance { margin-top: 20px; padding: 18px 20px; border: 1px solid #c7d2fe; border-left: 4px solid var(--primary); border-radius: 10px; background: var(--primary-soft); }
.glance-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); }
.story-summary { margin-top: 8px; font-size: 16.5px; line-height: 1.65; color: var(--text); }
.glance-facts { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.glance-facts div { display: flex; flex-direction: column; }
.glance-facts .wide { flex-basis: 100%; }
.glance-facts dt { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.glance-facts dd { margin: 2px 0 0; font-weight: 600; color: var(--text); }
.glance-facts a { color: var(--primary); }
.toc { margin-top: 20px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--page); }
.toc strong { font-size: 14px; }
.toc ol { margin: 8px 0 0; padding-left: 20px; list-style: decimal; display: grid; gap: 4px; }
.toc a { color: var(--primary); font-size: 15px; }
.toc a:hover { text-decoration: underline; }
.prose h2[id] { scroll-margin-top: calc(var(--header-h) + 16px); }
.moral-box { margin-top: 28px; padding: 18px 20px; border-radius: 10px; background: #fffbeb; border: 1px solid #fde68a; }
.moral-box h2 { font-size: 18px; }
.moral-box p { margin-top: 6px; font-size: 17px; color: var(--text); }
.footer-legal { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer-legal a:hover { color: var(--primary); }
.story-faq { margin-top: 28px; }
.story-faq > h2 { font-size: 20px; margin-bottom: 12px; }
.story-faq-item { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--page); }
.story-faq-item + .story-faq-item { margin-top: 10px; }
.story-faq-item h3 { font-size: 16px; }
.story-faq-item p { margin-top: 4px; color: var(--text-2); font-size: 15.5px; }
.prose .answer { padding: 16px 18px; border-left: 4px solid var(--primary); border-radius: 0 10px 10px 0; background: var(--primary-soft); color: var(--text); font-size: 1.02em; }
.guide-card .card-title { -webkit-line-clamp: 3; }
/* In-article ads */
.ad-slot { margin: 28px auto; padding: 8px 0; text-align: center; clear: both; min-height: 120px; }
.ad-label { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
