/*
Theme Name: Candy Shorts AI Guide
Theme URI: https://candyshortsai.net/
Author: Candy Shorts AI Editorial
Description: Editorial guide theme: sidebar navigation, FAQ-first pages, series and creator templates, SEO in theme.
Version: 0.1.0
Requires at least: 6.5
Requires PHP: 8.1
License: GNU General Public License v2 or later
Text Domain: csaguide
*/

:root {
  --bg: #f5f4f8;
  --card: #ffffff;
  --soft: #efedf4;
  --line: #e0dde8;
  --line-2: #cbc7d6;
  --ink: #17151d;
  --ink-2: #4b4757;
  --muted: #736f80;
  --accent: #e0287f;
  --accent-2: #b8135f;
  --accent-soft: rgba(224, 40, 127, .09);
  --hot: #e57a14;
  --grad: linear-gradient(95deg, #f24595, #bd1463);
  --radius: 16px;
  --radius-s: 10px;
  --shadow: 0 8px 24px rgba(23, 21, 29, .08);
  --side-w: 272px;
  --read: 760px;
  --f-head: "Outfit", system-ui, sans-serif;
  --f-body: "Manrope", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 var(--f-body); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-2); text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-head); line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.7rem); font-weight: 700; margin-top: 1.8em; }
h3 { font-size: 1.15rem; font-weight: 700; margin-top: 1.4em; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------- Top bar (mobile) ---------- */
.site-bar { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-bar-in { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand { font: 800 1.15rem var(--f-head); color: var(--ink); text-decoration: none; }
.brand::first-letter { color: var(--accent); }
.menu-btn { width: 40px; height: 40px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; cursor: pointer; position: relative; }
.menu-btn span, .menu-btn span::before, .menu-btn span::after { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--ink); content: ""; border-radius: 2px; }
.menu-btn span { top: 19px; } .menu-btn span::before { top: -6px; left: 0; right: 0; } .menu-btn span::after { top: 6px; left: 0; right: 0; }

/* ---------- Frame + sidebar ---------- */
.frame { display: block; min-height: 100vh; }
.main-col { display: flex; flex-direction: column; min-height: 100%; }
.main-col > main { flex: 1 0 auto; }
.site-foot { margin-top: auto; }
.side { position: fixed; inset: 0 auto 0 0; width: min(86vw, var(--side-w)); background: var(--card); border-right: 1px solid var(--line); overflow-y: auto; padding: 16px; z-index: 60; transform: translateX(-100%); transition: transform .25s ease; }
.side.open { transform: none; }
.side-scrim { position: fixed; inset: 0; background: rgba(20,18,28,.45); z-index: 50; }
.side-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.side-close { border: 0; background: var(--soft); width: 36px; height: 36px; border-radius: 10px; font-size: 1.4rem; cursor: pointer; }
.side-label { margin: 18px 0 6px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.side-list a { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .93rem; }
.side-list a:hover { background: var(--soft); color: var(--ink); }
.side-list a[aria-current] { background: var(--accent-soft); color: var(--accent-2); }
.side-list .count { font-size: .75rem; background: var(--soft); border-radius: 999px; padding: 1px 8px; color: var(--muted); }
.side-cta { margin: 20px 0; padding: 14px; border-radius: var(--radius); background: var(--accent-soft); text-align: center; }
.side-cta .btn { width: 100%; }
.side-cta small { display: block; margin-top: 6px; color: var(--muted); font-size: .75rem; }
.side-minor a { font-size: .85rem; font-weight: 500; padding: 5px 12px; }

@media (min-width: 1024px) {
  .site-bar { display: none; }
  .frame { display: grid; grid-template-columns: var(--side-w) 1fr; }
  .side { position: sticky; top: 0; height: 100vh; transform: none; width: auto; padding-top: 28px; }
  .side-close, .side-scrim { display: none !important; }
}
.main-col { min-width: 0; }
.page { padding: 20px 0 40px; }
.kind-hub .page { padding-top: 0; }
.page > article, .page > .section { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 1024px) { .page { padding: 28px 0 56px; } .page > article, .page > .section { padding: 0 32px; } }

/* ---------- Buttons + badges ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px; font: 700 .95rem var(--f-body); text-decoration: none; cursor: pointer; border: 0; }
.btn-cta { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(224,40,127,.28); }
.btn-cta:hover { filter: brightness(1.08); }
.btn-ghost { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.4); }
.btn-line { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.badge { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; }
.badge-new { background: var(--accent); color: #fff; }
.badge-hot { background: var(--hot); color: #fff; }
.kicker { display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 8px; }
.label { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2); }

/* ---------- Crumbs, lede, byline ---------- */
.crumbs { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 18px; font-size: .85rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 6px; }
.crumbs a { color: var(--muted); }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: var(--read); }
.byline { font-size: .85rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Article ---------- */
.article { max-width: var(--read); }
.page > article > .article, .page > article > .section { margin-left: 0; }
.answer { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius-s); padding: 16px 18px; margin: 20px 0; box-shadow: var(--shadow); }
.answer p { margin: 6px 0 0; font-weight: 600; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin: 4px 0; }
.prose figure { margin: 24px 0; }
.prose figcaption { font-size: .85rem; color: var(--muted); margin-top: 6px; }
.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--soft); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 22px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 14px; }
.stat b { display: block; font: 800 1.8rem var(--f-head); color: var(--accent); }
.stat span { font-size: .85rem; color: var(--muted); }
.cta-inline { margin: 20px 0; }
.cta-inline a { font-weight: 800; }
.cta-inline a::after { content: " →"; }
.cta-row { margin: 28px 0; }
.todo { background: repeating-linear-gradient(45deg, #fff7fb, #fff7fb 8px, #fdf0f6 8px, #fdf0f6 16px); border: 1px dashed var(--line-2); border-radius: 8px; padding: 10px 12px; color: var(--muted) !important; font-size: .9rem; }

/* ---------- FAQ + related ---------- */
.faq { margin-top: 36px; }
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-s); margin: 8px 0; }
.faq-item summary { cursor: pointer; padding: 14px 44px 14px 16px; font-weight: 700; list-style: none; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 16px; top: 10px; font-size: 1.4rem; color: var(--accent); }
.faq-item[open] summary::after { content: "–"; }
.faq-a { padding: 0 16px 14px; color: var(--ink-2); }
.faq-a p { margin: 0; }
.related { margin-top: 36px; }
.related-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.related-card { display: block; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 14px; text-decoration: none; color: var(--ink); }
.related-card:hover { border-color: var(--accent); }
.related-card b { display: block; font-family: var(--f-head); margin-bottom: 4px; }
.related-card span { font-size: .87rem; color: var(--muted); }

/* ---------- Sections + tiles ---------- */
.section { margin: 36px 0; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.sec-head h2 { margin: 0; }
.sec-head a { font-weight: 700; font-size: .92rem; white-space: nowrap; }
.sec-intro { color: var(--ink-2); max-width: var(--read); }
.tile-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .tile-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .tile-grid, .tile-grid.compact { grid-template-columns: repeat(5, 1fr); } }
.tile { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden; background: var(--soft); color: #fff; text-decoration: none; box-shadow: var(--shadow); }
.tile img, .tile .ph { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.tile:hover img, .tile:hover .ph { transform: scale(1.04); }
.tile .badge { position: absolute; top: 10px; left: 10px; }
.tile .badge + .badge { left: auto; right: 10px; }
.tile-cap { position: absolute; inset: auto 0 0 0; padding: 36px 12px 12px; background: linear-gradient(transparent, rgba(12,10,18,.88)); }
.tile-cap b { display: block; font: 700 1rem/1.25 var(--f-head); }
.tile-cap span { font-size: .8rem; opacity: .85; }
.ph { display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; background: linear-gradient(160deg, hsl(var(--h) 70% 62%), hsl(calc(var(--h) + 30) 60% 30%)); color: rgba(255,255,255,.9); font: 800 1rem/1.2 var(--f-head); }
.qgrid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .qgrid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .qgrid { grid-template-columns: repeat(4, 1fr); } }
.qbox { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--ink); }
.qbox:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.qbox h3 { margin: 6px 0; font-size: 1.05rem; }
.qbox p { color: var(--muted); font-size: .88rem; margin: 0 0 10px; flex: 1; }
.qbox .go { font-weight: 800; color: var(--accent-2); font-size: .88rem; }
.qbox .go::after { content: " →"; }

/* ---------- Entity head ---------- */
.entity-head { display: grid; gap: 22px; margin-bottom: 8px; }
@media (min-width: 768px) { .entity-head { grid-template-columns: 260px 1fr; align-items: start; } }
.entity-poster { margin: 0 auto; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); max-width: 260px; }
.entity-poster img, .entity-poster .ph { width: 100%; height: 100%; object-fit: cover; }
.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 16px 0; }
.specs > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 12px; }
.specs dt { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.specs dd { margin: 2px 0 0; font-weight: 700; font-size: .92rem; }
.entity-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0 8px; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 460px; display: flex; align-items: flex-end; overflow: hidden; margin: 0; background: linear-gradient(135deg, #2a0f24, #6b1245 55%, #e0287f); color: #fff; }
@media (min-width: 1024px) { .hero { min-height: 520px; } }
.hero-bg, .hero-veil { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-veil { background: linear-gradient(0deg, rgba(14,8,16,.85), rgba(14,8,16,.2)); }
.hero-body { position: relative; padding: 40px 16px; max-width: 820px; }
@media (min-width: 1024px) { .hero-body { padding: 56px 32px; } }
.hero h1 { font-size: clamp(2.3rem, 6vw, 3.8rem); }
.hero-tag { font: 700 1.2rem var(--f-head); margin: 0 0 8px; color: #ffd0e6; }
.hero-lede { font-size: 1.08rem; opacity: .92; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.hero-note { font-size: .82rem; opacity: .75; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--line); background: var(--card); padding: 28px 0; font-size: .88rem; color: var(--muted); }
.site-foot .wrap { max-width: 1080px; }
.foot-nav ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-nav a { color: var(--ink-2); }

/* ---------- Age gate ---------- */
.agegate { position: fixed; inset: 0; z-index: 200; background: rgba(16,10,20,.82); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; padding: 16px; }
.agegate[hidden] { display: none; }
.agegate-card { background: var(--card); border-radius: 20px; padding: 28px; max-width: 440px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.agegate-title { font: 800 1.6rem var(--f-head); margin: 8px 0; }
.agegate-actions { display: grid; gap: 10px; margin: 18px 0 10px; }
.agegate small { color: var(--muted); }
html.age-locked body { overflow: hidden; }

@media print { .side, .site-bar, .agegate, .cta-row, .side-cta { display: none !important; } }

/* ---------- Notes ---------- */
.note { border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--card); border-radius: var(--radius-s); padding: 12px 16px; margin: 18px 0; }
.note p { margin: 4px 0; }
.note-warn { border-left-color: var(--hot); background: #fff7ee; }
.note-ok { border-left-color: #1f9d63; background: #eefbf3; }

/* ---------- Conversion elements ---------- */
.cta-box { display: grid; gap: 18px; align-items: center; margin: 32px 0; padding: 22px 24px; border-radius: var(--radius); background: linear-gradient(135deg, #fff5fa, #fde7f2); border: 1px solid #f5c6dd; box-shadow: var(--shadow); }
@media (min-width: 720px) { .cta-box { grid-template-columns: 1fr auto; } }
.cta-box-head { margin: 6px 0 4px; font: 800 1.35rem/1.2 var(--f-head); color: var(--ink); }
.cta-box-sub { margin: 0; color: var(--ink-2); font-size: .95rem; }
.cta-box-action { display: grid; gap: 6px; justify-items: center; }
.cta-box-action .btn { min-height: 52px; padding: 0 28px; font-size: 1rem; }
.cta-box-action small { color: var(--muted); font-size: .75rem; }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: .88rem; }
.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(23,21,29,.08); font-weight: 700; font-size: .9rem; }
.sticky-cta span { color: var(--ink-2); }
html.age-locked .sticky-cta { display: none; }
@media (min-width: 1024px) { .sticky-cta { display: none; } }
@media (max-width: 1023px) { body.has-sticky-cta { padding-bottom: 64px; } }
.chip { position: absolute; right: 10px; bottom: 58px; font-size: .68rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.chip-free { background: #1f9d63; color: #fff; }
.tile { transition: transform .25s ease, box-shadow .25s ease; }
.tile:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(224,40,127,.22); }
.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.specs .is-good dd { color: #157a4b; }
.specs .is-good { border-color: #b9e2cb; background: #f2fbf6; }
.specs .is-warn dd { color: #b35a05; }
.specs .is-warn { border-color: #f5cfa3; background: #fff7ee; }
.answer .label::before { content: "✓ "; color: var(--accent); }
.hero .btn-cta { min-height: 52px; padding: 0 30px; font-size: 1.02rem; }
.qbox:hover h3 { color: var(--accent-2); }
.entity-actions .btn-cta { min-height: 52px; padding: 0 28px; }
@media (min-width: 768px) { .entity-poster { margin: 0; } }
@media (max-width: 767px) { .entity-head > div { text-align: left; } .entity-head h1 { margin-top: 6px; } }

/* ---------- Key facts + verified ---------- */
.keyfacts { margin: 0 0 22px; padding: 14px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-s); }
.keyfacts-title { margin: 0 0 8px; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.keyfacts ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
@media (min-width: 720px) { .keyfacts ul { grid-template-columns: 1fr 1fr; } }
.keyfacts li { position: relative; padding-left: 22px; font-size: .93rem; color: var(--ink-2); }
.keyfacts li::before { content: "•"; position: absolute; left: 6px; color: var(--accent); font-weight: 800; }
.keyfacts li strong { color: var(--ink); }
.byline .verified::before { content: "✓ "; color: #1f9d63; }
