/* NTU Movie Festival — shared styles
   Tokens come from the Figma "Design System" section. */
@import url("https://fonts.googleapis.com/css2?family=Beiruti:wght@300;400;500;600&family=Inter:ital,wght@0,400;1,300;1,400&family=Roboto:wght@200&family=Saira:wght@500&family=Noto+Sans+TC:wght@200;300;400;500&display=swap");

:root {
  --blue: #351ad3;        /* 主色 */
  --teal: #4caeae;        /* 次色 */
  --bg: #f5f9fd;          /* 頁面背景底色 */
  --surface: #f2f2f2;     /* 元件背景底色 */
  --dark-gray: #424242;   /* 文字色 */
  --gray: #656565;
  --gray-blue: #536182;
  --dark-blue: #2e4059;
  --comedy-orange: #d6582b;

  --font-main: "Beiruti", "Noto Sans TC", sans-serif;
  --font-nav: "Saira", "Noto Sans TC", sans-serif;
  --font-film-cn: "Roboto", "Noto Sans TC", sans-serif;
  --font-film-en: "Inter", "Beiruti", sans-serif;

  --page-w: 1440px;
  --gutter: 120px;
}

/* ---------- Page transition (Figma: Move in · Top · Ease in · 300ms) ----------
   Cross-document view transition: on every same-site navigation the new page
   slides down from the top over the old one, which stays put. Browsers without
   support (e.g. Firefox) simply navigate without the animation. */
@view-transition { navigation: auto; }
::view-transition-group(root) { animation-duration: 400ms; }
::view-transition-old(root) { animation: none; }
::view-transition-new(root) { animation: page-move-in-bottom 400ms ease-in both; }
@keyframes page-move-in-bottom { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ---------- Scroll reveal (js/common.js adds .reveal, then .is-revealed) ----------
   Only elements tagged by JS are hidden, so the page still shows without JS. */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1.2s ease, transform 1.2s cubic-bezier(.2, .7, .2, 1); }
.reveal.is-revealed { opacity: 1; transform: none; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--dark-gray);
  font-family: var(--font-main);
  /* Beiruti has no CJK glyphs, so Chinese falls back to Noto Sans TC, whose
     glyphs sit much taller (cap-height .733em vs Beiruti's .605em). Scale every
     fallback font to the first font's cap-height so Chinese matches the Latin
     text's visual size instead of crowding the layout. */
  font-size-adjust: cap-height from-font;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.15em;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
p { margin: 0; }

/* weekday after a programme date, e.g. "15 Sun." (Now Playing list + home timeline) */
.date-dow { margin-left: .4em; font-size: .5em; font-weight: 400; letter-spacing: .08em; }

.page { width: 100%; max-width: var(--page-w); margin: 0 auto; position: relative; }
.section { padding: 40px var(--gutter); }

/* ---------- Navigation bar ---------- */
/* Closed: play icon + current page.  Open: pause icon + list of pages. */
.nav {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 295px;
  z-index: 20;
  font-family: var(--font-nav);
  font-weight: 500;
  font-size: 24px;
  color: var(--dark-blue);
  letter-spacing: 0;
  line-height: 1.2;
  border: 2px solid var(--gray-blue);
  border-radius: 5px;
  background: var(--bg);
  opacity: .8;
  overflow: hidden;
}
.nav__toggle {
  display: flex; align-items: center; gap: 11px;
  width: 100%; height: 57.6px; padding: 0 28px 0 26px; text-align: left;
}
.nav__icon { width: 31.6px; height: 31.6px; flex: none; }
.nav__pause { display: none; width: 17.7px; height: 21px; margin: 0 7px 0 6px; flex: none; }
.nav__label { white-space: nowrap; }
.nav__list { display: none; list-style: none; margin: 0; padding: 13px 28px 14px 70px; background: #d4d4d4; }
.nav__list a { display: block; padding: 5px 0; }
.nav__list a:hover, .nav__list a[aria-current="page"] { color: var(--blue); }
.nav.is-open { opacity: 1; }
.nav.is-open .nav__toggle { background: #e4e8ec; }
.nav.is-open .nav__icon, .nav.is-open .nav__label { display: none; }
.nav.is-open .nav__pause { display: block; }
.nav.is-open .nav__list { display: block; }

/* ---------- Contact us block (bottom right) ---------- */
.contact {
  position: relative;
  width: 440px; height: 336px;
  margin-left: auto;
  background: var(--blue);
  color: var(--bg);
}
.contact h2 {
  position: absolute; left: 32px; top: 35px; margin: 0;
  font-weight: 400; font-size: 48px; line-height: 1.2; letter-spacing: .15em;
}
.contact__row { position: absolute; left: 35px; display: flex; align-items: center; gap: 20px; font-size: 24px; line-height: 1.2; }
.contact__row img { width: 28px; height: 28px; }
.contact__ig { top: 123px; letter-spacing: .2em; }
.contact__fb { top: 168px; letter-spacing: .15em; white-space: nowrap; }
.contact__mail { position: absolute; left: 37px; top: 224px; font-weight: 300; font-size: 24px; letter-spacing: .15em; }

/* ---------- Festival info row (shared by Home + Now Playing) ---------- */
/* columns share a top line (title, excerpt, place/entrance) */
.fest-info {
  display: flex; align-items: flex-start; justify-content: center; gap: 64px;
  padding: 40px var(--gutter);
}
/* height follows the content; fixed 40px between the title and the year/date */
.fest-info__left { width: 330px; display: flex; flex-direction: column; gap: 40px; }
/* the two title lines are stacked blocks: with the <br> line box (h1 default size × 1.5)
   想像的笑場 sat ~17px below the other columns' top */
.fest-title { margin: 0; font-weight: 300; color: var(--dark-gray); }
.fest-title br { display: none; }
.fest-title__main, .fest-title__sub { display: block; }
.fest-title__main { font-size: 48px; letter-spacing: .15em; line-height: 1; }
.fest-title__sub { font-size: 36px; letter-spacing: .6em; line-height: 1; margin-top: 23px; white-space: nowrap; }
/* year stacked above the date, a little smaller, with extra space between */
.fest-when { display: flex; flex-direction: column; gap: 10px; }
.fest-year { font-size: 30px; letter-spacing: .2em; line-height: 1.3; }
.fest-date { font-size: 40px; letter-spacing: .2em; line-height: 1.2; }
.fest-info__mid { width: 385px; min-height: 201px; display: flex; flex-direction: column; align-items: flex-end; gap: 16px; }
.fest-info__mid p { font-size: 16px; text-align: justify; letter-spacing: .15em; }
.fest-info__text { display: flex; flex-direction: column; }
/* small arrow tucked under the excerpt's bottom-right corner */
.more-link { align-self: flex-end; width: 26px; height: auto; margin-top: 6px; display: block; }
.more-link img { width: 100%; height: auto; }
.fest-info__right { display: flex; flex-direction: column; gap: 57px; }
.fact { width: 248px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; text-align: right; }
.fact__head { display: flex; align-items: center; justify-content: space-between; width: 100%; font-size: 24px; letter-spacing: .15em; }
.fact__head img { width: 36px; height: 36px; }
.fact__sub { font-size: 24px; letter-spacing: .2em; line-height: 1.2; }
.fact a.fact__sub { text-decoration: underline; text-underline-position: from-font; }

/* ---------- Placeholder for the lead-in video ---------- */
.trailer { padding: 40px 0; display: flex; flex-direction: column; align-items: center; }
/* small grey section label ("Podcast", "宣傳片"), shared by Home and Now Playing */
.podcast__label { margin: 0 0 10px; font-size: 20px; line-height: 1.2; letter-spacing: .15em; color: var(--gray); }
/* label sits above the frame, left edge aligned with it */
.trailer > .podcast__label { width: 1200px; max-width: calc(100% - 2 * var(--gutter)); }
.trailer__frame {
  width: 1200px; max-width: calc(100% - 2 * var(--gutter)); height: 650px;
  background: var(--surface); display: grid; place-items: center;
}
.trailer__frame img { width: 42px; height: 42px; }
.trailer__frame { position: relative; overflow: hidden; background-size: cover; background-position: center; }
.trailer__play { display: grid; place-items: center; width: 100%; height: 100%; cursor: default; }
.trailer__frame.has-video .trailer__play { cursor: pointer; background: rgba(0, 0, 0, .25); transition: background .2s; }
.trailer__frame.has-video .trailer__play:hover { background: rgba(0, 0, 0, .1); }
.trailer__frame.has-video .trailer__play img { transition: transform .2s; }
.trailer__frame.has-video .trailer__play:hover img { transform: scale(1.1); }
.trailer__play:focus-visible { outline: 3px solid var(--teal); outline-offset: -3px; }
.trailer__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
