/* ==========================================================================
   KidsVerve — playful, colourful theme
   Theme colours are also injected from data/site.json at runtime.
   ========================================================================== */

:root {
  --primary: #ff5d8f;
  --secondary: #3ec6c6;
  --accent: #ffd23f;
  --purple: #7b6cf6;
  --ink: #2b2d42;
  --paper: #fff9f3;
  --card: #ffffff;
  --muted: #6b6f80;
  --shadow: 0 12px 30px rgba(43, 45, 66, 0.12);
  --radius: 22px;
  --radius-sm: 14px;
  --font-head: "Fredoka", "Baloo 2", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(123, 108, 246, 0.12), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(62, 198, 198, 0.14), transparent 55%),
    var(--paper);
  min-height: 100vh;
  line-height: 1.6;
}

h1, h2, h3, .brand__name { font-family: var(--font-head); line-height: 1.15; }

a { color: inherit; }

img { max-width: 100%; display: block; }

.container { width: min(1140px, 92vw); margin-inline: auto; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 0 0 12px 0; z-index: 1000;
}
.skip-link:focus { left: 0; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(1.4) blur(10px);
  background: rgba(255, 249, 243, 0.85);
  border-bottom: 3px solid rgba(43, 45, 66, 0.06);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 0;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__logo {
  width: 51px; height: 51px; display: grid; place-items: center; position: relative;
}
.brand__logo-img { width: 51px; height: 51px; object-fit: contain; display: block; }
.brand__name { font-size: 1.5rem; font-weight: 700; margin: 0; }
.brand__tag { font-size: .72rem; color: var(--muted); font-weight: 700; letter-spacing: .3px; }

.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  text-decoration: none; font-weight: 700; font-size: .98rem;
  padding: 9px 14px; border-radius: 999px; color: var(--ink);
  display: inline-flex; align-items: center; gap: 7px; transition: all .18s ease;
}
.nav a:hover { background: rgba(123, 108, 246, 0.12); transform: translateY(-1px); }
.nav a.is-active { background: var(--ink); color: #fff; }
.nav a .nav__icon { font-size: 1rem; }

.nav-toggle {
  display: none; border: 0; background: var(--ink); color: #fff;
  width: 46px; height: 46px; border-radius: 14px; font-size: 22px; cursor: pointer;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--font-head); font-weight: 600; text-decoration: none;
  padding: 12px 22px; border-radius: 999px; border: 0; font-size: 1rem;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn--primary { background: linear-gradient(135deg, var(--primary), var(--purple)); color: #fff; box-shadow: var(--shadow); }
.btn--ghost { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 40px; }
.hero__grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin: 0 0 12px; }
.hero h1 .hl {
  background: linear-gradient(120deg, var(--primary), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 46ch; margin: 0 0 26px; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__art {
  aspect-ratio: 1/1; border-radius: 32px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(255,93,143,.18), rgba(123,108,246,.18));
  box-shadow: var(--shadow); display: grid; place-items: center;
}
.hero__art .blob { font-size: clamp(80px, 18vw, 160px); filter: drop-shadow(0 10px 20px rgba(0,0,0,.12)); }
.floaty { position: absolute; font-size: 40px; animation: float 5s ease-in-out infinite; }
.floaty:nth-child(2) { top: 12%; left: 12%; animation-delay: .4s; }
.floaty:nth-child(3) { bottom: 14%; right: 12%; animation-delay: 1s; }
.floaty:nth-child(4) { bottom: 18%; left: 18%; animation-delay: 1.6s; }
.floaty:nth-child(5) { top: 12%; right: 12%; animation-delay: 2.2s; }
@keyframes float { 0%,100%{ transform: translateY(0) rotate(-4deg);} 50%{ transform: translateY(-14px) rotate(4deg);} }

/* ---------- Section headings ---------- */
.section { padding: 40px 0; }
.section__head { text-align: center; margin-bottom: 28px; }
.section__head h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin: 0 0 6px; }
.section__head p { color: var(--muted); margin: 0; }
.eyebrow {
  display: inline-block; font-weight: 800; font-size: .8rem; letter-spacing: 1px;
  text-transform: uppercase; color: var(--purple);
  background: rgba(123,108,246,.12); padding: 5px 14px; border-radius: 999px; margin-bottom: 10px;
}

/* ---------- Category cards (home) ---------- */
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.cat {
  text-decoration: none; color: var(--ink); background: var(--card);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
  border: 3px solid transparent; transition: transform .18s ease, border-color .18s ease;
}
.cat:hover { transform: translateY(-6px); border-color: var(--accent); }
.cat__emoji { font-size: 44px; }
.cat h3 { margin: 12px 0 6px; font-size: 1.35rem; }
.cat p { margin: 0; color: var(--muted); }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 26px; }
.chip {
  border: 0; cursor: pointer; font-weight: 800; font-size: .92rem;
  padding: 9px 18px; border-radius: 999px; background: #fff; color: var(--ink);
  box-shadow: var(--shadow); display: inline-flex; align-items: center; gap: 8px;
  transition: transform .15s ease;
}
.chip:hover { transform: translateY(-2px); }
.chip.is-active { color: #fff; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; opacity: .8; }

/* ---------- Gallery grid ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 300px)); gap: 24px; justify-content: center; }
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); cursor: pointer; border: 3px solid transparent;
  transition: transform .18s ease, border-color .18s ease; text-align: left;
  padding: 0; font: inherit; color: inherit; width: 100%;
}
.card:hover { transform: translateY(-6px); border-color: var(--secondary); }
.card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.card__media { aspect-ratio: 4/3; overflow: hidden; background: linear-gradient(135deg, #f3f0ff, #e7fbfb); position: relative; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.card:hover .card__media img { transform: scale(1.06); }
.card__badge {
  position: absolute; top: 12px; left: 12px; color: #fff; font-weight: 800; font-size: .78rem;
  padding: 5px 12px; border-radius: 999px; box-shadow: var(--shadow);
}
.card__badge--type { right: 12px; left: auto; background: var(--ink); }
.card__body { padding: 16px 18px 20px; }
.card__body h3 { margin: 0 0 6px; font-size: 1.15rem; }
.card__meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .85rem; font-weight: 700; }
.card__desc { margin: 8px 0 0; color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.empty { text-align: center; color: var(--muted); padding: 40px; font-weight: 700; }

/* ---------- Lightbox / modal ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(43, 45, 66, 0.72); backdrop-filter: blur(4px);
}
.lightbox[open], .lightbox.is-open { display: flex; }
.lightbox__panel {
  background: var(--card); border-radius: var(--radius); max-width: 900px; width: 100%;
  max-height: 90vh; overflow: auto; box-shadow: var(--shadow); position: relative;
}
.lightbox__close {
  position: absolute; top: 14px; right: 14px; z-index: 2; border: 0; cursor: pointer;
  width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 22px;
}
.lightbox__toolbar {
  position: absolute; top: 14px; right: 14px; z-index: 4; display: flex; gap: 8px;
}
.lightbox__tool {
  border: 0; cursor: pointer; width: 44px; height: 44px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 20px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease, background .15s ease;
}
.lightbox__tool:hover { transform: scale(1.08); }
.lightbox__tool.is-playing { background: var(--brand, #ff5d8f); }
.lightbox__tool.lightbox__close { position: static; top: auto; right: auto; }
.lightbox__tool[hidden] { display: none; }
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; border: 0; cursor: pointer;
  width: 52px; height: 52px; border-radius: 50%; background: rgba(43, 45, 66, .55); color: #fff;
  font-size: 34px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, transform .15s ease;
}
.lightbox__nav:hover { background: var(--ink); }
.lightbox__nav--prev { left: 14px; }
.lightbox__nav--next { right: 14px; }
.lightbox__nav[hidden] { display: none; }
.lightbox__counter { font-weight: 700; color: var(--muted); margin-left: 6px; }
.lightbox__media { width: 100%; background: linear-gradient(135deg, #f3f0ff, #e7fbfb); }
.lightbox__media img { width: 100%; max-height: 60vh; object-fit: contain; }
.lightbox__embed { position: relative; width: 100%; aspect-ratio: 16/11; }
.lightbox__embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lightbox__body { padding: 22px 26px 26px; }
.lightbox__body h3 { margin: 0 0 8px; font-size: 1.6rem; }
.lightbox__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* Fullscreen image view */
.lightbox:fullscreen { padding: 0; background: #000; }
.lightbox:fullscreen .lightbox__panel {
  max-width: none; width: 100vw; height: 100vh; max-height: none; border-radius: 0; background: #000;
}
.lightbox:fullscreen .lightbox__media {
  height: 100vh; display: flex; align-items: center; justify-content: center; background: #000;
}
.lightbox:fullscreen .lightbox__media img { width: auto; max-width: 100vw; max-height: 100vh; }
.lightbox:fullscreen .lightbox__body { display: none; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 50px; background: var(--ink); color: #fff; padding: 48px 0 24px; }
.site-footer a { color: rgba(255,255,255,.85); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; }
.footer__about h3 { margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.footer__logo { width: 30px; height: 30px; object-fit: contain; flex: 0 0 auto; }
.footer__about p { color: rgba(255,255,255,.7); max-width: 40ch; }
.footer__col h4 { margin: 0 0 12px; font-family: var(--font-head); }
.footer__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer__social { display: flex; gap: 10px; margin-top: 16px; }
.footer__social-icons { display: flex; gap: 10px; }
.footer__social a {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: rgba(255,255,255,.1); font-size: 20px; transition: background .18s ease;
}
.footer__social a:hover { background: rgba(255,255,255,.2); }
.footer__bottom { margin-top: 34px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.14); text-align: center; color: rgba(255,255,255,.7); font-size: .9rem; }
.footer__col { position: relative; }
.footer__visits {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px;
  padding: 8px 14px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 6px 16px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.12);
  font-weight: 800; font-size: .82rem; color: rgba(255,255,255,.9); white-space: nowrap;
}
.footer__visits-icon { font-size: 1.05rem; line-height: 1; }
.footer__visits-num strong { color: var(--accent); font-size: 1rem; }
.footer__visits-label { color: rgba(255,255,255,.7); font-weight: 700; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { order: -1; max-width: 360px; margin-inline: auto; }
  .cats { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-grid; place-items: center; }
  .nav {
    position: absolute; top: 74px; right: 4vw; flex-direction: column; align-items: stretch;
    background: #fff; padding: 12px; border-radius: 18px; box-shadow: var(--shadow);
    width: min(240px, 80vw); display: none;
  }
  .nav.is-open { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
