/* ─────────────────────────────────────────────────────────────
   hotel-videos.css — PUBLIC SITE. Styles the video section that
   js/hotel-videos-firestore.js fills in, on any page.

   1 video   → one large, centred player.
   2 or more → a slider: the current video sits in the middle, the previous / next
               ones peek in from the sides. Swipe, use the ‹ › buttons, tap a dot,
               press the left / right arrow keys, or tap a side video.

   LAPTOP / TABLET   title + caption sit on the picture (cinematic).
   PHONE             the picture on top, title + caption on a card underneath, so the
                     text is easy to read and nothing covers the video.

   Works in the dark and light theme; the gold is the site's --gold if it has one.
   To fine-tune, change the variables just below.
───────────────────────────────────────────────────────────── */

#hotel-videos {
  --hv-gold: var(--gold, #E8A020);
  --hv-pad-x: clamp(1.1rem, 4vw, 3rem);     /* side padding of the section */
  --hv-max: 76rem;                          /* widest the section gets on a big screen */
  --hv-slide-w: min(30rem, 82vw);           /* width of the video in the middle: phones */
  --hv-gap: clamp(.8rem, 2vw, 1.6rem);      /* space between slides */
  --hv-radius: 18px;
  --hv-line: rgba(128, 128, 128, .3);
  --hv-surface: rgba(128, 128, 128, .08);
  --hv-ink: rgba(128, 128, 128, .5);
  --hv-line: color-mix(in srgb, currentColor 16%, transparent);
  --hv-surface: color-mix(in srgb, currentColor 5%, transparent);
  --hv-ink: color-mix(in srgb, currentColor 42%, transparent);

  box-sizing: border-box;
  width: 100%;
  max-width: var(--hv-max);
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5.5rem) var(--hv-pad-x);
  text-align: center;
  overflow-x: clip;                         /* the peeking slides never cause a sideways scrollbar */
}
@media (min-width: 720px)  { #hotel-videos { --hv-slide-w: min(52rem, 74vw); --hv-radius: 22px; } }
@media (min-width: 1100px) { #hotel-videos { --hv-slide-w: min(52rem, 60vw); } }

#hotel-videos[hidden] { display: none; }
#hotel-videos *, #hotel-videos *::before, #hotel-videos *::after { box-sizing: border-box; }

/* ── heading block ── */
#hotel-videos .section-label {
  display: block;
  width: 100%;
  margin-left: auto; margin-right: auto;
  text-align: center;
}
#hotel-videos .hv-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2rem, 4.2vw, 3rem);
  font-weight: 400;
  letter-spacing: .035em;
  line-height: 1.05;
  margin: .6rem 0 0;
}
#hotel-videos .hv-intro {
  max-width: 38rem;
  margin: .9rem auto 0;
  line-height: 1.7;
  opacity: .78;
}
#hotel-videos .hv-intro::after {            /* short gold rule under the heading */
  content: "";
  display: block;
  width: 3rem; height: 2px;
  margin: 1.5rem auto 0;
  background: var(--hv-gold);
  border-radius: 2px;
}

.hv-grid { margin-top: clamp(1.4rem, 3.5vw, 2.4rem); text-align: left; }

/* ── a video card ── */
.hv-card { position: relative; margin: 0; border-radius: var(--hv-radius); }

.hv-media {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--hv-radius);
  overflow: hidden;
  isolation: isolate;
  background: #0b0905;
  box-shadow: 0 22px 44px -24px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06);
}
.hv-poster {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}
/* no poster picture: a warm, dark frame instead of an empty black box */
.hv-media.hv-noposter {
  background:
    radial-gradient(90% 120% at 14% 0%, rgba(232, 160, 32, .34), transparent 60%),
    radial-gradient(70% 90% at 100% 100%, rgba(232, 67, 32, .22), transparent 60%),
    linear-gradient(135deg, #221b11, #0b0905);
}
/* shade along the bottom so overlaid text always reads (laptop / tablet only) */
.hv-media::after {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, .84) 0%, rgba(0, 0, 0, .4) 34%, transparent 64%);
  pointer-events: none;
}

.hv-duration {
  position: absolute; z-index: 2;
  top: .75rem; right: .75rem;
  padding: .28rem .7rem;
  border-radius: 99px;
  background: rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
  font-size: .76rem; font-weight: 600; letter-spacing: .04em;
}

/* play button — always in the middle of the picture, with a soft pulsing ring */
.hv-play {
  position: absolute; z-index: 3;
  top: 50%; left: 50%;
  width: clamp(3.5rem, 11vw, 4.6rem);
  height: clamp(3.5rem, 11vw, 4.6rem);
  transform: translate(-50%, -50%);
  display: grid; place-items: center;
  padding: 0;
  border: 0; border-radius: 50%;
  background: var(--hv-gold);
  color: #1a1306;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .5);
  transition: transform .25s ease, box-shadow .25s ease;
}
.hv-play svg { width: 40%; height: 40%; margin-left: 6%; position: relative; z-index: 1; }
.hv-play::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--hv-gold);
  animation: hv-pulse 2.6s ease-out infinite;
}
@keyframes hv-pulse { 0% { transform: scale(1); opacity: .65; } 100% { transform: scale(1.7); opacity: 0; } }
.hv-play:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* once it's playing, the poster, button and badge step aside */
.hv-media.is-playing::after,
.hv-media.is-playing .hv-poster,
.hv-media.is-playing .hv-play,
.hv-media.is-playing .hv-duration { display: none; }
.hv-player {
  position: absolute; inset: 0; z-index: 4;
  width: 100%; height: 100%;
  border: 0; background: #000;
  object-fit: contain;        /* tall (phone-shot) videos are letterboxed, not cropped */
}
.hv-error {
  position: absolute; inset: 0; z-index: 4; margin: 0;
  display: grid; place-items: center;
  padding: 1rem; text-align: center;
  background: #0b0905; color: #fff; font-size: .9rem; line-height: 1.5;
}

/* ── title + caption ── */
.hv-card-title {
  margin: 0;
  font-family: 'Bebas Neue', 'Oswald', Impact, sans-serif;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  font-weight: 400; letter-spacing: .035em; line-height: 1.05;
  text-transform: uppercase;
}
.hv-card-caption {
  margin: .55rem 0 0;
  max-width: 40rem;
  font-size: clamp(.9rem, 1.4vw, 1rem);
  line-height: 1.6;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}

/* PHONE: picture on top, text on a card underneath */
@media (max-width: 719.98px) {
  .hv-card { background: var(--hv-surface); border: 1px solid var(--hv-line); overflow: hidden; }
  .hv-media { border-radius: 0; box-shadow: none; }
  .hv-media::after { display: none; }
  .hv-info { padding: 1.05rem 1.15rem 1.25rem; }
  .hv-card-caption { opacity: .78; }
}

/* LAPTOP / TABLET: text sits on the picture */
@media (min-width: 720px) {
  .hv-info {
    position: absolute; z-index: 3;
    left: 0; right: 0; bottom: 0;
    padding: clamp(1.2rem, 3vw, 2.2rem);
    color: #fff;
    text-shadow: 0 1px 16px rgba(0, 0, 0, .5);
    pointer-events: none;
  }
  .hv-card-caption { opacity: .9; -webkit-line-clamp: 2; line-clamp: 2; }
  .hv-media.is-playing ~ .hv-info { display: none; }
  .hv-duration { top: 1.1rem; right: 1.1rem; }
}

/* ── one video ── */
.hv-one { display: flex; justify-content: center; }
.hv-one .hv-card { width: min(100%, 52rem); }

/* ── slider ── */
.hv-slider { margin-inline: calc(-1 * var(--hv-pad-x)); }   /* let it run to the screen edges */
.hv-stage { position: relative; }

.hv-track {
  position: relative;
  display: flex;
  gap: var(--hv-gap);
  overflow-x: auto;
  /* equal space either side so the first and last slide can reach the middle */
  padding: 1.4rem calc((100% - var(--hv-slide-w)) / 2) 3rem;   /* room underneath for the shadow */
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  outline: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 min(8%, 4rem), #000 calc(100% - min(8%, 4rem)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 min(8%, 4rem), #000 calc(100% - min(8%, 4rem)), transparent 100%);
}
.hv-track::-webkit-scrollbar { display: none; }
.hv-track:focus-visible { outline: 2px solid var(--hv-gold); outline-offset: -2px; border-radius: var(--hv-radius); }

.hv-slide {
  flex: 0 0 var(--hv-slide-w);
  scroll-snap-align: center;
  scroll-snap-stop: always;
  opacity: .68;
  filter: saturate(.85);
  transition: transform .5s cubic-bezier(.2, .7, .2, 1), opacity .5s ease, filter .5s ease;
  cursor: pointer;
}
.hv-slide.is-active { opacity: 1; filter: none; cursor: auto; }
@media (min-width: 720px) { .hv-slide:not(.is-active) { transform: scale(.92); } }   /* side videos sit a little smaller */
/* the side slides are for peeking at — pressing one brings it to the middle */
.hv-slide:not(.is-active) .hv-play { opacity: 0; }
.hv-slide:not(.is-active) .hv-play::before { animation: none; }
.hv-slide:not(.is-active) .hv-media { box-shadow: 0 12px 26px -18px rgba(0, 0, 0, .5); }
@media (min-width: 720px) { .hv-slide:not(.is-active) .hv-info { opacity: 0; } }

/* ── control bar:  ‹  ● ○ ○ ○  › ── */
.hv-nav {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(.8rem, 2.4vw, 1.3rem);
  margin-top: -1.2rem;
  position: relative; z-index: 1;
}
.hv-dots { display: flex; align-items: center; gap: .5rem; }
.hv-arrow {
  color: inherit;                          /* buttons don't pick up the page's text colour by themselves */
  width: 2.9rem; height: 2.9rem;
  display: grid; place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--hv-line);
  background: var(--hv-surface);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.hv-arrow svg { width: 1.15rem; height: 1.15rem; }
.hv-arrow:hover { background: var(--hv-gold); border-color: var(--hv-gold); color: #1a1306; transform: scale(1.06); }
.hv-arrow:active { transform: scale(.95); }
.hv-arrow:focus-visible { outline: 3px solid var(--hv-gold); outline-offset: 3px; }

.hv-dot {
  color: inherit;
  width: .55rem; height: .55rem;
  padding: 0; border: 0; border-radius: 99px;
  background: var(--hv-ink);
  cursor: pointer;
  transition: width .3s ease, background .3s ease;
}
.hv-dot:hover { background: var(--hv-gold); }
.hv-dot.is-active { width: 1.9rem; background: var(--hv-gold); }
.hv-dot:focus-visible { outline: 2px solid var(--hv-gold); outline-offset: 3px; }
.hv-counter { min-width: 4.5rem; text-align: center; font-size: .9rem; font-weight: 600; letter-spacing: .1em; opacity: .8; }

/* ── pointer devices: a little life on the middle video ── */
@media (hover: hover) {
  .hv-slide.is-active .hv-media:hover .hv-poster,
  .hv-one .hv-media:hover .hv-poster { transform: scale(1.045); }
  .hv-slide.is-active .hv-media:hover .hv-play,
  .hv-one .hv-media:hover .hv-play { transform: translate(-50%, -50%) scale(1.1); box-shadow: 0 14px 36px rgba(0, 0, 0, .55), 0 0 0 10px rgba(232, 160, 32, .22); }
}

@media (prefers-reduced-motion: reduce) {
  .hv-slide, .hv-poster, .hv-play, .hv-arrow, .hv-dot { transition: none; }
  .hv-play::before { animation: none; }
}