/* =============================================================================
   Ringout Pillar Header — rph-*
   Full-viewport hero + right-side slideout panel
   ============================================================================= */

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --rph-gold:    #F0BE00;
  --rph-navy:    #001e3c;
  --rph-blue:    #004277;
  --rph-teal:    #009EA1;
  --rph-panel-w: 48%;
}

/* ── Hero wrapper ──────────────────────────────────────────────────────────── */
.rph-hero {
  position: relative;
  width: 100%;
  height: 70vh;
  max-height: 550px;
  overflow: hidden;
}

/* Background photo with subtle Ken Burns zoom */
.rph-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform-origin: center;
  animation: rph-kb 24s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes rph-kb {
  from { transform: scale(1);    }
  to   { transform: scale(1.06); }
}

.rph-hero__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 1;
}

/* ── Bottom-left hero content — mirrors wow-panel__content ─────────────────── */
.rph-hero__content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 520px;
  color: #fff;
  z-index: 3;
  text-align: center;
}

.rph-hero__tag {
  display: block;
  font-family: 'elido', Arial, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.30em;
  text-transform: uppercase;
  color: var(--rph-gold);
  margin-bottom: 16px;
}

.rph-hero__title {
  display: block;
  width: 100%;
  margin: 0 0 22px;
  text-shadow: 0 0 30px rgba(0, 0, 0, 0.9);
}

.rph-title-large {
  display: block;
  font-family: 'AbhayaLibre-Regular', serif;
  font-size: clamp(4.5rem, 6.75vw, 5.95rem);
  color: var(--rph-gold);
  line-height: 0.85;
}

.rph-title-small {
  display: block;
  font-family: 'AbhayaLibre-Regular', serif;
  font-size: clamp(2.625rem, 3.75vw, 3.55rem);
  color: #fff;
  line-height: 1.0;
}

.rph-hero__desc {
  font-family: 'elido', Arial, sans-serif;
  font-size: clamp(1rem, 1.35vw, 1.08rem);
  line-height: 1.68;
  color: rgba(255, 255, 255, 0.82);
  max-width: 400px;
  margin-bottom: 30px;
}

/* CTA button — matches wow-panel__cta exactly */
.rph-hero__cta {
  display: inline-block;
  padding: 13px 32px;
  border: 2px solid var(--rph-gold);
  background: transparent;
  color: var(--rph-gold);
  font-family: 'elido', Arial, sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}

.rph-hero__cta:hover,
.rph-hero__cta:focus-visible {
  background: var(--rph-gold);
  color: var(--rph-blue);
  outline: none;
}

/* ── Slideout panel ────────────────────────────────────────────────────────── */
.rph-slideout {
  position: absolute;
  top: 0;
  right: 0;
  width: var(--rph-panel-w);
  height: 100%;
  z-index: 10;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(100%);
  /* Transition added by JS after init to prevent sliding-in on page load */
  border-left: 1px solid #001830;
  background:
    linear-gradient(120deg, rgba(0, 42, 80, 0.88) 0%, rgba(0, 30, 60, 0.76) 55%, rgba(0, 0, 0, 0.46) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.rph-slideout.rph-ready {
  transition: transform 0.58s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.rph-hero.is-open .rph-slideout {
  transform: translateX(0);
}

/* Radial gold glow — decorative accent */
.rph-glow {
  position: absolute;
  width: 60%;
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(240, 190, 0, 0.10) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  animation: rph-pulse 6s ease-in-out infinite;
}

@keyframes rph-pulse {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1);    }
  50%       { opacity: 1;   transform: translate(-50%, -50%) scale(1.12); }
}

/* Close button */
.rph-slideout__close {
  position: absolute;
  top: 22px;
  right: 24px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.rph-slideout__close:hover,
.rph-slideout__close:focus-visible {
  background: rgba(240, 190, 0, 0.14);
  border-color: rgba(240, 190, 0, 0.5);
  color: var(--rph-gold);
  outline: none;
}

/* ── Slideout inner content (vertically centered column) ──────────────────── */
.rph-slideout__inner {
  position: relative;
  z-index: 5;
  width: 100%;
  padding: 88px 52px 64px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Stagger fade-in — animation fires on load and on each reopen */
@keyframes rph-item-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.rph-slideout__inner > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.2s ease, transform 0.2s ease; /* quick hide when panel closes */
}

.rph-hero.is-open .rph-slideout__inner > * {
  animation: rph-item-in 0.55s ease both;
}

.rph-hero.is-open .rph-slideout__inner > *:nth-child(1) { animation-delay: 0.40s; }
.rph-hero.is-open .rph-slideout__inner > *:nth-child(2) { animation-delay: 0.55s; }
.rph-hero.is-open .rph-slideout__inner > *:nth-child(3) { animation-delay: 0.70s; }
.rph-hero.is-open .rph-slideout__inner > *:nth-child(4) { animation-delay: 0.85s; }

/* ── Pull handle ───────────────────────────────────────────────────────────── */
.rph-handle {
  position: absolute;
  left: -42px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 76px;
  background: linear-gradient(120deg, rgba(0, 42, 80, 0.88) 0%, rgba(0, 30, 60, 0.78) 100%);
  border: 1px solid rgba(240, 190, 0, 0.25);
  border-right: none;
  border-radius: 8px 0 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: grab;
  color: rgba(255, 255, 255, 0.5);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  user-select: none;
  z-index: 20;
}

.rph-handle:hover {
  background: linear-gradient(120deg, rgba(0, 42, 80, 0.94) 0%, rgba(0, 30, 60, 0.88) 100%);
  border-color: rgba(240, 190, 0, 0.55);
  color: var(--rph-gold);
}

.rph-handle:active { cursor: grabbing; }

.rph-handle__lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rph-handle__lines span {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.rph-handle__chevron {
  transition: transform 0.4s ease;
}

.rph-hero.is-open .rph-handle__chevron {
  transform: rotate(180deg);
}

/* Featured hero stat */
.rph-featured-stat {
  display: flex;
  flex-direction: column;
  margin-bottom: 28px;
}

.rph-featured-stat__num {
  font-family: 'AbhayaLibre-Regular', serif;
  font-size: clamp(2.3rem, 3.45vw, 3.03rem);
  color: var(--rph-gold);
  line-height: 0.9;
  display: block;
  text-shadow: 0 0 40px rgba(240, 190, 0, 0.3);
}

.rph-featured-stat__label {
  display: block;
  font-family: 'elido', Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 0;
}

/* Divider */
.rph-divider {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.10);
  margin-bottom: 26px;
}

/* ── Video thumbnail grid ──────────────────────────────────────────────────── */
.rph-videos {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  max-width: 340px;
}

.rph-video-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.rph-video-item:focus-visible { outline: 2px solid var(--rph-gold); outline-offset: 3px; }

.rph-video-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  transition: transform 0.35s ease;
}

/* Gradient fallbacks — visible while image loads or if src is missing */
.rph-video-thumb--1 { background: linear-gradient(135deg, #001e3c 0%, #004277 60%, #0b5c99 100%); }
.rph-video-thumb--2 { background: linear-gradient(135deg, #00243a 0%, #006b6e 60%, #009EA1 100%); }
.rph-video-thumb--3 { background: linear-gradient(135deg, #1a0a00 0%, #7a4a00 60%, #F0BE00 100%); }

.rph-video-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease, filter 0.35s ease;
  filter: brightness(0.85);
}

.rph-video-item:hover .rph-video-thumb img,
.rph-video-item:focus-visible .rph-video-thumb img {
  transform: scale(1.06);
  filter: brightness(1);
}

.rph-video-item:hover .rph-video-thumb,
.rph-video-item:focus-visible .rph-video-thumb {
  transform: scale(1.04);
}

.rph-video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease;
}

.rph-video-play svg {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
  transition: transform 0.25s ease;
}

.rph-video-item:hover .rph-video-play svg {
  transform: scale(1.15);
}

.rph-video-label {
  display: block;
  font-family: 'elido', Arial, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.60);
  line-height: 1.3;
  transition: color 0.2s ease;
}

.rph-video-item:hover .rph-video-label {
  color: var(--rph-gold);
}

/* ── Lightbox ──────────────────────────────────────────────────────────────── */
.rph-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.rph-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.rph-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 10, 25, 0.92);
  cursor: pointer;
}

.rph-lightbox__frame {
  position: relative;
  width: min(900px, 90vw);
  z-index: 1;
}

.rph-lightbox__close {
  position: absolute;
  top: -44px;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.70);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.rph-lightbox__close:hover { background: rgba(240, 190, 0, 0.2); color: var(--rph-gold); }

.rph-lightbox__ratio {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}

.rph-lightbox__ratio iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */

/* Large screens: tighten left edge while still side-by-side */
@media (max-width: 1400px) {
  .rph-hero__content { left: 50%; }
}

/* Tablet and below: stack slideout under the banner */
@media (max-width: 1024px) {
  .rph-hero {
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
    display: block; /* block so slideout simply flows below */
  }

  /* Constrain the background image to just the banner zone */
  .rph-hero__bg,
  .rph-hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 320px;
    bottom: auto;
  }

  /* Banner zone — in flow, gives the hero its visible height */
  .rph-hero__content {
    position: relative;
    top: auto;
    z-index: 3;
    bottom: auto;
    left: auto;
    transform: none;
    max-width: 100%;
    height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 25px;
    box-sizing: border-box;
  }

  /* Slideout is a plain block below the banner — no transforms, no blur */
  .rph-slideout {
    position: static;
    width: 100%;
    height: auto;
    transform: none !important;
    transition: none !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #004277;
    border-left: none;
    border-top: 1px solid rgba(240, 190, 0, 0.18);
    overflow: visible;
    display: block;
  }

  .rph-slideout.rph-ready { transition: none !important; }
  .rph-hero.is-open .rph-slideout { transform: none; }

  /* Handle is meaningless in stacked layout */
  .rph-handle { display: none; }
  .rph-glow   { display: none; }

  .rph-slideout__inner {
    padding: 28px 25px 36px;
  }
}

/* Mobile: tighten the banner height */
@media (max-width: 767px) {
  .rph-hero__bg,
  .rph-hero__overlay { height: 240px; }

  .rph-hero__content { height: 240px; }

  .rph-featured-stat__num { font-size: clamp(1.99rem, 7.5vw, 2.4rem); }

  .rph-videos { gap: 8px; }
}
