/**
 * Common "Banobagi Welcomes You" section.
 *
 * Shared by History, Look Around, Medical Staff, and Introduction
 * (template-parts/common/welcome-section.php). Ported from the History
 * mock-up (html-pages/history) and namespaced under .bnb-welcome so it
 * cannot collide with the theme's global resets/typography.
 *
 * @package Banobagi_V2
 */

.bnb-welcome {
  --ink: #161616;
  --ink-2: #4c4c4c;
  --tan: #c4915f;
  --cream: #f5f1ea;
  --line: #e7e0d4;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.16, .84, .44, 1);

  position: relative;
  overflow: hidden;
  background: var(--cream);
  text-align: center;
  padding: clamp(60px, 9vw, 116px) 0;
  font-family: var(--sans);
}

.bnb-welcome *,
.bnb-welcome *::before,
.bnb-welcome *::after { box-sizing: border-box; }

/* Faint wordmark watermark already baked into the source image — no extra
   fade needed, it reads as texture at full opacity. */
.bnb-welcome-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: bottom center;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.bnb-welcome .wrap {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 44px);
}

.bnb-welcome .inner { max-width: 760px; margin-inline: auto; }

.bnb-welcome .eyebrow {
  display: block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tan);
  margin: 0 0 12px;
}

.bnb-welcome h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.1;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 18px;
}
.bnb-welcome h2 i { font-style: normal; color: var(--tan); }

.bnb-welcome .title-bar {
  width: 120px;
  height: 3px;
  margin: 0 auto 18px;
  background: var(--tan);
  border-radius: 2px;
}

.bnb-welcome .desc {
  margin: 0;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--ink-2);
}

/* Responsive 16:9 frame for the intro video — the embed has no native
   sizing, so the wrapper holds the ratio and the iframe fills it. */
.bnb-welcome .video {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: clamp(30px, 5vw, 46px) auto 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 44px -20px rgba(33, 58, 77, .5);
}
.bnb-welcome .video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  /* Ignore the cursor entirely: YouTube's title bar / share / watch-later /
     centre buttons only appear on hover, and controls=0 does NOT suppress
     them. Blocking pointer events keeps the embed ambient; all playback is
     driven by .video-controls (which sit above this and stay clickable). */
  pointer-events: none;
}

/* Custom minimal controls for the ambient embed. controls=0 hides YouTube's
   own chrome; these drive play/pause + mute via the iframe API (see
   assets/js/welcome-section.js). */
.bnb-welcome .video-controls {
  position: absolute;
  right: 12px;
  bottom: 16px;
  z-index: 3;
  display: flex;
  gap: 8px;
}

/* Transparent click-to-play/pause layer over the (pointer-inert) iframe. Sits
   below the buttons/progress bar so those stay clickable. */
.bnb-welcome .video-shield {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
  background: transparent;
}

/* Seekable progress bar pinned to the bottom edge (clipped by .video's
   rounded corners). Filled + seeked via assets/js/welcome-section.js. */
.bnb-welcome .video-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  height: 6px;
  background: rgba(255, 255, 255, .28);
  cursor: pointer;
  transition: height .15s var(--ease);
}
.bnb-welcome .video-progress:hover,
.bnb-welcome .video-progress:focus-visible {
  height: 10px;
  outline: none;
}
.bnb-welcome .video-progress-fill {
  width: 0;
  height: 100%;
  background: #ff0000; /* YouTube red */
  /* Eases smoothly between the player's ~250ms currentTime updates. */
  transition: width .25s linear;
}
.bnb-welcome .video-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: rgba(22, 22, 22, .55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.bnb-welcome .video-btn:hover { background: rgba(22, 22, 22, .82); }
.bnb-welcome .video-btn:active { transform: scale(.94); }
.bnb-welcome .video-btn:focus-visible { outline: 2px solid var(--tan); outline-offset: 2px; }
.bnb-welcome .video-btn svg { display: block; width: 18px; height: 18px; fill: currentColor; }

/* Play/pause icon swap — default (no .is-paused) = playing, shows the pause icon. */
.bnb-welcome .video-btn--play .icon-play { display: none; }
.bnb-welcome .video-btn--play.is-paused .icon-pause { display: none; }
.bnb-welcome .video-btn--play.is-paused .icon-play { display: block; }

/* Mute icon swap — .is-muted (default) shows the muted-speaker icon. */
.bnb-welcome .video-btn--mute .icon-unmuted { display: none; }
.bnb-welcome .video-btn--mute:not(.is-muted) .icon-muted { display: none; }
.bnb-welcome .video-btn--mute:not(.is-muted) .icon-unmuted { display: block; }

.bnb-welcome .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.bnb-welcome .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .bnb-welcome .reveal { opacity: 1; transform: none; transition: none; }
}
