/*
Theme Name: Daybe Studios
Theme URI: https://daybestudios.com
Author: Daybe Studios
Description: Lightweight block theme for Daybe Studios and the Marionettes animation series.
Version: 1.3.2
Requires at least: 6.4
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: daybe-studios
*/

:root { --ds-blue:#2B388F; --ds-yellow:#FBD000; --ds-red:#D10412; --ds-navy:#25243C; --ds-header:84px; }
body { background: var(--ds-blue); }
img { max-width: 100%; height: auto; }

/* Header */
.ds-header { position: sticky; top: 0; z-index: 50; min-height: var(--ds-header); padding: 0 clamp(16px,4vw,56px); background: var(--ds-blue); gap: 24px; }
.ds-logo img { display: block; height: 44px; width: auto; }
.ds-nav { font-family: var(--wp--preset--font-family--sub); font-size: 21px; }
.ds-nav a { text-decoration: none; padding: 10px 0; }
.ds-nav .current-menu-item a, .ds-nav a[aria-current="page"] { color: var(--ds-yellow); border-bottom: 3px solid var(--ds-yellow); }
.ds-header .ds-social { margin-left: 8px; }
@media (max-width: 781px) { .ds-header .ds-social { display: none; } .ds-logo img { height: 34px; } }

/* Red angled section tag */
.ds-tag { display: inline-block; margin: 0 0 24px calc(-1 * clamp(16px,4vw,56px)); padding: 12px 56px 12px clamp(16px,4vw,56px); background: var(--ds-red); color: #fff; font-family: var(--wp--preset--font-family--display); font-size: 26px; letter-spacing: 1px; clip-path: polygon(0 0,100% 0,88% 100%,0 100%); }

/* Buttons */
.wp-block-button__link { font-family: var(--wp--preset--font-family--display); letter-spacing: 1px; border-radius: 999px; padding: 16px 28px; }
.is-style-outline .wp-block-button__link { border: 2px solid currentColor; background: transparent; }
.ds-on-yellow .wp-block-button__link { background: var(--ds-blue); color: #fff; }

/* Home: trailer */
.ds-trailer { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100svh - var(--ds-header)); background: #000; overflow: hidden; }
.ds-trailer iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.ds-trailer-ui { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 10px; z-index: 2; }
.ds-trailer-ui button, .ds-trailer-end button { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 2px solid #fff; background: rgba(37,36,60,.7); color: #fff; font: 17px var(--wp--preset--font-family--sub); cursor: pointer; }
.ds-trailer-end { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; text-align: center; background: rgba(37,36,60,.88); }
.ds-trailer-end[hidden], .ds-trailer-ui [hidden] { display: none; }
.ds-trailer-end p { margin: 0; font: clamp(26px,4vw,48px)/1.05 var(--wp--preset--font-family--display); color: #fff; }
.ds-trailer-end .ds-yt { display: inline-flex; align-items: center; min-height: 56px; padding: 0 30px; border-radius: 999px; background: var(--ds-yellow); color: var(--ds-blue); text-decoration: none; font: 20px var(--wp--preset--font-family--display); letter-spacing: 1px; }
.ds-intro { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px 48px; padding: clamp(32px,5vw,64px) clamp(16px,4vw,56px); }
.ds-intro .ds-mlogo img { width: min(460px, 100%); display: block; }
.ds-intro p { margin: 8px 0 0; }

/* Home: link cards (vertical on desktop, sideways on mobile) */
.ds-links { display: flex; flex-direction: column; gap: 40px; padding: 0 clamp(16px,4vw,56px) clamp(48px,7vw,96px); margin: 0; list-style: none; }
.ds-link-card { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); align-items: center; border-radius: 28px; overflow: hidden; color: var(--ds-navy); margin: 0 !important; }
.ds-link-card:nth-child(even) .ds-link-art { order: 2; }
.ds-link-art img { width: 100%; height: 100%; max-height: 420px; object-fit: contain; display: block; }
.ds-link-text { padding: clamp(24px,4vw,56px); }
.ds-link-text h2 { color: var(--ds-navy); font-size: clamp(30px,3.5vw,46px); margin: 0 0 12px; }
.ds-link-text p { color: var(--ds-navy); margin: 0 0 22px; font-size: 19px; }
.ds-link-text a { display: inline-flex; align-items: center; min-height: 52px; padding: 0 26px; border-radius: 999px; background: var(--ds-navy); color: #fff; text-decoration: none; font: 19px var(--wp--preset--font-family--display); letter-spacing: 1px; }
.ds-link-text a:hover { background: var(--ds-blue); color: #fff; }

/* Series: panels (top to bottom on desktop, right to left on mobile) */
.ds-panel { box-sizing: border-box; padding: clamp(48px,7vw,96px) clamp(16px,4vw,56px); position: relative; display: flex; align-items: center; gap: clamp(24px,4vw,64px); margin: 0 !important; }
.ds-panel > * { margin: 0; }
.ds-col { flex-direction: column; align-items: flex-start; }
.ds-hero-art { flex: 0 1 42%; }
.ds-hero-art img { max-height: 78vh; width: auto; display: block; }
.ds-hero-copy { flex: 1 1 50%; }
.ds-hero-copy .ds-mlogo img { width: min(560px,100%); }
.ds-kicker { font-size: 18px; font-weight: 600; letter-spacing: 6px; }
.ds-blob { background: var(--ds-yellow); color: var(--ds-blue); border-radius: 0 60% 55% 0 / 0 70% 60% 0; padding: clamp(28px,5vw,64px); padding-right: clamp(48px,9vw,140px); margin-left: calc(-1 * clamp(16px,4vw,56px)) !important; flex: 1 1 62%; }
.ds-blob h2, .ds-blob p { color: var(--ds-blue); }
.ds-side { flex: 0 1 32%; text-align: center; }
.ds-side img { width: min(280px,70vw); transform: rotate(3deg); }
.ds-rail { display: none; }
@media (max-width: 781px) {
  .ds-panels { display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; height: calc(100svh - var(--ds-header) - 64px); scrollbar-width: none; }
  .ds-panels::-webkit-scrollbar { display: none; }
  .ds-panel { flex: 0 0 100%; scroll-snap-align: start; overflow-y: auto; flex-direction: column; justify-content: flex-start; padding-top: 16px; padding-bottom: 32px; }
  .ds-hero-art { align-self: center; }
  .ds-hero-art img { max-height: 38svh; }
  .ds-blob { border-radius: 0 40px 40px 0; }
  .ds-panel .ds-strip { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; gap: 20px; }
  .ds-panel .ds-strip > * { flex: none; }
  .ds-panel .ds-char img { width: 130px; height: 130px; }
  .ds-rail { position: relative; display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 16px; background: var(--ds-blue); }
  .ds-rail::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; background: var(--ds-yellow); }
  .ds-rail button { position: relative; width: 44px; height: 44px; border: 0; padding: 0; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; }
  .ds-rail button span { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--ds-yellow); background: var(--ds-blue); color: #fff; display: flex; align-items: center; justify-content: center; font: 13px var(--wp--preset--font-family--display); box-sizing: border-box; }
  .ds-rail button[aria-current="true"] span { background: var(--ds-yellow); color: var(--ds-blue); }
  .ds-rail .ds-swipe { position: relative; margin-left: auto; background: var(--ds-blue); padding: 0 6px; font: 16px var(--wp--preset--font-family--sub); color: #fff; }
  .ds-links { flex-direction: row; overflow-x: auto; scroll-snap-type: x mandatory; gap: 16px; padding-bottom: 40px; }
  .ds-link-card { flex: 0 0 84%; scroll-snap-align: center; grid-template-columns: 1fr; align-self: stretch; align-content: start; }
  .ds-link-card:nth-child(even) .ds-link-art { order: 0; }
  .ds-link-art img { max-height: 230px; }
  .ds-photo { transform: rotate(-2deg); }
}

/* Horizontal strips (characters, timeline) */
.ds-strip { display: flex; gap: 32px; overflow-x: auto; scroll-snap-type: x proximity; padding: 12px 4px 28px; margin: 0; list-style: none; }
.ds-strip > * { flex: 0 0 220px; scroll-snap-align: start; margin: 0 !important; }
.ds-char { text-align: center; }
.ds-char:nth-child(odd) { transform: rotate(-1.5deg); } .ds-char:nth-child(even) { transform: rotate(1.5deg); }
.ds-char img { width: 200px; height: 200px; object-fit: contain; }
.ds-char h3 { font-size: 24px; color: var(--ds-yellow); margin: 8px 0 6px; }
.ds-char p { font-size: 15px; line-height: 1.45; margin: 0; }
.ds-chars-home { flex: 1 1 100%; max-width: 100%; }
.ds-time { flex-basis: 300px !important; background: #fff; color: var(--ds-blue); padding: 14px 14px 18px; }
.ds-time:nth-child(odd) { transform: rotate(-1.5deg); } .ds-time:nth-child(even) { transform: rotate(1.5deg); }
.ds-time img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.ds-time .ds-date { font-family: var(--wp--preset--font-family--display); font-size: 20px; margin: 12px 0 4px; color: var(--ds-red); }
.ds-time p { margin: 0; font-size: 16px; line-height: 1.45; color: var(--ds-blue); }
.ds-time .ds-noimg { aspect-ratio: 4/3; background: var(--ds-yellow); display: flex; align-items: center; justify-content: center; font: 28px var(--wp--preset--font-family--display); color: var(--ds-blue); }

/* Sections */
.ds-section { padding: clamp(48px,7vw,96px) clamp(16px,4vw,56px); }
.ds-section.is-yellow { background: var(--ds-yellow); color: var(--ds-blue); }
.ds-section.is-yellow h2, .ds-section.is-yellow p { color: var(--ds-blue); }
.ds-credits { columns: 2 260px; column-gap: 48px; list-style: none; padding: 0; }
.ds-credits li { break-inside: avoid; margin: 0 0 14px; font-size: 17px; }
.ds-credits strong { display: block; font-family: var(--wp--preset--font-family--sub); font-weight: 400; font-size: 18px; color: var(--ds-yellow); }
.ds-people { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 32px; }
.ds-person { background: rgba(255,255,255,.08); border-radius: 24px; padding: 28px; }
.ds-avatar { width: 96px; height: 96px; border-radius: 50%; background: var(--ds-yellow); color: var(--ds-blue); display: flex; align-items: center; justify-content: center; font: 34px var(--wp--preset--font-family--display); }
.ds-episodes .wp-block-post-title a { text-decoration: none; }
.ds-episodes .wp-block-post-featured-image img { border-radius: 16px; }

/* Footer */
.ds-footer { padding: 40px clamp(16px,4vw,56px); border-top: 5px solid var(--ds-yellow); gap: 24px; }
.ds-footer img { height: 40px; width: auto; display: block; }
.ds-footer p { margin: 0; font-size: 15px; }

@media (prefers-reduced-motion: reduce) { .ds-panels { scroll-behavior: auto; } }

/* Studio teaser card and taped photo */
.ds-studio-card { flex: 1 1 45%; background: var(--ds-yellow); color: var(--ds-blue); padding: clamp(28px,4vw,56px); border-radius: 28px; }
.ds-studio-card h2, .ds-studio-card h3, .ds-studio-card p { color: var(--ds-blue); }
.ds-photo { background: #fff; padding: 14px 14px 18px; transform: rotate(-3deg); flex: 1 1 40%; max-width: 480px; margin: 0; }
.ds-photo img { display: block; width: 100%; }
.ds-photo figcaption { color: var(--ds-blue); font-family: var(--wp--preset--font-family--sub); font-size: 18px; margin: 10px 0 0; }
.ds-credits-wrap { flex: 1 1 55%; }
@media (max-width: 781px) { .ds-episodes .wp-block-post-template { grid-template-columns: 1fr !important; } }

/* Mobile header: menu button on the left, logo beside it */
@media (max-width: 599px) {
  .ds-header { justify-content: flex-start !important; gap: 12px; padding-left: 8px; }
  .ds-header > .wp-block-group { order: -1; }
  .ds-header .wp-block-navigation__responsive-container-open { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: #fff; }
  .ds-header .wp-block-navigation__responsive-container-open svg { width: 30px; height: 30px; }
}

/* Mobile menu: left drawer that slides in, links aligned left */
@media (max-width: 599px) {
  .ds-header .wp-block-navigation__responsive-container.is-menu-open {
    right: auto !important;
    width: min(78vw, 340px);
    padding: 24px 28px !important;
    background: var(--ds-blue) !important;
    box-shadow: 0 0 0 100vmax rgba(37, 36, 60, .55);
    border-right: 4px solid var(--ds-yellow);
    animation: ds-drawer-in .28s ease-out both !important;
  }
  .ds-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-close { max-width: none; }
  .ds-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
  .ds-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
    align-items: flex-start !important;
    justify-content: flex-start !important;
    text-align: left;
  }
  .ds-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { gap: 22px !important; padding-top: 56px; }
  .ds-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { font-size: 30px; }
  .ds-header .wp-block-navigation__responsive-container-close { left: auto; right: 0; top: 0; width: 44px; height: 44px; color: #fff; }
}
@keyframes ds-drawer-in { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .ds-header .wp-block-navigation__responsive-container.is-menu-open { animation: none !important; } }
