/* ============================================================
   thefunnycartoon.com — "Bright Funny Pages" cartoon stylesheet
   Cream paper + candy colors + soft stripes + ink outlines
   ============================================================ */

:root {
  --ink:    #16161d;
  --paper:  #fff6e0;
  --white:  #fffdf6;
  --yellow: #ffc91f;
  --red:    #ff4b4b;
  --blue:   #2ec4ff;
  --green:  #3ddc74;
  --pink:   #ff7bc1;
  --purple: #9b5de5;
  --orange: #ff8e3c;
  --border: 3px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);
  --radius: 14px;
  --font-display: 'Boogaloo', 'Comic Sans MS', cursive;
  --font-body: 'Baloo 2', 'Trebuchet MS', sans-serif;
  --stripes: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.22) 0 14px, transparent 14px 28px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--ink);
  background-color: var(--paper);
  line-height: 1.55;
}

img { max-width: 100%; }

a { color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--red); }

:focus-visible {
  outline: 3px dashed var(--red);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 760px; }
.center { text-align: center; margin-top: 2rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 99;
  background: var(--yellow); padding: 8px 16px; border: var(--border);
  border-radius: 8px; font-weight: 800;
}
.skip-link:focus { left: 8px; }

/* ---------- Masthead bar ---------- */
.masthead-bar {
  text-align: center; overflow: hidden; white-space: nowrap;
  background: var(--ink); color: var(--paper);
  font-weight: 700; font-size: 0.85rem; letter-spacing: 0.5px;
  padding: 5px 12px;
  user-select: none;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--yellow);
  border-bottom: var(--border);
  box-shadow: 0 4px 0 rgba(22, 22, 29, 0.15);
  position: relative; z-index: 10;
}
.header-inner {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  padding-top: 14px; padding-bottom: 14px;
}
.logo {
  font-family: var(--font-display);
  font-size: 2rem; line-height: 1;
  text-decoration: none; white-space: nowrap;
  display: flex; align-items: baseline; gap: 4px;
}
.logo-the { font-size: 1.2rem; transform: rotate(-6deg); }
.logo-funny {
  color: var(--red);
  text-shadow: 2px 2px 0 var(--ink);
  transform: rotate(-2deg);
}
.logo-cartoon {
  color: var(--white);
  text-shadow: 2px 2px 0 var(--ink), -1px -1px 0 var(--ink), 1px -1px 0 var(--ink), -1px 1px 0 var(--ink);
}
.logo-dot { color: var(--red); text-shadow: 2px 2px 0 var(--ink); font-size: 2.4rem; }
.logo:hover .logo-funny { animation: wiggle 0.4s ease-in-out; }

.main-nav { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.main-nav a {
  font-weight: 800; text-decoration: none; font-size: 0.95rem;
  padding: 6px 13px; border: var(--border); border-radius: 999px;
  background: var(--white); box-shadow: var(--shadow-sm);
  transition: transform 0.12s, box-shadow 0.12s;
}
.main-nav a:hover {
  transform: translate(-2px, -2px) rotate(-1deg);
  box-shadow: 6px 6px 0 var(--ink);
  background: var(--pink);
}

.search-form {
  margin-left: auto; display: flex;
  border: var(--border); border-radius: 999px; overflow: hidden;
  background: var(--white); box-shadow: var(--shadow-sm);
}
.search-form input {
  border: 0; padding: 8px 14px; font-family: inherit; font-size: 1rem;
  background: transparent; min-width: 150px;
}
.search-form input:focus { outline: none; }
.search-form button {
  border: 0; border-left: var(--border); background: var(--blue);
  padding: 8px 14px; font-size: 1rem; cursor: pointer;
  font-family: inherit; font-weight: 800;
}
.search-form button:hover { background: var(--green); }

/* ---------- Hero ---------- */
.hero { overflow: hidden; }
.hero-inner {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem;
  align-items: center; padding-top: 3.5rem; padding-bottom: 3.5rem;
}
.hero-kicker {
  font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  color: var(--red); margin: 0 0 0.5rem;
}
.hero-title {
  font-family: var(--font-display); font-weight: 400;
  margin: 0 0 1rem; line-height: 0.95;
  font-size: clamp(3rem, 8vw, 5.5rem);
}
.ht-line { display: block; animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards; }
.ht-1 { transform: rotate(-2deg); animation-delay: 0.05s; }
.ht-2 {
  color: var(--red);
  text-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-1deg); animation-delay: 0.15s;
}
.ht-3 {
  color: var(--blue);
  text-shadow: 4px 4px 0 var(--ink);
  transform: rotate(1deg); animation-delay: 0.25s;
}
.hero-sub { font-size: 1.15rem; max-width: 46ch; margin: 0 0 1.5rem; }
.hero-cta { display: flex; gap: 0.8rem; flex-wrap: wrap; }

.btn {
  display: inline-block; text-decoration: none; cursor: pointer;
  font-family: var(--font-display); font-size: 1.3rem; letter-spacing: 1px;
  padding: 10px 24px; border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); background: var(--white);
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn:hover { transform: translate(-3px, -3px) rotate(-1deg); box-shadow: 9px 9px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn-pow { background: var(--red); color: var(--white); text-shadow: 1px 1px 0 var(--ink); }
.btn-ghost { background: var(--white); }
.btn-big { font-size: 1.6rem; margin-top: 0.5rem; }

.hero-art { position: relative; min-height: 260px; }
.speech-bubble {
  position: relative; background: var(--white); border: var(--border);
  border-radius: 24px; padding: 1.4rem 1.8rem; box-shadow: var(--shadow);
  transform: rotate(2deg);
  width: fit-content; max-width: 100%;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s backwards;
}
.speech-bubble p {
  margin: 0; font-family: var(--font-display);
  font-size: 1.7rem; line-height: 1.15; letter-spacing: 1px;
}
/* Clean triangular tail: ::before draws the ink outline, ::after the white fill. */
.speech-bubble::before {
  content: ''; position: absolute; bottom: -22px; left: 42px;
  border: 17px solid transparent; border-bottom: 0;
  border-top: 22px solid var(--ink);
}
.speech-bubble::after {
  content: ''; position: absolute; bottom: -13px; left: 47px;
  border: 12px solid transparent; border-bottom: 0;
  border-top: 16px solid var(--white);
}
.bubble-credit { display: block; margin-top: 0.6rem; font-family: var(--font-body); font-weight: 700; font-size: 0.9rem; color: #666; }

/* ---------- Sections ---------- */
.section { padding: 2.5rem 0; }
.section-alt {
  background-color: var(--blue);
  background-image: var(--stripes);
  border-top: var(--border); border-bottom: var(--border);
}
.section-title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: 1px;
  margin: 0 0 1.5rem; text-align: center;
}
.section-title span {
  display: inline-block; background: var(--white); border: var(--border);
  border-radius: var(--radius); padding: 6px 22px;
  box-shadow: var(--shadow-sm); transform: rotate(-1deg);
}

/* ---------- Category cards ---------- */
.cat-grid {
  display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.cat-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  text-decoration: none; text-align: center;
  border: var(--border); border-radius: var(--radius);
  padding: 1.2rem 0.8rem; box-shadow: var(--shadow);
  transition: transform 0.12s, box-shadow 0.12s;
}
.cat-card:hover { transform: translate(-3px, -3px) rotate(-1deg); box-shadow: 9px 9px 0 var(--ink); }
.cat-emoji { font-size: 2.2rem; }
.cat-name { font-family: var(--font-display); font-size: 1.4rem; letter-spacing: 1px; }
.cat-count { font-weight: 700; font-size: 0.85rem; opacity: 0.75; }

/* Accent backgrounds (assigned per slug) */
.acc-yellow { background: var(--yellow); }
.acc-red    { background: var(--red); }
.acc-blue   { background: var(--blue); }
.acc-green  { background: var(--green); }
.acc-pink   { background: var(--pink); }
.acc-purple { background: var(--purple); }
.acc-orange { background: var(--orange); }
.acc-red .cat-name, .acc-purple .cat-name,
.acc-red .cat-count, .acc-purple .cat-count { color: var(--white); }

/* ---------- Comic cards ---------- */
.comic-grid {
  display: grid; gap: 1.4rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.comic-card {
  background: var(--white); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
  animation: popIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.comic-grid .comic-card:nth-child(2n) { animation-delay: 0.06s; }
.comic-grid .comic-card:nth-child(3n) { animation-delay: 0.12s; }
.comic-grid .comic-card:nth-child(4n) { animation-delay: 0.18s; }
.comic-card:hover { transform: translate(-4px, -4px) rotate(-0.6deg); box-shadow: 10px 10px 0 var(--ink); }
.comic-card-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; }

.comic-card-art {
  display: grid; place-items: center; height: 110px;
  border-bottom: var(--border);
  background-image: var(--stripes);
}
.acc-yellow .comic-card-art { background-color: var(--yellow); }
.acc-red    .comic-card-art { background-color: var(--red); }
.acc-blue   .comic-card-art { background-color: var(--blue); }
.acc-green  .comic-card-art { background-color: var(--green); }
.acc-pink   .comic-card-art { background-color: var(--pink); }
.acc-purple .comic-card-art { background-color: var(--purple); }
.acc-orange .comic-card-art { background-color: var(--orange); }

.comic-card-initial {
  font-family: var(--font-display); font-size: 4rem; line-height: 1;
  color: var(--white);
  text-shadow: 3px 3px 0 var(--ink), -1px -1px 0 var(--ink), 1px -1px 0 var(--ink), -1px 1px 0 var(--ink);
  transform: rotate(-4deg);
}
.comic-card:hover .comic-card-initial { animation: wiggle 0.4s ease-in-out; }

.comic-card-body { padding: 0.9rem 1rem 0.4rem; flex: 1; }
.comic-card-title { font-family: var(--font-display); font-weight: 400; font-size: 1.45rem; letter-spacing: 0.5px; margin: 0; line-height: 1.1; }
.comic-card-author { margin: 0.15rem 0 0.5rem; font-size: 0.85rem; font-weight: 700; color: #777; }
.comic-card-blurb { margin: 0; font-size: 0.92rem; }

.comic-card-foot {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.6rem 1rem 0.9rem;
}
.badge {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.3px;
  border: 2px solid var(--ink); border-radius: 999px; padding: 2px 10px;
  background: var(--paper);
}
.badge-year { background: var(--white); }

/* ---------- Page heads & breadcrumbs ---------- */
.breadcrumbs { padding: 1.2rem 0 0; font-weight: 700; font-size: 0.9rem; }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs span[aria-current] { color: var(--red); }

.page-head { padding: 1rem 0 1.8rem; text-align: center; }
.page-title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.2rem, 6vw, 3.6rem); letter-spacing: 1px;
  margin: 0 0 0.3rem; line-height: 1.05;
}
.page-title span { color: var(--red); }
.page-sub { font-size: 1.1rem; max-width: 62ch; margin: 0 auto; }

/* ---------- A–Z listing ---------- */
.az-nav {
  display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center;
  margin-bottom: 2rem;
}
.az-nav a {
  font-family: var(--font-display); font-size: 1.2rem;
  width: 40px; height: 40px; display: grid; place-items: center;
  text-decoration: none; background: var(--white);
  border: var(--border); border-radius: 10px; box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.1s, background 0.1s;
}
.az-nav a:hover { transform: translate(-2px, -2px); background: var(--yellow); }

.az-section { margin-bottom: 2.5rem; }
.az-letter {
  font-family: var(--font-display); font-weight: 400; font-size: 2.6rem;
  margin: 0 0 1rem;
  display: inline-block; background: var(--ink); color: var(--yellow);
  padding: 2px 20px; border-radius: 10px; transform: rotate(-2deg);
  box-shadow: var(--shadow-sm);
}

/* ---------- Categories index ---------- */
.cat-list { display: flex; flex-direction: column; gap: 1.4rem; padding-bottom: 2rem; }
.cat-row {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 1.5rem;
  border: var(--border); border-radius: var(--radius);
  padding: 1.4rem 1.6rem; box-shadow: var(--shadow);
}
.cat-row-head h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.9rem; letter-spacing: 1px; margin: 0 0 0.4rem; }
.cat-row-head h2 a { text-decoration: none; }
.cat-row-head h2 a:hover { text-decoration: underline wavy var(--ink) 2px; }
.cat-row-head p { margin: 0; font-weight: 600; }
.acc-red .cat-row-head, .acc-purple .cat-row-head { color: var(--white); }
.acc-red .cat-row-head a, .acc-purple .cat-row-head a { color: var(--white); }
.cat-row-comics {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-content: center;
}
.cat-row-comics a {
  display: inline-block; text-decoration: none; font-weight: 800; font-size: 0.92rem;
  background: var(--white); border: 2px solid var(--ink); border-radius: 999px;
  padding: 4px 14px; box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.1s;
}
.cat-row-comics a:hover { transform: translate(-2px, -2px) rotate(-1deg); background: var(--yellow); }

/* ---------- Comic detail ---------- */
.comic-detail {
  display: grid; grid-template-columns: 280px 1fr; gap: 2rem;
  background: var(--white); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; margin: 1.5rem 0 2.5rem;
}
.detail-art {
  position: relative; display: grid; place-items: center; min-height: 280px;
  border-right: var(--border);
  background-image: var(--stripes);
}
.acc-yellow .detail-art { background-color: var(--yellow); }
.acc-red    .detail-art { background-color: var(--red); }
.acc-blue   .detail-art { background-color: var(--blue); }
.acc-green  .detail-art { background-color: var(--green); }
.acc-pink   .detail-art { background-color: var(--pink); }
.acc-purple .detail-art { background-color: var(--purple); }
.acc-orange .detail-art { background-color: var(--orange); }
.detail-initial {
  font-family: var(--font-display); font-size: 9rem; line-height: 1;
  color: var(--white);
  text-shadow: 6px 6px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink);
  transform: rotate(-5deg);
}
.detail-body { padding: 1.8rem 2rem; }
.detail-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.2rem, 5vw, 3.2rem); letter-spacing: 1px; margin: 0; line-height: 1.05; }
.detail-author { margin: 0.2rem 0 1rem; font-size: 1.05rem; color: #666; }
.detail-blurb { font-size: 1.12rem; margin: 0 0 1.4rem; }

.detail-facts {
  display: flex; gap: 1rem; flex-wrap: wrap; margin: 0 0 1.2rem;
}
.detail-facts .fact {
  border: 2px solid var(--ink); border-radius: 10px;
  background: var(--paper); padding: 8px 16px; box-shadow: 3px 3px 0 var(--ink);
}
.detail-facts dt { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: #888; }
.detail-facts dd { margin: 0; font-weight: 800; font-size: 1.05rem; }
.status-running { color: #0d8a3f; }
.status-concluded { color: var(--red); }

.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0 0 1.4rem; padding: 0; }
.tag-list a {
  display: inline-block; text-decoration: none; font-weight: 800; font-size: 0.85rem;
  background: var(--blue); border: 2px solid var(--ink); border-radius: 999px;
  padding: 3px 12px; box-shadow: 2px 2px 0 var(--ink); transition: transform 0.1s, background 0.1s;
}
.tag-list a:hover { transform: translate(-2px, -2px); background: var(--green); }
.tag-list-big { justify-content: center; }
.tag-list-big a { font-size: 1.05rem; padding: 6px 18px; }

.detail-note { font-size: 0.85rem; color: #888; font-weight: 700; margin: 0.7rem 0 0; }

/* ---------- Search & empty states ---------- */
.search-form-big {
  max-width: 560px; margin: 0 auto 2.5rem; border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.search-form-big input { flex: 1; font-size: 1.15rem; padding: 14px 18px; }
.search-form-big button { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: 1px; padding: 14px 22px; }

.empty-state { text-align: center; padding: 3rem 0 4rem; }
.empty-pow {
  font-family: var(--font-display); font-size: 4.5rem; letter-spacing: 2px;
  color: var(--red);
  text-shadow: 5px 5px 0 var(--ink);
  margin: 0 0 1rem; transform: rotate(-3deg); display: inline-block;
}
.empty-404 { padding-top: 4rem; }
.empty-404 .hero-cta { justify-content: center; margin-top: 1.5rem; }

/* ---------- Fun facts ---------- */
.fact-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.fact-panel {
  background: var(--white); border: var(--border); border-radius: var(--radius);
  padding: 1.3rem 1.5rem; box-shadow: var(--shadow);
}
.fact-panel:nth-child(1) { transform: rotate(-1deg); background: var(--yellow); }
.fact-panel:nth-child(2) { transform: rotate(0.8deg); background: var(--pink); }
.fact-panel:nth-child(3) { transform: rotate(-0.6deg); background: var(--green); }
.fact-panel h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; letter-spacing: 1px; margin: 0 0 0.4rem; }
.fact-panel p { margin: 0; font-size: 0.98rem; }

/* ---------- Prose (about) ---------- */
.prose { background: var(--white); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem 2.4rem; margin-bottom: 3rem; }
.prose h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.7rem; letter-spacing: 1px; margin: 1.6rem 0 0.5rem; }
.prose li { margin-bottom: 0.4rem; }
.prose-signoff { font-weight: 800; font-size: 1.15rem; margin-top: 2rem; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 3rem; background: var(--ink); color: var(--paper);
  border-top: 6px solid var(--red);
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem;
  padding-top: 2.5rem; padding-bottom: 1.5rem;
}
.footer-logo { font-family: var(--font-display); font-size: 1.9rem; letter-spacing: 1px; color: var(--yellow); margin: 0 0 0.4rem; }
.footer-logo span { color: var(--red); }
.footer-tag { margin: 0; opacity: 0.85; }
.footer-h { font-family: var(--font-display); font-weight: 400; font-size: 1.25rem; letter-spacing: 1px; color: var(--blue); margin: 0 0 0.6rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.35rem; }
.footer-col a { color: var(--paper); text-decoration: none; font-weight: 700; }
.footer-col a:hover { color: var(--yellow); text-decoration: underline wavy var(--yellow) 2px; }
.footer-bottom { border-top: 1px solid rgba(255, 246, 224, 0.2); padding-top: 1rem; padding-bottom: 1.4rem; }
.footer-bottom p { margin: 0; font-size: 0.85rem; opacity: 0.7; }

/* ---------- Comic of the Day ---------- */
.cotd {
  display: grid; grid-template-columns: 220px 1fr; overflow: hidden;
  background: var(--white); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); max-width: 900px; margin: 0 auto;
}
.cotd-art {
  display: grid; place-items: center; min-height: 200px; text-decoration: none;
  border-right: var(--border);
  background-image: var(--stripes);
}
.acc-yellow .cotd-art { background-color: var(--yellow); }
.acc-red    .cotd-art { background-color: var(--red); }
.acc-blue   .cotd-art { background-color: var(--blue); }
.acc-green  .cotd-art { background-color: var(--green); }
.acc-pink   .cotd-art { background-color: var(--pink); }
.acc-purple .cotd-art { background-color: var(--purple); }
.acc-orange .cotd-art { background-color: var(--orange); }
.cotd-art .comic-card-initial { font-size: 6rem; }
.cotd-body { padding: 1.4rem 1.8rem; }
.cotd-title { font-family: var(--font-display); font-weight: 400; font-size: 2.1rem; letter-spacing: 1px; margin: 0; line-height: 1.05; }
.cotd-title a { text-decoration: none; }
.cotd-title a:hover { text-decoration: underline wavy var(--red) 2px; }
.cotd-blurb { margin: 0.5rem 0 1rem; }

/* ---------- Timeline ---------- */
.az-decade { width: auto !important; padding: 0 12px; }
.decade-blurb { max-width: 70ch; font-weight: 600; margin: 0 0 1rem; }
.chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip-list a {
  display: inline-block; text-decoration: none; font-weight: 800; font-size: 0.92rem;
  background: var(--white); border: 2px solid var(--ink); border-radius: 999px;
  padding: 4px 14px; box-shadow: 3px 3px 0 var(--ink); transition: transform 0.1s, background 0.1s;
}
.chip-list a:hover { transform: translate(-2px, -2px) rotate(-1deg); background: var(--yellow); }
.chip-year { font-weight: 600; opacity: 0.6; font-size: 0.8rem; }

/* ---------- Embedded strips ---------- */
.strip-embed { margin: 0 0 2rem; }
.strip-figure {
  margin: 0 auto; max-width: 860px;
  background: var(--white); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.2rem;
}
.strip-figure img {
  display: block; width: auto; max-width: 100%; max-height: 1100px;
  margin: 0 auto; border-radius: 6px;
}
.strip-figure figcaption {
  margin-top: 0.8rem; text-align: center;
  font-size: 0.88rem; font-weight: 700; color: #666;
}
.strip-figure figcaption a { color: inherit; }

/* ---------- Pager & dice ---------- */
.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0 0 1rem; }
.pager .btn { font-size: 1.05rem; }
.pager-next { margin-left: auto; }
.btn-dice { background: var(--green); }
.nav-dice { font-size: 1.1rem; }

/* ---------- Animations ---------- */
@keyframes popIn {
  from { opacity: 0; transform: scale(0.85) translateY(14px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(-4deg); }
  25% { transform: rotate(4deg) scale(1.06); }
  75% { transform: rotate(-6deg); }
}
@keyframes floaty {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 2.5rem; }
  .hero-art { min-height: 0; margin-top: 1rem; }
  .comic-detail { grid-template-columns: 1fr; }
  .cotd { grid-template-columns: 1fr; }
  .cotd-art { border-right: 0; border-bottom: var(--border); min-height: 140px; }
  .cotd-art .comic-card-initial { font-size: 4.5rem; }
  .detail-art { border-right: 0; border-bottom: var(--border); min-height: 190px; }
  .detail-initial { font-size: 6rem; }
  .fact-strip { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .cat-row { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .header-inner { gap: 0.8rem; }
  .search-form { margin-left: 0; width: 100%; }
  .search-form input { flex: 1; }
  .logo { font-size: 1.6rem; }
}

/* ---------- Link cards (games) ---------- */
.section-blurb { text-align: center; max-width: 64ch; margin: -0.6rem auto 1.4rem; font-weight: 600; }
.link-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.link-card { border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); background-image: var(--stripes); transition: transform 0.12s, box-shadow 0.12s; }
.link-card:hover { transform: translate(-3px, -3px) rotate(-0.6deg); box-shadow: 9px 9px 0 var(--ink); }
.link-card a { display: flex; flex-direction: column; gap: 0.25rem; height: 100%; padding: 1.1rem 1.2rem; text-decoration: none; }
.link-emoji { font-size: 2rem; line-height: 1; }
.link-name { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: 0.5px; line-height: 1.1; }
.link-blurb { font-size: 0.9rem; flex: 1; }
.link-cta { font-weight: 800; font-size: 0.85rem; margin-top: 0.4rem; background: var(--white); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 12px; width: fit-content; }
.acc-red .link-name, .acc-purple .link-name, .acc-red .link-blurb, .acc-purple .link-blurb { color: var(--white); }

/* ---------- Resource list (lessons) & books ---------- */
.resource-list, .book-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.resource, .book {
  display: flex; gap: 1.1rem; align-items: flex-start;
  background: var(--white); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 1rem 1.2rem; border-left-width: 12px;
}
.resource.acc-yellow, .book.acc-yellow { background: var(--white); border-left-color: var(--yellow); }
.resource.acc-red, .book.acc-red { background: var(--white); border-left-color: var(--red); }
.resource.acc-blue, .book.acc-blue { background: var(--white); border-left-color: var(--blue); }
.resource.acc-green, .book.acc-green { background: var(--white); border-left-color: var(--green); }
.resource.acc-pink, .book.acc-pink { background: var(--white); border-left-color: var(--pink); }
.resource.acc-purple, .book.acc-purple { background: var(--white); border-left-color: var(--purple); }
.resource.acc-orange, .book.acc-orange { background: var(--white); border-left-color: var(--orange); }
.resource-emoji, .book-spine { font-size: 1.8rem; line-height: 1; margin-top: 0.15rem; }
.resource-body h3, .book-body h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.45rem; letter-spacing: 0.5px; margin: 0 0 0.2rem; }
.resource-body p, .book-body p { margin: 0; font-size: 0.95rem; }
.book-meta { font-weight: 700; color: #777; font-size: 0.85rem !important; margin-bottom: 0.3rem !important; }
.lesson-links { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-direction: column; gap: 0.5rem; }
.lesson-links a { font-weight: 800; }
.prose-intro { padding: 1.4rem 1.8rem; margin-bottom: 2rem; }
.prose-intro p { margin: 0; }
.code-block { background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; padding: 0.8rem 1rem; overflow-x: auto; font-size: 0.85rem; }

/* ---------- Legacy (original-directory) bits ---------- */
.legacy-section { border-top: 3px dashed var(--ink); margin-top: 1rem; }
.legacy-group { font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; letter-spacing: 1px; text-align: center; margin: 1.4rem 0 0.6rem; }
.chip-list-center { justify-content: center; }
.legacy-note { max-width: 760px; margin: 0 auto 1rem; font-size: 0.95rem; background: var(--white); border: 2px dashed var(--ink); border-radius: var(--radius); padding: 0.9rem 1.3rem; }
.legacy-note p { margin: 0; }

/* ---------- Sitemap & gallery ---------- */
.sitemap-list { list-style: none; margin: 0; padding: 0; columns: 3; column-gap: 1.5rem; }
.sitemap-list li { break-inside: avoid; margin-bottom: 0.3rem; font-weight: 700; }
.sitemap-pages { columns: 2; }
.sitemap-cats { display: flex; flex-direction: column; gap: 1.4rem; }
.sitemap-cat { background: var(--white); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1rem 1.4rem; }
.sitemap-cat h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; letter-spacing: 0.5px; margin: 0 0 0.6rem; }
.sitemap-cat h3 a { text-decoration: none; }
.sitemap-cat small { font-weight: 700; color: #888; font-family: var(--font-body); }
.gallery-item { margin-bottom: 1rem; }
.gallery-title { font-family: var(--font-display); font-weight: 400; font-size: 1.9rem; letter-spacing: 1px; text-align: center; margin: 0 0 -1.5rem; }
.gallery-title a { text-decoration: none; }
.gallery-title a:hover { text-decoration: underline wavy var(--red) 2px; }
.gallery-title small { display: block; font-family: var(--font-body); font-size: 0.9rem; font-weight: 700; color: #777; letter-spacing: 0; }
.gallery-item .section-title { display: none; }

@media (max-width: 880px) {
  .sitemap-list { columns: 2; }
  .sitemap-pages { columns: 1; }
}
@media (max-width: 620px) {
  .sitemap-list { columns: 1; }
  .resource, .book { flex-direction: column; gap: 0.5rem; }
}
