/* Phone layout (≤ 600px). Loaded last on every page so it overrides both the
   desktop styles and each page's 1100px tablet breakpoint.
   Type scale ≈ 60–70% of desktop; letter-spacing tightened to .05–.1em. */
@media (max-width: 600px) {
  :root { --gutter: 20px; }
  body { letter-spacing: .08em; }

  /* ---------- Navigation ---------- */
  .nav { top: 20px; width: 200px; font-size: 18px; }
  .nav__toggle { height: 44px; padding: 0 16px; gap: 8px; }
  .nav .nav__icon { width: 22px; height: 22px; margin: 0; }
  .nav__pause { width: 14px; height: 17px; margin: 0 4px; }
  .nav__list { padding: 8px 16px 10px 46px; }
  .nav__list a { padding: 6px 0; }

  /* ---------- Festival info (Home + Now Playing) ---------- */
  .fest-info { padding: 24px var(--gutter); gap: 20px; }
  /* title block and date side by side, date on the 想像的笑場 baseline;
     wraps under the title only on very narrow screens */
  .fest-info__left {
    height: auto; flex-direction: row; flex-wrap: wrap; justify-content: space-between;
    align-items: baseline; gap: 12px 16px;
  }
  /* drop the h1's default margins and the tall <br> line between the titles */
  .fest-title { margin: 0; line-height: 1.2; }
  .fest-title br { display: none; }
  .fest-title__main, .fest-title__sub { display: block; }
  .fest-title__main { font-size: 30px; letter-spacing: .12em; }
  .fest-title__sub { font-size: 20px; letter-spacing: .4em; margin-top: 8px; }
  /* 2 × 2 grid so the lines pair up: 想像的笑場 ↔ 2026, 國族喜劇選 ↔ 11-14 → 19
     (each row shares a baseline). The title and year/date wrappers are unwrapped
     with display: contents so their lines can sit in the grid directly. */
  .fest-info__left {
    display: grid; grid-template-columns: 1fr auto; column-gap: 16px; row-gap: 8px; align-items: baseline;
  }
  .fest-title, .fest-when { display: contents; }
  .fest-title__main { grid-area: 1 / 1; }
  .fest-title__sub { grid-area: 2 / 1; margin-top: 0; }
  .fest-year { grid-area: 1 / 2; }
  .fest-date { grid-area: 2 / 2; }
  .fest-year { font-size: 20px; letter-spacing: .12em; }
  .fest-date { font-size: 24px; letter-spacing: .08em; white-space: nowrap; }
  .fest-info__mid { min-height: 0; gap: 10px; }
  .fest-info__mid p { font-size: 14px; line-height: 1.6; letter-spacing: .08em; }
  .more-link { width: 20px; margin-top: 4px; }
  .fest-info__text { width: 100%; }

  /* icon on the left, both text lines left-aligned next to it */
  /* 臺大怡仁堂 and 免費入場 side by side, matching the title/date row */
  .fest-info__right { flex-direction: row; flex-wrap: wrap; justify-content: space-between; gap: 18px 16px; width: 100%; }
  .fact {
    width: auto; display: grid; grid-template-columns: 28px auto; column-gap: 12px; row-gap: 4px;
    justify-items: start; align-items: center; text-align: left;
  }
  .fact__head { display: contents; font-size: 16px; letter-spacing: .1em; }
  .fact__head img { grid-row: span 2; align-self: start; width: 24px; height: 24px; }
  .fact__head .fact__ticket { width: 26px; height: auto; margin: 3px 0 0; }
  .fact__sub { font-size: 13px; letter-spacing: .15em; }

  /* ---------- Trailer placeholder ---------- */
  .trailer { padding: 24px 0; }
  .trailer__frame img { width: 32px; height: 32px; }

  /* ---------- Contact ---------- */
  .contact { width: 100%; height: 232px; }
  .contact h2 { left: var(--gutter); top: 24px; font-size: 30px; letter-spacing: .12em; }
  .contact__row { left: var(--gutter); gap: 12px; font-size: 15px; }
  .contact__row img { width: 22px; height: 22px; }
  .contact__ig { top: 88px; letter-spacing: .12em; }
  .contact__fb { top: 124px; letter-spacing: .05em; }
  .contact__mail { left: var(--gutter); top: 172px; font-size: 15px; letter-spacing: .08em; }
  footer, .film + footer { margin-top: 40px; }

  /* ---------- Home ---------- */
  .hero { padding-top: 88px; margin-bottom: 24px; }
  .hero + main > section + section { margin-top: 24px; }
  .timeline { gap: 16px; }
  .timeline__month { height: auto; font-size: 28px; letter-spacing: .15em; }
  /* Scale the cards and the axis line together (both from the scroller's
     top-left corner) so the line stays aligned with the dates and times. */
  /* auto height = scaled content + the horizontal scrollbar, so the bar sits
     below the cards instead of covering their rounded bottom edge */
  .timeline__scroller { height: auto; padding-bottom: 6px; }
  .timeline__line, .timeline__track { zoom: .75; }
  /* +28 design px (≈ +21px on screen after the .75 zoom): +8 above the title,
     +8 above the blurb (arrow moves with it), +12 breathing room at the bottom */
  .tl-group__box { height: 301px; }
  .tl-card { height: 289px; }
  .tl-card__text { top: 187px; }
  .tl-card__blurb { margin-top: 13px; }
  .tl-card__arrow { top: 261px; }

  .faq { width: 100%; height: 280px; }
  .faq__icon { left: 12px; top: 6px; width: 34px; height: 34px; }
  .faq__title { left: 54px; top: 12px; font-size: 28px; letter-spacing: .12em; }
  .faq__deco { left: auto; right: 12px; width: 110px; height: auto; }
  .faq__q { left: 20px; right: 20px; top: 54px; width: auto; font-size: 20px; letter-spacing: .08em; }
  .faq__body { top: 92px; }
  .faq__a { left: 20px; right: 20px; top: 106px; bottom: 36px; width: auto; height: auto; font-size: 14px; line-height: 1.7; letter-spacing: .08em; }
  .faq__track { left: 72px; right: 16px; width: auto; }

  .merch__name, .merch__price { font-size: 17px; letter-spacing: .1em; }

  /* ---------- Now Playing ---------- */
  .np-banner { margin-top: 0; }
  .np-banner + main > section { margin-top: 24px; }
  .curation { gap: 12px; }
  .curation__title { font-size: 22px; letter-spacing: .2em; }
  .curation__text { font-size: 15px; line-height: 1.8; letter-spacing: .08em; }
  .curation__text p + p { margin-top: 18px; }
  .curation__end { padding-left: 4em; }

  .np-timeline { gap: 16px; }
  .np-timeline__month { height: auto; font-size: 28px; letter-spacing: .15em; }
  .np-list { padding: 24px 0 24px 24px; gap: 36px; }
  .np-list__axis { top: 24px; height: calc(100% - 48px); }
  .np-entry { gap: 16px; }
  .np-entry__date { height: auto; font-size: 32px; }
  .np-entry__film { gap: 8px; }
  .np-entry__time { height: auto; font-size: 18px; }
  .np-entry__row { padding-right: 0; gap: 12px; }
  .np-entry__still { grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; height: auto; width: 100%; }
  .np-entry__still img { width: 100%; height: auto; aspect-ratio: 280 / 191; }
  .np-entry__runtime { margin-top: 2px; font-size: 16px; }
  .np-entry__zh { min-height: 0; font-size: 22px; }
  .np-entry__en { margin: 4px 0; font-size: 15px; }
  .np-entry__meta { margin: 4px 0 0; font-size: 14px; line-height: 1.6; }
  .np-entry__blurb { gap: 8px; }
  .np-entry__blurb p {
    max-height: none; font-size: 14px; line-height: 1.7; letter-spacing: .08em;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5;
  }

  /* ---------- Film detail ---------- */
  .film { padding-top: 96px; }

  /* Vertical ticket stub: info + barcode on top, perforation with side
     notches, still at the bottom. Re-uses the desktop markup; the SVG ticket
     pieces stay hidden and the ticket body is drawn with CSS instead. */
  .ticket {
    position: relative; overflow: hidden;
    /* narrower than the text column: page gutter + 10px extra on each side */
    width: calc(100% - 2 * (var(--gutter) + 10px)); max-width: 330px; margin: 0 auto; padding: 0; gap: 0;
    background: var(--surface); border-radius: 8px 8px 2px 2px;
  }
  .ticket__info { order: 1; padding: 28px 24px 0; gap: 20px; min-height: 0; }
  .ticket__zh { margin-bottom: 10px; font-size: 22px; letter-spacing: .1em; }
  .ticket__en { font-size: 15px; }
  .ticket__meta { font-size: 13px; line-height: 2; letter-spacing: .05em; }

  /* desktop barcode is a 58.9 × 352 vertical strip; turn it sideways and
     scale it (→ ≈ 222 × 37), with negative margins cancelling its unrotated
     layout height */
  .ticket__barcode {
    order: 2; display: block; position: relative; left: auto; top: auto; flex: none;
    align-self: center; transform: rotate(-90deg) scale(.63);
    margin: -129px 0 -145px;
  }

  .ticket__dash {
    order: 3; display: block; position: relative; left: auto; top: auto;
    width: 100%; height: 44px;
  }
  .ticket__dash img {
    left: 26px; top: 50%; width: calc(100% - 52px); height: 3px;
    transform: translateY(-50%); opacity: .6;
  }
  /* side notches, filled with the page background */
  .ticket__dash::before, .ticket__dash::after {
    content: ""; position: absolute; top: 50%; width: 36px; height: 36px; margin-top: -18px;
    border-radius: 50%; background: var(--bg);
  }
  .ticket__dash::before { left: -18px; }
  .ticket__dash::after { right: -18px; }

  .ticket__still {
    order: 4; width: 100%; height: auto; aspect-ratio: 16 / 10; margin-top: 8px;
    object-fit: cover; border-radius: 0;
  }
  /* same width as the ticket stub above (gutter + 10px each side, max 330px) */
  .intro { width: calc(100% - 2 * (var(--gutter) + 10px)); max-width: 330px; margin-top: 40px; gap: 32px; }
  .film-nav { width: calc(100% - 2 * (var(--gutter) + 10px)); max-width: 330px; margin-top: 32px; gap: 16px; }
  .film-nav__dir { font-size: 12px; letter-spacing: .1em; }
  .film-nav__title { font-size: 15px; letter-spacing: .08em; }
  .intro__screening { text-align: left; gap: 8px; }
  .intro__when { font-size: 18px; letter-spacing: .1em; }
  .intro__format { font-size: 13px; letter-spacing: .08em; }
  .intro__spec, .intro__desc, .intro__notes { text-align: left; } /* all film-page text left-aligned on phones */
  .intro__spec, .intro__notes { font-size: 14px; line-height: 1.8; letter-spacing: .08em; }
  .intro__desc { font-size: 14px; line-height: 1.8; letter-spacing: .08em; }
  .notfound { padding: 120px var(--gutter); font-size: 18px; }

  /* ---------- About ---------- */
  .about { gap: 40px; padding-top: 96px; }
  .about p { font-size: 15px; line-height: 1.8; letter-spacing: .08em; }
  .ab-title { gap: 4px; padding: 24px var(--gutter); }
  .ab-title__zh { font-size: 32px; line-height: 1.4; letter-spacing: .12em; }
  .ab-title__en { font-size: 22px !important; letter-spacing: .1em; }
  .ab-intro, .ab-split, .ab-center, .ab-logo { padding: 24px var(--gutter); }
  .ab-split { gap: 24px; }
  .ab-center { gap: 32px; }
  .ab-center p { text-align: justify; } /* centred on desktop; justified on phones like the other About paragraphs */
  .ab-center__photo { height: auto; aspect-ratio: 16 / 9; }
  .ab-center__arrow { width: 56px; margin: 12px 0; }
  .ab-logo { gap: 24px; }
  .ab-logo h2 { font-size: 26px; letter-spacing: .12em; }
  .ab-logo__body { gap: 24px; }
}

/* very narrow phones: no room for the two columns, so year/date go under the title */
@media (max-width: 359px) {
  .fest-info__left { grid-template-columns: 1fr; }
  .fest-year { grid-area: 3 / 1; margin-top: 8px; }
  .fest-date { grid-area: 4 / 1; }
}
