/* ============================================================
   IGNITION & VELOCITY — LUXURY ENHANCEMENTS
   Scroll animations, micro-interactions, reading progress,
   polished hover states, refined typography details
   ============================================================ */

/* ── Reading Progress Bar ─────────────────────────────────── */
#readingProgress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light));
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}

#readingProgress::after {
  content: '';
  position: absolute;
  right: 0;
  top: -2px;
  width: 8px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 8px 2px rgba(201,168,76,0.8);
}

/* ── Scroll Reveal Animations ─────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal="left"] {
  transform: translateX(-28px);
}

[data-reveal="right"] {
  transform: translateX(28px);
}

[data-reveal="scale"] {
  transform: scale(0.96) translateY(12px);
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

/* Stagger children */
[data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal-stagger].revealed > *:nth-child(1)  { transition-delay: 0.05s; }
[data-reveal-stagger].revealed > *:nth-child(2)  { transition-delay: 0.12s; }
[data-reveal-stagger].revealed > *:nth-child(3)  { transition-delay: 0.19s; }
[data-reveal-stagger].revealed > *:nth-child(4)  { transition-delay: 0.26s; }
[data-reveal-stagger].revealed > *:nth-child(5)  { transition-delay: 0.33s; }
[data-reveal-stagger].revealed > *:nth-child(6)  { transition-delay: 0.40s; }
[data-reveal-stagger].revealed > *:nth-child(7)  { transition-delay: 0.47s; }
[data-reveal-stagger].revealed > *:nth-child(8)  { transition-delay: 0.54s; }
[data-reveal-stagger].revealed > * {
  opacity: 1;
  transform: translateY(0);
}

/* ── Enhanced Navigation ──────────────────────────────────── */
/* Gold underline on active/hover nav links */
.nav__links a {
  position: relative;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 14px;
  right: 14px;
  height: 1.5px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 1px;
}

.nav__links a:hover::after,
.nav__links a.active::after {
  transform: scaleX(1);
}

/* Nav logo — subtle glow on hover */
.nav__logo:hover .nav__logo-icon {
  filter: drop-shadow(0 0 6px rgba(201,168,76,0.5));
}

/* ── Button Shimmer Effect ────────────────────────────────── */
.btn-gold,
.nav__subscribe,
.hero__cta,
.newsletter__btn {
  position: relative;
  overflow: hidden;
}

.btn-gold::before,
.nav__subscribe::before,
.hero__cta::before,
.newsletter__btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.18) 50%,
    transparent 100%
  );
  transform: skewX(-15deg);
  transition: left 0.5s ease;
  pointer-events: none;
}

.btn-gold:hover::before,
.nav__subscribe:hover::before,
.hero__cta:hover::before,
.newsletter__btn:hover::before {
  left: 150%;
}

/* ── Card Enhancement ─────────────────────────────────────── */
.article-card {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
}

.article-card:hover {
  box-shadow: 0 16px 48px rgba(0,0,0,0.55),
              0 0 0 1px rgba(201,168,76,0.25),
              0 0 24px rgba(201,168,76,0.06);
}

/* Image overlay shine on hover */
.article-card__image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(201,168,76,0.0) 0%,
    rgba(201,168,76,0.06) 50%,
    rgba(201,168,76,0.0) 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.article-card:hover .article-card__image-wrap::after {
  opacity: 1;
}

/* ── Featured Story Enhancement ───────────────────────────── */
.featured-story {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.35s ease,
              border-color 0.35s ease;
}

.featured-story:hover {
  transform: translateY(-3px);
}

/* ── Section Header Refinement ────────────────────────────── */
/* Only target the gold accent word (span without .en/.es class) */
.section__title span:not(.en):not(.es) {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 60%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto;
  animation: goldShimmer 3s linear infinite;
}

@keyframes goldShimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* ── Smooth Image Loading ─────────────────────────────────── */
img.lazy-fade {
  opacity: 0;
  transition: opacity 0.5s ease;
}

img.lazy-fade.loaded {
  opacity: 1;
}

/* ── Article Body Enhancements ────────────────────────────── */
/* Enhanced drop cap */
.article-body-inner > p:first-child::first-letter {
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
  font-size: 5.2em;
  line-height: 0.82;
  padding-right: 2px;
}

/* Pull quote refinement */
.pull-quote {
  background: linear-gradient(135deg, var(--navy3) 0%, rgba(20,20,20,0.8) 100%);
  box-shadow: -4px 0 0 var(--gold), inset 0 0 60px rgba(201,168,76,0.02);
  border-left: none;
  position: relative;
  overflow: hidden;
}

.pull-quote::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, var(--gold-mid), transparent);
}

/* Smooth headings — keep the original solid border but add glow */
.article-body-inner h2 {
  border-left: 3px solid var(--gold);
  text-shadow: 0 0 40px rgba(201,168,76,0.0);
  transition: color var(--transition), text-shadow var(--transition);
}

.article-body-inner h2:hover {
  color: var(--gold-light);
  text-shadow: 0 0 30px rgba(201,168,76,0.15);
}

/* ── Reading Progress Indicator in Hero ───────────────────── */
.article-hero__bg {
  transition: transform 0.1s linear;
}

/* ── Enhanced Scrollbar ───────────────────────────────────── */
:root {
  scrollbar-width: thin;
  scrollbar-color: rgba(201,168,76,0.35) rgba(13,13,13,0.5);
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(13,13,13,0.5);
}

::-webkit-scrollbar-thumb {
  background: rgba(201,168,76,0.35);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(201,168,76,0.55);
}

/* ── Social Link Enhancements ─────────────────────────────── */
.footer__social-link {
  position: relative;
  overflow: hidden;
}

.footer__social-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(201,168,76,0.15) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.footer__social-link:hover::before {
  opacity: 1;
}

/* ── Search Result Hover ──────────────────────────────────── */
.search-result {
  transition: background 0.2s ease, padding-left 0.2s ease;
  border-radius: var(--radius-sm);
  padding-left: 8px !important;
  margin: 0 -8px;
}

.search-result:hover {
  background: var(--navy3);
  padding-left: 16px !important;
}

/* ── Search overlay entrance ──────────────────────────────── */
/* Uses animation so it doesn't fight display:none/flex toggle */
.search-overlay.open {
  animation: searchFadeIn 0.25s ease forwards;
}

.search-overlay.open .search-overlay__inner {
  animation: searchSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes searchFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes searchSlideIn {
  from { transform: translateY(-14px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ── Mobile Menu Slide ────────────────────────────────────── */
.nav__mobile.open {
  animation: navMenuSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes navMenuSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Pill Hover ───────────────────────────────────────────── */
.pill {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover .pill {
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(0,0,0,0.5);
}

/* ── Gold Divider Lines ───────────────────────────────────── */
.section__header {
  position: relative;
}

.section__header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  border-radius: 1px;
}

/* ── Related Grid Card Size ───────────────────────────────── */
.related-grid .article-card {
  font-size: 0.95em;
}

/* ── Focus States ─────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid rgba(201,168,76,0.6);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ── Page Transition ──────────────────────────────────────── */
body {
  animation: luxuryFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes luxuryFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Article Hero Ken Burns ───────────────────────────────── */
.article-hero__bg {
  animation: articleKenBurns 20s ease-in-out infinite alternate;
}

@keyframes articleKenBurns {
  0%   { transform: scale(1) translateX(0); }
  100% { transform: scale(1.06) translateX(-0.5%); }
}

/* ── People Cards Enhancements ────────────────────────────── */
.person-card {
  position: relative;
  overflow: hidden;
}

.person-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-mid), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.person-card:hover::before {
  opacity: 1;
}

/* ── Key Facts Refinement ────────────────────────────────── */
.key-facts__list li::before {
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

/* ── Contact Block Refinement ────────────────────────────── */
.contact-block {
  background: linear-gradient(135deg, var(--navy3) 0%, var(--navy4) 100%);
  border-color: rgba(201,168,76,0.2);
  position: relative;
}

.contact-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 32px;
  right: 32px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-mid), transparent);
}

/* ── Ticker Enhancement ───────────────────────────────────── */
.ticker {
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light), var(--gold), var(--gold-dark));
  background-size: 300% auto;
  animation: tickerGold 6s linear infinite;
}

@keyframes tickerGold {
  0%   { background-position: 0% center; }
  100% { background-position: 300% center; }
}

/* ── Pagination Enhancement ────────────────────────────────── */
.pagination__btn:hover {
  transform: translateY(-1px);
}

.pagination__btn.active {
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold-light) 100%);
  box-shadow: 0 4px 16px rgba(201,168,76,0.3);
}

/* ── Filter Bar Enhancement ────────────────────────────────── */
.filter-btn.active {
  background: linear-gradient(135deg, rgba(201,168,76,0.18) 0%, rgba(201,168,76,0.08) 100%);
  box-shadow: 0 0 0 1px rgba(201,168,76,0.3) inset;
}

/* ── Hero CTA Arrow Animation ──────────────────────────────── */
.hero__cta svg {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero__cta:hover svg {
  transform: translateX(6px);
}

/* ── Info Box Refinement ───────────────────────────────────── */
.info-box {
  background: linear-gradient(135deg, var(--navy3) 0%, var(--navy4) 100%);
  position: relative;
  overflow: hidden;
}

.info-box::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,0.03));
}

/* ── Article Share Sidebar Enhancement ───────────────────── */
.sidebar-share-btn {
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease,
              transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-share-btn:hover {
  transform: scale(1.1);
}

/* ── Category Page Header Gradient ───────────────────────── */
.cat-header {
  background: linear-gradient(
    to bottom,
    rgba(20,20,20,0.9) 0%,
    var(--navy) 100%
  );
  position: relative;
}

.cat-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-mid), transparent);
}

/* ── Smooth Scroll Offset ─────────────────────────────────── */
html {
  scroll-padding-top: calc(var(--nav-height) + 24px);
}

/* ── Gold Glow on Brand Logo ──────────────────────────────── */
.footer__brand-logo {
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.footer__brand-logo:hover {
  color: var(--gold-light);
  text-shadow: 0 0 20px rgba(201,168,76,0.3);
}

/* ── Admin Sidebar Enhancement (keep same styles) ─────────── */
/* Only applies to .admin-page elements so never conflicts */

/* ── Reduced Motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  [data-reveal-stagger] > *,
  .article-hero__bg,
  .hero__bg,
  .section__title span,
  .ticker {
    animation: none !important;
    transition: opacity 0.2s ease !important;
  }

  [data-reveal] {
    transform: none;
  }

  body {
    animation: none;
  }
}
