/* Portrait tablets get a poster-and-copy archive, independent of the desktop stage. */
@media (min-width:761px) and (max-width:1024px) and (orientation:portrait) {
  #works.immersive-showcase {
    display:grid;
    grid-template-columns:minmax(0,.94fr) minmax(0,1.06fr);
    grid-template-rows:auto minmax(380px,auto) auto auto auto;
    grid-template-areas:"top top" "poster copy" "controls controls" "queue queue" "hint hint";
    column-gap:30px;
    row-gap:24px;
    align-items:center;
    align-content:start;
    height:auto;
    min-height:0;
    max-height:none;
    padding:28px 32px 30px;
    overflow:hidden;
    --card-gap:14px;
  }
  #works .showcase-layers,
  #works .showcase-shade,
  #works .showcase-grain {inset:0;height:auto;width:auto}
  #works .showcase-layer img {object-position:center center}
  #works .showcase-shade {
    background:linear-gradient(90deg,#090d0a85 0%,#090d0ab0 50%,#090d0ac7 100%),linear-gradient(0deg,#0c110eee 0%,#0c110e60 60%,#0c110e70 100%);
  }
  #works .showcase-top {
    grid-area:top;
    position:relative;
    inset:auto;
    width:100%;
    min-width:0;
    margin:0;
    gap:20px;
    font-size:8px;
    line-height:1.8;
    letter-spacing:.1em;
    z-index:3;
  }
  #works .showcase-top>span:last-child {text-align:right}
  #works .showcase-mobile-stage {
    grid-area:poster;
    display:flex;
    position:relative;
    inset:auto;
    align-items:center;
    justify-content:center;
    min-width:0;
    width:100%;
    padding:0;
    margin:0;
    z-index:3;
  }
  #works .showcase-mobile-poster {
    display:block;
    position:relative;
    isolation:isolate;
    width:100%;
    height:380px;
    padding:0;
    border:0;
    background:transparent;
  }
  #works .showcase-mobile-poster img {
    position:absolute;
    inset:0;
    display:block;
    width:100%;
    height:100%;
    max-width:none;
    object-fit:contain;
    filter:drop-shadow(0 12px 21px #0008);
    pointer-events:none;
  }
  #works .showcase-mobile-poster:focus-visible {outline-offset:7px}
  #works .showcase-copy {
    grid-area:copy;
    position:relative;
    inset:auto;
    align-self:center;
    width:auto;
    min-width:0;
    padding:0;
    margin:0;
    z-index:3;
  }
  #works .showcase-category {font-size:8px;letter-spacing:.1em;line-height:1.8;margin:0 0 17px}
  #works .showcase-title {
    font-size:clamp(48px,6.6vw,66px);
    line-height:1.13;
    letter-spacing:-.025em;
    margin:0 0 22px;
    overflow-wrap:anywhere;
  }
  #works .showcase-title.compact {font-size:clamp(42px,5.5vw,55px);line-height:1.2}
  #works .showcase-title span {display:block}
  #works .showcase-title span+span::before {content:none}
  #works .showcase-title-underline {width:40px;border-top-width:1px;margin-bottom:18px}
  #works .showcase-description {font-size:13px;line-height:1.9;letter-spacing:.02em;max-width:none}
  #works .showcase-copy-actions {display:flex;flex-wrap:wrap;align-items:center;gap:10px 20px;margin-top:18px}
  #works .showcase-poster-button {font-size:11px;min-height:44px;padding:5px 0;gap:18px}
  #works .showcase-artwork-button {font-size:11px;min-height:44px;padding:5px 0;letter-spacing:.04em}
  #works .showcase-dossier {display:inline-flex;align-items:center;min-height:44px;font-size:10px;padding:5px 0}
  #works .showcase-dossier[hidden] {display:none}
  #works .showcase-source {display:none}
  #works .showcase-controls {
    grid-area:controls;
    position:relative;
    inset:auto;
    display:flex;
    align-items:center;
    width:100%;
    min-width:0;
    margin:4px 0 0;
    padding:0;
    gap:18px;
    z-index:4;
  }
  #works .showcase-arrows {gap:11px;flex-shrink:0}
  #works .showcase-arrows button {width:44px;height:44px;min-width:44px;min-height:44px;font-size:20px}
  #works .showcase-progress {min-width:50px;margin:0 8px}
  #works .showcase-number {font-size:42px;gap:9px;flex-shrink:0}
  #works .showcase-number small {font-size:9px}
  #works .showcase-queue {
    grid-area:queue;
    position:relative;
    inset:auto;
    display:flex;
    align-items:center;
    width:100%;
    max-width:100%;
    min-width:0;
    gap:14px;
    margin:0;
    padding:6px 4px 18px;
    overflow-x:auto;
    overflow-y:hidden;
    overscroll-behavior-x:contain;
    scroll-snap-type:x mandatory;
    scrollbar-width:thin;
    scrollbar-color:#e0a67f70 #ffffff10;
    z-index:3;
  }
  #works .poster-card {
    height:150px;
    width:auto;
    flex:0 0 auto;
    aspect-ratio:var(--poster-aspect,.667);
    padding:0;
    border-radius:0;
    box-shadow:none;
    scroll-snap-align:start;
  }
  #works .poster-card:hover,
  #works .poster-card:focus-visible {transform:none}
  #works .poster-card-art img {object-fit:contain}
  #works .showcase-hint {
    grid-area:hint;
    position:relative;
    inset:auto;
    min-width:0;
    margin:0;
    padding:0;
    font-size:8px;
    letter-spacing:.05em;
    line-height:1.9;
  }
  #works .showcase-load-error {position:relative;inset:auto;grid-column:1/-1;margin:0;font-size:12px}

  /* Keep each short-film title on its own line rather than between two labels. */
  .short-film-card figcaption {
    grid-template-columns:minmax(0,1fr) auto;
    grid-template-areas:"title title" "number watch";
    gap:7px 16px;
    margin-top:16px;
  }
  .short-film-card figcaption>span:first-child {grid-area:number;align-self:center;font-size:8px;padding:0}
  .short-film-card figcaption>span:nth-child(2) {grid-area:title;font-size:22px;line-height:1.45;min-width:0}
  .short-film-card figcaption>button {grid-area:watch;min-height:44px;font-size:10px;margin:0;padding:5px 0;text-align:right}
}

/* The primary viewing action is prominent only when a local film is available. */
#works .showcase-poster-button:not([aria-disabled="true"]) {
  display:flex;
  align-items:center;
  justify-content:space-between;
  min-width:168px;
  min-height:56px;
  padding:14px 22px;
  border:1px solid #F1EDE4;
  border-radius:0;
  background:#F1EDE4;
  color:#171715;
  font-size:14px;
  line-height:1.4;
  letter-spacing:.06em;
  gap:24px;
}
#works .showcase-poster-button:not([aria-disabled="true"]) span {
  color:#171715;
  font-size:24px;
  line-height:1;
}
#works .showcase-poster-button:not([aria-disabled="true"]):hover {
  background:#E0A67F;
  border-color:#E0A67F;
  color:#171715;
}
#works .showcase-poster-button:not([aria-disabled="true"]):focus-visible {
  outline:2px solid #E0A67F;
  outline-offset:5px;
}
@media (max-width:760px) {
  #works .showcase-poster-button:not([aria-disabled="true"]) {
    width:100%;
    flex-basis:100%;
    min-width:0;
    min-height:56px;
    padding:14px 22px;
    font-size:14px;
  }
}

/* Original V4 lettering for narrow opening frames; desktop artwork remains intact. */
@media (max-width:760px), (min-width:761px) and (max-width:1200px) and (max-aspect-ratio:3/2) {
  .opening .mobile-opening-copy>div {
    display:block;
    width:min(100%,600px);
    height:auto;
    aspect-ratio:666 / 252;
    margin:0;
    padding:0;
    background:url("assets/brand/v4-approved-title.svg") left center / contain no-repeat;
    color:transparent;
    font-size:0;
    line-height:0;
    letter-spacing:0;
    text-shadow:none;
  }
}
@media (min-width:761px) and (max-width:1200px) and (max-aspect-ratio:3/2) {
  .opening .opening-image {object-position:78% center}
  .opening::before {
    content:"";
    position:absolute;
    inset:0;
    background:linear-gradient(90deg,#10120f 0%,#10120f 37%,#10120f00 46%),linear-gradient(0deg,#10120fec 0%,#10120f70 22%,transparent 46%);
    z-index:1;
    pointer-events:none;
  }
  .opening::after {
    content:"";
    position:absolute;
    inset:0 0 auto;
    width:100%;
    height:160px;
    background:linear-gradient(#131713 0%,#131713 80%,#13171300);
    z-index:1;
    pointer-events:none;
  }
  .opening .opening-nav {
    position:absolute;
    left:42px;
    right:42px;
    top:34px;
    z-index:3;
    display:grid;
    grid-template-columns:repeat(4,max-content);
    gap:14px 30px;
  }
  .opening .opening-nav a {
    position:static!important;
    width:auto!important;
    height:auto!important;
    min-height:32px;
    font-family:var(--serif);
    font-size:14px!important;
    text-align:left!important;
    letter-spacing:.1em;
  }
  .opening .opening-nav a>span {position:static;width:auto;height:auto;clip:auto;overflow:visible}
  .opening .opening-nav a[data-map=brand] {
    display:flex;
    align-items:center;
    gap:12px;
    grid-column:1/-1;
    font-size:32px!important;
    font-weight:700;
    margin-bottom:4px;
    line-height:1.2;
  }
  .opening .opening-nav a[data-map=brand]>.brand-avatar {
    position:static;
    left:auto;
    top:auto;
    transform:none;
    width:42px;
    height:42px;
    flex:none;
    margin-top:0;
  }
  .opening .opening-nav small {font-family:var(--mono);font-size:8px;letter-spacing:.6em;margin-left:20px;font-weight:400}
  .opening .mobile-opening-copy {
    display:block;
    position:absolute;
    z-index:2;
    bottom:clamp(94px,11.5svh,118px);
    left:42px;
    right:42px;
  }
  .opening .mobile-opening-copy p {font-family:var(--mono);font-size:10px;letter-spacing:.14em;margin-bottom:24px}
  .opening .mobile-opening-copy>small {font-size:12px;letter-spacing:.04em;display:block;margin-top:26px}
  .opening .opening-scroll {
    position:absolute!important;
    left:auto!important;
    top:auto!important;
    bottom:32px!important;
    right:42px!important;
    width:auto!important;
    height:auto!important;
    background:none;
    padding:0;
    font-family:var(--mono);
    font-size:10px;
    letter-spacing:.16em;
    min-height:24px;
    display:flex;
    align-items:center;
  }
  .opening .opening-scroll::before,.opening .opening-scroll::after {display:none}
  .opening .opening-scroll>span {position:static;width:auto;height:auto;clip:auto;overflow:visible}
}
/* In portrait, the crop already excludes the baked-in title. Keep the face clear. */
@media (min-width:761px) and (max-width:1200px) and (orientation:portrait) {
  .opening::before {
    background:linear-gradient(0deg,#10120fec 0%,#10120f70 22%,transparent 46%);
  }
}
@media (max-width:760px) and (max-height:600px) {
  .opening .mobile-opening-copy>div {width:min(100%,380px)}
}
/* Hide the baked scroll label at the far crop edge on narrow landscapes. */
@media (min-width:761px) and (max-width:1200px) and (max-aspect-ratio:3/2) {
 .opening .opening-scroll::before {content:"";display:block;position:absolute;z-index:-1;inset:auto -42px -32px auto;width:140px;height:210px;background:linear-gradient(90deg,transparent,#10120f 42%);pointer-events:none}
}
