/* =============================================================
   MIRAI — Hero Carousel
   Covers: slide transitions · hero text · nav bar · scroll indicator
   Tokens from :root in header.css
   ============================================================= */

/* ===== BLOCK: Box-sizing reset ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ===== BLOCK: Carousel shell ===== */
.hero-carousel {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* ===== BLOCK: Individual slides ===== */
.carousel-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.9s ease, transform 0.9s ease;
  z-index: 0;
}

.carousel-slide.active {
  opacity: 1;
  transform: scale(1);
  z-index: 10;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===== BLOCK: Slide darkening overlay ===== */
.hero-overlay {
  background: linear-gradient(135deg, rgba(8, 8, 16, 0.65) 0%, rgba(8, 8, 16, 0.35) 100%);
}

/* ===== BLOCK: Hero text container ===== */
.hero-container {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  transform: translateY(-50%);
  display: flex;
  justify-content: center;
  padding: 0 2rem;
  z-index: 20;
}

/* ===== BLOCK: Hero text wrapper ===== */
.hero-text {
  color: var(--white);
  text-align: left;
  width: 100%;
  max-width: 1200px;
}

/* ===== BLOCK: Hero sub-text (above h1) ===== */
.hero-text p {
  font-family: var(--ff-body);
  font-size: clamp(0.75rem, 1.4vw, 0.9rem);
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-light);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

/* ===== BLOCK: Hero headline (Cormorant Garamond) ===== */
.hero-text h1,
.hero-text .hero-title {
  font-family: var(--ff-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 300;
  line-height: 1.05;
  color: var(--white);
  margin-bottom: 2rem;
  max-width: 800px;
  transform: none;   /* override old translateY(-10%) from herocarousel.css */
}

/* Italic accent word — brand red */
.hero-text h1 em,
.hero-text .hero-title em {
  font-style: italic;
  color: var(--red);
}

/* ===== BLOCK: Hero CTA ("Learn More") — text link, no box =====
   Hover / keyboard focus: the label goes bold and the arrow nudges
   toward the reading direction (right; left in Arabic). */
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--ff-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--white);
  text-decoration: none;
  padding: 10px 0;          /* keeps a comfortable tap height without a box */
  transition: font-weight 0.2s ease;
  --nudge: 1;               /* -1 in RTL (css/rtl.css direction set below) */
}

.hero-cta-arrow {
  display: inline-block;
  font-size: 14px;
  line-height: 1;
}

.hero-cta:hover,
.hero-cta:focus-visible {
  font-weight: 700;
}

.hero-cta:hover .hero-cta-arrow,
.hero-cta:focus-visible .hero-cta-arrow {
  animation: hero-cta-nudge 0.9s ease-in-out infinite;
}

.hero-cta:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.6);
  outline-offset: 4px;
}

@keyframes hero-cta-nudge {
  0%, 100% { translate: 0 0; }
  50%      { translate: calc(6px * var(--nudge)) 0; }
}

html[dir="rtl"] .hero-cta { --nudge: -1; }
html[dir="rtl"] .hero-cta-arrow { transform: scaleX(-1); }

@media (prefers-reduced-motion: reduce) {
  .hero-cta:hover .hero-cta-arrow,
  .hero-cta:focus-visible .hero-cta-arrow {
    animation: none;
    translate: calc(4px * var(--nudge)) 0;
  }
}

/* Legacy .link class support */
.hero-text .link {
  font-weight: 600;
  color: var(--gray-light);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: color 0.25s;
}

.hero-text .link:hover {
  color: var(--white);
}

/* ===== BLOCK: Carousel bottom nav container ===== */
.hero-nav-container {
  max-width: 1200px;
  width: 100%;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ===== BLOCK: Active indicator line ===== */
.nav-line {
  position: relative;
  border-top: 0.5px solid rgba(141, 153, 174, 0.2);
  width: 100%;
}

.active-indicator {
  position: absolute;
  top: -1px;
  left: 0;
  height: 2px;
  background: var(--red);
  transition: left 0.3s ease, width 0.3s ease;
  border-radius: 1px;
}

/* ===== BLOCK: Nav row (buttons + scroll indicator) ===== */
.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

/* ===== BLOCK: Slide title buttons ===== */
.carousel-nav button {
  font-family: var(--ff-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: normal;
  width: 180px;
  text-align: center;
  line-height: 1.4em;
  background: none;
  border: none;
  padding: 0.5rem;
  color: rgba(141, 153, 174, 0.65);
  cursor: pointer;
  transition: color 0.25s ease;
}

.carousel-nav button.active,
.carousel-nav button:hover {
  color: var(--white);
}

/* ===== BLOCK: Carousel controls (prev/next — legacy) ===== */
.carousel-controls {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  z-index: 30;
}

.carousel-controls button {
  background: rgba(0, 0, 0, 0.4);
  border: none;
  color: var(--white);
  font-size: 1.75rem;
  padding: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.carousel-controls button:hover {
  background: rgba(0, 0, 0, 0.7);
}

/* ===== BLOCK: Scroll-down indicator ===== */
.scroll-down-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--white);
  gap: 0.75rem;
}

.scroll-down-container .divider {
  width: 0.5px;
  height: 24px;
  background: rgba(141, 153, 174, 0.25);
}

.mouse-icon {
  width: 22px;
  height: 34px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 11px;
  position: relative;
}

.mouse-icon::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 5px;
  background: var(--white);
  border-radius: 1px;
  animation: scrollDot 1.4s ease infinite;
}

@keyframes scrollDot {
  0%   { opacity: 0; transform: translateX(-50%) translateY(0); }
  50%  { opacity: 1; transform: translateX(-50%) translateY(8px); }
  100% { opacity: 0; transform: translateX(-50%) translateY(0); }
}

/* ===== BLOCK: Scrollbar hide utility ===== */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* ===== BLOCK: Timer bar (legacy — kept for backward compat) ===== */
.carousel-timer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 40;
  overflow: hidden;
}

.timer-segments {
  display: flex;
  width: 100%;
  height: 100%;
}

.segment {
  flex: 1;
  height: 100%;
  background: var(--white);
  opacity: 0.4;
  width: 0%;
  transition: width 10s linear, opacity 0.3s ease;
}

.segment.active {
  opacity: 0.9;
  width: 100%;
}

.segment.filled {
  opacity: 0.25;
  width: 100%;
}

/* ===== BLOCK: Responsive ===== */
@media (max-width: 768px) {
  .hero-text h1,
.hero-text .hero-title {
    font-size: 2.25rem;
    max-width: 80vw;
  }

  .hero-text p {
    font-size: 0.75rem;
  }

  .timer-segments {
    height: 12px;
  }
}

@media (max-width: 640px) {
  .carousel-nav button {
    width: 110px;
    font-size: 9px;
  }

  .scroll-down-container .divider {
    display: none;
  }
}
