/* Sovrin TV — shared site styles (page designs live inline in each page) */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; } }
[id] { scroll-margin-top: 16px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #f6e43c; outline-offset: 3px; }
.sv-films.open .sv-films-menu { display: block; }
.sv-video-stage { overflow: hidden; }
.sv-video-stage iframe, .sv-video-stage > div { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border: 0; }
.sv-form-status { margin: 4px 0 0; font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: #f4f2ec; }
.sv-form-thanks { padding: 32px; background: #3b3a36; border: 1px solid #6e6c64; color: #f4f2ec; font-family: Inter, sans-serif; }
.sv-form-thanks p { margin: 0; font-size: 17px; }
.sv-thanks-title { margin-bottom: 8px !important; font-size: 22px !important; font-weight: 600; }
input:focus, select:focus, textarea:focus { border-color: #cfcdc5 !important; }

/* ---------- Phone layout ---------- */
.sv-burger, .sv-ft-m, .sv-films-menu .sv-m-only { display: none; }
@media (max-width: 700px) {
  /* header: logo left, Donate + menu button right, one row */
  .sv-header { flex-wrap: nowrap !important; gap: 10px !important; padding: 10px 16px !important; }
  .sv-logo { flex-direction: column !important; align-items: flex-start !important; gap: 3px !important; min-width: 0; }
  .sv-logo > span:first-child { font-size: 16px !important; letter-spacing: 0.14em !important; }
  .sv-logo > span:last-child { font-size: 11px !important; letter-spacing: 0.02em !important; white-space: nowrap; }
  .sv-header nav { flex-wrap: nowrap !important; gap: 6px !important; flex: none; }
  .sv-header nav > a:not(.sv-donate) { display: none !important; }
  .sv-donate { min-height: 34px !important; padding: 0 12px !important; }
  .sv-films { position: static !important; }
  .sv-films > a { min-width: 44px; justify-content: center; }
  .sv-films-label, .sv-chev { display: none; }
  .sv-burger { display: block; }
  .sv-films-menu { left: 0 !important; right: 0 !important; top: 100% !important; min-width: 0 !important;
    max-height: calc(100vh - 64px); overflow-y: auto; border-left: 0 !important; border-right: 0 !important; padding: 6px 0 14px !important; }
  .sv-films-menu a { padding: 12px 20px !important; }
  .sv-films:not(.open) .sv-films-menu { display: none !important; }
  .sv-films-menu .sv-m-only { display: block; }
  .sv-films-menu .sv-menu-sep { height: 1px; margin: 8px 20px; background: #2e2d29; }

  /* footer: one short line */
  .sv-footer { justify-content: center !important; text-align: center; }
  .sv-footer > *:not(.sv-ft-m) { display: none !important; }
  .sv-footer > .sv-ft-m { display: inline; }

  /* two- and three-column layouts stack */
  [style*="grid-template-columns: minmax(0, 5fr) minmax(0, 7fr)"],
  [style*="grid-template-columns: minmax(0, 7fr) minmax(0, 5fr)"],
  [style*="grid-template-columns: minmax(0, 6fr) minmax(0, 5fr)"],
  [style*="grid-template-columns: minmax(0, 1fr) minmax(0, 1fr)"],
  [style*="grid-template-columns: 2fr 3fr"],
  [style*="grid-template-columns: repeat(3, minmax(0, 1fr))"] { grid-template-columns: minmax(0, 1fr) !important; }

  /* Director filmography: details move under the title */
  [style*="grid-template-columns: 56px minmax(0, 1fr) 280px 24px"] { grid-template-columns: 30px minmax(0, 1fr) 18px !important; gap: 6px 12px !important; padding: 22px 0 !important; }
  [style*="grid-template-columns: 56px minmax(0, 1fr) 280px 24px"] > span:nth-child(3) { grid-column: 2; grid-row: 2; }
  [style*="grid-template-columns: 56px minmax(0, 1fr) 280px 24px"] > span:nth-child(4) { grid-column: 3; grid-row: 1; }
}

/* ---------- Phone: page by page ---------- */
@media (max-width: 700px) {
  /* Beyond Breakthrough: shorter opening, title fits */
  .pg-beyond-breakthrough > div > section:first-of-type { min-height: 540px !important; padding-bottom: 40px !important; }
  .pg-beyond-breakthrough h1 { font-size: 14.4vw !important; }
  .pg-beyond-breakthrough > div > section:first-of-type { justify-content: center !important; }
  .pg-beyond-breakthrough > div > section:first-of-type p:first-child { font-size: 11px !important; letter-spacing: 0.1em !important; color: #ffffff !important; text-shadow: 0 1px 8px rgba(27, 29, 46, 0.8); }

  /* Manik da: text first, the artwork below it */
  /* Manik da: Ray's portrait as a faint watermark behind the text */
  .pg-manik-da > div > section:first-of-type > img { opacity: 0.2; object-position: 72% 100% !important; }
  .pg-manik-da > div > section:first-of-type > div { min-height: 0 !important; }
  .pg-manik-da > div > section:first-of-type > div > div[aria-hidden] { display: none; }
  /* streaming logos: two per row */
  [style*="minmax(min(100%, 220px), 1fr)); gap: 12px"], [style*="minmax(min(100%, 200px), 1fr)); gap: 12px"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }

  /* Mismatched */
  .pg-mismatched h1 { font-size: 16vw !important; }
  .pg-mismatched [style*="grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 6px"] { grid-template-columns: minmax(0, 1fr) !important; row-gap: 6px; }
  .pg-mismatched [style*="grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 6px"] > svg { display: none !important; }
  .pg-mismatched [style*="grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 6px"] > div { padding: 32px 24px !important; }
  .pg-mismatched [style*="grid-template-columns: repeat(6, minmax(0, 1fr))"] { grid-template-columns: minmax(0, 1fr) !important; }
  .pg-mismatched [style*="grid-template-columns: repeat(6, minmax(0, 1fr))"] > li { min-height: 0 !important; padding: 22px 24px !important; }
  .pg-mismatched .mm-tab { display: none !important; }
  .pg-mismatched [style*="grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 64px"] { grid-template-columns: minmax(0, 1fr) !important; }
  .pg-mismatched [style*="grid-template-columns: repeat(4, minmax(0, 1fr))"] { grid-template-columns: minmax(0, 1fr) !important; }

  /* Beyond Fight or Flight */
  .pg-beyond-fight-or-flight h1 { font-size: 12.6vw !important; }
  .pg-beyond-fight-or-flight [style*="grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px"] { grid-template-columns: minmax(0, 1fr) !important; }

  /* Body Electric */
  .pg-body-electric [style*="font-size: clamp(80px, 9vw, 136px)"] { font-size: 19vw !important; }

  /* Steeped In Tradition: photo on top, title under it */
  .pg-steeped-in-tradition > div > section:first-of-type { flex-direction: column; align-items: stretch !important; min-height: 0 !important; }
  .pg-steeped-in-tradition > div > section:first-of-type > img { position: relative !important; width: 100% !important; height: 440px !important; object-position: 40% 30% !important; }
  .pg-steeped-in-tradition > div > section:first-of-type > span { display: none; }
  .pg-steeped-in-tradition > div > section:first-of-type > div { margin-top: -140px !important; padding: 0 20px 56px !important; background: linear-gradient(to bottom, rgba(20, 28, 24, 0) 0, #141c18 140px); padding-top: 120px !important; }
  .pg-steeped-in-tradition h1 { font-size: 64px !important; }
  .pg-steeped-in-tradition [style*="grid-template-columns: repeat(4, 1fr)"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 20px 12px !important; }
  .pg-steeped-in-tradition [style*="grid-template-columns: repeat(4, 1fr)"] li > span:last-child { font-size: 22px !important; }
  .pg-steeped-in-tradition [style*="border-left: 1px solid #c9b993"] { padding-left: 20px !important; }
  .pg-steeped-in-tradition [style*="grid-template-columns: minmax(0, 1fr) minmax(0, 1fr)"] > img { max-height: 460px; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18%, #000 85%, transparent 100%) !important; mask-image: linear-gradient(to bottom, transparent 0, #000 18%, #000 85%, transparent 100%) !important; }
  .pg-steeped-in-tradition [style*="grid-template-columns: minmax(0, 1fr) minmax(0, 1fr)"] > div { padding: 24px 20px 24px !important; }
}

@media (max-width: 700px) {
  /* video frames: small play button in the corner, so it doesn't cover the title */
  a[data-youtube] > span[style*="left: 50"][style*="border-radius: 50%"],
  a[data-wistia] > span[style*="left: 50"][style*="border-radius: 50%"] {
    width: 54px !important; height: 54px !important; left: auto !important; top: auto !important; right: 12px !important; bottom: 12px !important; transform: none !important; }
  a[data-youtube] > span[style*="border-radius: 50%"] svg, a[data-wistia] > span[style*="border-radius: 50%"] svg { width: 18px !important; height: 18px !important; }
  /* Beyond Fight or Flight trailer card */
  .pg-beyond-fight-or-flight a[data-youtube] > span > span:first-child { font-size: 26px !important; }
  .pg-beyond-fight-or-flight a[data-youtube] > span > span:nth-child(2) { font-size: 11px !important; }
  .pg-beyond-fight-or-flight a[data-youtube] > span > span:nth-child(3) { margin-top: 0 !important; font-size: 11px !important; gap: 10px !important; }
  .pg-beyond-fight-or-flight a[data-youtube] > span > span:nth-child(3) > span { width: 44px !important; height: 44px !important; }
  .pg-beyond-fight-or-flight a[data-youtube] > span > span:nth-child(3) svg { width: 14px !important; height: 16px !important; }
  .pg-beyond-fight-or-flight a[data-youtube] > span { gap: 8px !important; }
  .pg-body-electric a[data-youtube] > span[style*="bottom: 18px"] { display: none; }
}

/* ---------- Phone: round 2 ---------- */
@media (max-width: 700px) {
  /* Beyond Breakthrough */
  .pg-beyond-breakthrough h1 + p { font-weight: 500 !important; color: #ffffff !important; text-shadow: 0 1px 3px rgba(20, 22, 40, 0.9), 0 0 18px rgba(20, 22, 40, 0.85); }
  .pg-beyond-breakthrough img[src*="bb-poster"] { display: none; }

  /* Statin Nation pages */
  .pg-statin-nation [style*="color: #ff6b7f"][style*="margin: 0 0 40px"] { display: none; }
  .pg-statin-nation ol > li[style*="padding: 36px"] { padding: 28px 0 32px !important; }
  .pg-statin-nation h2[style*="clamp(44px, 5.6vw, 76px)"], .pg-statin-nation-2 h2[style*="clamp(44px, 5.6vw, 76px)"] { font-size: 34px !important; }
  .pg-statin-nation > div > section:first-of-type p:first-child, .pg-statin-nation-2 > div > section:first-of-type p:first-child { font-size: 13px !important; letter-spacing: 0.12em !important; }

  /* Body Electric */
  .pg-body-electric .sv-desk-only { display: none; }
  .pg-body-electric [style*="text-align: center"][style*="radial-gradient(ellipse 70% 80%"] { text-align: left !important; }
  .pg-body-electric [style*="text-align: center"][style*="radial-gradient(ellipse 70% 80%"] > div { align-items: flex-start !important; }
  .pg-body-electric #watch h2 { font-size: 30px !important; }
  .pg-body-electric p[style*="clamp(44px, 5.4vw, 80px)"] { font-size: 32px !important; line-height: 1.08 !important; }
  .pg-body-electric > div { display: flex; flex-direction: column; }
  .pg-body-electric > div > * { order: 3; }
  .pg-body-electric > div > header, .pg-body-electric > div > section:first-of-type, .pg-body-electric #film { order: 1; }
  .pg-body-electric #watch { order: 2; padding-top: 8px !important; }

  /* Beyond Fight or Flight: artwork on top, then the text */
  .pg-beyond-fight-or-flight > div > section:first-of-type { display: flex; flex-direction: column; }
  .pg-beyond-fight-or-flight > div > section:first-of-type > img { position: relative !important; inset: auto !important; top: auto !important; right: auto !important;
    width: 100% !important; height: 430px !important; min-height: 0 !important; object-fit: cover; object-position: 50% 0; margin-bottom: -36px;
    -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%); mask-image: linear-gradient(to bottom, #000 72%, transparent 100%); }
  .pg-beyond-fight-or-flight > div > section:first-of-type > span { display: none; }
  .pg-beyond-fight-or-flight > div > section:first-of-type > div { padding-top: 0 !important; padding-bottom: 56px !important; gap: 24px !important; }
  .pg-beyond-fight-or-flight > div > section:first-of-type > div > div:nth-child(1) { order: 1; }
  .pg-beyond-fight-or-flight > div > section:first-of-type > div > div:nth-child(3) { order: 2; }
  .pg-beyond-fight-or-flight > div > section:first-of-type > div > div:last-child { order: 3; }
  .pg-beyond-fight-or-flight > div > section:first-of-type ul { order: 4; gap: 10px 14px !important; }
  .pg-beyond-fight-or-flight > div > section:first-of-type ul img { height: 62px !important; }
  .pg-beyond-fight-or-flight > div > section:first-of-type ul[aria-label="More festival selections"] { margin-top: -10px !important; }
  .pg-beyond-fight-or-flight h1 + p { font-size: 17px !important; letter-spacing: 0.02em !important; }
}

@media (max-width: 700px) {
  /* Mismatched: keep short lines on one line */
  .pg-mismatched h1 + p { font-size: 14px !important; letter-spacing: 0.22em !important; margin-right: 0 !important; padding-left: 2px !important; }
  .pg-mismatched h1 + p + p { font-size: 16px !important; }
  .pg-mismatched h1 + p + p br { display: none; }
  .pg-mismatched h1 + p + p > span::after { content: " "; }
  .pg-mismatched h2[style*="clamp(36px, 4.6vw, 64px)"] { font-size: 30px !important; }
  .pg-mismatched h2[style*="clamp(44px, 5vw, 72px)"] { font-size: 31px !important; }
  .pg-mismatched h2[style*="letter-spacing: 0.32em"] { font-size: 34px !important; letter-spacing: 0.14em !important; }
  .pg-mismatched p[style*="color: #f6e43c"][style*="letter-spacing: 0.14em"] { font-size: 11px !important; letter-spacing: 0.08em !important; }
  .pg-mismatched h2[style*="clamp(32px, 3.8vw, 52px)"] { font-size: 26px !important; }
  .pg-mismatched a[style*="font-size: 20px"][href*="stress.org"] { font-size: 16px !important; padding: 16px 20px !important; min-height: 52px !important; }
  .pg-mismatched span[style*="color: #8a877f"] { font-size: 11px !important; letter-spacing: 0.02em !important; }
}

@media (max-width: 700px) {
  /* Mismatched: face on top, centred title underneath */
  .pg-mismatched > div > section:first-of-type { min-height: 0 !important; display: flex; flex-direction: column; }
  .pg-mismatched > div > section:first-of-type > img { position: relative !important; right: auto !important; width: 100% !important; height: 440px !important;
    object-fit: cover; object-position: 0 18%; margin-bottom: -110px;
    -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 100%); mask-image: linear-gradient(to bottom, #000 62%, transparent 100%); }
  .pg-mismatched > div > section:first-of-type > div { min-height: 0 !important; padding-top: 0 !important; padding-bottom: 56px !important; align-items: center; text-align: center; }
  .pg-mismatched h1, .pg-mismatched h1 + p { align-self: center !important; }
  .pg-mismatched h1 + p { margin-top: -18px !important; padding-left: 0.22em !important; }
  .pg-mismatched > div > section:first-of-type > div > div { justify-content: center; }
}
