/* Energy Economics Solar: brand film (added 2026-09-28)
   Hero "Watch the film" link, the film section under the reframe band,
   the end screen, and the full-screen player upright phones get.
   Uses the tokens from styles.css. Loaded by index.php only. */

/* ---------- Hero link ---------- */
.watch-film {
  display: inline-flex; align-items: center; gap: 14px;
  color: #fff; font-weight: 600; font-size: 1.02rem; line-height: 1.1;
  padding: 4px 8px 4px 4px; border-radius: 40px;
}
.watch-film-ic {
  width: 50px; height: 50px; border-radius: 50%; flex: none;
  border: 2px solid var(--amber-bright); background: rgba(12,13,15,.35);
  display: grid; place-items: center;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.watch-film-ic::after {
  content: ""; margin-left: 4px;
  border-left: 14px solid var(--amber-bright); border-top: 9px solid transparent; border-bottom: 9px solid transparent;
}
.watch-film-t { display: grid; gap: 4px; }
.watch-film-t small { font-weight: 500; font-size: .78rem; color: rgba(255,255,255,.72); letter-spacing: .04em; }
.watch-film:hover .watch-film-ic { background: rgba(237,141,16,.2); transform: scale(1.05); }
.watch-film:focus-visible { outline: 2px solid var(--amber-bright); outline-offset: 4px; }
/* on phones the extra row would sit on the "Scroll" hint: lift the hero copy clear of it */
@media (max-width: 767px) { .hero .hero-inner { padding-bottom: 108px; } .watch-film { margin-left: -4px; } }
/* 981-1180px: the third link would run under the "Acres of rooftop" caption, so the caption steps aside */
@media (min-width: 981px) and (max-width: 1180px) { .hero-scale { display: none; } }

/* ---------- Film section ---------- */
.film-section { scroll-margin-top: 0; }
.film-section .section-head { margin-bottom: clamp(28px, 4vw, 44px); }
.film-section h2 { text-wrap: balance; }
/* never taller than the space under the fixed header (short laptops, landscape phones) */
.film-frame {
  max-width: 1080px;
  max-width: min(1080px, calc((100vh - 104px) * 16 / 9));
  max-width: min(1080px, calc((100svh - 104px) * 16 / 9));
  margin-inline: auto;
}
.film-player {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  border-radius: var(--radius-lg); overflow: hidden; background: #000;
  border: 1px solid var(--line-dark); box-shadow: 0 30px 80px -20px rgba(0,0,0,.6);
}
@supports not (aspect-ratio: 16 / 9) { .film-player { height: 0; padding-top: 56.25%; } }
.film-player video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block; background: #000;
  transition: filter .5s var(--ease), transform .5s var(--ease);
}

/* play button and duration exist only once film.js is running;
   without it the video keeps its native controls */
.film-play, .film-dur { display: none; }
.film-ready .film-play {
  display: grid; place-items: center;
  position: absolute; inset: 0; margin: auto; z-index: 2;
  width: 92px; height: 92px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.94); box-shadow: 0 10px 40px rgba(0,0,0,.35);
  transition: transform .25s var(--ease), background .25s var(--ease);
}
.film-play-ic { margin-left: 7px; border-left: 28px solid #111; border-top: 17px solid transparent; border-bottom: 17px solid transparent; }
.film-ready .film-player:hover .film-play { transform: scale(1.06); background: #fff; }
.film-play:focus-visible { outline: 3px solid var(--amber-bright); outline-offset: 4px; }
/* the player clips the video's own focus ring, so draw it on the player */
.film-player:has(video:focus-visible) { outline: 3px solid var(--amber-bright); outline-offset: 3px; }
.film-player:has(video:focus-visible) video { outline: none; }
@supports not selector(:has(*)) { .film-player video:focus-visible { outline: 3px solid var(--amber-bright); outline-offset: -3px; } }
.film-ready .film-dur {
  display: block; position: absolute; right: 16px; bottom: 14px; z-index: 2; pointer-events: none;
  background: rgba(0,0,0,.62); color: #fff; font-size: .85rem; font-weight: 600;
  padding: 5px 9px; border-radius: 6px; letter-spacing: .03em;
}
.film-player.is-playing .film-play, .film-player.is-playing .film-dur,
.film-player.is-ended .film-play, .film-player.is-ended .film-dur { display: none; }

/* ---------- End screen ---------- */
.is-ended > video { filter: blur(14px) brightness(.5); transform: scale(1.1); }
.film-end {
  position: absolute; inset: 0; z-index: 3; padding: 24px;
  background: rgba(10,11,13,.42);
  display: grid; place-content: center; justify-items: center; gap: 22px; text-align: center;
}
.film-end[hidden] { display: none; }
.film-end-q {
  margin: 0; color: #fff; font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.5rem, 3.2vw, 2.8rem); line-height: 1.05; letter-spacing: -.02em;
}
.film-end-q:focus, #calculator[tabindex="-1"]:focus { outline: none; }
.film-end-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.film-replay {
  background: none; border: 0; cursor: pointer; padding: 6px 10px;
  color: rgba(255,255,255,.78); font: 500 .9rem/1 var(--font-body);
  text-decoration: underline; text-underline-offset: 3px;
}
.film-replay:hover { color: #fff; }
.film-replay:focus-visible { outline: 2px solid var(--amber-bright); outline-offset: 3px; }

/* text alternative for the film (music only, all words are on screen) */
.film-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
/* positioned so the player's shadow does not paint over it; lighter grey for contrast margin */
.film-disc {
  position: relative;
  max-width: 760px; margin: 22px auto 0; text-align: center;
  font-size: .84rem; line-height: 1.55; color: #8C8C8C;
}

@media (max-width: 767px) {
  .film-player { border-radius: 10px; }
  .film-ready .film-play { width: 64px; height: 64px; }
  .film-play-ic { margin-left: 5px; border-left-width: 20px; border-top-width: 12px; border-bottom-width: 12px; }
  .film-player .film-end { gap: 10px; padding: 10px; }
  .film-player .film-end-q { font-size: 1.2rem; }
  .film-player .film-end .btn-lg { padding: .75em 1.1em; font-size: .82rem; }
}

/* ---------- Full-screen player for upright phones ---------- */
.film-overlay {
  position: fixed; inset: 0; z-index: 300; background: #000;
  display: flex; align-items: center; justify-content: center;
}
.film-overlay > video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.film-overlay-close {
  position: absolute; z-index: 4; right: 12px; top: calc(12px + env(safe-area-inset-top, 0px));
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; color: #fff; font-size: 26px; line-height: 1;
  background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.28);
}
.film-overlay-disc {
  position: absolute; z-index: 3; left: 16px; right: auto; max-width: calc(100% - 100px);
  top: calc(22px + env(safe-area-inset-top, 0px));
  margin: 0; padding: 3px 8px; border-radius: 4px; background: rgba(0,0,0,.55);
  font-size: .72rem; line-height: 1.3; color: #fff; pointer-events: none;
}
.film-overlay-close:focus-visible { outline: 2px solid var(--amber-bright); outline-offset: 3px; }
.film-overlay .film-end { gap: 18px; padding: 28px 22px; }
.film-overlay .film-end-q { font-size: 2rem; }
.film-overlay .film-end-acts { flex-direction: column; align-items: stretch; width: min(100%, 320px); }
.film-overlay .film-end-acts .btn { justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .film-player video, .watch-film-ic, .film-ready .film-play { transition: none; }
}
