:root {
  --green-dark: #2f5233;
  --green: #4a7c3f;
  --green-light: #e8f0e3;
  --orange: #c9622a;
  --text: #23291f;
  --text-muted: #5a6355;
  --bg: #fdfdfb;
  --surface: #ffffff;
  --border: #dfe3da;
  --radius: 10px;
  --max-width: 72rem;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  font-size: 17px;
}

body {
  margin: 0;
  font-family: "Roboto", -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: "Roboto", -apple-system, "Segoe UI", sans-serif;
  color: var(--green-dark);
  line-height: 1.25;
}

a {
  color: var(--green);
}

img {
  max-width: 100%;
  height: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--green-dark);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 100;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 3px solid var(--green-dark);
}

.site-banner {
  width: 100%;
  line-height: 0;
}
.site-banner__img {
  display: block;
  width: 100%;
  height: auto;
}

.site-header__bar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}
.site-logo {
  width: 44px;
  height: auto;
}
.site-title {
  display: block;
  font-size: 1.35rem;
  color: var(--green-dark);
}
.site-tagline {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: "Roboto", -apple-system, "Segoe UI", sans-serif;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  position: relative;
  cursor: pointer;
}
.menu-toggle::before {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  top: 12px;
  height: 2px;
  background: var(--text);
  box-shadow: 0 8px 0 var(--text), 0 16px 0 var(--text);
}

.main-nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--nav-bg);
  font-family: "Roboto", -apple-system, "Segoe UI", sans-serif;
  font-size: 0.95rem;
}

.main-nav > ul {
  flex: 1;
  list-style: none;
  margin: 0;
  padding: 0.25rem 0 0.6rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1.1rem;
}

.main-nav ul ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav li {
  position: relative;
}

.main-nav > ul > li > a {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  color: var(--text);
  border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.main-nav > ul > li.current > a,
.main-nav > ul > li > a:hover,
.main-nav > ul > li > a:focus {
  background: var(--green-light);
}

.submenu-toggle {
  display: none;
}

.main-nav li.has-children > ul {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 0.4rem;
  min-width: 15rem;
  z-index: 20;
}
.main-nav li.has-children:hover > ul,
.main-nav li.has-children:focus-within > ul {
  display: block;
}
.main-nav li.has-children ul li.has-children > ul {
  left: 100%;
  top: -0.4rem;
}
.main-nav li.has-children ul a {
  display: block;
  padding: 0.4rem 0.6rem;
  text-decoration: none;
  color: var(--text);
  border-radius: 6px;
  white-space: nowrap;
}
.main-nav li.has-children ul a:hover,
.main-nav li.has-children ul a:focus {
  background: var(--green-light);
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  padding: 0.4rem 0;
}

.search-form {
  position: relative;
  display: flex;
}
.search-form input[type="search"] {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.9rem;
  width: 11rem;
}
.search-form button {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.4rem;
  height: 1.4rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
}
.search-form button::before {
  content: "";
  display: block;
  width: 0.7rem;
  height: 0.7rem;
  margin: 0 auto;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  box-shadow: 0.5rem 0.5rem 0 -0.35rem var(--text-muted);
}
.search-results {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  list-style: none;
  padding: 0.35rem;
  width: 20rem;
  max-width: 80vw;
  max-height: 60vh;
  overflow-y: auto;
  z-index: 30;
}
.search-results li a {
  display: block;
  padding: 0.5rem 0.6rem;
  text-decoration: none;
  color: var(--text);
  border-radius: 6px;
}
.search-results li a:hover,
.search-results li a:focus {
  background: var(--green-light);
}
.search-results li a small {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.search-results .no-results {
  padding: 0.5rem 0.6rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.lang-switcher {
  display: flex;
  gap: 0.35rem;
  font-size: 0.82rem;
}
.lang-switcher a {
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}
.lang-switcher a[aria-current="true"] {
  color: var(--green-dark);
  font-weight: bold;
  background: var(--green-light);
}

/* Main content */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.page h1 {
  font-size: 1.9rem;
  margin-bottom: 1.25rem;
}

.entry-content table {
  border-collapse: collapse;
  max-width: 100%;
  margin: 1rem 0;
}
.entry-content td {
  vertical-align: top;
  padding: 0.5rem 0.9rem 0.5rem 0;
}
.entry-content img {
  border-radius: 6px;
}

/* Buttons — used in place of plain text hyperlinks throughout the site */
.btn {
  display: inline-block;
  padding: 0.55rem 1.15rem;
  background: var(--green-dark);
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid var(--green-dark);
}
.btn:hover,
.btn:focus {
  background: var(--green);
  border-color: var(--green);
}
.btn--ghost {
  background: transparent;
  color: var(--green-dark);
  margin-bottom: 1.5rem;
}
.btn--ghost:hover,
.btn--ghost:focus {
  background: var(--green-light);
}

/* Inline text links inside content areas read as small clickable pills rather
   than underlined hyperlinks. */
.entry-content a,
.fiche__desc a,
.species-search__intro a,
.site-footer a {
  display: inline-block;
  padding: 0.05rem 0.6rem;
  background: var(--green-light);
  color: var(--green-dark);
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
}
.entry-content a:hover,
.fiche__desc a:hover,
.species-search__intro a:hover,
.site-footer a:hover {
  border-color: var(--green);
  background: #fff;
}

/* Links that only wrap an image (thumbnails, logos) should not get the
   pill/button frame or hover treatment above. */
.entry-content a:has(> img),
.fiche__desc a:has(> img),
.species-search__intro a:has(> img),
.site-footer a:has(> img) {
  display: inline;
  padding: 0;
  background: none;
  border: none;
}
.entry-content a:has(> img):hover,
.fiche__desc a:has(> img):hover,
.species-search__intro a:has(> img):hover,
.site-footer a:has(> img):hover {
  border: none;
  background: none;
}

/* Quick-access tiles (e.g. the fruit-species grid) keep their card look even
   when used inside .entry-content, instead of inheriting the pill style above. */
.entry-content a.tile {
  display: block;
  padding: 1.25rem 1.4rem;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.entry-content a.tile:hover,
.entry-content a.tile:focus {
  background: var(--surface);
  border-color: var(--green);
}

/* Link cards (logo + title/site link + description or address), used for the
   partner/press links on the "Vidéos & Liens" page. Flex so cards wrap and
   reflow at any width instead of the fixed WordPress table layout. */
.link-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.link-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 16rem;
  gap: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.entry-content a.link-card__media {
  display: flex;
  align-self: flex-start;
}
.link-card__media img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100px;
  object-fit: contain;
}
.link-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.link-card__title {
  margin: 0;
  font-size: 1.05rem;
}
.entry-content a.link-card__title-link {
  display: inline;
  padding: 0;
  background: none;
  border: none;
  color: var(--green-dark);
  font-weight: 600;
  text-decoration: none;
}
.entry-content a.link-card__title-link:hover {
  background: none;
  border: none;
  text-decoration: underline;
}
.link-card__desc,
.link-card__address {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}
.link-card__contacts {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}
.link-card__contacts li {
  white-space: nowrap;
}

/* Badges (RGF-Gembloux / Trad-RGF) */
.badge {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  vertical-align: middle;
}
.badge--rgf {
  background: var(--green-light);
  color: var(--green-dark);
}
.badge--trad {
  background: #fbe6d6;
  color: var(--orange);
}

/* Variety fiche (photo left third / title + description right two-thirds) */
.page--fiche {
  max-width: 56rem;
  margin: 0 auto;
}
.fiche {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 2fr;
  gap: 1.75rem 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
/* `.fiche { display: grid }` above has the same specificity as the browser's
   default `[hidden] { display: none }` UA rule and would otherwise win as the
   later, author-stylesheet rule — showing every fiche at once regardless of
   the hidden attribute the search page relies on to swap the detail pane. */
.fiche[hidden] {
  display: none;
}
.fiche__media {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.fiche__media img {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
}
.fiche__media-placeholder {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  background: var(--green-light);
  border-radius: var(--radius);
}
.fiche__title {
  margin-top: 0;
  font-size: 1.6rem;
}
.fiche__desc {
  line-height: 1.75;
}
.fiche__desc p {
  margin: 0 0 0.7em;
}

@media (max-width: 700px) {
  .fiche {
    grid-template-columns: 1fr;
  }
  .fiche__media img,
  .fiche__media-placeholder {
    max-width: 240px;
  }
}

/* Species page: 1/3 search list + 2/3 fiche display */
.species-search__intro {
  color: var(--text-muted);
  max-width: 62ch;
}
.species-search {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.75rem;
  align-items: start;
  margin-top: 1.5rem;
}
.species-search__filter {
  width: 100%;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}
.species-search__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 32rem;
  overflow-y: auto;
  background: var(--surface);
}
.species-search__list li:not([hidden]) + li {
  border-top: 1px solid var(--border);
}
.species-search__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.9rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: var(--text);
}
.species-search__item:hover,
.species-search__item:focus-visible {
  background: var(--green-light);
}
.species-search__item[aria-selected="true"] {
  background: var(--green-dark);
  color: #fff;
}
.species-search__item[aria-selected="true"] .badge--rgf {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.species-search__item[aria-selected="true"] .badge--trad {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}
.species-search__empty {
  padding: 0.75rem 0.9rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.species-search__detail-pane .fiche {
  margin: 0;
}
.species-search__placeholder {
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
}

@media (max-width: 900px) {
  .species-search {
    grid-template-columns: 1fr;
  }
  .species-search__list {
    max-height: 18rem;
  }
}

/* Home */
.hero {
  text-align: center;
  padding: 2rem 1rem 2.5rem;
}
.hero__logo {
  margin-bottom: 1rem;
}
.hero h1 {
  font-size: 2.4rem;
  margin: 0 0 0.5rem;
}
.hero__tagline {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 40rem;
  margin: 0 auto;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.tile {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}
.tile:hover,
.tile:focus {
  border-color: var(--green);
  transform: translateY(-2px);
}
.tile h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  color: var(--green-dark);
}
.tile p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.home-video {
  margin: 2.5rem 0 1rem;
}

/* Embed facade (Maps / YouTube lazy load) */
.embed-facade {
  position: relative;
  aspect-ratio: 16 / 9;
  max-width: 40rem;
  background: var(--green-light) center/cover;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.embed-facade iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.embed-facade__btn {
  font-family: "Roboto", -apple-system, "Segoe UI", sans-serif;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.7rem 1.3rem;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.embed-facade__btn:hover {
  border-color: var(--green);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: "Roboto", -apple-system, "Segoe UI", sans-serif;
}
.site-footer a {
  color: var(--text-muted);
}

/* Mobile */
@media (max-width: 780px) {
  .menu-toggle {
    display: block;
  }
  .main-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 1rem;
  }
  .main-nav.is-open {
    display: flex;
  }
  .main-nav > ul {
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
  }
  .main-nav li.has-children > ul {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    padding-left: 1rem;
  }
  .main-nav li.has-children.is-open > ul {
    display: block;
  }
  .submenu-toggle {
    display: block;
    position: absolute;
    right: 0;
    top: 0;
    width: 2.4rem;
    height: 2.4rem;
    background: transparent;
    border: none;
    cursor: pointer;
  }
  .submenu-toggle::before {
    content: "▾";
    display: block;
    text-align: center;
    line-height: 2.4rem;
  }
  .nav-tools {
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
    margin-top: 0.5rem;
  }
  .search-form input[type="search"] {
    width: 100%;
  }
}
