/*
  Preserved Studio vertical-split mobile layout.

  This snapshots the left/right phone composition from commit
  56e846eb3d0e1e8ac0e714741ebf7ce8800a4b8b while allowing the main Studio
  route to continue evolving independently. Load after studio.css.
*/

@media (max-width: 760px) {
  .studio-card {
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    grid-template-rows: minmax(0, 1fr);
  }

  .studio-brand {
    padding: 14px 12px 0;
    gap: 8px;
  }

  .studio-brand img {
    width: min(68%, 112px);
    height: 52px;
  }

  .studio-brand span {
    max-width: 64px;
    padding-top: 2px;
    font-size: .46rem;
  }

  .studio-edition {
    top: 78px;
    left: 13px;
    font-size: .5rem;
  }

  .studio-art-disc {
    bottom: 17%;
    left: 6%;
    width: 84%;
    box-shadow: 8px 9px 0 rgba(84,47,43,.2);
  }

  .studio-art-copy {
    right: 3px;
    bottom: 29px;
    font-size: clamp(2.8rem, 14vw, 4rem);
  }

  .studio-portrait-window {
    inset: 68px 0 30px;
  }

  /* Restore the previous bottom-anchored portrait geometry for this variant. */
  body[data-character] .studio-portrait-window img {
    top: auto;
    bottom: 0;
  }

  .studio-details {
    min-height: 0;
    padding: 18px 12px 14px;
    overflow: hidden;
  }

  #studio-character-name {
    font-size: calc(clamp(2.3rem, 12vw, 3.25rem) * var(--name-size, 1));
    line-height: .72;
  }

  .studio-facts {
    gap: 0;
    margin: 14px 0;
    border-top-width: 1px;
  }

  .studio-facts div {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 6px;
    padding: 9px 0;
    border-bottom-width: 1px;
  }

  .studio-facts dd {
    font-size: clamp(.68rem, 3vw, .82rem);
    line-height: 1.13;
  }

  .studio-ticket,
  .studio-instagram {
    min-height: 40px;
    padding: 9px 10px;
    font-size: .67rem;
  }
}

/* Desktop and landscape are intentionally isolated from the locked portrait
   phone composition above. Remove the phone-era minimum column widths so
   tablets and landscape phones can use the full available width without
   overflowing, and show the session rail as a normal horizontal strip. */
@media (min-width: 761px) {
  .studio-shell {
    width: min(calc(100% - 40px), 1180px);
  }

  .studio-character-rail {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
  }

  .studio-character-rail__label {
    padding-left: 0;
    text-align: right;
  }

  .studio-character-carousel {
    margin-inline: 0;
    padding: 3px 4px 6px;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .studio-card {
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
    grid-template-rows: minmax(0, 1fr);
    min-width: 0;
  }

  .studio-art,
  .studio-details {
    min-width: 0;
  }
}

/* A landscape phone simply does not have enough vertical room for the topbar,
   session rail, full card, CTA and footer at once. Keep the desktop/landscape
   two-column card, but scroll the page rather than compressing the card into an
   unusable strip. This never matches portrait phones (<= 760px). */
@media (min-width: 761px) and (max-height: 680px) {
  body {
    height: auto;
    min-height: 100svh;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .studio-shell {
    height: auto;
    min-height: 100svh;
    grid-template-rows: auto auto 520px auto auto;
    padding: max(12px, env(safe-area-inset-top)) 0 max(16px, env(safe-area-inset-bottom));
    gap: 10px;
  }

  .studio-card {
    height: 520px;
  }

  .studio-topbar {
    min-height: 38px;
  }

  .studio-home {
    width: 38px;
    height: 38px;
  }

  .studio-character-card {
    min-height: 56px;
  }

  .studio-footer {
    padding-bottom: 2px;
  }
}
