/* =========================================================================
   Cards
   ========================================================================= */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-xl);
  overflow: hidden;
}
.card__media {
  position: relative;
  aspect-ratio: 384 / 487;
  overflow: hidden;
  border-radius: var(--r-xl);
  background: var(--syn-bg-soft);
}

/* Media entities render through a few nested wrappers, so the image is pinned
   to the tile rather than relying on an unbroken height:100% chain. */
.card__media img,
.feature__media img,
.teaser__media img,
.media-tile__media img,
.media-tile__media iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* For editors, contextual links wrap the media in a zero-height relative box,
   which would become the image's frame. */
:is(.card__media, .feature__media, .teaser__media, .media-tile__media) .contextual-region { position: static; }

.card__number {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--syn-orange);
}
.card__title { margin-bottom: 8px; font-size: 1.2rem; }
.card__text { font-size: 0.92rem; }
.card__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
}
.card__link:hover { text-decoration: none; }

/* Drupal wraps multi-value fields in a field div; letting it collapse keeps the
   paragraph items as direct grid children. */
.card-grid__items > *,
.features__items > *,
.numbered__items > * {
  display: contents;
}
/* The media band template wraps each item itself (.media-band__item), so its
   children must keep their boxes. */
.media-band__item .media-tile { width: 100%; }

/* Grid variant: image tiles with the crop name over the photo; the whole tile
   is the link. */
.card-grid__items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
/* The photo carries no text at rest; hovering slides a coloured panel over it
   with the crop name, its description and the link (Figma Card-9, 1392:4100). */
.card-grid--grid .card,
.card-grid--split .card { border-radius: 30px; }
.card-grid--grid .card__media,
.card-grid--split .card__media { border-radius: 30px; }
.card-grid--grid .card__media img,
.card-grid--split .card__media img { transition: transform 0.45s ease; }
.card-grid--grid .card:hover .card__media img,
.card-grid--split .card:hover .card__media img,
.card-grid--grid .card:focus-within .card__media img,
.card-grid--split .card:focus-within .card__media img,
.card-grid--grid .card.is-inview .card__media img { transform: scale(1.04); }

.card-grid--grid .card__body,
.card-grid--split .card__body {
  position: absolute;
  inset: 7.7% 7.7%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  border-radius: 44px;
  background: var(--syn-card-hover);
  color: #fff;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.card-grid--grid .card:hover .card__body,
.card-grid--split .card:hover .card__body,
.card-grid--grid .card:focus-within .card__body,
.card-grid--split .card:focus-within .card__body,
.card-grid--grid .card.is-inview .card__body { opacity: 1; }
/* Recette: tablets and touch screens show each crop's name and link at all
   times, so the cards read as links without a hover. With the panels always
   there, the photo stays still instead of zooming on hover or scroll. */
@media (max-width: 1024px), (hover: none) {
  .card-grid--grid .card__body,
  .card-grid--split .card__body { opacity: 1; }
  .card-grid--grid .card:is(:hover, :focus-within, .is-inview) .card__media img,
  .card-grid--split .card:is(:hover, :focus-within) .card__media img { transform: none; }
}

/* Each crop carries its own panel colour (Figma Card-9 variants). */
.card--brick .card__body { background: var(--syn-brick); }
.card--orange .card__body { background: var(--syn-orange); }
.card--teal .card__body { background: var(--syn-teal-ink); }

.card-grid--grid .card__title,
.card-grid--split .card__title {
  margin: 0 0 14px;
  color: #fff;
  font-size: 1.49rem;
  font-weight: 500;
}
.card-grid--grid .card__text,
.card-grid--split .card__text {
  max-width: 283px;
  color: #fff;
  font-size: 1rem;
  line-height: 1.35;
}
.card-grid--grid .card__link,
.card-grid--split .card__link {
  margin-top: 37px;
  font-size: 1.125rem;
  font-weight: 500;
}
/* Keeps the whole tile clickable while the label lives inside the panel. */
.card-grid--grid .card__link::before,
.card-grid--split .card__link::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}


@media (prefers-reduced-motion: reduce) {
  .card-grid--grid .card__media img,
  .card-grid--split .card__media img,
  .card-grid--grid .card__body,
  .card-grid--split .card__body { transition: none; }
}

/* Featured variant: the lead story of a listing page. */
.card-grid--featured .card-grid__items { grid-template-columns: 1fr; }
.card-grid--featured .card {
  display: grid;
  grid-template-columns: 650fr 550fr;
  gap: 60px;
  align-items: center;
  border-radius: 0;
  overflow: visible;
}
.card-grid--featured .card__media {
  aspect-ratio: 650 / 520;
  border-radius: var(--r-md);
}
.card-grid--featured .card__body { padding: 0; }
.card-grid--featured .card__meta {
  margin: 0 0 18px;
  color: var(--syn-green-600);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.card-grid--featured .card__title { margin-bottom: 18px; font-size: clamp(1.6rem, 2.8vw, 2.25rem); line-height: 1.3; }
.card-grid--featured .card__text { color: var(--syn-gray-500); font-size: 1rem; line-height: 1.6; }
.card-grid--featured .card__link {
  gap: 12px;
  margin-top: 28px;
  padding: 16px 26px;
  border-radius: 8px;
  background: var(--syn-green-500);
  font-size: 1rem;
}
.card-grid--featured .card__link:hover { background: var(--syn-green-600); }
.card-grid--featured .card__arrow {
  width: 24px; height: 24px;
  background: var(--icon-arrow-disc) center / contain no-repeat;
  -webkit-mask: none;
  mask: none;
}

/* Recette (Figma "Actualité à la une", 1139:7563): the heading's colours
   and sizes, a tighter photo with a soft shadow, a dark navy title, a grey
   summary, and a rounder button. */
.card-grid--featured .eyebrow { margin-bottom: 10px; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.05em; color: #eb8200; }
.card-grid--featured .section__title { font-size: clamp(1.75rem, 2.8vw, 2.5rem); font-weight: 600; line-height: 1.25; color: #131a27; }
.card-grid--featured .card { grid-template-columns: 648fr 488fr; gap: 64px; }
.card-grid--featured .card__media {
  aspect-ratio: 648 / 486;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 24px;
  box-shadow: 0 20px 42px -8px rgba(5, 18, 6, 0.15);
}
.card-grid--featured .card__meta { margin-bottom: 16px; font-size: 0.8125rem; letter-spacing: 0.02em; color: #009933; }
.card-grid--featured .card__title { margin-bottom: 16px; font-size: clamp(1.5rem, 2.2vw, 1.94rem); font-weight: 600; line-height: 1.32; color: #131a27; }
.card-grid--featured .card__text { color: #636e85; line-height: 26px; }
.card-grid--featured .card__link { margin-top: 16px; padding: 16px 24px; border-radius: 16px; background: #009933; font-size: 0.9375rem; font-weight: 500; }

/* The filter bar spans the grid; its own look lives in "Listing filters". */
.block-ref__content .views-exposed-form,
.block-ref__content .pager { grid-column: 1 / -1; }
.block-ref__content .views-exposed-form { margin-bottom: 40px; }

/* Pager */
.dealers__list .pager__items,
.block-ref__content .pager__items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 48px;
}
.dealers__list .pager__item a,
.block-ref__content .pager__item a {
  display: grid;
  place-items: center;
  min-width: 42px;
  padding: 10px 14px;
  border: 1px solid var(--syn-border);
  border-radius: 8px;
  color: var(--syn-ink);
  font-size: 0.95rem;
}
.dealers__list .pager__item.is-active a,
.block-ref__content .pager__item.is-active a {
  border-color: var(--syn-green-500);
  background: var(--syn-green-500);
  color: #fff;
}
.dealers__list .pager__item a:hover,
.block-ref__content .pager__item a:hover { text-decoration: none; border-color: var(--syn-green-500); }

/* Spotlight variant */
.card-grid--spotlight { background: var(--syn-bg-soft); }
.card-grid--spotlight .section__title { color: #03030f; font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; }
.spotlight {
  display: grid;
  grid-template-columns: 813fr 396fr;
  gap: 18px;
}
.spotlight__rest {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 22px;
}
/* Hovering a spotlight card zooms the photo and lights the number and button
   up in full amber (Figma 290:1911 feature card, 290:1914 compact cards). */
.spotlight .card {
  justify-content: flex-end;
  height: 100%;
  border-radius: 22px;
}
.spotlight .card__media {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
  border-radius: inherit;
}
.spotlight .card__media img {
  transform-origin: 50% 100%;
  transition: transform 0.5s ease;
}
.spotlight .card:hover .card__media img,
.spotlight .card:focus-within .card__media img,
.spotlight .card.is-inview .card__media img { transform: scale(1.06); }
.spotlight .card__media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0, 44, 34, 0.9) 0%, rgba(0, 44, 34, 0.4) 24%, rgba(0, 44, 34, 0) 51%);
}
.spotlight .card__body {
  position: relative;
  padding: 48px;
  color: #fff;
}
.spotlight .card__title { color: #fff; font-size: 2.25rem; font-weight: 700; line-height: 1.1; }
.spotlight .card__text { max-width: 545px; color: rgba(236, 253, 245, 0.9); font-size: 1.125rem; line-height: 1.55; }
.spotlight .card__number {
  font-family: var(--font-body);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(253, 171, 0, 0.55);
  transition: color 0.25s ease;
}
.spotlight .card:hover .card__number,
.spotlight .card:focus-within .card__number,
.spotlight .card.is-inview .card__number { color: var(--syn-amber); }

/* Feature button: the label rolls up and an identical copy (data-label)
   rolls in from below, while a white outline appears (Figma 288:1820). */
.spotlight__feature .card__link {
  overflow: hidden;
  gap: 14px;
  margin-top: 26px;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--syn-amber);
  font-size: 1rem;
  transition: border-color 0.25s ease;
}
.spotlight__feature .card__link:hover,
.spotlight__feature .card__link:focus-visible { border-color: #fff; text-decoration: none; }
.card__link-label {
  position: relative;
  display: inline-block;
  transition: transform 0.35s ease;
}
.spotlight__feature .card__link-label::after {
  content: attr(data-label);
  position: absolute;
  inset-inline-start: 0;
  top: 100%;
  padding-top: 14px;
  white-space: nowrap;
}
.spotlight__feature .card__link:hover .card__link-label,
.spotlight__feature .card__link:focus-visible .card__link-label {
  transform: translateY(calc(-100% - 14px));
}
.spotlight__feature .card { min-height: 600px; }
.spotlight__rest .card { min-height: 288px; }
.spotlight__rest .card__media::after {
  background: linear-gradient(0deg, rgba(0, 44, 34, 0.9) 12%, rgba(0, 44, 34, 0.2) 63%, rgba(0, 44, 34, 0) 76%);
}
.spotlight__rest .card__body { padding: 28px 32px; }
.spotlight__rest .card__number { font-size: 1.125rem; margin-bottom: 4px; }
.spotlight__rest .card__title { margin-bottom: 4px; font-size: 1.375rem; }
.spotlight__rest .card__text { font-size: 0.875rem; line-height: 1.45; }
/* Compact cards swap the text button for a round arrow. */
.spotlight__rest .card__link {
  justify-content: center;
  width: 40px; height: 40px;
  margin-top: 18px;
  padding: 0;
  gap: 0;
  border-radius: var(--r-pill);
  font-size: 0;
  background: rgba(255, 255, 255, 0.2);
  transition: background-color 0.25s ease;
}
.spotlight__rest .card:hover .card__link,
.spotlight__rest .card:focus-within .card__link,
.spotlight__rest .card.is-inview .card__link { background: var(--syn-amber); }

@media (prefers-reduced-motion: reduce) {
  .spotlight .card__media img,
  .card__link-label { transition: none; }
}

/* Numbered variant */
.card-grid--numbered {
  background: var(--syn-green-800);
  color: #fff;
  border-radius: var(--r-band) var(--r-band) 0 0;
}
.numbered {
  display: grid;
  grid-template-columns: minmax(0, 609px) minmax(0, 1fr);
  gap: 64px;
  align-items: start;
}
.numbered__media {
  align-self: stretch;
  min-height: 640px;
  border-radius: 24px;
  background-color: var(--syn-green-900);
  background-size: cover;
  background-position: center;
}
.numbered__panel { position: relative; padding-top: 24px; }
.numbered__title {
  color: #fff;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.01em;
}
.numbered__title .hl { color: var(--syn-green-400); }
.numbered__intro { max-width: 566px; margin-bottom: 36px; color: #fff; font-size: 1rem; line-height: 1.6; }
.numbered__items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* Recette: every row as tall as the tallest, so all cards match. */
  grid-auto-rows: 1fr;
  gap: 28px;
  width: calc(100% + 224px);
  margin-block: 60px 0; margin-inline: -224px 0;
}
/* Glass tiles that lift 18px on hover (Figma Component 40, 34:826). */
.numbered__items .card {
  padding: 30px 26px;
  border: 0.65px solid rgba(255, 255, 255, 0.38);
  border-radius: 14px;
  background: rgba(37, 55, 37, 0.37);
  -webkit-backdrop-filter: blur(25px);
  backdrop-filter: blur(25px);
  transition: transform 0.3s ease;
  height: 100%;
}
.numbered__items .card:hover,
.numbered__items .card:focus-within,
.numbered__items .card.is-inview { transform: translateY(-18px); }
@media (prefers-reduced-motion: reduce) {
  .numbered__items .card { transition: none; }
}
.numbered__items .card__media { display: none; }
.numbered__items .card__body { display: grid; grid-template-columns: 1fr auto; column-gap: 16px; }
.numbered__items .card__number {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
}
.numbered__items .card__title {
  grid-column: 1;
  grid-row: 1;
  margin-bottom: 14px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}
.numbered__items .card__text { grid-column: 1 / -1; color: rgba(255, 255, 255, 0.9); font-size: 0.94rem; line-height: 1.55; }

/* Card slider arrows (crop cards, spotlight, icon and panel cards, news): only on phones, where the row scrolls (the JS
   also hides each one at its end of the row). */
.card-grid__slider { position: relative; }
/* Scrollers the JS wraps around existing rows: no box of their own until
   the row turns into a slider, so the desktop layout is untouched. */
@media (min-width: 721px) {
  .card-grid__slider--wrap { display: contents; }
}
.card-grid__prev,
.card-grid__next { display: none; }
@media (max-width: 720px) {
  .card-grid__prev:not([hidden]),
  .card-grid__next:not([hidden]) {
    position: absolute;
    z-index: 3;
    top: 50%;
    display: block;
    width: 40px;
    height: 40px;
    margin-top: -24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 6px 18px rgba(17, 24, 39, 0.18);
    cursor: pointer;
  }
  .card-grid__prev { inset-inline-start: -6px; }
  .card-grid__next { inset-inline-end: -6px; }
  /* The Figma chevron points left; it is mirrored on the next arrow. */
  .card-grid__prev::after,
  .card-grid__next::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../../images/icon-chevron-green.svg") center / 9px 16px no-repeat;
  }
  .card-grid__next::after { transform: scaleX(-1); }
  .card-grid__prev:focus-visible,
  .card-grid__next:focus-visible { outline: 2px solid var(--syn-green-500); outline-offset: 2px; }
}

/* =========================================================================
   Actualités listing (Figma "Actualités - Listing page", 1139:7556). The
   page is the only one with the featured story, so it scopes these rules.
   ========================================================================= */
/* Hero: the photo framed as in the design (the tractor behind the title,
   not under the header), and the design's title and subtitle sizes. */
.page:has(.card-grid--featured) .hero { background-position: center 10%; }
.page:has(.card-grid--featured) .hero__title { font-size: clamp(2rem, 4.4vw, 3.4375rem); font-weight: 600; line-height: 1.164; }
.page:has(.card-grid--featured) .hero__subtitle { font-size: 1.1875rem; line-height: 26px; color: #fff; }
/* "À la une" heading and the featured story's meta line. */
.card-grid--featured .eyebrow { margin-bottom: 10px; line-height: 18px; }
.card-grid--featured .section__title { letter-spacing: 0; }
.card-grid--featured .card__meta { line-height: 19px; }
/* "Explorez nos actualités": a smaller heading over the filters. */
.page:has(.card-grid--featured) .block-ref .section__title { margin-bottom: 8px; font-size: clamp(1.6rem, 2.6vw, 2rem); line-height: 1.3125; letter-spacing: 0; color: #131a27; }
.page:has(.card-grid--featured) .block-ref .section__intro { font-size: 1rem; line-height: 24px; color: #636e85; }
