/*
Theme Name: Happy Qideo
Theme URI: https://hqideo.com
Author: Happy Qideo
Description: Happy, Mappy ve Qideo ile 4-10 yaş çocuklar için kısa eğitici çizgi film sitesi. YouTube Shorts bölümleri, merak soruları, boyama sayfaları ve ebeveyn/öğretmen köşesi.
Version: 1.2.1
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: hqideo
*/

/* Layout: a kids' science picture-book site — sticky top bar, big hero with the three friends, then alternating
   bands (episodes, curiosity questions, characters, colouring, grown-ups) stitched together by YouTube call-outs. */
:root {
  --bg: #f1f7ff;
  --paper: #ffffff;
  --ink: #1d2742;
  --muted: #56627e;
  --line: #d7e3f4;
  --honey: #f0a43a;      /* Happy */
  --honey-ink: #4a2c00;
  --berry: #e8608f;      /* Mappy */
  --teal: #1fb3a3;       /* Qideo */
  --sky: #2f86e6;
  --yt: #e5322d;
  --tint-honey: #fff1dc;
  --tint-berry: #ffe6ef;
  --tint-teal: #dcf6f2;
  --shadow: 0 14px 34px rgba(29, 39, 66, .10);
  --display: "Baloo 2", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1626; --paper: #18213a; --ink: #eaf0fb; --muted: #a3b0cb; --line: #2a3655;
    --honey: #ffb653; --honey-ink: #2a1800; --berry: #ff7fa9; --teal: #3fd0bf; --sky: #6aaeff; --yt: #ff4d47;
    --tint-honey: #3a2a14; --tint-berry: #3b1d2b; --tint-teal: #12332f; --shadow: 0 14px 34px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1626; --paper: #18213a; --ink: #eaf0fb; --muted: #a3b0cb; --line: #2a3655;
  --honey: #ffb653; --honey-ink: #2a1800; --berry: #ff7fa9; --teal: #3fd0bf; --sky: #6aaeff; --yt: #ff4d47;
  --tint-honey: #3a2a14; --tint-berry: #3b1d2b; --tint-teal: #12332f; --shadow: 0 14px 34px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.6; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 16px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(30px, 4.6vw, 44px); font-weight: 800; }
h3 { font-size: 23px; font-weight: 800; }
p { margin: 0; }
.eyebrow { font-weight: 800; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--sky); }
.lead { color: var(--muted); font-size: 18px; max-width: 60ch; }

/* preview ribbon */
.ribbon { background: var(--ink); color: var(--bg); font-size: 13.5px; text-align: center; padding-block: 7px; padding-inline: 16px; }

/* top bar */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-block: 10px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo img { width: 44px; height: 44px; object-fit: contain; }
.logo b { font-family: var(--display); font-size: 25px; font-weight: 800; letter-spacing: -.01em; }
.logo b span:nth-child(1) { color: var(--honey); } .logo b span:nth-child(2) { color: var(--teal); }
nav.menu { display: flex; gap: 4px; flex-wrap: wrap; }
nav.menu a { text-decoration: none; font-weight: 700; font-size: 15px; padding: 6px 10px; border-radius: 999px; color: var(--muted); }
nav.menu a:hover { background: var(--paper); color: var(--ink); }
@media (max-width: 900px) { nav.menu { display: none; } }

.yt-btn { display: inline-flex; align-items: center; gap: 9px; background: var(--yt); color: #fff; text-decoration: none; font-weight: 800; border-radius: 999px; padding: 10px 18px; white-space: nowrap; box-shadow: 0 6px 16px color-mix(in srgb, var(--yt) 30%, transparent); }
.yt-btn svg { width: 22px; height: 16px; flex: none; }
.yt-btn.small { padding: 8px 14px; font-size: 14px; }
.btn-ghost { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; border-radius: 999px; padding: 10px 18px; border: 2px solid var(--ink); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }

/* hero */
.hero { padding-block: 44px 30px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 28px; align-items: center; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); } }
.hero h1 { font-size: clamp(40px, 6.4vw, 70px); font-weight: 800; }
.hero h1 .q { color: var(--berry); }
.hero .copy { display: grid; gap: 18px; }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.stage { position: relative; border-radius: 34px; background: radial-gradient(120% 90% at 50% 100%, var(--tint-teal), transparent 70%), var(--paper); border: 1px solid var(--line); padding: 26px 18px 0; overflow: hidden; box-shadow: var(--shadow); }
.stage img { margin: 0 auto; width: 100%; max-width: 560px; }
.bubble { position: absolute; top: 18px; left: 18px; background: var(--honey); color: var(--honey-ink); font-family: var(--display); font-weight: 800; font-size: 20px; padding: 8px 16px; border-radius: 20px 20px 20px 4px; }
.facts { display: flex; flex-wrap: wrap; gap: 10px; }
.fact { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; font-weight: 700; font-size: 14px; }
.fact b { color: var(--teal); font-family: var(--display); font-size: 19px; margin-right: 4px; }

/* bands */
section.band { padding-block: 56px; }
.band-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px 24px; margin-bottom: 26px; }
.band-head .t { display: grid; gap: 8px; }

/* episodes */
.eps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 960px) { .eps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ep { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; display: grid; grid-template-rows: auto 1fr; box-shadow: var(--shadow); }
.ep .player { position: relative; aspect-ratio: 9 / 16; background: #0b1020; }
.ep .player img, .ep .player video { width: 100%; height: 100%; object-fit: cover; }
.ep .play { position: absolute; inset: 0; display: grid; place-items: center; border: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.45)); cursor: pointer; padding: 0; }
.ep .play span { width: 66px; height: 66px; border-radius: 50%; background: rgba(255,255,255,.94); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.ep .play svg { width: 26px; height: 26px; margin-left: 4px; fill: #1d2742; }
.ep .badge { position: absolute; left: 10px; top: 10px; background: var(--honey); color: var(--honey-ink); font-weight: 800; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; }
.ep .badge.special { background: var(--berry); color: #fff; }
.ep .body { padding: 14px 14px 16px; display: grid; gap: 8px; align-content: start; }
.ep .body h3 { font-size: 19px; }
.ep .body a.yt { font-weight: 800; font-size: 14px; color: var(--yt); text-decoration: none; }

/* youtube strip */
.strip { background: var(--yt); color: #fff; border-radius: 28px; padding: 26px 26px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px 22px; align-items: center; }
.strip img { width: 92px; height: 92px; object-fit: contain; background: rgba(255,255,255,.16); border-radius: 22px; padding: 6px; }
.strip h3 { font-size: 26px; }
.strip p { opacity: .92; }
.strip .go { background: #fff; color: var(--yt); text-decoration: none; font-weight: 800; border-radius: 999px; padding: 12px 20px; white-space: nowrap; }
@media (max-width: 700px) { .strip { grid-template-columns: minmax(0, 1fr); text-align: center; } .strip img { margin: 0 auto; } }

/* questions */
.qs { display: grid; gap: 22px; }
.qcard { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: 26px; padding: 20px; }
@media (max-width: 640px) { .qcard { grid-template-columns: minmax(0, 1fr); } .qcard .mini { max-width: 200px; } }
.qcard .mini { position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 9/16; background: #0b1020; }
.qcard .mini img, .qcard .mini video { width: 100%; height: 100%; object-fit: cover; }
.qcard .txt { display: grid; gap: 12px; min-width: 0; align-content: start; }
.qcard .ask { font-family: var(--display); font-weight: 800; font-size: clamp(24px, 3vw, 30px); }
.qcard .ask::before { content: "?"; display: inline-grid; place-items: center; width: 34px; height: 34px; margin-right: 10px; border-radius: 50%; background: var(--berry); color: #fff; font-size: 22px; vertical-align: 4px; }
.answer { display: grid; gap: 6px; padding: 0; margin: 0; list-style: none; }
.answer li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 6px; }
.answer li::before { content: "✓"; color: var(--teal); font-weight: 800; }
.tryit { background: var(--tint-honey); border-radius: 16px; padding: 12px 14px; }
.tryit b { font-family: var(--display); font-size: 18px; color: var(--ink); margin-right: 6px; }
.qcard .links { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; font-weight: 800; font-size: 14.5px; }
.qcard .links a { text-decoration: none; }
.qcard .links .yt { color: var(--yt); }

/* characters */
.chars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 860px) { .chars { grid-template-columns: minmax(0, 1fr); } }
.char { border-radius: 28px; padding: 22px; display: grid; gap: 12px; align-content: start; border: 1px solid var(--line); }
.char.h { background: var(--tint-honey); } .char.m { background: var(--tint-berry); } .char.q { background: var(--tint-teal); }
.char img { height: 210px; width: auto; margin: 0 auto; object-fit: contain; }
.char .name { font-family: var(--display); font-weight: 800; font-size: 32px; }
.char.h .name { color: var(--honey); } .char.m .name { color: var(--berry); } .char.q .name { color: var(--teal); }
.char .role { font-weight: 800; }
.char .says { font-style: italic; color: var(--muted); }

/* colouring */
.color-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 860px) { .color-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sheet { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 12px; display: grid; gap: 10px; }
.sheet img { border-radius: 10px; background: #fff; border: 1px solid var(--line); aspect-ratio: 1240/1754; object-fit: cover; }
.sheet .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sheet b { font-family: var(--display); font-size: 18px; }
.sheet button, .sheet a.dl { font: inherit; font-weight: 800; font-size: 14px; border: 0; cursor: pointer; background: var(--teal); color: #fff; border-radius: 999px; padding: 7px 14px; text-decoration: none; }
.note { color: var(--muted); font-size: 14px; }

/* grown-ups */
.grown { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
@media (max-width: 860px) { .grown { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 26px; padding: 24px; display: grid; gap: 14px; align-content: start; }
.steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; align-items: start; }
.steps li::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: var(--sky); color: #fff; font-family: var(--display); font-weight: 800; font-size: 19px; }
.steps b { display: block; }
details.qq { border-top: 1px solid var(--line); padding-block: 10px; }
details.qq summary { cursor: pointer; font-weight: 800; }
details.qq ol { margin: 8px 0 0; padding-left: 22px; color: var(--muted); }

footer { padding-block: 40px 56px; border-top: 1px solid var(--line); margin-top: 20px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; }
footer small { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ===================================================== WordPress additions */
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }
.custom-logo { width: 44px; height: 44px; object-fit: contain; }
.ep .player .play, .qcard .mini .play { text-decoration: none; }
.ep .player iframe, .qcard .mini iframe, .single-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.qcard .mini { position: relative; }
.ep .body h3 a { text-decoration: none; }
.ep .body h3 a:hover { color: var(--sky); }
.page-head { padding-block: 44px 10px; display: grid; gap: 10px; }
.page-head h1 { font-size: clamp(36px, 5.6vw, 58px); font-weight: 800; }
.single-wrap { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 34px; padding-block: 34px 50px; align-items: start; }
@media (max-width: 860px) { .single-wrap { grid-template-columns: minmax(0, 1fr); } }
.single-player { position: relative; aspect-ratio: 9 / 16; border-radius: 28px; overflow: hidden; background: #0b1020; box-shadow: var(--shadow); max-width: 360px; width: 100%; margin: 0 auto; }
.single-player img { width: 100%; height: 100%; object-fit: cover; }
.single-player .play { position: absolute; inset: 0; display: grid; place-items: center; border: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.45)); cursor: pointer; }
.single-player .play span { width: 84px; height: 84px; border-radius: 50%; background: rgba(255,255,255,.94); display: grid; place-items: center; }
.single-player .play svg { width: 32px; height: 32px; margin-left: 5px; fill: #1d2742; }
.single-body { display: grid; gap: 18px; min-width: 0; }
.single-body .content { max-width: 65ch; }
.single-body .content p + p { margin-top: 1em; }
.pager { display: flex; justify-content: center; gap: 8px; padding-block: 20px 40px; }
.pager a, .pager span { padding: 8px 14px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); text-decoration: none; font-weight: 800; }
.pager .current { background: var(--honey); color: var(--honey-ink); border-color: var(--honey); }
.sheet a.dl { display: inline-block; }
.prose { max-width: 70ch; padding-block: 30px 60px; display: grid; gap: 1em; }

/* ===================================================== animations */
@keyframes hq-float { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-12px) rotate(-1.5deg); } }
@keyframes hq-float-alt { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-9px) rotate(2deg); } }
@keyframes hq-pop { 0% { transform: scale(.4) rotate(-8deg); opacity: 0; } 70% { transform: scale(1.08) rotate(2deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@keyframes hq-rise { 0% { transform: translateY(0) scale(.6); opacity: 0; } 12% { opacity: .9; } 100% { transform: translateY(-460px) scale(1.15); opacity: 0; } }
@keyframes hq-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--yt) 55%, transparent); } 100% { box-shadow: 0 0 0 16px transparent; } }
@keyframes hq-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
@keyframes hq-bounce-in { 0% { transform: translateY(30px); opacity: 0; } 60% { transform: translateY(-6px); opacity: 1; } 100% { transform: translateY(0); } }
@keyframes hq-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }

.stage { isolation: isolate; }
.stage .crew { position: relative; z-index: 1; }
.stage .crew img { animation: hq-float 4.5s ease-in-out infinite; transform-origin: 50% 100%; }
.stage .bubble { animation: hq-pop .7s cubic-bezier(.2,1.4,.4,1) .3s both; z-index: 2; }
.stage .rise { position: absolute; bottom: -30px; width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(255,255,255,.85);
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.9) 0 18%, rgba(160,220,255,.35) 19% 100%); animation: hq-rise 7s linear infinite; z-index: 0; }
.stage .rise:nth-of-type(1) { left: 8%; animation-delay: 0s; }
.stage .rise:nth-of-type(2) { left: 26%; width: 18px; height: 18px; animation-delay: 1.6s; animation-duration: 8s; }
.stage .rise:nth-of-type(3) { left: 58%; width: 34px; height: 34px; animation-delay: 3.1s; }
.stage .rise:nth-of-type(4) { left: 78%; width: 20px; height: 20px; animation-delay: 4.4s; animation-duration: 6.5s; }
.stage .rise:nth-of-type(5) { left: 90%; animation-delay: 2.2s; animation-duration: 9s; }
.hero h1 .w { display: inline-block; animation: hq-bounce-in .7s cubic-bezier(.2,1.3,.4,1) both; }
.float { animation: hq-float 5s ease-in-out infinite; }
.char img { animation: hq-float-alt 5.5s ease-in-out infinite; }
.char.m img { animation-delay: -1.8s; } .char.q img { animation-delay: -3.2s; }
.char:hover img { animation: hq-wiggle .5s ease-in-out 2; }
.yt-btn { animation: hq-pulse 2.2s ease-out infinite; }
.ep, .sheet, .qcard, .char { transition: transform .25s cubic-bezier(.2,1.2,.4,1), box-shadow .25s; }
.ep:hover, .sheet:hover { transform: translateY(-6px) rotate(-.6deg); box-shadow: 0 22px 40px rgba(29, 39, 66, .16); }
.qcard:hover { transform: translateY(-3px); }
.ep .play span, .single-player .play span { transition: transform .2s; }
.ep .play:hover span, .qcard .play:hover span, .single-player .play:hover span { transform: scale(1.12); }
.logo img { transition: transform .4s; } .logo:hover img { transform: rotate(-12deg) scale(1.08); }
.strip .go { transition: transform .2s; } .strip .go:hover { transform: scale(1.07) rotate(-2deg); }
.qcard .ask::before { animation: hq-wiggle 2.6s ease-in-out infinite; display: inline-grid; }

/* scroll reveal: only hides content when JS is running, so the page is complete without it */
.js .reveal { opacity: 0; transform: translateY(26px) scale(.98); transition: opacity .6s ease, transform .6s cubic-bezier(.2,1.1,.4,1); }
.js .reveal.in { opacity: 1; transform: none; }
.js .eps .ep.reveal:nth-child(2), .js .chars .char.reveal:nth-child(2), .js .color-grid .sheet.reveal:nth-child(2) { transition-delay: .08s; }
.js .eps .ep.reveal:nth-child(3), .js .chars .char.reveal:nth-child(3), .js .color-grid .sheet.reveal:nth-child(3) { transition-delay: .16s; }
.js .eps .ep.reveal:nth-child(4), .js .color-grid .sheet.reveal:nth-child(4) { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
.strip.tone-berry { background: var(--berry); } .strip.tone-berry .go { color: var(--berry); }
.strip.tone-teal { background: var(--teal); } .strip.tone-teal .go { color: var(--teal); }
.qs .strip { margin-block: 4px; }
.stage img, .char img, .strip img { height: auto; }
.player.is-ph, .mini.is-ph { background: linear-gradient(180deg, var(--tint-teal), var(--tint-honey)); }
.player.is-ph img, .mini.is-ph img { object-fit: contain; padding: 30% 8% 18%; }
.player.is-ph .play, .mini.is-ph .play { background: transparent; }

/* episode colouring page */
.ep-color { grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 20px; background: var(--tint-honey); }
.ep-color-img img { width: 150px; height: auto; aspect-ratio: 2480 / 3508; object-fit: cover; background: #fff; border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 8px 18px rgba(29, 39, 66, .12); transform: rotate(-3deg); transition: transform .25s; }
.ep-color-img:hover img { transform: rotate(0deg) scale(1.04); }
.ep-color-txt { display: grid; gap: 8px; min-width: 0; }
.dl-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--teal); color: #fff; text-decoration: none; font-weight: 800; border-radius: 999px; padding: 10px 18px; }
@media (max-width: 520px) { .ep-color { grid-template-columns: minmax(0, 1fr); } .ep-color-img img { margin: 0 auto; } }
