/* Home-page feedback fixes (flagships). Loaded after restructure.css.
   Every rule is scoped to #flagships so LRF and Tafakkur pages are unaffected. */

/* ---------- 1. Festival intro: one left-aligned block ---------- */
#flagships .festival-section .festival-heading {
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}
#flagships .festival-section .festival-heading > .eyebrow {
  width: auto;
  margin: 0 0 18px;
  text-align: left;
}
/* Remove the stray decorative ornament on the festival eyebrow */
#flagships .festival-section .eyebrow::before,
#flagships .festival-section .eyebrow::after {
  content: none;
  display: none;
}
#flagships .festival-section .festival-heading h2 {
  margin: 0 0 22px;
  text-align: left;
}
#flagships .festival-section .festival-heading > p:not(.eyebrow) {
  max-width: 60ch;
  margin: 0 0 30px;
  text-align: left;
}
#flagships .festival-section .festival-heading > .btn {
  margin: 0;
}

/* ---------- 2. Edition archive cards ---------- */
#flagships .festival-section .festival-editions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
  margin-top: 56px;
}
#flagships .festival-section .festival-edition {
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-height: 380px;
  padding: 28px;
  overflow: hidden;
  text-align: left;
}
/* Label sits at the top, inside the padding */
#flagships .festival-section .festival-edition > .eyebrow {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 9px;
}
/* Arch outline: centred, inset from the label above and the footer row below */
#flagships .festival-section .festival-edition::before {
  content: '';
  position: absolute;
  top: 70px;
  bottom: 80px;
  left: 50%;
  right: auto;
  width: min(60%, 230px);
  transform: translateX(-50%);
  border: 1px solid #e8c16d4d;
  border-bottom: none;
  border-radius: 999px 999px 0 0;
  pointer-events: none;
}
/* Numeral centred inside the arch */
#flagships .festival-section .edition-number {
  position: absolute;
  top: 70px;
  bottom: 80px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: clamp(72px, 7vw, 104px);
  line-height: 1;
  letter-spacing: -.04em;
  text-align: center;
  pointer-events: none;
}
/* "Explore the festival" row pinned to the bottom, inside the padding */
#flagships .festival-section .festival-edition > span:last-child {
  position: relative;
  z-index: 1;
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  line-height: 1.4;
}

/* ---------- 3. Tafakkur: aligned photo and text column ---------- */
#flagships .tafakkur-home .split {
  align-items: center;
  gap: 72px;
}
#flagships .tafakkur-home .prose {
  text-align: left;
}
#flagships .tafakkur-home .prose > .eyebrow {
  margin: 0;
}
#flagships .tafakkur-home .prose h2 {
  margin: 22px 0 0;
  font-size: clamp(42px, 4vw, 56px);
  line-height: 1.12;
  padding: 0 .08em .14em 0;
  overflow: visible;
  text-align: left;
}

/* ---------- Mobile (<= 760px): stack cards one per row ---------- */
@media (max-width: 760px) {
  #flagships .festival-section .festival-editions {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 36px;
  }
  #flagships .festival-section .festival-edition {
    min-height: 300px;
    padding: 22px;
  }
  #flagships .festival-section .festival-edition > .eyebrow {
    font-size: 9px;
  }
  #flagships .festival-section .festival-edition::before {
    top: 58px;
    bottom: 64px;
    width: min(55%, 200px);
  }
  #flagships .festival-section .edition-number {
    top: 58px;
    bottom: 64px;
    font-size: 76px;
  }
  #flagships .festival-section .festival-edition > span:last-child {
    font-size: 9px;
  }
  #flagships .tafakkur-home .split {
    gap: 36px;
  }
  #flagships .tafakkur-home .prose h2 {
    font-size: 38px;
  }
}

/* ---------- 4. Tafakkur background: animated typographic layer ---------- */
/* Base colour is the existing flat green (#12563d from cinematic.css), with a faint gold glow added on top. */
#flagships .tafakkur-home {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse 55% 75% at 28% 50%, rgba(227,190,115,.13), rgba(227,190,115,0) 70%),
    #12563d;
}
#flagships .tafakkur-home > .wrap {
  position: relative;
  z-index: 1;
}
/* Outlined word band drifting slowly across the section */
#flagships .tafakkur-home::before {
  content: "TAFAKKUR · THINK DEEPLY · BUILD THOUGHTFULLY · TAFAKKUR · THINK DEEPLY · BUILD THOUGHTFULLY · ";
  position: absolute;
  top: 8%;
  left: 0;
  z-index: 0;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(90px, 14vw, 220px);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(227,190,115,.18);
  white-space: nowrap;
  letter-spacing: -.01em;
  pointer-events: none;
  will-change: transform;
  animation: tafakkur-drift 120s linear infinite;
}
/* Very large Arabic word, bottom-right, partly off-canvas */
#flagships .tafakkur-home::after {
  content: "تفكر";
  position: absolute;
  right: -4%;
  bottom: -16%;
  z-index: 0;
  font-family: 'Amiri', serif;
  font-size: clamp(220px, 30vw, 460px);
  line-height: 1;
  color: rgba(227,190,115,.06);
  white-space: nowrap;
  pointer-events: none;
  transform-origin: 50% 50%;
  animation: tafakkur-float 14s ease-in-out infinite alternate;
}
@keyframes tafakkur-drift {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes tafakkur-float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-2%, -4%, 0) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  #flagships .tafakkur-home::before,
  #flagships .tafakkur-home::after {
    animation: none;
  }
}
@media (max-width: 760px) {
  #flagships .tafakkur-home::before {
    font-size: clamp(56px, 16vw, 90px);
    top: 4%;
    -webkit-text-stroke-width: .8px;
  }
  #flagships .tafakkur-home::after {
    font-size: clamp(160px, 55vw, 230px);
    right: -10%;
    bottom: -10%;
  }
}

/* ---------- 5. Edition archive cards: texture, drifting outlined band, hover glow ---------- */
/* Layers, bottom to top: base colour, gold glow behind the numeral, faint star-tile pattern,
   then the drifting outlined band (::after, z 0), the existing arch (::before, z 1) and the text (z 2).
   The arch keeps its geometry; only a z-index is added to it. */
#flagships .festival-section .festival-edition {
  isolation: isolate;
  background-color: #11583e;
  background-image:
    radial-gradient(circle at 50% 50%, rgba(227,190,115,.16), rgba(227,190,115,0) 42%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 90 90'%3E%3Cg fill='none' stroke='%23e3be73' stroke-opacity='.08' stroke-width='1'%3E%3Cpath d='M45 4 L86 45 L45 86 L4 45 Z'/%3E%3Cpath d='M17 17 H73 V73 H17 Z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: auto, 90px 90px;
}
/* The base colour is set above, so restate the hover colour here (the cinematic hover rule loses to it) */
#flagships .festival-section .festival-edition:hover {
  background-color: #196b4a;
}
/* Arch stays where it was; z-index only puts it above the band */
#flagships .festival-section .festival-edition::before {
  z-index: 1;
}
/* Text layers sit above all decorations (label and footer are already positioned) */
#flagships .festival-section .festival-edition > .eyebrow,
#flagships .festival-section .festival-edition > span:last-child {
  z-index: 2;
}
/* Numeral is already absolutely positioned, so only its z-index is added */
#flagships .festival-section .festival-edition > .edition-number {
  z-index: 2;
}
/* Drifting outlined word band behind the arch; text repeated so -50% loops seamlessly */
#flagships .festival-section .festival-edition::after {
  content: "LRF 3.0 · LRF 3.0 · LRF 3.0 · LRF 3.0 · ";
  position: absolute;
  left: 0;
  bottom: 14%;
  z-index: 0;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(48px, 6vw, 84px);
  line-height: 1;
  letter-spacing: -.01em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(227,190,115,.16);
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(0) rotate(-8deg);
  will-change: transform;
  animation: edition-band 50s linear infinite;
}
/* Each card has its own edition text; the middle card drifts the other way */
#flagships .festival-section .festival-editions > a.festival-edition:nth-child(2)::after {
  content: "LRF 2.0 · LRF 2.0 · LRF 2.0 · LRF 2.0 · ";
  animation-duration: 60s;
  animation-direction: reverse;
}
#flagships .festival-section .festival-editions > a.festival-edition:nth-child(3)::after {
  content: "LRF 1.0 · LRF 1.0 · LRF 1.0 · LRF 1.0 · ";
  animation-duration: 45s;
}
/* Gentle gold breathing on the numeral, only while the card is hovered */
#flagships .festival-section .festival-edition:hover > .edition-number {
  animation: edition-breathe 4s ease-in-out infinite;
}
@keyframes edition-band {
  from { transform: translateX(0) rotate(-8deg); }
  to   { transform: translateX(-50%) rotate(-8deg); }
}
@keyframes edition-breathe {
  0%, 100% { text-shadow: 0 0 0 rgba(227,190,115,0); }
  50%      { text-shadow: 0 0 26px rgba(227,190,115,.28); }
}
@media (prefers-reduced-motion: reduce) {
  #flagships .festival-section .festival-edition::after,
  #flagships .festival-section .festival-edition:hover > .edition-number {
    animation: none;
  }
}
@media (max-width: 760px) {
  /* Stacked cards are narrower, so the band text is smaller */
  #flagships .festival-section .festival-edition::after {
    font-size: clamp(36px, 11vw, 56px);
    -webkit-text-stroke-width: .8px;
  }
}
