/* =========================================================
   PigWings Cartoons — design tokens
   Palette:
     --sky      #EAF6FB  (page background — big open cartoon sky)
     --ink      #1F2A44  (headings, body text)
     --coral    #FF6B6B  (primary buttons / links)
     --gold     #FFD166  (section bands, highlights)
     --leaf     #06A77D  (fan-art section accent)
     --paper    #FFFFFF  (cards / video frames)
   Type:
     Headings — 'Baloo 2' (rounded, playful, holds up big)
     Body     — 'Nunito' (friendly, easy to read at small sizes)
   ========================================================= */

:root {
  --sky: #EAF6FB;
  --ink: #1F2A44;
  --coral: #FF6B6B;
  --coral-dark: #E85454;
  --gold: #FFD166;
  --leaf: #06A77D;
  --paper: #FFFFFF;
  --wing-shadow: rgba(31, 42, 68, 0.18);
  --max-w: 760px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--sky);
  color: var(--ink);
  font-family: 'Nunito', sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: 'Baloo 2', cursive;
  line-height: 1.15;
  margin: 0 0 0.4em;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; }

p { margin: 0 0 1em; }

a { color: var(--coral-dark); }

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

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

/* ---------- Top welcome bar ---------- */
.welcome-bar {
  background: var(--ink);
  color: #fff;
  text-align: center;
  padding: 10px 16px;
  font-family: 'Baloo 2', cursive;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.welcome-bar button.link-btn {
  background: none;
  border: none;
  color: var(--gold);
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  margin-left: 10px;
}

/* ---------- Logo banner ---------- */
.logo-banner {
  text-align: center;
  padding: 28px 20px 10px;
}

.logo-banner img {
  max-width: 320px;
  margin: 0 auto 14px;
}

.logo-banner img.top-banner-img {
  max-width: 900px;
  width: 100%;
  height: auto;
  margin: 0 auto 14px;
  display: block;
}

.mission {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  font-size: 1.05rem;
}

.thank-you-block {
  max-width: 560px;
  margin: 18px auto 0;
  text-align: center;
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--coral-dark);
  line-height: 1.5;
}

/* ---------- About page ---------- */
.about-copy {
  max-width: 620px;
  margin: 0 auto;
}

.about-copy p { margin-bottom: 1.1em; }

.btn-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
}

/* ---------- Distinct "back to main page" button ---------- */
.back-row--main {
  text-align: center;
  margin-top: 30px;
}

.btn--back {
  display: inline-block;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
  color: var(--ink);
  background: transparent;
  border: 2px dashed var(--ink);
  border-radius: 999px;
  padding: 10px 24px;
  text-decoration: none;
}

.btn--back:hover { background: rgba(31, 42, 68, 0.06); }

/* ---------- Wavy section divider ---------- */
.wave-divider {
  display: block;
  width: 100%;
  height: 46px;
  margin: 0;
}

/* ---------- Sections ---------- */
.section {
  padding: 40px 0 48px;
}

.section--gold { background: var(--gold); }
.section--paper { background: var(--paper); }
.section--sky { background: var(--sky); }
.section--ink { background: var(--ink); color: #fff; }
.section--ink h2 { color: #fff; }

.section-header {
  text-align: center;
  margin-bottom: 18px;
}

.section-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.character-frame {
  width: 220px;
  height: 220px;
  border-radius: 50% 50% 48% 52% / 55% 48% 52% 45%;
  overflow: hidden;
  border: 5px solid var(--paper);
  box-shadow: 0 8px 0 var(--wing-shadow);
  background: var(--paper);
}

.character-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Video embed frame ---------- */
.video-frame {
  position: relative;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 0 var(--wing-shadow);
  background: #000;
  margin: 0 auto;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: 'Baloo 2', cursive;
  font-size: 1.05rem;
  color: #fff;
  background: var(--coral);
  border: none;
  border-radius: 999px;
  padding: 12px 30px;
  box-shadow: 0 5px 0 var(--coral-dark);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease;
}

.btn:hover { filter: brightness(1.03); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--coral-dark); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: none;
  padding: 9px 27px;
}

.btn--ghost:active { transform: none; box-shadow: none; }

.btn-row { text-align: center; margin-top: 22px; }

/* ---------- Toggle switch (gallery / list) ---------- */
.mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 6px 0 30px;
  font-family: 'Baloo 2', cursive;
}

.switch {
  position: relative;
  width: 54px;
  height: 30px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.switch .track {
  position: absolute;
  inset: 0;
  background: var(--ink);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.switch .track::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
}

.switch input:checked + .track { background: var(--coral); }
.switch input:checked + .track::before { transform: translateX(24px); }

/* ---------- Gallery grid ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

@media (min-width: 520px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

.gallery-item {
  background: var(--paper);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 5px 0 var(--wing-shadow);
  cursor: pointer;
  border: none;
  padding: 0;
  text-align: left;
  font-family: inherit;
}

.gallery-item .thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #ccc;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item .thumb-title {
  padding: 10px 12px 14px;
  font-family: 'Baloo 2', cursive;
  font-size: 0.95rem;
  color: var(--ink);
}

/* ---------- List (detail) mode ---------- */
.list-view { display: flex; flex-direction: column; gap: 34px; }

.list-entry h3 { margin-bottom: 8px; }

.list-entry .video-frame { margin-bottom: 12px; }

/* ---------- Single video page ---------- */
.single-video-page {
  padding: 30px 0 50px;
}

.back-row { text-align: center; margin-top: 26px; }

.back-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Baloo 2', cursive;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
  font-size: 1rem;
}

/* ---------- Fan art ---------- */
.fanart-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.fanart-preview-grid img,
.fanart-thumb {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 12px;
  border: 4px solid var(--paper);
  box-shadow: 0 4px 0 var(--wing-shadow);
}

.fanart-grid-page {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (min-width: 520px) {
  .fanart-grid-page { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Forms ---------- */
form.card-form {
  background: var(--paper);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 6px 0 var(--wing-shadow);
  max-width: 480px;
  margin: 0 auto;
}

form.card-form label {
  display: block;
  font-family: 'Baloo 2', cursive;
  margin-bottom: 6px;
  margin-top: 14px;
}

form.card-form label:first-of-type { margin-top: 0; }

form.card-form input[type="text"],
form.card-form input[type="email"],
form.card-form input[type="file"],
form.card-form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid #d9e4ea;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
}

form.card-form textarea { resize: vertical; min-height: 100px; }

form.card-form .btn { margin-top: 18px; width: 100%; }

.form-note {
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.85;
  margin-top: 10px;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 40px 20px 50px;
  background: var(--ink);
  color: #fff;
}

.site-footer img { max-width: 160px; margin: 0 auto 16px; }

.site-footer .thank-god {
  font-family: 'Baloo 2', cursive;
  font-size: 1.15rem;
  color: var(--gold);
  margin-top: 6px;
}

/* ---------- Save-video star (profile feature, no login) ---------- */
.save-star {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}

.thumb-wrap { position: relative; }

/* ---------- Simple internal nav ---------- */
.top-nav {
  text-align: center;
  padding: 16px 20px 0;
}

.top-nav a {
  font-family: 'Baloo 2', cursive;
  text-decoration: none;
  color: var(--ink);
  margin: 0 10px;
  font-size: 0.95rem;
}

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


/* ---------- Playlist controls (single video page) ---------- */
.playlist-controls { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.playlist-controls .btn { margin: 0; }
.playlist-controls .btn:disabled { cursor: default; }
.autoplay-label { font-weight: 700; cursor: pointer; }
.autoplay-label input { margin-right: 6px; transform: scale(1.2); }

.yt-link { text-align: center; margin-top: 10px; font-size: 0.95rem; }
.yt-link a { font-weight: 700; }

.btn--big { font-size: 1.5rem; padding: 18px 38px; }

.btn--sub { background: #E62117; box-shadow: 0 5px 0 #9E150E; margin: 6px; }
.btn--sub:active { box-shadow: 0 1px 0 #9E150E; }

/* Wide picture frame (frame fits the picture instead of a small blob) */
.character-frame--wide {
  width: 100%;
  max-width: 640px;
  height: auto;
  border-radius: 18px;
  line-height: 0;
}
.character-frame--wide img { width: 100%; height: auto; display: block; object-fit: contain; }
.series-subtitle { font-family: 'Baloo 2', cursive; font-size: 1.2rem; font-weight: 700; }
.series-desc p { margin: 0 0 12px; }

/* Footer sticker (replaces the old logo placeholder) */
.site-footer img.footer-sticker {
  max-width: 200px;
  filter: drop-shadow(0 0 3px rgba(255,255,255,0.9));
}
