/* Bloomie opening film hero (js/screens/home-hero.js).
   The film fills the stage (object-fit: cover, top kept). .bh-frame is sized by JS to the film's picture, so the title
   uses film coordinates (cqw/% of the picture) and lands where the burned-in title used to be: top centre, above the
   bouquet, clear of the raised rose. Wide cut 1920x1080 on landscape screens, tall cut 720x688 on portrait phones. */
.bloom-hero {
  --bh-ink: #9C7759; --bh-glow: rgb(255 250 236 / .62); --bh-sand: #EADBC0; --bh-ease: cubic-bezier(.22, 1, .36, 1);
  --bh-ticket-h: 112px;
  position: relative; isolation: isolate; background: var(--bh-sand);
}
.bh-stage {
  position: relative; overflow: hidden; z-index: 0;
  block-size: max(360px, min(56.25vw, calc(100svh - var(--hdr-h) - var(--bh-ticket-h))));
  background: #E4D3B5;
}
.bh-poster, .bh-final, .bh-video, .bh-anim {
  position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; object-position: 50% 0;
  display: block; border: 0;
}
.bh-poster { z-index: 0; }
.bh-video { z-index: 1; background: transparent; }
.bh-anim { z-index: 1; }   /* Low Power Mode stand-in for the video (animated WebP), placed after it in the DOM */
.bh-final { z-index: 2; opacity: 0; transition: opacity .45s ease; }
.is-still .bh-final, .is-waiting .bh-final { opacity: 1; }
/* is-waiting: the film is still loading underneath (kept visible so iOS does not pause it) */
.is-still .bh-video { visibility: hidden; }

/* title box = the film picture */
.bh-frame { position: absolute; z-index: 3; left: 0; top: 0; inline-size: 100%; block-size: 100%; pointer-events: none; container-type: inline-size; }
.bh-title {
  position: absolute; inset-inline: 0; inset-block-start: 3.1%; margin: 0;
  display: grid; justify-items: center; text-align: center; color: var(--bh-ink);
  text-shadow: 0 0 18px var(--bh-glow), 0 1px 2px var(--bh-glow);
  opacity: 0; transform: translateY(1.2cqw);
  transition: opacity 1.1s var(--bh-ease), transform 1.1s var(--bh-ease);
}
.bh-name { font: 400 7.3cqw/1 "Pinyon Script", "Italiana", cursive; letter-spacing: 0; padding-inline: .1em; }
.bh-tag { font: italic 400 2.25cqw/1.15 "Cormorant Garamond", Georgia, serif; letter-spacing: .02em; margin-block-start: -.1em; }
:root[lang="ar"] .bh-tag { font: 500 1.9cqw/1.5 "El Messiri", serif; letter-spacing: 0; margin-block-start: .1em; }
.show-title .bh-title { opacity: 1; transform: none; }

/* replay: only once the film has finished (or is shown as a still) */
.bh-replay {
  position: absolute; z-index: 4; inset-block-end: 14px; inset-inline-end: 14px; inline-size: 44px; block-size: 44px;
  display: grid; place-items: center; border-radius: 50%; border: 1px solid rgb(255 255 255 / .55);
  background: rgb(80 58 40 / .28); color: #FFF8EC; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: opacity .4s ease, visibility 0s .4s, background-color .15s ease;
}
.is-ended .bh-replay { opacity: 1; visibility: visible; transition: opacity .4s ease .3s, visibility 0s, background-color .15s ease; }
.bh-replay:hover { background: rgb(80 58 40 / .45); }
.bh-replay:focus-visible { outline: 2px solid #FFF8EC; outline-offset: 3px; }

/* ticket: the call to action, a paper ticket laid on the stage's lip */
.bh-ticket {
  position: relative; z-index: 2; display: grid; gap: 12px 28px; align-items: center;
  inline-size: min(100% - 32px, 1080px); margin: calc(-1 * clamp(18px, 2.4vw, 36px)) auto 0;
  padding: 18px 24px; background: #FFF8EC; color: var(--ink); border-radius: 6px;
  box-shadow: 0 18px 40px -20px rgb(60 40 25 / .55), 0 1px 0 rgb(60 40 25 / .06);
  -webkit-mask: radial-gradient(circle 9px at 0 50%, transparent 98%, #000) 0 0 / 51% 100% no-repeat, radial-gradient(circle 9px at 100% 50%, transparent 98%, #000) 100% 0 / 51% 100% no-repeat;
  mask: radial-gradient(circle 9px at 0 50%, transparent 98%, #000) 0 0 / 51% 100% no-repeat, radial-gradient(circle 9px at 100% 50%, transparent 98%, #000) 100% 0 / 51% 100% no-repeat;
}
@media (min-width: 900px) { .bh-ticket { grid-template-columns: minmax(0, 1fr) auto; } .bh-ticket .acts { justify-content: flex-end; border-block-start: 0; padding-block-start: 0; border-inline-start: 1.5px dashed var(--line); padding-inline-start: 24px; } }
.bh-ticket .row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between; }
.bh-ticket .hand { font: 600 1.35rem/1 var(--f-hand); color: var(--poppy); }
:root[lang="ar"] .bh-ticket .hand { font-size: 1.15rem; }
.bh-ticket .no { font: 500 .72rem var(--f-mono); color: var(--muted); letter-spacing: .06em; }
.bh-ticket p { margin: 6px 0 0; color: var(--muted); font-size: .98rem; max-inline-size: 60ch; }
.bh-ticket .acts { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; border-block-start: 1.5px dashed var(--line); padding-block-start: 12px; }

/* tall cut (portrait phones and tablets): the film keeps its own shape, nothing is cropped */
.bloom-hero[data-cut="tall"] { --bh-ticket-h: 0px; }
.bloom-hero[data-cut="tall"] .bh-stage { block-size: auto; aspect-ratio: 720 / 688; max-block-size: calc(100svh - var(--hdr-h) - 150px); min-block-size: 0; margin-inline: auto; }
.bloom-hero[data-cut="tall"] .bh-title { inset-block-start: 5.5%; }
.bloom-hero[data-cut="tall"] .bh-name { font-size: 15cqw; }
.bloom-hero[data-cut="tall"] .bh-tag { font-size: 4.7cqw; }
:root[lang="ar"] .bloom-hero[data-cut="tall"] .bh-tag { font-size: 4cqw; }
@media (max-width: 760px) {
  .bh-ticket { inline-size: calc(100% - 24px); margin-block-start: -14px; padding: 14px 16px 16px; }
  .bh-ticket .acts .btn { flex: 1 1 100%; justify-content: center; }
  .bh-ticket p { font-size: .95rem; }
}
/* phones in landscape: the wide cut fills the screen height, minus the notch area */
@media (orientation: landscape) and (max-height: 560px) {
  .bloom-hero { --bh-ticket-h: 0px; }
  .bh-stage { block-size: calc(100svh - var(--hdr-h)); }
  .bh-ticket { margin-block-start: 12px; }
}
/* notch / home-indicator safe areas (viewport-fit=cover): keep the ticket's text and buttons clear of them */
.bh-ticket { inline-size: min(100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px), 1080px); }
@media (max-width: 760px) { .bh-ticket { inline-size: calc(100% - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)); } }

/* reduced motion: no rising title */
html[data-motion="reduced"] .bh-title, html[data-motion="reduced"] .bh-final { transition: none; }
@media (prefers-reduced-motion: reduce) { .bh-title, .bh-final, .bh-replay { transition: none !important; } }
