:root {
  --ink: #2A2A2A;
  --muted: #886D4F;
  --paper: #F5F3EE;
  --paper-soft: #E6DBC3;
  --paper-line: #D3C9B4;
  --gold: #886D4F;
  --gold-light: #AE9C87;
  --gold-dark: #6C5944;
  --rose-soft: #DAB3C1;
  --rose: #C888A3;
  --rose-deep: #A17185;
  --danger: #c0392b;
  --shadow-sm: 0 2px 10px rgba(42,42,42,0.06);
  --shadow-md: 0 10px 30px rgba(42,42,42,0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', 'Helvetica Neue', Arial, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: 'Playfair Display', Georgia, serif;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-block;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--rose-deep);
  margin-bottom: 10px;
}

/* ================= Buttons ================= */
.btn-gold, .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.78rem;
  padding: 15px 32px;
  border-radius: 2px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn-gold {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--gold-light);
  box-shadow: 0 6px 20px rgba(42,42,42,0.18);
}
.btn-gold::after {
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.22), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
  pointer-events: none;
}
.btn-gold:hover { transform: translateY(-2px); background: #1a1a1a; box-shadow: 0 10px 26px rgba(42,42,42,0.25); }
.btn-gold:hover::after { left: 130%; }
.btn-gold:active { transform: translateY(-1px) scale(0.98); }
.btn-gold:disabled { opacity: 0.6; cursor: default; transform: none; }

.btn-outline {
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
}
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-outline:active { transform: scale(0.98); }

/* ================= Header / Nav ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--paper-line);
}
.nav-wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}
.brand-crown { width: 26px; height: 26px; flex: none; }
.brand-logo { height: 44px; width: auto; display: block; flex: none; }
@media (max-width: 860px) {
  .brand-logo { height: 26px; }
}
@media (max-width: 480px) {
  .brand-logo { height: 34px; }
}
.brand-word {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.brand-word em { font-family: 'Alex Brush', cursive; font-style: normal; color: var(--gold-dark); font-size: 1.4em; margin-left: 2px; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}
.nav-link {
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
  padding: 6px 0;
  position: relative;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-link:hover::after,
.nav-link.active::after { transform: scaleX(1); }
.nav-link.active { color: var(--gold-dark); }

.btn-nav { padding: 12px 24px; font-size: 0.72rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); display: block; transition: transform 0.2s ease, opacity 0.2s ease; }

@media (max-width: 860px) {
  .main-nav {
    position: fixed;
    top: 62px; left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--paper-line);
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 24px 26px;
    gap: 16px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .main-nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .btn-nav { display: none; }
  .main-nav .btn-nav-mobile { display: inline-flex; margin-top: 4px; }
  .nav-toggle { display: flex; }
}
@media (min-width: 861px) {
  .btn-nav-mobile { display: none; }
}

/* ================= Hero: fixed full-bleed image, content scrolls over it ================= */
.hero-fixed-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: linear-gradient(160deg, #463E35, #333130);
}
.hero-fixed-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
@media (max-width: 1024px) {
  /* .hero-fixed-bg always fills the full viewport (position:fixed; inset:0),
     regardless of .hero-spacer's height — on a portrait phone/tablet screen,
     a wide 16:9-ish photo under object-fit:cover gets cropped down to a
     narrow vertical sliver of its middle, cutting off most of the width
     (and any text baked into the image). Showing the whole photo instead
     needs object-fit:contain, which letterboxes with .hero-fixed-bg's own
     dark gradient rather than cropping. */
  .hero-fixed-bg img { object-fit: contain; object-position: center top; }
}
.hero-fixed-bg::after {
  /* soft fade at the bottom edge, where the next section slides over it */
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 30%;
  background: linear-gradient(180deg, transparent, rgba(30,26,22,0.5));
  pointer-events: none;
}
.hero-fixed-bg-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-fixed-bg-fallback svg { width: 100%; max-width: 420px; height: auto; }
.hero-fixed-bg-fallback .crown-float {
  animation: crown-float 4.5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes crown-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Reserves the scroll space that reveals the fixed image behind it */
.hero-spacer { height: 88vh; min-height: 560px; }
@media (max-width: 700px) {
  /*
   * .site-header is sticky + z-index:100, so at scroll 0 it paints on top
   * of (occludes) whatever the fixed hero shows in that same top strip —
   * cutting off the top of the photo, not actually cropping it. Starting
   * .hero-fixed-bg's box below the header instead of at the very top
   * removes that overlap entirely. 64px covers the header's tallest size
   * in this breakpoint (34px logo at <=480px + 2*14px nav padding + 1px
   * border, rounded up — the 481-700px range uses a shorter 26px logo,
   * so 64px leaves a few extra unused px there, which is harmless).
   * Update it if the header's mobile sizing changes.
   */
  .hero-fixed-bg { inset: 64px 0 0 0; }

  /*
   * .hero-fixed-bg img is object-fit:contain + object-position:top (see
   * above) — pinned to the top of its (now header-offset) box, so it
   * renders at height = viewport-width / photo-aspect-ratio, starting
   * 64px down. Matching the spacer to header-offset + that height would
   * land the white section exactly at the photo's bottom edge; trimming
   * ~35px off that on purpose means white arrives slightly before the
   * photo's true edge — cropping a sliver of background at the very
   * bottom rather than risking a leftover gap from rounding — the first
   * pass at this (35px) still left a thin sliver visible, so the margin
   * is bigger this round. 2048/1144 is the CURRENT hero photo's real
   * pixel size — update the 0.5586 (= 1144/2048) below if a
   * differently-shaped photo replaces it.
   */
  .hero-spacer { height: calc(55.86vw - 6px); min-height: 200px; }
}

/*
 * Everything from the hero-intro onward needs to paint above the fixed
 * background image (z-index:0) as you scroll — but plain non-positioned
 * blocks paint BELOW positioned z-index:0 siblings per the CSS stacking
 * order, regardless of document order. Rather than adding position+z-index
 * to every single section below, wrap them all in one container that
 * establishes its own stacking context above the fixed layer; everything
 * inside it then paints as a unit above the image.
 */
.page-content { position: relative; z-index: 1; }

.hero-intro {
  position: relative;
  z-index: 1;
  background: var(--paper);
  padding: 56px 0 64px;
  text-align: center;
  box-shadow: 0 -30px 60px rgba(42,42,42,0.1);
}
.hero-intro .container { max-width: 640px; }
.hero-intro .hero-badge { margin-left: auto; margin-right: auto; }
.hero-intro .lead {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
  margin: 0 auto 32px;
}
.hero-intro .hero-actions { justify-content: center; }
.hero-intro .hero-stats { justify-content: center; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(161,113,133,0.10);
  color: var(--rose-deep);
  border: 1px solid rgba(161,113,133,0.28);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.hero-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--rose-deep); animation: pulse-dot 1.8s ease-in-out infinite; }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  gap: 36px;
  margin-top: 44px;
  flex-wrap: wrap;
}
@media (max-width: 900px) { .hero-stats { justify-content: center; } }
.hero-stats .stat strong {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--ink);
}
.hero-stats .stat span {
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ================= Section scaffolding ================= */
.section { padding: 84px 0; background: var(--paper); position: relative; }
.section.alt {
  background: linear-gradient(180deg,
    var(--paper) 0%, var(--paper-soft) 14%,
    var(--paper-soft) 86%, var(--paper) 100%);
}
.section-head { max-width: 620px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { margin: 0 0 14px; font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
.section-head p { color: var(--muted); line-height: 1.7; margin: 0; }

/* ================= Motion: scroll reveal ================= */
.reveal-init {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-init.revealed { opacity: 1; transform: translateY(0); }

/* ================= Cards: News / Candidates ================= */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
@media (max-width: 900px) { .card-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .card-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--paper);
  border: 1px solid var(--paper-line);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card.card-hidden, .gallery-tile.card-hidden { opacity: 0; transform: scale(0.94); pointer-events: none; }

.card-media {
  aspect-ratio: 4/3;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--paper-soft), #EEE7D9);
}
.card-media svg { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform 0.5s ease; }
.card:hover .card-media svg { transform: scale(1.07); }

.card-body { padding: 20px 22px 24px; }
.card-tag {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rose-deep);
  font-weight: 600;
  margin-bottom: 8px;
}
.card-body h3 { margin: 0 0 8px; font-size: 1.15rem; }
.card-body p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.6; }
.card-meta { margin-top: 14px; font-size: 0.76rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }

.card.js-expand { cursor: pointer; }
.card-readmore {
  display: inline-block;
  margin-top: 14px;
  background: none;
  border: none;
  padding: 0;
  color: var(--rose-deep);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
}
.card-readmore:hover { text-decoration: underline; }

.section-cta { text-align: center; margin-top: 44px; }

/* ================= Candidates grid (people cards) ================= */
.candidate-card { display: block; text-align: center; color: inherit; text-decoration: none; }
.candidate-photo {
  aspect-ratio: 3/4;
  background: linear-gradient(160deg, #463E35, #6C5944);
  position: relative;
  overflow: hidden;
}
.candidate-photo svg, .candidate-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.candidate-card:hover .candidate-photo svg, .candidate-card:hover .candidate-photo img { transform: scale(1.07); }
.candidate-card { cursor: pointer; }
.candidate-photo .wilaya-badge {
  position: absolute;
  top: 12px; left: 12px;
  background: rgba(255,255,255,0.9);
  color: var(--ink);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 9px;
  border-radius: 999px;
}
.candidate-card .card-body h3 { font-family: 'Playfair Display', serif; }
.candidate-card .card-body .role { display:block; font-size: 0.76rem; color: var(--muted); margin-top: -4px; margin-bottom: 6px; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 40px;
}
.filter-chip {
  border: 1px solid var(--paper-line);
  background: var(--paper);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.filter-chip:hover { border-color: var(--gold); transform: translateY(-1px); }
.filter-chip:active { transform: scale(0.96); }
.filter-chip.active { background: var(--ink); color: var(--gold-light); border-color: var(--ink); }

/* ================= Timeline (Contest page) ================= */
.timeline { max-width: 720px; margin: 0 auto; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 18px; top: 6px; bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--gold) 8%, var(--gold) 92%, transparent);
}
.timeline-item { position: relative; padding-left: 52px; margin-bottom: 40px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
  position: absolute; left: 10px; top: 4px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--gold);
  transition: transform 0.3s ease, background 0.3s ease;
}
.timeline-item.revealed .timeline-dot { background: var(--gold); transform: scale(1.15); }
.timeline-item h3 { margin: 0 0 6px; font-size: 1.1rem; }
.timeline-item .when { font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rose-deep); font-weight: 600; display: block; margin-bottom: 6px; }
.timeline-item p { margin: 0; color: var(--muted); line-height: 1.7; }

/* ================= Home: news carousel (auto-swipes right to left) ================= */
.news-carousel { max-width: 1060px; margin: 0 auto; overflow: hidden; }
.news-carousel-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(.4,0,.2,1);
}
.news-carousel-track .news-story {
  flex: 0 0 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 820px) {
  .news-carousel-track .news-story { grid-template-columns: 1fr; gap: 24px; }
}

.news-carousel-dots { display: flex; justify-content: center; gap: 9px; margin-top: 36px; }
.news-carousel-dot {
  width: 8px; height: 8px; padding: 0; border: none; border-radius: 50%;
  background: var(--paper-line); cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.news-carousel-dot:hover { background: var(--rose); }
.news-carousel-dot.active { background: var(--rose-deep); transform: scale(1.3); }

.pinned-flag {
  display: inline-block;
  margin-left: 8px;
  background: var(--rose);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 9px;
  border-radius: 999px;
  vertical-align: middle;
}

.news-story-media {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--paper-soft), #EEE7D9);
}
.news-story-media img,
.news-story-media svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transition: transform 0.5s ease;
}
.news-story:hover .news-story-media img,
.news-story:hover .news-story-media svg { transform: scale(1.04); }

.news-story-body .card-tag { margin-bottom: 12px; }
.news-story-body h3 {
  margin: 0 0 14px;
  font-size: clamp(1.3rem, 2.8vw, 1.8rem);
  line-height: 1.25;
}
.news-story-body p { margin: 0 0 16px; color: var(--muted); font-size: 1rem; line-height: 1.8; }
.news-story-body .card-meta { margin: 0; }

/* ================= Our team ================= */
.team-grid {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
@media (max-width: 900px) { .team-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .team-grid { grid-template-columns: 1fr; } }

.team-member { text-align: center; }
.team-photo {
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
  border-radius: 50%;
  margin: 0 auto 18px;
  max-width: 190px;
  background: linear-gradient(160deg, #463E35, #333130);
}
.team-photo img, .team-photo svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.team-photo img { object-position: center 20%; }
.team-member h3 { margin: 0 0 4px; font-size: 1.08rem; }
.team-member .team-role {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rose-deep);
  font-weight: 600;
  margin-bottom: 6px;
}
.team-member a { font-size: 0.85rem; color: var(--muted); word-break: break-all; }
.team-member a:hover { color: var(--gold-dark); }

/* ================= Sponsors page ================= */
.sponsor-grid {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
@media (max-width: 820px) { .sponsor-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .sponsor-grid { grid-template-columns: 1fr; } }

.sponsor-card {
  background: #fff;
  border: 1px solid var(--paper-line);
  border-radius: 6px;
  padding: 34px 26px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sponsor-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.sponsor-logo {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.sponsor-logo img { max-height: 78px; max-width: 100%; width: auto; object-fit: contain; }
.sponsor-card h3 { margin: 0; font-size: 1.05rem; }
/* The whole card is the link when the sponsor has a website */
a.sponsor-card { display: block; text-decoration: none; color: inherit; }
a.sponsor-card:hover { border-color: var(--rose); }
a.sponsor-card:focus-visible { outline: 2px solid var(--rose-deep); outline-offset: 3px; }
a.sponsor-card:hover h3 { color: var(--rose-deep); }

/* ================= Past winners strip ================= */
.winners-scroll {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  padding: 4px 4px 18px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.winner-card {
  flex: 0 0 190px;
  scroll-snap-align: start;
  background: var(--paper);
  border: 1px solid var(--paper-line);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.winner-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.winner-photo {
  aspect-ratio: 3/4;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #463E35, #333130);
}
.winner-photo img,
.winner-photo svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.winner-photo img { object-position: center 20%; }
.winner-year {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: rgba(42,42,42,0.82);
  color: var(--gold-light);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
}
.winner-body { padding: 14px 16px 18px; text-align: center; }
.winner-body h3 { margin: 0 0 4px; font-size: 0.98rem; line-height: 1.3; }
.winner-body span { font-size: 0.78rem; color: var(--muted); }

/* ================= Partners strip ================= */
.partners-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 44px 56px;
}
.partner-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}
.partner-item img {
  max-height: 58px;
  max-width: 170px;
  width: auto;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.62;
  transition: filter 0.25s ease, opacity 0.25s ease;
}
.partner-item:hover img { filter: grayscale(0); opacity: 1; }
.partner-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ================= History page (editorial layout) ================= */
.hist-section { padding: 96px 0; }
.hist-section.alt { background: var(--paper-soft); }
@media (max-width: 700px) { .hist-section { padding: 60px 0; } }

.hist-head { max-width: 1160px; margin: 0 auto 56px; padding: 0 24px; }
.hist-head .eyebrow { margin-bottom: 14px; }
.hist-head h2 {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.hist-head .hist-sub {
  margin: 18px 0 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

/* Narrative prose */
.hist-prose { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.hist-lead {
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 32px;
  font-weight: 400;
}
.hist-prose p { margin: 0 0 24px; color: var(--muted); font-size: 1.02rem; line-height: 1.9; }
.hist-prose p:last-child { margin-bottom: 0; }
.hist-prose strong { color: var(--ink); font-weight: 600; }
.hist-prose abbr { text-decoration: none; border-bottom: 1px dotted var(--gold); cursor: help; }

/* Leadership — full-width alternating editorial rows */
.hist-leader {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 56px;
  align-items: center;
}
.hist-leader + .hist-leader { margin-top: 88px; }
.hist-leader.reverse .hist-leader-media { order: 2; }
@media (max-width: 820px) {
  .hist-leader { grid-template-columns: 1fr; gap: 28px; }
  .hist-leader + .hist-leader { margin-top: 56px; }
  .hist-leader.reverse .hist-leader-media { order: 0; }
}

.hist-leader-media {
  position: relative;
  aspect-ratio: 300/340;
  overflow: hidden;
  border-radius: 4px;
  background: linear-gradient(160deg, #463E35, #333130);
}
.hist-leader-media svg,
.hist-leader-media .img-slot-real { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hist-leader-media .img-slot-real { object-position: center 20%; }

.hist-leader-role {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--rose-deep);
  margin-bottom: 16px;
}
.hist-leader-body h3 {
  margin: 0 0 10px;
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.5rem, 3.2vw, 2.2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.hist-leader-years {
  margin: 0 0 22px;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  color: var(--gold-dark);
  font-weight: 600;
}
.hist-leader-body p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.85;
}

/* Timeline — stacked full-width entries with oversized years */
.hist-search { max-width: 1160px; margin: 0 auto 20px; padding: 0 24px; }
.hist-search input {
  width: 100%;
  max-width: 480px;
  padding: 14px 18px;
  background: var(--paper);
  border: 1px solid var(--paper-line);
  border-radius: 2px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.94rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.hist-search input:focus {
  border-color: var(--rose-deep);
  box-shadow: 0 0 0 3px rgba(161,113,133,0.13);
}
.hist-noresults { margin: 16px 0 0; color: var(--muted); font-size: 0.95rem; }

/* Horizontal timeline — years run left to right along a single rail */
.hist-timeline {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px 20px;
  display: flex;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.hist-entry {
  flex: 0 0 290px;
  scroll-snap-align: start;
  position: relative;
  padding: 46px 28px 8px 0;
  border-top: 1px solid var(--paper-line);
}
.hist-entry::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--gold);
}
.hist-entry.filtered-out { display: none; }
@media (max-width: 600px) { .hist-entry { flex-basis: 240px; padding-right: 20px; } }

.hist-year {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--gold-dark);
}
.hist-year small {
  display: block;
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.hist-entry h3 {
  margin: 14px 0 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.25;
}
.hist-entry p { margin: 0; color: var(--muted); font-size: 0.94rem; line-height: 1.8; }

/* ================= Rules / requirements list ================= */
.req-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  max-width: 760px;
  margin: 0 auto;
}
@media (max-width: 640px) { .req-grid { grid-template-columns: 1fr; } }
.req-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--paper);
  border: 1px solid var(--paper-line);
  border-radius: 6px;
  padding: 18px 20px;
}
.req-item svg { width: 20px; height: 20px; flex: none; margin-top: 2px; fill: var(--gold-dark); }
.req-item p { margin: 0; font-size: 0.92rem; color: var(--ink); line-height: 1.55; }

/* ================= CTA band ================= */
.cta-band {
  background:
    radial-gradient(560px 320px at 50% 0%, rgba(200,136,163,0.16), transparent 70%),
    var(--ink);
  color: #fff;
  padding: 64px 0;
  text-align: center;
}
.cta-band h2 { color: #fff; margin: 0 0 14px; font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
.cta-band p { color: rgba(255,255,255,0.65); max-width: 520px; margin: 0 auto 30px; line-height: 1.7; }
.cta-band .btn-gold { background: var(--gold-light); border-color: var(--gold-light); color: var(--ink); }
.cta-band .btn-gold:hover { background: #fff; border-color: #fff; }

/* ================= Contact page ================= */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  max-width: 980px;
  margin: 0 auto;
}
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info h3 { margin: 0 0 10px; font-size: 1.2rem; }
.contact-info p { color: var(--muted); line-height: 1.7; margin: 0 0 26px; }
.contact-item { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.contact-item svg { width: 20px; height: 20px; flex: none; fill: var(--gold-dark); margin-top: 2px; }
.contact-item strong { display: block; font-size: 0.92rem; }
.contact-item span { font-size: 0.88rem; color: var(--muted); }

/* ================= Page header (inner pages) ================= */
.page-header {
  padding: 56px 0 40px;
  text-align: center;
  background: linear-gradient(180deg, var(--paper), var(--paper-soft) 55%, var(--paper-soft) 100%);
  border-bottom: 1px solid var(--paper-line);
}
.page-header .eyebrow { margin-bottom: 12px; }
.page-header h1 { margin: 0 0 12px; font-size: clamp(2rem, 4.4vw, 2.8rem); }
.page-header p { color: var(--muted); max-width: 560px; margin: 0 auto; line-height: 1.7; }

/* ================= Footer ================= */
.site-footer { background: var(--ink); color: rgba(255,255,255,0.72); padding: 60px 0 0; }
.footer-wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 44px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
@media (max-width: 800px) { .footer-wrap { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-wrap { grid-template-columns: 1fr; } }
.footer-brand .brand-word { color: #fff; }
.footer-brand p { margin-top: 14px; font-size: 0.86rem; line-height: 1.7; max-width: 280px; color: rgba(255,255,255,0.6); }
.footer-links h4, .footer-social h4 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.9);
  margin: 0 0 16px;
}
.footer-links a { display: block; font-size: 0.88rem; margin-bottom: 12px; color: rgba(255,255,255,0.6); transition: color 0.2s ease; }
.footer-links a:hover { color: var(--gold-light); }
.footer-bottom { padding: 22px 24px; text-align: center; font-size: 0.78rem; color: rgba(255,255,255,0.45); }

/* ---------- Socials ---------- */
/* Five icons now — let them wrap rather than squash on narrow screens */
.socials { display: flex; gap: 12px; flex-wrap: wrap; }
.socials a {
  width: 36px; height: 36px;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.8);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.socials a:hover { background: var(--gold-light); color: var(--ink); border-color: var(--gold-light); transform: translateY(-2px); }
.socials svg { width: 16px; height: 16px; fill: currentColor; }

/* ================================================================
   APPLICATION FORM (apply.html) — carried over from the original
   single-page flow, restyled to sit inside the standard page chrome.
   ================================================================ */
.apply-section { padding: 56px 0 90px; }

.screen { display: none; position: relative; z-index: 1; }
.screen.active { display: block; }

.form-wrap { width: 100%; max-width: 640px; margin: 0 auto; animation: form-in 0.5s ease both; }
@keyframes form-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold-dark);
  font-weight: 600;
  margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field input[type="date"],
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  background: var(--paper-soft);
  border: 1px solid var(--paper-line);
  color: var(--ink);
  font-family: 'Poppins', sans-serif;
  font-size: 0.94rem;
  border-radius: 3px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--rose-deep);
  box-shadow: 0 0 0 3px rgba(161,113,133,0.18); /* --rose-deep, #A17185 */
}
.field textarea { resize: vertical; min-height: 100px; }

.field.error input, .field.error textarea, .field.error select { border-color: var(--danger); }
.field-error-msg { color: var(--danger); font-size: 0.78rem; margin-top: 5px; display: none; }
.field.error .field-error-msg { display: block; }

.checkbox-field { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
.checkbox-field input { margin-top: 4px; }
.checkbox-field label { font-size: 0.85rem; color: var(--muted); line-height: 1.4; text-transform: none; font-weight: 400; }

.section-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 30px 0 20px;
  color: var(--rose-deep);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.section-divider::before, .section-divider::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--rose-soft), var(--rose-deep), var(--rose-soft), transparent);
}

.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.submit-row { text-align: center; margin-top: 8px; }
.form-msg { text-align: center; margin-top: 16px; font-size: 0.9rem; min-height: 1.2em; }
.form-msg.error { color: var(--danger); }

#thanksScreen { text-align: center; }
.thanks-inner { max-width: 520px; margin: 0 auto; }
.check-flourish {
  width: 70px; height: 70px; margin: 0 auto 22px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: var(--paper-soft);
  display: flex; align-items: center; justify-content: center;
  animation: pop-in 0.5s cubic-bezier(.2,.9,.3,1.3) both;
}
.check-flourish svg { width: 30px; height: 30px; fill: var(--rose-deep); }
@keyframes pop-in { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: scale(1); } }
#thanksScreen h2 { font-size: clamp(1.8rem, 4.4vw, 2.4rem); margin: 0 0 14px; }
#thanksScreen h2 em { font-family: 'Alex Brush', cursive; font-style: normal; color: var(--gold-dark); font-size: 1.25em; }
#thanksScreen p { color: var(--muted); line-height: 1.7; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ================= Page-image slots (managed from the admin panel) ================= */
.img-slot-real { width: 100%; height: 100%; object-fit: cover; display: block; }
.candidate-photo .img-slot-real { object-position: center 22%; }

/* ================= News card expand modal ================= */
.news-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.news-modal.open { opacity: 1; visibility: visible; }

.news-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(42,42,42,0.72);
}

.news-modal-panel {
  position: relative;
  z-index: 1;
  background: var(--paper);
  border-radius: 10px;
  width: 100%;
  max-width: 860px;
  max-height: 88vh;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(42,42,42,0.35);
  transform: scale(0.94) translateY(14px);
  transition: transform 0.3s cubic-bezier(.2,.8,.3,1.1);
  display: flex;
}
.news-modal.open .news-modal-panel { transform: scale(1) translateY(0); }
@media (max-width: 720px) {
  .news-modal-panel { flex-direction: column; max-height: 92vh; }
}

.news-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(42,42,42,0.85);
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.news-modal-close:hover { background: #1a1a1a; }

/* Media sits full-bleed against the panel's own edge (no padding),
   as its own side column — separate from the padded text column. */
.news-modal-media-col {
  flex: 0 0 40%;
  overflow-y: auto;
  background: var(--paper-soft);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.news-modal-media-col svg, .news-modal-media-col img {
  width: 100%;
  flex: 1 0 auto;
  min-height: 140px;
  object-fit: cover;
  display: block;
}
@media (max-width: 720px) {
  .news-modal-media-col { flex: 0 0 auto; max-height: 38vh; flex-direction: row; }
  .news-modal-media-col svg, .news-modal-media-col img { min-height: 0; height: 100%; }
}

.news-modal-content-col { flex: 1 1 auto; overflow-y: auto; padding: 28px 32px 34px; }
.news-modal-tag {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rose-deep);
  font-weight: 600;
  margin-bottom: 10px;
}
.news-modal-title { margin: 0 0 10px; font-size: clamp(1.4rem, 3vw, 1.9rem); }
.news-modal-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 18px; }
.news-modal-desc { color: var(--ink); line-height: 1.75; }
.news-modal-desc p { margin: 0 0 1.1em; }
.news-modal-desc p:last-child { margin-bottom: 0; }
.news-modal-desc strong, .profile-body strong { font-weight: 700; }
.news-modal-desc em, .profile-body em { font-style: italic; }
.news-modal-desc u, .profile-body u { text-decoration: underline; }
/* Rendered rich text (render_article_body()) shows up in both the news modal and
   the candidate modal — share the same heading/paragraph treatment. */
.news-modal-desc .article-heading,
.profile-body .article-heading {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--ink);
  line-height: 1.3;
  margin: 1.6em 0 0.45em;
}
.news-modal-desc .article-heading:first-child,
.profile-body .article-heading:first-child { margin-top: 0; }
.news-modal-desc h2.article-heading, .profile-body h2.article-heading { font-size: 1.5rem; }
.news-modal-desc h3.article-heading, .profile-body h3.article-heading { font-size: 1.22rem; }
.news-modal-desc h4.article-heading, .profile-body h4.article-heading {
  font-size: 1rem;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rose-deep);
}
/* A link inside article body text — the site-wide `a { color: inherit }`
   reset makes these invisible otherwise. Author-chosen colors (see
   news_render_link() in inc/news.php) override this via inline style. */
.news-modal-desc .article-link, .profile-body .article-link {
  color: var(--gold-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.news-modal-desc .article-link:hover, .profile-body .article-link:hover { color: var(--rose-deep); }

.gallery-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: rgba(42,42,42,0.75);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

/* ================= Gallery page ================= */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}
.gallery-tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  border: none;
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper-soft);
  cursor: pointer;
  padding: 0;
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}
.gallery-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.gallery-tile img, .gallery-tile svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(42,42,42,0.28);
  transition: background 0.2s ease;
}
.gallery-tile:hover .gallery-play { background: rgba(42,42,42,0.4); }
.gallery-play svg {
  width: 56px; height: 56px;
  fill: #fff;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}
.gallery-tile-meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 22px 14px 10px;
  background: linear-gradient(180deg, transparent, rgba(20,18,16,0.78));
  color: #fff;
  text-align: left;
  display: flex; flex-direction: column; gap: 2px;
}
.gallery-tile-year { font-weight: 700; font-size: 0.82rem; letter-spacing: 0.03em; }
.gallery-tile-caption { font-size: 0.74rem; opacity: 0.9; }

/* Gallery lightbox */
.gallery-modal {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.gallery-modal.open { opacity: 1; visibility: visible; }
.gallery-modal-backdrop { position: absolute; inset: 0; background: rgba(20,18,16,0.82); }
.gallery-modal-panel {
  position: relative; z-index: 1;
  background: var(--ink);
  border-radius: 10px;
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(0,0,0,0.5);
  transform: scale(0.94) translateY(14px);
  transition: transform 0.3s cubic-bezier(.2,.8,.3,1.1);
}
.gallery-modal.open .gallery-modal-panel { transform: scale(1) translateY(0); }
.gallery-modal-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 36px; height: 36px; border: none; border-radius: 50%;
  background: rgba(0,0,0,0.55); color: #fff; font-size: 1.5rem; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.gallery-modal-close:hover { background: rgba(0,0,0,0.8); }
.gallery-modal-media { width: 100%; aspect-ratio: 16/9; background: #000; }
.gallery-modal-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gallery-modal-media iframe { width: 100%; height: 100%; border: 0; display: block; }
.gallery-modal-caption {
  padding: 12px 20px; color: #fff; font-size: 0.85rem; opacity: 0.85;
}
.gallery-modal-caption:empty { display: none; }

/* ================= Candidate profile page ================= */
.profile-head { padding: 56px 0 28px; text-align: center; }
.profile-wilaya {
  display: block; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--rose-deep); font-weight: 600; margin-bottom: 10px;
}
.profile-head h1 { margin: 0; font-size: clamp(1.9rem, 4vw, 2.6rem); }
.profile-rule { width: 64px; height: 1px; background: var(--gold); margin: 20px auto 0; }
.profile-tagline {
  max-width: 560px; margin: 22px auto 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--muted);
}
.profile-tagline::before { content: "\201C"; }
.profile-tagline::after { content: "\201D"; }

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 44px;
  align-items: start;
}
@media (max-width: 800px) { .profile-layout { grid-template-columns: 1fr; } }

.profile-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.profile-photos:has(.profile-photo:only-child) { grid-template-columns: 1fr; }
.profile-photo {
  aspect-ratio: 3/4;
  border-radius: 6px;
  overflow: hidden;
  background: var(--paper-soft);
}
.profile-photo img, .profile-photo svg { width: 100%; height: 100%; object-fit: cover; display: block; }

.profile-body { color: var(--ink); line-height: 1.8; padding-top: 6px; }
.profile-body p { margin: 0 0 1.15em; }
.profile-body p:last-child { margin-bottom: 0; }
.profile-body strong { font-weight: 700; }
.profile-body em { font-style: italic; }
.profile-body u { text-decoration: underline; }

body.modal-lock { overflow: hidden; }

/* ================= Reduced motion ================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal-init { opacity: 1 !important; transform: none !important; }
}

/* ================= Apply: rules screen shown before the form ================= */
.rules-wrap { width: 100%; max-width: 760px; margin: 0 auto; animation: form-in 0.5s ease both; }
.rules-title { text-align: center; margin-bottom: 36px; }
.rules-title .eyebrow { display: block; margin-bottom: 8px; }
.rules-title h2 { margin: 0 0 12px; font-size: clamp(1.7rem, 3.6vw, 2.3rem); }
.rules-title p { margin: 0 auto; max-width: 540px; color: var(--muted); line-height: 1.7; }

.rules-list { border: 1px solid var(--paper-line); border-radius: 6px; background: #fff; padding: 8px 32px; }
.rule-block { padding: 26px 0; border-bottom: 1px solid var(--paper-line); }
.rule-block:last-child { border-bottom: none; }
.rule-block h3 { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; font-size: 1.15rem; }
.rule-num {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--gold); color: var(--gold-dark);
  font-family: 'Poppins', sans-serif; font-size: 0.8rem; font-weight: 600;
}
.rule-block ul { margin: 0; padding-left: 20px; color: var(--muted); }
.rule-block li { margin: 0 0 10px; line-height: 1.75; font-size: 0.96rem; }
.rule-block li:last-child { margin-bottom: 0; }
.rule-block li strong { color: var(--ink); font-weight: 600; }
@media (max-width: 560px) { .rules-list { padding: 4px 20px; } }

.rules-cta { text-align: center; margin-top: 32px; }
.rules-cta p { margin: 0 0 18px; color: var(--muted); font-size: 0.9rem; }

/* ================= Apply: yes/no choices, social rows, small extras ================= */
.label-note { text-transform: none; letter-spacing: 0; opacity: 0.7; font-weight: 400; }

.choice-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field .choice {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0; padding: 10px 18px;
  border: 1px solid var(--paper-line); border-radius: 3px;
  background: var(--paper-soft);
  font-size: 0.86rem; font-weight: 500; letter-spacing: 0; text-transform: none;
  color: var(--ink); cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.field .choice:hover { border-color: var(--rose-deep); }
.field .choice:has(input:checked) { border-color: var(--rose-deep); background: #fff; }
.field .choice input { margin: 0; accent-color: var(--rose-deep); }
.field.error .choice-row .choice { border-color: var(--danger); }

.social-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; margin-bottom: 10px; align-items: center; }
@media (max-width: 560px) { .social-row { grid-template-columns: 1fr auto; } .social-row .social-platform { grid-column: 1 / 2; } .social-row .social-username { grid-column: 1 / 2; } .social-row .social-remove { grid-column: 2; grid-row: 1 / 3; } }
.social-row input { width: 100%; padding: 12px 14px; background: var(--paper-soft); border: 1px solid var(--paper-line); border-radius: 3px; font-family: 'Poppins', sans-serif; font-size: 0.94rem; color: var(--ink); outline: none; }
.social-row input:focus { border-color: var(--rose-deep); box-shadow: 0 0 0 3px rgba(161,113,133,0.18); }
.field.error .social-row input { border-color: var(--danger); }
.social-remove { width: 36px; height: 36px; border: 1px solid var(--paper-line); border-radius: 50%; background: transparent; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.social-remove:hover { border-color: var(--danger); color: var(--danger); }
.btn-link { background: none; border: none; padding: 4px 0; color: var(--rose-deep); font-family: 'Poppins', sans-serif; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }

/* ================= Language switcher (a dropdown, right of Apply Now) ================= */
.lang-switch { position: relative; }
.lang-current {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink);
  background: none;
  border: 1px solid var(--paper-line);
  border-radius: 20px;
  padding: 7px 12px;
  cursor: pointer;
}
.lang-current:hover { border-color: var(--gold); color: var(--gold-dark); }
.lang-caret { width: 10px; height: 10px; fill: currentColor; transition: transform 0.15s ease; pointer-events: none; }
.lang-current[aria-expanded="true"] .lang-caret { transform: rotate(180deg); }
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: var(--paper);
  border: 1px solid var(--paper-line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  padding: 6px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lang-menu[hidden] { display: none; }
.lang-option { padding: 8px 10px; border-radius: 5px; font-size: 0.82rem; color: var(--ink); }
.lang-option:hover { background: var(--paper-soft); }
.lang-option.active { color: var(--gold-dark); font-weight: 600; }

/* Two instances render (mobile, inside the hamburger menu; desktop, beside Apply Now) — show one at a time. */
.nav-wrap > .lang-switch { display: block; }
#mainNav .lang-switch { display: none; margin-top: 10px; }
#mainNav .lang-menu { position: static; box-shadow: none; margin-top: 6px; }
@media (max-width: 860px) {
  .nav-wrap > .lang-switch { display: none; }
  #mainNav .lang-switch { display: block; }
}

/* ================= RTL (Arabic) ================= */
/* Flexbox/grid main-axis placement already mirrors on its own via dir="rtl" —
   only rules with a hardcoded physical side (left/right, margin-left, etc.)
   need an explicit override here. */
[dir="rtl"] { font-family: 'Cairo', 'Poppins', sans-serif; }
[dir="rtl"] .brand { margin-right: 0; margin-left: auto; }
[dir="rtl"] .brand-word em { margin-left: 0; margin-right: 4px; }
[dir="rtl"] .nav-link::after { transform-origin: right; }
[dir="rtl"] .lang-menu { right: auto; left: 0; }
@media (max-width: 860px) {
  [dir="rtl"] .main-nav { align-items: flex-end; }
}
[dir="rtl"] .candidate-photo .wilaya-badge { left: auto; right: 12px; }
[dir="rtl"] .winner-year { left: auto; right: 10px; }
[dir="rtl"] .gallery-badge { left: auto; right: 10px; }
[dir="rtl"] .news-modal-close { right: auto; left: 14px; }
[dir="rtl"] .gallery-tile-meta { text-align: right; }
[dir="rtl"] .pinned-flag { margin-left: 0; margin-right: 8px; }
[dir="rtl"] .rule-block ul { padding-left: 0; padding-right: 20px; }
[dir="rtl"] .hist-entry::before { left: auto; right: 0; }
[dir="rtl"] .hist-entry { padding: 46px 0 8px 28px; }
[dir="rtl"] .timeline::before { left: auto; right: 18px; }
[dir="rtl"] .timeline-item { padding-left: 0; padding-right: 52px; }
[dir="rtl"] .timeline-dot { left: auto; right: 10px; }

/* ================= Apply form: photo examples ================= */
.photo-example-field {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.photo-example-field .field { flex: 1 1 260px; margin-bottom: 0; }
.photo-example-img { flex: 0 0 120px; text-align: center; }
.photo-example-img img,
.photo-example-placeholder {
  width: 120px;
  height: 150px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--paper-line);
}
.photo-example-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-soft);
  color: var(--muted);
  font-size: 0.7rem;
  text-align: center;
  padding: 8px;
}
.photo-example-caption {
  display: block;
  margin-top: 6px;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
@media (max-width: 560px) {
  .photo-example-field { flex-direction: column; align-items: stretch; }
  .photo-example-img { flex: none; display: flex; align-items: center; gap: 12px; text-align: left; }
  .photo-example-img img, .photo-example-placeholder { width: 72px; height: 90px; }
  .photo-example-caption { margin-top: 0; }
}
[dir="rtl"] .photo-example-img { text-align: center; }
@media (max-width: 560px) {
  [dir="rtl"] .photo-example-img { text-align: right; }
}

.choose-body { max-width: 640px; margin: 0 auto 32px; color: var(--muted); font-size: 1.02rem; line-height: 1.7; }
.choose-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.phone-input { display: flex; align-items: stretch; }
.phone-input .phone-prefix {
  display: flex; align-items: center; padding: 0 14px;
  background: var(--paper-line); border: 1px solid var(--paper-line); border-right: none;
  color: var(--ink); font-family: 'Poppins', sans-serif; font-size: 0.94rem;
  border-radius: 3px 0 0 3px; direction: ltr;
}
.phone-input input { flex: 1; min-width: 0; border-radius: 0 3px 3px 0; direction: ltr; }
.field-hint { color: var(--danger); font-size: 0.8rem; margin-top: 6px; }
.field-hint a { color: var(--rose-deep); text-decoration: underline; }

.country-picker { position: relative; }
.country-current {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--paper-soft); border: 1px solid var(--paper-line); border-radius: 3px;
  color: var(--ink); font-family: 'Poppins', sans-serif; font-size: 0.94rem; text-align: start; cursor: pointer;
}
.country-current:focus { outline: none; border-color: var(--rose-deep); }
.country-menu {
  position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--paper-line); border-radius: 3px;
  box-shadow: var(--shadow-md); padding: 8px;
}
.country-search {
  width: 100%; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--paper-line);
  border-radius: 3px; font-family: 'Poppins', sans-serif; font-size: 0.9rem;
}
.country-list { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow-y: auto; }
.country-option {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 3px; cursor: pointer; font-size: 0.9rem; color: var(--ink);
}
.country-option:hover { background: var(--paper-soft); }
.country-option[hidden] { display: none; }
.country-option .country-flag { font-size: 1.15rem; }
.country-option .country-label { flex: 1; }
.country-option .country-dial { color: var(--muted); font-size: 0.82rem; direction: ltr; }
.country-option.is-disabled { color: #9a9a9a; cursor: not-allowed; background: transparent; }
.country-option.is-disabled .country-flag { filter: grayscale(1); opacity: 0.6; }
.country-info {
  border: 1px solid #b5b5b5; background: none; color: #7a7a7a; border-radius: 50%;
  width: 20px; height: 20px; font-size: 0.75rem; line-height: 1; cursor: pointer; padding: 0;
}
.country-note {
  display: none; position: absolute; left: 10px; right: 10px; top: 100%; z-index: 30;
  background: var(--ink); color: #fff; font-size: 0.78rem; padding: 8px 10px; border-radius: 3px; line-height: 1.5;
}
.country-note a { color: #F2C6D6; text-decoration: underline; }
.country-option.is-disabled:hover .country-note,
.country-option.is-disabled.is-open .country-note { display: block; }

.socials-light a { border-color: var(--paper-line); color: var(--ink); background: #fff; }
.socials-light a:hover { background: var(--gold-light); color: #fff; border-color: var(--gold-light); }
