/* ============================================================================
   polish.css — light UI polish (additive only)
   Loaded AFTER main.css. Does NOT alter existing layout/markup; only enhances
   accessibility + interaction feedback per ui-ux-pro-max priority rules.
   Applied to the Home page (index.php).
   ============================================================================ */

/* --- 1. Higher-contrast focus ring (WCAG 2.4.11 — needs >=3:1 on ANY bg) ---
   The base gold ring is only ~2.1:1 on light backgrounds. A dual ring (dark
   core + gold halo) stays clearly visible on both light and dark surfaces. */
:focus-visible {
  outline: 3px solid var(--primary-dark);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(212, 175, 55, 0.55);
  border-radius: 4px;
}
/* On dark sections the dark core would vanish — lead with gold there. */
.hero-section :focus-visible,
.footer :focus-visible,
footer :focus-visible,
.chatbot-window :focus-visible {
  outline-color: var(--gold);
  box-shadow: 0 0 0 5px rgba(13, 40, 24, 0.55);
}

/* --- 2. Touch targets >=44x44 (ui-ux-pro-max Touch rule, CRITICAL) ---
   Expand small controls' hit area without changing their visual weight. */
.lang-toggle-btn,
#lang-toggle,
#lang-toggle-mob {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#back-to-top {
  min-width: 44px;
  min-height: 44px;
}
.pwa-banner-dismiss {
  /* keep the 32px visual circle but pad the clickable area out to ~44px */
  padding: 6px;
  box-sizing: content-box;
}

/* --- 3. Consistent, smooth interaction feedback (no instant 0ms changes) --- */
.btn-gold,
.btn-outline,
.nav-link,
.lang-toggle-btn,
.filter-btn {
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease;
}
.btn-gold:hover,
.btn-outline:hover {
  transform: translateY(-2px);
}
.btn-gold:active,
.btn-outline:active {
  transform: translateY(0);
}

/* --- 4. Respect reduced-motion: disable the lift/transition above --- */
@media (prefers-reduced-motion: reduce) {
  .btn-gold, .btn-outline, .nav-link, .lang-toggle-btn, .filter-btn { transition: none; }
  .btn-gold:hover, .btn-outline:hover, .btn-gold:active, .btn-outline:active { transform: none; }
}

/* ============================================================================
   Scroll-Expand Hero — vanilla JS/CSS port of scroll-expansion-hero.
   Media starts as a small card and grows to full screen on scroll while the
   background fades and the title halves slide apart; content then reveals.
   ============================================================================ */
.se-hero { position: relative; background: var(--primary-deep, #071A10); overflow-x: hidden; }
.se-stage {
  position: relative;
  height: 100vh; height: 100dvh;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.se-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  will-change: opacity;
}
.se-bg-tint { position: absolute; inset: 0; background: rgba(7,26,16,0.45); }

.se-media {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 300px; height: 400px;
  max-width: 95vw; max-height: 85vh;
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.55);
  z-index: 2;
}
.se-media img, .se-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.se-media-tint { position: absolute; inset: 0; background: rgba(7,26,16,0.35); will-change: opacity; }
.se-media-meta {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 8px; padding-bottom: 22px;
}
.se-date { color: #fff; font-weight: 600; font-size: .95rem; text-shadow: 0 2px 14px rgba(0,0,0,.7); will-change: transform; }
.se-hint {
  background: rgba(0,0,0,.28); border: 1px solid rgba(212,175,55,.5);
  color: var(--gold-light, #F0D060); font-weight: 600; font-size: .9rem;
  border-radius: 30px; padding: 8px 18px; cursor: pointer;
  min-height: 44px; display: inline-flex; align-items: center;
  will-change: transform, opacity; transition: background .2s ease;
}
.se-hint:hover { background: rgba(0,0,0,.45); }

.se-title {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; pointer-events: none;
}
.se-title-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.se-half {
  font-weight: 800; line-height: 1.02; color: #fff;
  font-size: clamp(2.4rem, 7vw, 5.5rem);
  text-shadow: 0 6px 34px rgba(0,0,0,.55);
  will-change: transform;
}
.se-half-r { color: var(--gold, #D4AF37); }

.se-reveal {
  position: relative; z-index: 4; opacity: 0;
  transition: opacity .6s ease;
  background: linear-gradient(180deg, var(--primary-deep,#071A10), var(--primary-dark,#0D2818));
}
.se-reveal-inner { padding: 72px 16px 92px; text-align: center; color: #fff; max-width: 920px; }
.se-lead { font-size: 1.15rem; line-height: 1.7; margin: 22px auto 6px; max-width: 640px; color: rgba(255,255,255,.9); }
.se-slogan { font-size: 1rem; font-style: italic; color: var(--gold-light, #F0D060); margin-bottom: 26px; }
.se-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 46px; }
.se-stats { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.se-stat { min-width: 130px; padding: 18px 10px; border: 1px solid rgba(212,175,55,.22); border-radius: 14px; background: rgba(255,255,255,.03); }
.se-stat-num { font-size: 2rem; font-weight: 800; color: var(--gold, #D4AF37); }
.se-stat-num span { font-size: 1rem; }
.se-stat-lbl { font-size: .82rem; color: rgba(255,255,255,.7); letter-spacing: .5px; }

/* Reduced motion: skip the scroll hijack — show media + content statically. */
@media (prefers-reduced-motion: reduce) {
  .se-bg { opacity: 0 !important; }
  .se-reveal { opacity: 1 !important; }
  .se-half { transform: none !important; }
}

/* ── Hero title font: match the header brand name (Playfair Display; Cairo for Arabic) ── */
.se-half { font-family: var(--font-en-head, 'Playfair Display', Georgia, serif); }
body.lang-ar .se-half { font-family: var(--font-ar, 'Cairo', 'Segoe UI', sans-serif); }

/* ============================================================================
   Story heading — "The Story of Bickfaya"
   Base color was --primary-dark (dark green) on the dark Story section, so the
   title was nearly invisible. Lift it to a soft cream, keep the accent gold,
   and add a slow gold/green glow pulse.
   ============================================================================ */
#story .section-title-main { color: #EDE6D4; }
#story .section-title-main .display-en,
#story .section-title-main .display-ar { color: #EDE6D4; }
#story .section-title-main .accent { color: var(--gold, #D4AF37); }

@keyframes storyGlow {
  0%, 100% { text-shadow: 0 0 8px rgba(212, 175, 55, 0.25); }
  50%      { text-shadow: 0 0 22px rgba(212, 175, 55, 0.70),
                          0 0 40px rgba(27, 67, 50, 0.50); }
}
@media (prefers-reduced-motion: no-preference) {
  #story .section-title-main .display-en {
    animation: storyGlow 3s ease-in-out infinite;
  }
}
