/* =========================================================================
   POLISH LAYER — Visual Rhythm + Refined Accents
   Loaded AFTER styles.css so selectors here win without !important where safe.

   Goal:
   1. Make section transitions unmistakable (alternating navy/ivory + dividers)
   2. Add restrained, luxurious accents (gold glow, subtle gradients, shimmer)

   Brand discipline: navy + gold + ivory only. No purple/pink/glassmorphism.
   ========================================================================= */

/* ---------- 1. EXTRA TOKENS ---------- */
:root {
  --navy-deep: #06121f;
  --navy-rich: #0d2238;
  --gold-bright: #d9b86b;
  --gold-deep: #a88a3f;
  --pulse: #4ad991;

  /* gradients */
  --grad-ivory: linear-gradient(180deg, #fffdf7 0%, #f5efe1 100%);
  --grad-navy: linear-gradient(180deg, var(--navy-deep) 0%, var(--navy-rich) 100%);
  --grad-gold: linear-gradient(135deg, var(--gold-deep) 0%, var(--gold-bright) 50%, var(--gold) 100%);
  --grad-card-light: linear-gradient(180deg, #ffffff 0%, #faf7ee 100%);
  --grad-card-dark: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(198,168,90,0.07) 100%);

  /* glows */
  --glow-gold: 0 0 0 1px rgba(198,168,90,0.45), 0 10px 30px rgba(198,168,90,0.18);
  --glow-gold-strong: 0 0 0 1px rgba(198,168,90,0.7), 0 18px 50px rgba(198,168,90,0.28);
  --shadow-card: 0 14px 36px -16px rgba(10,26,47,0.18), 0 2px 6px rgba(10,26,47,0.06);
  --shadow-card-hover: 0 28px 60px -20px rgba(10,26,47,0.28), 0 4px 12px rgba(10,26,47,0.08);
}

/* ---------- 2. ALTERNATING SECTION BACKGROUNDS ---------- */
/* Establish a clear ivory ↔ navy rhythm.
   Default .section is ivory (already in styles.css).
   .section--alt now becomes a deep navy block with light text. */

.section {
  background: var(--grad-ivory);
  position: relative;
}

.section--alt {
  background: var(--grad-navy);
  color: rgba(255,255,255,0.92);
}

.section--alt h2,
.section--alt h3,
.section--alt .section__title { color: #fff; }

.section--alt .section__intro,
.section--alt .section__lead { color: rgba(255,255,255,0.78); }

.section--alt .section__rule {
  background: linear-gradient(90deg, var(--gold-bright) 0%, transparent 100%);
  opacity: 0.7;
}
html[dir="rtl"] .section--alt .section__rule {
  background: linear-gradient(270deg, var(--gold-bright) 0%, transparent 100%);
}

/* monitors already navy gradient — refine it */
.section--monitors {
  background: linear-gradient(180deg, var(--navy-deep) 0%, var(--navy-rich) 60%, #102945 100%);
}
.section--contact {
  background: linear-gradient(180deg, var(--navy-rich) 0%, var(--navy-deep) 100%);
}

/* ---------- 3. DECORATIVE SECTION DIVIDERS (top-of-section curve) ---------- */
/* A thin gold seam + a soft top glow that announces each section.
   Combined with alternating bg, this makes every transition visible. */

.section::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(198,168,90,0.35) 20%,
    rgba(198,168,90,0.6) 50%,
    rgba(198,168,90,0.35) 80%,
    transparent 100%);
  pointer-events: none;
  z-index: 2;
}

.section::after {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 320px;
  max-width: 60%;
  height: 80px;
  background: radial-gradient(ellipse at top, rgba(198,168,90,0.18) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.section--alt::after {
  background: radial-gradient(ellipse at top, rgba(217,184,107,0.18) 0%, transparent 70%);
}

/* don't apply to the very first section (stats) — and skip the hero */
.hero::before, .hero::after,
.stats::before, .stats::after { display: none; }

/* keep section padding generous enough for the divider not to crowd content */
.section { padding-top: clamp(72px, 9vw, 110px); padding-bottom: clamp(64px, 8vw, 96px); }

/* ---------- 4. ENHANCED SECTION HEADER ---------- */
/* The eyebrow chip becomes a real "badge" — easy to spot when scrolling */

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  position: relative;
  z-index: 3;
}

.section__num {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
  background: rgba(198,168,90,0.10);
  border: 1px solid rgba(198,168,90,0.35);
  border-radius: 999px;
  text-transform: none;
  position: relative;
  box-shadow: 0 4px 14px -6px rgba(198,168,90,0.4);
}
.section__num::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 8px var(--gold-bright);
}

.section--alt .section__num {
  background: rgba(217,184,107,0.12);
  border-color: rgba(217,184,107,0.45);
  color: #e9d29a;
}

.section__title {
  font-size: clamp(28px, 3.6vw, 42px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  position: relative;
  padding-bottom: 4px;
}

/* gold accent on the first character of section titles (RTL & LTR both) */
.section__title::first-letter {
  color: var(--gold-bright);
  font-weight: 800;
}

/* draw-in underline beneath the section title once it scrolls into view */
.section__title::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  bottom: -10px;
  width: 56px;
  height: 3px;
  background: var(--grad-gold);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: inset-inline-start;
  transition: transform 700ms cubic-bezier(.2,.7,.3,1);
}
html[dir="rtl"] .section__title::after { transform-origin: right; }
html[dir="ltr"] .section__title::after { transform-origin: left; }

.section.is-in-view .section__title::after { transform: scaleX(1); }

/* the long gold rule on the right becomes a richer gradient */
.section__rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--gold) 0%, rgba(198,168,90,0.15) 60%, transparent 100%);
  position: relative;
  overflow: hidden;
}
.section__rule::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(217,184,107,0.7), transparent);
  transform: translateX(-100%);
  animation: ruleShimmer 6s ease-in-out infinite;
}
html[dir="rtl"] .section__rule {
  background: linear-gradient(270deg, var(--gold) 0%, rgba(198,168,90,0.15) 60%, transparent 100%);
}
html[dir="rtl"] .section__rule::after { animation-direction: reverse; }

@keyframes ruleShimmer {
  0%, 30% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}

/* ---------- 5. STATS STRIP — luxe gradient + shimmer on numbers ---------- */
.stats {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy-rich) 50%, #143055 100%);
  position: relative;
  overflow: hidden;
  border-block: 1px solid rgba(198,168,90,0.3);
}
.stats::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(198,168,90,0.10) 0%, transparent 50%),
              radial-gradient(circle at 80% 50%, rgba(198,168,90,0.08) 0%, transparent 50%);
  pointer-events: none;
}
.stat { position: relative; z-index: 1; }
.stat__num {
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
}
.stat__num::after {
  content: "";
  position: absolute;
  top: 0; left: -150%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  transform: skewX(-20deg);
  animation: numShimmer 7s ease-in-out infinite;
  pointer-events: none;
}
@keyframes numShimmer {
  0%, 85% { left: -150%; }
  100% { left: 250%; }
}

/* ---------- 6. CARD LUXURY — gradients + gold glow on hover ---------- */

/* Generic about/CV cards */
.card {
  background: var(--grad-card-light);
  border: 1px solid rgba(10,26,47,0.08);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform 280ms cubic-bezier(.2,.7,.3,1),
              box-shadow 280ms cubic-bezier(.2,.7,.3,1),
              border-color 280ms;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-gold);
  opacity: 0;
  transition: opacity 280ms;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover), 0 0 0 1px rgba(198,168,90,0.35);
  border-color: rgba(198,168,90,0.35);
}
.card:hover::before { opacity: 1; }
.section--alt .card {
  background: var(--grad-card-dark);
  border-color: rgba(198,168,90,0.18);
  color: rgba(255,255,255,0.9);
}
.section--alt .card h3 { color: #fff; }
.section--alt .card ul li { color: rgba(255,255,255,0.82); }

/* Pillar cards (electoral program) */
.pillar-card {
  background: var(--grad-card-light);
  box-shadow: var(--shadow-card);
  transition: transform 320ms cubic-bezier(.2,.7,.3,1),
              box-shadow 320ms cubic-bezier(.2,.7,.3,1),
              border-color 320ms;
}
.pillar-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--grad-gold);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 320ms;
  pointer-events: none;
}
.pillar-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card-hover), 0 0 24px -8px rgba(198,168,90,0.35);
  border-color: transparent;
}
.pillar-card:hover::after { opacity: 1; }

.section--alt .pillar-card {
  background: var(--grad-card-dark);
  border-color: rgba(198,168,90,0.2);
}
.section--alt .pillar-card__title { color: #fff; }
.section--alt .pillar-card__tagline { color: rgba(255,255,255,0.78); }
.section--alt .pillar-card__icon {
  background: rgba(255,255,255,0.06);
  border-color: rgba(198,168,90,0.3);
  color: var(--gold-bright);
}
.section--alt .pillar-card__counts {
  border-top-color: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
}
.section--alt .pillar-card__counts strong { color: var(--gold-bright); }

/* Articles */
.article-card {
  background: var(--grad-card-light);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform 280ms cubic-bezier(.2,.7,.3,1),
              box-shadow 280ms cubic-bezier(.2,.7,.3,1);
}
.article-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-gold);
  transform: scaleX(0);
  transform-origin: inset-inline-start;
  transition: transform 320ms cubic-bezier(.2,.7,.3,1);
}
html[dir="rtl"] .article-card::before { transform-origin: right; }
html[dir="ltr"] .article-card::before { transform-origin: left; }
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}
.article-card:hover::before { transform: scaleX(1); }

.section--alt .article-card {
  background: var(--grad-card-dark);
  border-color: rgba(198,168,90,0.2);
}
.section--alt .article-card h3 { color: #fff; }
.section--alt .article-card p { color: rgba(255,255,255,0.78); }

/* Media cards */
.media-card {
  background: var(--grad-card-light);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform 280ms, box-shadow 280ms, border-color 280ms;
}
.media-card::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-gold);
  opacity: 0;
  transition: opacity 280ms;
}
.media-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover), 0 0 0 1px rgba(198,168,90,0.45);
  border-color: rgba(198,168,90,0.6);
}
.media-card:hover::after { opacity: 1; }

.section--alt .media-card {
  background: var(--grad-card-dark);
  border-color: rgba(198,168,90,0.25);
}
.section--alt .media-card h3 { color: #fff; }
.section--alt .media-card__date { color: rgba(255,255,255,0.55); }

/* ---------- 7. HERO refinements ---------- */
.hero__name {
  background: linear-gradient(180deg, #ffffff 0%, #f4ead0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- 8. TOPBAR refinement — keep but add subtle gold edge ---------- */
.topbar {
  background: linear-gradient(180deg, rgba(6,18,31,0.97) 0%, rgba(10,26,47,0.95) 100%);
  border-bottom: 1px solid rgba(198,168,90,0.3);
  box-shadow: 0 8px 24px -12px rgba(0,0,0,0.5);
}

/* ---------- 9. SCROLL-TRIGGERED UNDERLINE ANIMATION ---------- */
/* Sections stay visible at all times — only the title underline animates in.
   This avoids the bad UX of empty pages during fast scroll. */
@media (prefers-reduced-motion: reduce) {
  .section__title::after { transform: scaleX(1); transition: none; }
  .stat__num::after, .section__rule::after { animation: none; }
  .card, .pillar-card, .article-card, .media-card { transition: none; }
}

/* ---------- 10. CONTACT section premium feel ---------- */
.section--contact .contact-email {
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}
.section--contact .contact-socials a {
  border-color: rgba(198,168,90,0.3);
  transition: border-color 200ms, background 200ms, transform 200ms;
}
.section--contact .contact-socials a:hover {
  border-color: var(--gold-bright);
  background: rgba(198,168,90,0.08);
  transform: translateY(-1px);
}

/* ---------- 11. MOBILE — make dividers less heavy ---------- */
@media (max-width: 768px) {
  .section::after { width: 240px; height: 60px; }
  .section__num { font-size: 11px; padding: 5px 12px; }
  .section__title { font-size: clamp(22px, 6vw, 30px); }
}
