/*
  Fira Agrícola de Nules — page-specific styles.
  Built on top of ../styleguide/tokens.css + components.css.
  No navbar/footer here: both are shared Webflow elements added at deploy time.
*/

.fira {
  --fira-shadow-violet: 0 24px 48px -18px rgba(104, 86, 150, .45);
  --fira-shadow-violet-sm: 0 10px 22px -8px rgba(104, 86, 150, .35);
  --fira-shadow-pink: 0 14px 28px -10px rgba(211, 142, 199, .5);
  --fira-tint-violet: rgba(104, 86, 150, .06);
  --fira-tint-pink: rgba(211, 142, 199, .09);

  position: relative;
  font-family: var(--font-body);
  color: var(--color-grey-text);
  overflow-x: hidden;
}

html:has(.fira) {
  scroll-behavior: smooth;
}

/* Fixed film-grain layer — breaks the flat-vector look without adding any imagery */
.fira::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

@media (prefers-reduced-motion: reduce) {
  .fira * { transition: none !important; scroll-behavior: auto !important; }
}

.fira section {
  position: relative;
  padding-top: clamp(56px, 8vw, 96px);
  padding-bottom: clamp(64px, 9vw, 108px);
}

.fira h1, .fira h2, .fira h3 {
  font-family: var(--font-heading);
  color: var(--color-text);
  margin: 0;
  text-wrap: balance;
  letter-spacing: -0.015em;
}

.fira h2 {
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 600;
  max-width: 34ch;
  margin-bottom: 18px;
}

.fira h3 {
  margin-bottom: 12px;
}

.fira .lead {
  font-size: 18px;
  line-height: 155%;
  color: var(--color-body-copy);
  max-width: 56ch;
}

.fira .section-head {
  margin-bottom: 40px;
}

.fira time,
.fira .tabular {
  font-variant-numeric: tabular-nums;
}

.fira .btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
}

/* Interaction polish for the pink CTA from components.css */
.fira .button-pink {
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease;
  will-change: transform;
}
.fira .button-pink:hover { transform: translateY(-2px); box-shadow: var(--fira-shadow-pink); }
.fira .button-pink:active { transform: translateY(0) scale(.98); }

/* Secondary CTA — pill outline in the same family as the pink primary,
   instead of the site-wide square black button-primary (visually foreign here). */
.fira-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8.5px 30px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--color-violet);
  color: var(--color-violet);
  background: transparent;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), background-color .2s ease, box-shadow .25s ease;
}
.fira-btn-secondary:hover { background: var(--fira-tint-violet); transform: translateY(-2px); box-shadow: var(--fira-shadow-violet-sm); }
.fira-btn-secondary:active { transform: translateY(0) scale(.98); }

.fira-btn-secondary--inverse {
  border-color: rgba(255,255,255,.7);
  color: #fff;
}
.fira-btn-secondary--inverse:hover { background: rgba(255,255,255,.12); box-shadow: none; }

/* Placeholder media block — swap the element's background-image / <video> src
   for the real asset; the label stays informational only. */
.fira .placeholder {
  position: relative;
  display: flex;
  align-items: flex-end;
  background:
    radial-gradient(120% 140% at 15% 0%, rgba(211,142,199,.35), transparent 55%),
    linear-gradient(135deg, #5c4c88, #b874a8);
  border-radius: var(--radius-md);
  overflow: hidden;
  color: var(--color-violet);
  min-height: 160px;
}

/* Demo-only stock photography — swap for the real assets; the gradient
   overlay baked into the inline background-image keeps the label chip legible. */
.fira .placeholder--photo {
  background-size: cover;
  background-position: center;
}

.fira .placeholder::after {
  content: attr(data-label);
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 9px 13px;
  background: rgba(255,255,255,.92);
  border-radius: 7px;
  margin: 14px;
}

.fira .placeholder--play::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  clip-path: polygon(38% 30%, 38% 70%, 68% 50%);
  background-color: rgba(255,255,255,.92);
}
.fira .placeholder--play {
  align-items: center;
  justify-content: center;
}
.fira .placeholder--play::after { display: none; }

/* Retrospective cards (past editions) get the year itself as the graphic
   element — big, bold, alternating violet/pink — instead of a text chip. */
.fira .placeholder--year::after {
  content: attr(data-year);
  margin: 0;
  padding: 18px;
  background: none;
  border-radius: 0;
  font-size: clamp(34px, 6vw, 46px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 6px 24px rgba(10,6,20,.5);
}
.fira .placeholder--year:nth-child(odd)::after { color: var(--color-pink-soft); }

/* Wrapper only positions the ribbon — no box, no background, no crop.
   The shadow lives on the image itself so the poster's own shape reads
   as a print object sitting on the page, not a photo inside a card. */
.fira .frame {
  position: relative;
  width: 100%;
}
/* Small icon used on participate cards — thin custom line icons, 22px */
.fira-icon {
  width: 26px;
  height: 26px;
  color: var(--color-violet);
  flex: none;
}

/* Download chip */
.fira-download-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--color-muted);
  margin-top: 14px;
  padding: 7px 12px 7px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
}
.fira-download-note a { color: var(--color-violet); font-weight: 600; text-decoration: none; }
.fira-download-note a:hover { text-decoration: underline; }
.fira-icon--sm { width: 15px; height: 15px; color: var(--color-violet); }

/* 1. Hero */
.fira-hero {
  position: relative;
  min-height: 620px;
  display: flex;
  align-items: center;
  padding-top: clamp(96px, 12vw, 140px);
  padding-bottom: clamp(96px, 12vw, 140px);
  background-color: #241a3d;
  background-image:
    linear-gradient(155deg, rgba(36,26,61,.82) 0%, rgba(76,61,115,.7) 45%, rgba(122,95,156,.55) 100%),
    url("https://cdn.prod.website-files.com/631606b3cab71f735885dbb2/6aa28fbfb964653247b62c4a_hero-desktop.webp");
  background-size: cover;
  background-position: center;
  color: #fff;
  clip-path: polygon(0 0, 100% 0, 100% 94%, 0 100%);
}
@media (max-width: 640px) {
  .fira-hero {
    background-image:
      linear-gradient(155deg, rgba(36,26,61,.82) 0%, rgba(76,61,115,.72) 55%, rgba(122,95,156,.6) 100%),
      url("https://cdn.prod.website-files.com/631606b3cab71f735885dbb2/6aa28fc18a8d5daed80395c3_hero-mobile.webp");
  }
}

.fira-hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--container-max);
  padding: 0 var(--container-padding-x);
  margin: 0 auto;
}

.fira-hero__inner > * {
  max-width: 620px;
}

.fira-hero .fira-dates {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: var(--radius-pill);
  padding: 8px 18px 8px 14px;
  margin-bottom: 22px;
}
.fira-hero .fira-dates strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.fira-hero h1 {
  color: #fff;
  font-size: clamp(34px, 5.4vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.fira-hero p {
  color: rgba(255,255,255,.86);
  font-size: 18px;
  line-height: 155%;
  max-width: 52ch;
  margin: 20px 0 0;
}

/* 2. Info */
.fira-info .container {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 64px;
  align-items: center;
}

.fira-info__media {
  position: relative;
}

.fira-info__media .frame { min-height: 280px; }

/* 3. Activities */
.fira-activities {
  background: var(--color-surface-alt);
}

.fira-activities__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 24px;
  margin-top: 44px;
}
@media (max-width: 860px) { .fira-activities__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .fira-activities__grid { grid-template-columns: 1fr; } }

.fira-activity-card {
  position: relative;
}

.fira-activity-card .placeholder {
  aspect-ratio: 4/3;
  transition: transform .3s ease;
}
.fira-activity-card .placeholder::after { display: none; }
.fira-activity-card:hover .placeholder { transform: translateY(-4px); box-shadow: var(--fira-shadow-violet-sm); }

.fira-activity-card h3 {
  font-size: 17px;
}

.fira-activity-card__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.fira-activity-card__cta {
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.fira-activity-card__cta:hover { color: var(--color-pink); }

.fira-activity-card time {
  display: block;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-pink);
  margin-top: 6px;
}

/* 4. History */
.fira-history .container {
  display: grid;
  grid-template-columns: .95fr 1.05fr;
  gap: 64px;
  align-items: center;
}

.fira-history__media { order: -1; }

.fira-history p {
  margin: 0 0 16px;
  line-height: 160%;
}

.fira-history blockquote {
  margin: 24px 0;
  padding-left: 18px;
  border-left: 3px solid var(--color-pink);
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 140%;
}

.fira-history__media .placeholder {
  aspect-ratio: 16/10;
  box-shadow: var(--fira-shadow-violet-sm);
}

/* 5. Recognition */
.fira-recognition {
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(255,255,255,.08), transparent 60%),
    var(--color-violet);
  color: #fff;
}

.fira-recognition .container {
  display: grid;
  grid-template-columns: 1fr .85fr;
  gap: 56px;
  align-items: center;
}

.fira-recognition h2 { color: #fff; }

.fira-recognition p {
  color: rgba(255,255,255,.86);
  line-height: 160%;
  margin: 0 0 14px;
  max-width: 54ch;
}

.fira-recognition .seal {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.fira-recognition .seal__ring {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.7);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.12);
  flex: none;
  color: #fff;
}
.fira-recognition .seal__ring .fira-icon { color: #fff; }
.fira-recognition .seal__label {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 130%;
}

.fira-recognition__media img {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--fira-shadow-violet);
}

/* 6. Video gallery — real short clips, muted autoplay loops */
.fira-videos__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 44px;
}
@media (max-width: 860px) { .fira-videos__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .fira-videos__grid { grid-template-columns: 1fr; } }

/* No card box — the clip and its caption float directly on the section
   background; only the video itself carries rounding + shadow. */
.fira-video-card {
  margin: 0;
}
.fira-video-card video {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: #14101f;
  box-shadow: 0 14px 30px -16px rgba(20,15,35,.4);
  transition: box-shadow .25s ease, transform .25s ease;
}
.fira-video-card:hover video { transform: translateY(-3px); box-shadow: var(--fira-shadow-violet-sm); }
.fira-video-card figcaption {
  margin-top: 12px;
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text-ii);
}

/* Real posters — natural aspect ratio, never cropped, no mat. Width fills
   the column and height follows the artwork's own proportions. */
.fira-poster-img {
  display: block;
  width: 100%;
  height: auto;
  padding: 4px;
  background: var(--color-white);
  border-radius: 6px;
  box-shadow: var(--fira-shadow-violet);
}

.fira-history video {
  display: block;
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--fira-shadow-violet-sm);
  background: #14101f;
}

.fira-carousel__track {
  align-items: flex-end;
}

/* "Cartells d'anys anteriors" — Netflix-style: a big outlined year climbing
   the left edge of each poster, alternating violet/pink. */
.fira-carousel--years .fira-carousel__track {
  gap: 42px;
  /* scroll-snap-align:start on the first card would otherwise make the
     browser auto-scroll on load to cancel out any leading margin/padding
     (it snaps the item's own box, not the space before it) */
  scroll-snap-type: none;
  /* the track scrolls (overflow-x:auto implies overflow-y:auto too), which
     clips anything reaching past its own box — give the poster shadows and
     the number badges room so they don't get cut off at the bottom */
  padding-bottom: 24px;
}
/* The floating side-arrows (mid-image) would sit right on top of the big
   year numbers here — keep this carousel's controls as a plain row below
   the posters instead. */
.fira-carousel--years .fira-carousel__controls {
  position: static;
  transform: none;
  justify-content: center;
  gap: 14px;
  padding: 0;
  margin-top: 20px;
  pointer-events: auto;
}
.fira-carousel--years .fira-carousel__track > .fira-poster-card:first-child {
  margin-left: 30px;
}
/* Fixed height, auto width — every poster reads as the same size regardless
   of its own printed proportions (they range ~0.61–0.71 width/height). */
.fira-poster-card {
  position: relative;
  flex: 0 0 auto;
  height: clamp(200px, 30vw, 260px);
}
.fira-poster-card img {
  display: block;
  box-sizing: border-box;
  width: auto;
  height: 100%;
  border-radius: 5px;
  /* hairline outline so pale poster backgrounds don't bleed into the page */
  border: 1px solid var(--color-border);
  scroll-snap-align: start;
  box-shadow: 0 10px 24px -14px rgba(20,15,35,.4);
  transition: transform .2s ease, box-shadow .2s ease;
  position: relative;
  z-index: 1;
}
.fira-poster-card:hover img {
  transform: translateY(-3px);
  box-shadow: var(--fira-shadow-violet-sm);
}

.fira-poster-year {
  position: absolute;
  left: -22px;
  bottom: -6px;
  z-index: 2;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(40px, 6.5vw, 56px);
  line-height: .8;
  letter-spacing: -0.01em;
  padding: 12px 6px;
  border-radius: 10px;
  background: rgb(255 255 255 / 82%);
  color: var(--color-violet);
  opacity: .88;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
.fira-poster-card:nth-child(even) .fira-poster-year {
  color: var(--color-pink);
}

/* 7. Participate — bento grid, all 7 categories visible at once */
.fira-participate {
  background: var(--color-surface-grey);
}

.fira-participate > .container > .lead {
  margin-bottom: 44px;
}

.fira-participate__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

.fira-p-card {
  grid-column: span 2;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 26px;
  box-shadow: 0 1px 0 var(--color-border), 0 10px 24px -18px rgba(20,15,35,.25);
  transition: transform .25s ease, box-shadow .25s ease;
}
.fira-p-card:nth-child(odd) { background: linear-gradient(165deg, var(--fira-tint-violet), var(--color-white) 60%); }
.fira-p-card:nth-child(even) { background: linear-gradient(165deg, var(--fira-tint-pink), var(--color-white) 60%); }
.fira-p-card:hover { transform: translateY(-3px); box-shadow: var(--fira-shadow-violet-sm); }

.fira-p-card--lg { grid-column: span 4; }

.fira-p-card__icon {
  width: 22px;
  height: 22px;
  color: var(--color-violet);
  padding: 11px;
  background: rgba(255,255,255,.75);
  border-radius: 12px;
  box-sizing: content-box;
  margin-bottom: 16px;
  box-shadow: 0 1px 0 var(--color-border);
}

.fira-p-card h3 {
  font-size: 17.5px;
  margin-bottom: 8px;
}
.fira-p-card--lg h3 { font-size: 20px; }

.fira-p-card p {
  font-size: 14.5px;
  line-height: 154%;
  color: var(--color-body-copy);
  margin: 0 0 20px;
  flex: 1;
}
.fira-p-card--lg p { font-size: 15.5px; max-width: 46ch; }

.fira-p-card .fira-btn-secondary {
  align-self: flex-start;
  margin-top: auto;
  padding: 9px 20px;
  font-size: 14.5px;
}

@media (max-width: 900px) {
  .fira-p-card, .fira-p-card--lg { grid-column: span 3; }
}
@media (max-width: 600px) {
  .fira-p-card, .fira-p-card--lg { grid-column: span 6; }
}

/* 8 & 9 carousels */
.fira-carousel {
  position: relative;
  margin-top: 40px;
}

.fira-carousel__track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  scrollbar-width: none;
  cursor: grab;
}
.fira-carousel__track::-webkit-scrollbar { display: none; }

/* Click-and-drag ("grab") scrolling — is-dragging is toggled by script.js
   while the mouse button is held; snapping is suspended so the track
   follows the cursor instead of fighting it back to the nearest card. */
.fira-carousel__track.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  scroll-behavior: auto;
  user-select: none;
}

.fira-carousel__track .placeholder {
  flex: 0 0 clamp(220px, 32vw, 320px);
  aspect-ratio: 4/3;
  scroll-snap-align: start;
  box-shadow: 0 10px 24px -14px rgba(20,15,35,.4);
  transition: transform .2s ease, box-shadow .2s ease;
}
.fira-carousel__track .placeholder:hover {
  transform: translateY(-3px);
  box-shadow: var(--fira-shadow-violet-sm);
}

/* Real historic photos (carousel 8) reuse the same card sizing as the
   placeholder tiles above, but as actual <img> elements. Extra bottom
   padding on the track keeps the hover-lift shadow from being clipped
   by the scroll container. */
.fira-gallery .fira-carousel__track {
  padding-top: 10px;
  padding-bottom: 28px;
}
.fira-gallery .fira-carousel__track .fira-zoom-wrap {
  display: block;
  box-sizing: border-box;
  flex: 0 0 clamp(200px, 24vw, 280px);
  width: clamp(200px, 24vw, 280px);
  min-width: 0;
  max-width: clamp(200px, 24vw, 280px);
  aspect-ratio: 4/3;
  border-radius: var(--radius-md);
  /* hairline outline so pale/overexposed photos still read as a distinct
     tile instead of bleeding into the section background */
  border: 1px solid var(--color-border);
  scroll-snap-align: start;
  overflow: hidden;
  box-shadow: 0 10px 24px -14px rgba(20,15,35,.4);
  transition: transform .2s ease, box-shadow .2s ease;
}
.fira-gallery .fira-carousel__track .fira-zoom-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fira-gallery .fira-carousel__track .fira-zoom-wrap:hover {
  transform: translateY(-3px);
  box-shadow: var(--fira-shadow-violet-sm);
}

/* Arrows float over the images, vertically centered, pinned to each edge —
   not a separate control row underneath. */
.fira-carousel__controls {
  position: absolute;
  inset: 0 0 auto 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 6px;
  pointer-events: none;
  z-index: 3;
}

.fira-carousel__controls button {
  pointer-events: auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-violet);
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(20,15,35,.4);
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.fira-carousel__controls button:hover {
  background: var(--color-white);
  box-shadow: var(--fira-shadow-violet-sm);
  transform: translateY(-2px);
}
.fira-carousel__controls button:active { transform: translateY(0) scale(.94); }

.fira-poster__grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 56px;
  align-items: start;
}

.fira-poster__media {
  position: relative;
  max-width: 340px;
}

/* The "cartells d'anys anteriors" carousel now lives in its own full-width
   row below the content+poster grid, instead of squeezed into the narrow
   text column where a Netflix-scale carousel had no room to breathe. */
.fira-poster__previous {
  margin-top: var(--space-2xl);
}

.fira-poster__previous h3 {
  font-size: 19px;
  margin-bottom: 4px;
}

/* 10. Committee */
.fira-committee {
  background: var(--color-surface-alt);
}

.fira-committee__layout {
  margin-top: 44px;
}

.fira-committee__vocals ul {
  list-style: none;
  margin: 0;
  padding: 0;
  column-count: 2;
  column-gap: 32px;
}

.fira-committee__vocals li {
  break-inside: avoid;
  font-size: 15px;
  line-height: 175%;
  color: var(--color-text-ii);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 10px;
}

.fira-committee__vocals li small {
  display: block;
  font-size: 12.5px;
  color: var(--color-muted);
}

@media (max-width: 760px) {
  .fira-committee__vocals ul { column-count: 1; }
}

/* 11. Closing CTA */
.fira-closing {
  position: relative;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(70% 100% at 50% 120%, rgba(211,142,199,.35), transparent 60%),
    linear-gradient(160deg, #4c3d73, #241a3d);
  color: #fff;
}

.fira-closing h2 {
  color: #fff;
  font-size: clamp(28px, 3.8vw, 40px);
  max-width: 20ch;
  margin: 0 auto;
}

.fira-closing p {
  color: rgba(255,255,255,.86);
  max-width: 54ch;
  margin: 18px auto 0;
  line-height: 158%;
}

.fira-closing .btn-row { justify-content: center; }

.fira-closing__carousel {
  margin-top: 48px;
}
.fira-closing__carousel .fira-carousel__track {
  align-items: flex-end;
  /* generous top/bottom room so the hover lift + drop shadows never get
     clipped by the scroll container's own box */
  padding: 22px clamp(20px, 5vw, 60px) 30px;
  scroll-snap-type: none;
}
/* Real (lightbox-able) photos are wrapped in .fira-zoom-wrap by script.js;
   the hidden aria-hidden clones used for the seamless loop stay plain
   <img> — both need identical sizing. */
.fira-closing__carousel .fira-carousel__track img,
.fira-closing__carousel .fira-carousel__track .fira-zoom-wrap {
  flex: 0 0 auto;
  height: clamp(200px, 26vw, 300px);
  width: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 14px 30px -14px rgba(0,0,0,.55);
  transition: transform .2s ease;
}
.fira-closing__carousel .fira-carousel__track .fira-zoom-wrap {
  display: block;
  overflow: hidden;
  cursor: zoom-in;
}
.fira-closing__carousel .fira-carousel__track .fira-zoom-wrap img {
  height: 100%;
  width: auto;
  border-radius: 0;
  box-shadow: none;
}
.fira-closing__carousel .fira-carousel__track img:hover,
.fira-closing__carousel .fira-carousel__track .fira-zoom-wrap:hover { transform: translateY(-4px); }

/* Nav row below the photos, centered — not floating over them. */
.fira-closing__carousel .fira-carousel__controls {
  position: static;
  transform: none;
  justify-content: center;
  gap: 12px;
  padding: 0;
  margin-top: 24px;
  pointer-events: auto;
}
.fira-closing__carousel .fira-carousel__controls button {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.35);
  color: #fff;
}
.fira-closing__carousel .fira-carousel__controls button:hover {
  background: rgba(255,255,255,.26);
}

@media (prefers-reduced-motion: reduce) {
  .fira-closing__carousel .fira-carousel__track { scroll-behavior: auto; }
}

/* Responsive */
@media (max-width: 860px) {
  .fira-info .container,
  .fira-history .container,
  .fira-recognition .container,
  .fira-poster__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .fira-history__media,
  .fira-info__media { order: -1; }
  .fira-poster__media { order: -1; }
  .fira-hero { clip-path: polygon(0 0, 100% 0, 100% 97%, 0 100%); }
}

/* Solo en mobile: el vídeo de "Una tradició que forma part de Nules" pasa
   al final de la sección, después de todo el texto (en tablet se mantiene arriba). */
@media (max-width: 640px) {
  .fira-history__media { order: 1; }
}

@media (max-width: 480px) {
  .fira { --container-padding-x: 20px; }
  .fira-hero { min-height: 460px; padding-top: 72px; padding-bottom: 72px; }
  .fira-committee__vocals ul { column-count: 1; }
}

/* "Descobreix com era la Fira" — stays a horizontal carousel on phones too:
   one photo prominent with a peek of the next, arrows kept. */
@media (max-width: 640px) {
  .fira-gallery .fira-carousel__track .fira-zoom-wrap {
    flex-basis: 78vw;
    width: 78vw;
    max-width: 78vw;
  }
}

/* Lightbox — click any [data-lightbox] image to view it full size */
[data-lightbox] { cursor: zoom-in; }

.fira-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 8, 20, .92);
  padding: 40px;
}
.fira-lightbox[hidden] { display: none; }

.fira-lightbox__img {
  max-width: min(90vw, 900px);
  max-height: 86vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.6);
  background: #fff;
}

.fira-lightbox__close,
.fira-lightbox__prev,
.fira-lightbox__next {
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  transition: background-color .2s ease, transform .2s ease;
}
.fira-lightbox__close:hover,
.fira-lightbox__prev:hover,
.fira-lightbox__next:hover { background: rgba(255,255,255,.18); }
.fira-lightbox__close:active,
.fira-lightbox__prev:active,
.fira-lightbox__next:active { transform: scale(.94); }

.fira-lightbox__close { top: 24px; right: 24px; }
.fira-lightbox__prev { left: 24px; top: 50%; transform: translateY(-50%); }
.fira-lightbox__next { right: 24px; top: 50%; transform: translateY(-50%); }
.fira-lightbox__prev:active { transform: translateY(-50%) scale(.94); }
.fira-lightbox__next:active { transform: translateY(-50%) scale(.94); }

@media (max-width: 620px) {
  .fira-lightbox { padding: 16px; }
  .fira-lightbox__prev, .fira-lightbox__next { width: 38px; height: 38px; font-size: 16px; }
  .fira-lightbox__prev { left: 8px; }
  .fira-lightbox__next { right: 8px; }
  .fira-lightbox__close { top: 12px; right: 12px; }
}

/* ===== Scroll-in reveal ===============================================
   [data-reveal] elements start faded/offset and settle in once they enter
   the viewport (see script.js, IntersectionObserver). Cards get a small
   per-item stagger via the --reveal-delay custom property. */
.fira [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .5s cubic-bezier(.16,1,.3,1), transform .5s cubic-bezier(.16,1,.3,1);
  transition-delay: var(--reveal-delay, 0s);
}
.fira [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .fira [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ===== Carousel edge fade =============================================
   Masks the first/last ~40px of the track so cards don't cut off abruptly.
   The carousel wrapper carries data-edge="left"/"right"/"both"/"none" —
   kept in sync by script.js as the track scrolls — naming the side(s) that
   still have more content to reveal, so the fade only shows there. */
.fira-carousel[data-edge="both"] .fira-carousel__track {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
}
.fira-carousel[data-edge="left"] .fira-carousel__track {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px);
  mask-image: linear-gradient(90deg, transparent, #000 40px);
}
.fira-carousel[data-edge="right"] .fira-carousel__track {
  -webkit-mask-image: linear-gradient(270deg, transparent, #000 40px);
  mask-image: linear-gradient(270deg, transparent, #000 40px);
}
.fira-carousel[data-edge="none"] .fira-carousel__track {
  -webkit-mask-image: none;
  mask-image: none;
}

/* ===== Zoom-to-enlarge hover cue =======================================
   A small zoom-in badge fades in over any lightbox-triggering image on
   hover (or keyboard focus) to hint it opens larger. script.js adds this
   class to a wrapping span around plain <img data-lightbox> elements
   (historic and closing carousels) and to the card wrappers that already
   exist (.fira-poster-card, .frame). Two new pseudo-elements (scrim +
   badge) are used instead of touching the image's own properties, so
   nothing here can clobber each context's existing hover transitions. */
.fira-zoom-wrap {
  position: relative;
}
.fira-zoom-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  /* brand violet scrim, not a generic black one */
  background: rgba(104,86,150,.45);
  opacity: 0;
  transition: opacity .45s cubic-bezier(.16,1,.3,1);
  pointer-events: none;
  /* above .fira-poster-card img's own z-index:1 */
  z-index: 5;
}
.fira-zoom-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: rgba(255,255,255,.95);
  /* zoom-in: magnifying glass with a "+" — reads as "enlarge" rather than
     just "look" */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23685696' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M11 8v6M8 11h6M21 21l-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px;
  box-shadow: 0 8px 18px -6px rgba(20,12,35,.45);
  opacity: 0;
  transform: scale(.7);
  transition: opacity .45s cubic-bezier(.16,1,.3,1), transform .45s cubic-bezier(.16,1,.3,1);
  pointer-events: none;
  z-index: 6;
}
.fira-zoom-wrap:hover::before,
.fira-zoom-wrap:focus-within::before {
  opacity: 1;
}
.fira-zoom-wrap:hover::after,
.fira-zoom-wrap:focus-within::after {
  opacity: 1;
  transform: scale(1);
}
@media (prefers-reduced-motion: reduce) {
  .fira-zoom-wrap::before, .fira-zoom-wrap::after { transition: none; }
}
/* Match the scrim's corners to each context's own image radius. */
.fira-poster-card.fira-zoom-wrap::before { border-radius: 5px; }
.frame.fira-zoom-wrap::before { border-radius: 6px; }
