/* ==========================================================================
   The Studio shared mobile layer (Dave's call, Oct 3 2026, P1)
   Linked LAST on every page: <link rel="stylesheet" href="/assets/mobile.css">
   Contains ONLY max-width media queries plus a few non-visual safety rules,
   so desktop rendering is never touched. Fills the gaps on pages that do
   NOT link /assets/nav.css or /assets/footer.css, and reinforces the ones
   that do. Never use !important here unless a page's inline style forces it.
   ========================================================================== */

/* ---- Non-visual safety, all widths -------------------------------------- */
img { max-width: 100%; }
a, button { -webkit-tap-highlight-color: transparent; }

/* ==========================================================================
   PHONES: 768px and below
   ========================================================================== */
@media (max-width: 768px) {

  /* No sideways scrolling, anywhere. `clip` keeps position:sticky working. */
  html, body { overflow-x: clip; max-width: 100%; }

  /* Images never blow out their container on small screens. */
  img { height: auto; }

  /* Long links/paths wrap instead of pushing the layout wide. */
  p, li, a { overflow-wrap: break-word; }

  /* ---- Site nav -------------------------------------------------------- */
  /* Only collapse the link row when a hamburger button is present.
     Pages without a hamburger keep a wrapping link row instead. */
  .nav:has(.nav-menu-btn) .nav-links { display: none; }
  .nav:not(:has(.nav-menu-btn)) .nav-links { flex-wrap: wrap; gap: 14px; row-gap: 10px; }
  .nav:not(:has(.nav-menu-btn)) .nav-inner { height: auto; min-height: 52px; padding-top: 8px; padding-bottom: 8px; }

  .nav-inner { padding-left: 16px; padding-right: 16px; gap: 12px; }
  .nav-brand { font-size: 17px; }

  /* Hamburger button: full styling for pages that never loaded nav.css.
     (Pages with nav.css already style this; these rules match it.) */
  .nav-menu-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    flex: 0 0 auto;
  }
  .nav-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: #1d1d1f;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }
  .nav-menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Mobile dropdown menu: works with or without nav.css loaded. */
  .mobile-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 12px;
    min-width: 240px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border: 1px solid #e8e8ed;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.14);
    padding: 10px;
    z-index: 200;
  }
  .mobile-menu.open { display: block; }
  .mobile-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    text-decoration: none;
  }
  .mobile-menu a:hover, .mobile-menu a:active { background: #f5f5f7; }
  .mobile-menu .menu-cta {
    justify-content: center;
    background: #b58520;
    color: #fff;
    border-radius: 999px;
    margin-top: 6px;
  }

  /* ---- Footer nav ------------------------------------------------------ */
  /* Matches /assets/footer.css behavior for pages that never linked it. */
  footer { padding-left: 20px; padding-right: 20px; }
  footer .col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px 32px;
  }
  footer .col a {
    display: block;
    min-height: 44px;
    padding: 10px 0;
    line-height: 1.4;
  }
  footer .col h4 { margin-bottom: 4px; }
  footer .foot-brand { font-size: 20px; margin-bottom: 24px; }

  /* ---- Tap targets ----------------------------------------------------- */
  nav a, footer a, .mobile-menu a { min-height: 44px; }

  /* ---- Forms: 16px+ inputs stop iOS auto-zoom on focus ------------------ */
  input, textarea, select { font-size: 16px; }

  /* ---- Header / hero images -------------------------------------------- */
  /* Cover-style hero bands and splash images fill the phone width. */
  .mischief-band img,
  .cover-hero img,
  [class*="hero"] > img:first-child {
    width: 100%;
    height: auto;
    display: block;
  }
  /* Fixed-height hero art crops gracefully instead of squashing. */
  .hero-art img, .hero img { object-fit: cover; }

  /* Cast / card rows: keep images proportioned, never tiny, never huge. */
  .cast-row { gap: 14px; }
  .cast-member img { width: 100%; height: auto; }

  /* ---- Video embeds never overflow ------------------------------------- */
  video { max-width: 100%; height: auto; }
  iframe[src*="youtube"], iframe[src*="youtu.be"],
  iframe[src*="soundcloud"], iframe[src*="w.soundcloud"] {
    max-width: 100%;
  }
}

/* ==========================================================================
   SMALL PHONES: 560px and below
   ========================================================================== */
@media (max-width: 560px) {
  footer .col-grid { grid-template-columns: 1fr; gap: 8px; }
  footer .col { border-bottom: 1px solid rgba(0, 0, 0, 0.06); padding-bottom: 8px; }
  .mobile-menu { right: 8px; left: 8px; min-width: 0; }
  /* Footer bottom row: un-jumble the hiring link + language flag (Dave's call).
     hiring-min is absolutely pinned bottom-right on desktop; on phones that
     lands on top of the copyright/flag line, so let it flow in place. */
  footer .hiring-min {
    position: static;
    display: inline-block;
    margin: 2px 0 26px;
    font-size: 13px;
    line-height: 44px;
    white-space: nowrap;
  }
}

/* ==========================================================================
   Reduced motion: keep the menu snap instead of animating
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .nav-menu-btn span { transition: none; }
}
