/* =========================================================
   RESOURCES — PAGE SCOPED STYLES
   File: assets/css/resources.css
   Goal: full color control via tokens + zero cross-page conflict
   Layer: pages
========================================================= */


/* ---------------------------------------------------------
   PAGE ROOT (scope)
--------------------------------------------------------- */
:where(.resources-page){
  background: var(--color-bg);
  font-family: var(--font-body);
  color: var(--color-dark);

  /* Local derived tokens (safe, reversible) */
  --res-white: var(--color-white);
  --res-text: var(--color-dark);

  /* Stronger primary for links/hover */
  --res-primary-strong: #0A6F7B; /* fallback */
  --res-primary-strong: color-mix(in srgb, var(--color-primary) 68%, #000);

  /* WAVE-safe link color (darker than primary) */
  --res-link-aa: #0A6F7B;

  /* Soft surfaces */
  --res-surface-muted: #f7f7f7; /* fallback */
  --res-surface-muted: color-mix(in srgb, var(--color-white) 92%, var(--color-dark) 8%);

  /* Subtle borders */
  --res-border: rgba(0,0,0,.08);

  /* Primary tints */
  --res-primary-tint-10: rgba(15,163,177,.10); /* fallback */
  --res-primary-tint-10: color-mix(in srgb, var(--color-primary) 10%, transparent);

  --res-primary-tint-25: rgba(15,163,177,.25); /* fallback */
  --res-primary-tint-25: color-mix(in srgb, var(--color-primary) 25%, transparent);

  /* Hero overlay */
  --res-hero-overlay: rgba(0,0,0,.35);
}

/* ---------------------------------------------------------
   SECTION SEPARATORS — Resources page only
   One divider BEFORE each main section
--------------------------------------------------------- */
:where(.resources-page) .resources-section::before,
:where(.resources-page) .resources-domains::before,
:where(.resources-page) .faq-section::before,
:where(.resources-page) .contact-cta::before{
  content: "";
  display: none;
}

/* ---------------------------------------------------------
   HERO — card on cream
--------------------------------------------------------- */
:where(.resources-page) .resources-hero{
  position: relative;
  width: 100%;
  max-width: 1400px;
  margin: 80px auto 120px;
  min-height: 580px;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;
  border-radius: 26px;
  box-shadow: 0 26px 48px rgba(0,0,0,.22);
  background: #000; /* image-loading safety */
}

/* Background image */
:where(.resources-page) .resources-hero-bg{
  position: absolute;
  inset: 0;
  z-index: 1;
}

:where(.resources-page) .resources-hero-bg img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Overlay */
:where(.resources-page) .resources-hero-overlay{
  position: absolute;
  inset: 0;
  background: var(--res-hero-overlay);
  z-index: 2;
}

/* Text container */
:where(.resources-page) .resources-hero-content{
  position: relative;
  z-index: 3;
  max-width: 900px;
  text-align: center;
  padding: 0 20px;
}

/* ---------------------------------------------------------
   HERO TEXT — FIX (match À propos spacing + readability)
   - Title = black pill
   - Lead = line chips (multi-line safe)
--------------------------------------------------------- */
:where(.resources-page) .resources-hero h1{
  font-family: var(--font-title);
  font-size: 48px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 18px;
  color: #fff;

  display: inline-block;
  background: rgba(0,0,0,.70);
  padding: .16em .34em;
  border-radius: 12px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

:where(.resources-page) .resources-hero-lead{
  font-size: 18px;
  line-height: 1.65;
  margin: 0 0 28px;
  color: #fff;

  display: inline-block;
  background: rgba(0,0,0,.48);
  padding: .14em .30em;
  border-radius: 12px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Buttons */
:where(.resources-page) .resources-hero .hero-ctas{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------
   GENERIC SECTION (Homepage style: cream background)
--------------------------------------------------------- */
:where(.resources-page) .resources-section{
  background: var(--color-bg);
  padding: 80px 40px;
  color: var(--color-dark);
}

:where(.resources-page) .resources-intro{
  text-align: center;
  margin-bottom: 50px;
}

:where(.resources-page) .section-label{
  display: inline-block;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 6px;

  color: var(--color-dark);
  background: var(--color-white);
  border: 1px solid var(--res-border);
  padding: 4px 10px;
  border-radius: 999px;
}

:where(.resources-page) .resources-title{
  font-family: var(--font-title);
  font-size: 36px;
  font-weight: 700;
  color: var(--color-dark);
  margin: 0 0 12px;
}

:where(.resources-page) .resources-subtitle{
  font-size: 16px;
  opacity: .9;
  margin: 0;
}

/* =========================================================
   GUIDES ESSENTIELS — FIGMA CARDS (stay white)
========================================================= */
:where(.resources-page) .resources-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
}

:where(.resources-page) .resource-card{
  background: var(--color-white);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.10);
}

:where(.resources-page) .resource-card--figma{
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

:where(.resources-page) .resource-figure{
  margin: 0;
  height: 220px;
  overflow: hidden;
}

:where(.resources-page) .resource-figure img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

:where(.resources-page) .resource-body{
  padding: 22px 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

:where(.resources-page) .resource-body .resource-tag{
  align-self: flex-start;
  background: color-mix(in srgb, var(--color-dark) 8%, transparent);
  color: var(--color-dark);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
}

:where(.resources-page) .resource-body h3{
  font-family: var(--font-title);
  font-size: 22px;
  line-height: 1.2;
  margin: 0;
  color: var(--color-dark);
}

:where(.resources-page) .resource-body p{
  margin: 0;
  color: var(--color-dark);
  font-size: 15px;
  line-height: 1.6;
}

:where(.resources-page) .resource-body .btn-gold{
  margin-top: auto;
}

@media (max-width: 1024px){
  :where(.resources-page) .resources-grid{
    grid-template-columns: 1fr;
    gap: 22px;
  }
  :where(.resources-page) .resource-figure{
    height: 240px;
  }
}

/* =========================================================
   VIE EN GRÈCE — MINI CARDS + LINKS
========================================================= */
:where(.resources-page) .resources-domains{
  background: var(--color-bg);
}

:where(.resources-page) .resources-domains-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

:where(.resources-page) .resources-domain-card{
  background: var(--color-white);
  border-radius: 20px;
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 210px;
}

:where(.resources-page) .resources-domain-card h3{
  font-family: var(--font-title);
  font-size: 20px;
  margin: 0 0 10px;
  color: var(--color-dark);
}

:where(.resources-page) .resources-domain-card p{
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 14px;
  color: var(--color-dark);
}

:where(.resources-page) .resources-domain-card.hover-lift{
  transition: transform var(--anim-speed-fast) var(--anim-ease), box-shadow var(--anim-speed-fast) var(--anim-ease);
}

:where(.resources-page) .resources-domain-card.hover-lift:hover{
  transform: translateY(-4px);
  box-shadow: var(--shadow-strong);
}

:where(.resources-page) .resources-domain-head{
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 10px;
}

:where(.resources-page) .resources-domain-icon{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  background: var(--color-bg);
  border: 1px solid var(--color-primary);
}

:where(.resources-page) .resources-domain-icon img{
  width: 20px;
  height: 20px;
  display: block;
}

/* ✅ FIX 1: Domain “button” links (WAVE contrast)
   WAVE shows inline style: color == background-color
   So we force black text ALWAYS (including hover/focus). */
:where(.resources-page) .resources-domain-card .resources-domain-link{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-title);
  text-decoration: none;

  background: var(--color-primary) !important;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-pill);
  padding: 8px 16px;

align-self: center;

  color: #111 !important; /* <- contrast fix */
  transition: transform var(--anim-speed-fast) var(--anim-ease), box-shadow var(--anim-speed-fast) var(--anim-ease);
}

:where(.resources-page) .resources-domain-card .resources-domain-link:link,
:where(.resources-page) .resources-domain-card .resources-domain-link:visited{
  color: #111 !important;
}

:where(.resources-page) .resources-domain-card .resources-domain-link:hover,
:where(.resources-page) .resources-domain-card .resources-domain-link:focus{
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong);
  color: #111 !important; /* <- DO NOT turn pink on turquoise */
}

:where(.resources-page) .resources-domain-card .resources-domain-link:focus-visible{
  outline: 3px solid var(--color-hot);
  outline-offset: 3px;
}

:where(.resources-page) .resources-domain-card .resources-domain-link *{
  color: inherit !important;
}

:where(.resources-page) .resources-domain-card--links{
  padding-bottom: 18px;
}

:where(.resources-page) .resources-domain-card--links .resources-links-list{
  list-style: none;
  padding: 0;
  margin: 6px 0 0;

  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ✅ FIX 2: Links list contrast (WAVE) */
:where(.resources-page) .resources-domain-card--links .resources-links-list a{
  font-size: 14px;
  font-weight: 600;
  color: var(--res-link-aa);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  border-bottom: none;

  transition: transform var(--anim-speed-fast) var(--anim-ease), color var(--anim-speed-fast) var(--anim-ease);
}

:where(.resources-page) .resources-domain-card--links .resources-links-list a:hover,
:where(.resources-page) .resources-domain-card--links .resources-links-list a:focus{
  color: var(--res-link-aa);
  transform: translateX(2px);
}

:where(.resources-page) .resources-domain-card--links .resources-links-list a:focus-visible{
  outline: 3px solid var(--color-hot);
  outline-offset: 3px;
}

/* =========================================================
   FAQ (HOMEPAGE STYLE: CREAM BACKGROUND)
========================================================= */
:where(.resources-page) .faq-section{
  background: var(--color-bg);
  padding: 80px 0;
  color: var(--color-dark);
}

:where(.resources-page) .faq-intro{
  text-align: center;
  margin-bottom: 40px;
}

:where(.resources-page) .faq-title{
  font-family: var(--font-title);
  font-size: 32px;
  font-weight: 700;
  color: var(--color-dark);
  margin: 0 0 8px;
}

:where(.resources-page) .faq-subtitle{
  font-size: 16px;
  color: var(--color-dark);
  opacity: 1;
  max-width: 640px;
  margin: 0 auto;
}

:where(.resources-page) .faq-list{
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

:where(.resources-page) .faq-item{
  background: var(--color-white);
  border-radius: 14px;
  border: 1px solid var(--res-border);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

:where(.resources-page) .faq-header{
  width: 100%;
  background: none;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px;
  cursor: pointer;
}

:where(.resources-page) .faq-header h3{
  margin: 0;
  font-family: var(--font-title);
  font-size: 18px;
  color: var(--color-dark);
}

:where(.resources-page) .faq-icon{
  font-size: 22px;
  transition: transform .3s ease;
  color: var(--color-dark);
}

:where(.resources-page) .faq-content{
  max-height: 0;
  overflow: hidden;
  padding: 0 24px;
  background: var(--color-white);
  transition: max-height .35s ease, padding .3s ease;
}

:where(.resources-page) .faq-content p{
  margin: 0;
  padding: 16px 0 6px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-dark);
}

/* ✅ FIX 3: FAQ links contrast (WAVE) */
:where(.resources-page) .faq-content a,
:where(.resources-page) .faq-content a:visited{
  color: var(--res-link-aa) !important;
  background: transparent !important;

  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

:where(.resources-page) .faq-content a:hover,
:where(.resources-page) .faq-content a:focus{
  color: var(--res-link-aa) !important;
  text-decoration: none;
  border-bottom: 2px solid var(--res-link-aa);
}

:where(.resources-page) .faq-content a:focus-visible{
  outline: 3px solid var(--color-hot);
  outline-offset: 3px;
}

:where(.resources-page) .faq-content ul{
  margin: 0 0 10px 18px;
  padding: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-dark);
}

:where(.resources-page) .faq-content li{
  margin-bottom: 4px;
}

:where(.resources-page) .faq-item.active .faq-content{
  max-height: 420px;
  padding: 0 24px 22px;
}

:where(.resources-page) .faq-item.active .faq-icon{
  transform: rotate(45deg);
}


/* =========================================================
   SUPPORT CTA — background image + overlay
========================================================= */
:where(.resources-page) .support-cta{
  position: relative;
  padding: 120px 0;
  color: var(--color-text-on-dark);
  text-align: center;
  background:
    linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.55)),
    url('../img/support-photo.webp') center/cover no-repeat;
}

:where(.resources-page) .support-cta-inner{
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

:where(.resources-page) .support-cta-text h2{
  font-family: var(--font-title);
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--color-text-on-dark);
}

:where(.resources-page) .support-cta-text p{
  font-size: 16px;
  line-height: 1.7;
  max-width: 750px;
  margin: 0 auto 32px;
  opacity: .95;
  color: var(--color-text-on-dark);
}

:where(.resources-page) .support-cta-actions{
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 8px;
  flex-wrap: wrap;
}

@media (max-width: 700px){
  :where(.resources-page) .support-cta{
    padding: 90px 16px;
  }
}

/* =========================================================
   RESPONSIVE — domains grid columns
========================================================= */
@media (max-width: 1200px){
  :where(.resources-page) .resources-grid{
    grid-template-columns: 1fr 1fr;
  }
  :where(.resources-page) .resources-domains-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px){
  :where(.resources-page) .resources-grid{
    grid-template-columns: 1fr;
  }
  :where(.resources-page) .resources-domains-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px){
  :where(.resources-page) .resources-section{
    padding: 60px 20px;
  }
  :where(.resources-page) .resources-domains-grid{
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   “Bande Contacter” text (explicit high contrast)
========================================================= */
:where(.resources-page) .resources-contact-text{
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-dark);
  opacity: 1;
  margin: 0 0 18px;
}

/* ======================================================
   HERO STANDARD — match HOME hero (size/position/spacing)
   Page: Ressources
   Safe override only (no deletions)
====================================================== */

:where(.resources-page) .resources-hero{
  width:calc(100% - 80px);
  max-width:1400px;
  margin:80px auto 120px;
  min-height:580px;
  border-radius:24px;
}

:where(.resources-page) .resources-hero-overlay{
  background:rgba(0,0,0,0.10);
}

:where(.resources-page) .resources-hero-content{
  max-width:900px;
  margin:0 16px;
  padding:0 20px;
  text-align:center;
}

/* Match HOME typography + pills */
:where(.resources-page) .resources-hero h1{
  font-size:56px;
  line-height:1.10;
  background:rgba(0,0,0,0.62);
  padding:.14em .36em;
  border-radius:12px;
}

:where(.resources-page) .resources-hero-lead{
  font-size:18px;
  line-height:1.65;
  max-width:760px;
  margin:0 auto 28px;
  background:rgba(0,0,0,0.55);
  padding:.22em .50em;
  border-radius:10px;
}

/* Responsive = same “frame” rules as HOME */
@media (max-width:900px){
  :where(.resources-page) .resources-hero{
    width:calc(100% - 32px);
    margin:60px auto 90px;
    min-height:480px;
    padding:40px 16px;
  }
  :where(.resources-page) .resources-hero h1{font-size:40px;}
  :where(.resources-page) .resources-hero-lead{font-size:16px;}
}

@media (max-width:600px){
  :where(.resources-page) .resources-hero{
    width:calc(100% - 28px);
    margin:40px auto 70px;
    min-height:520px;
    padding:24px 14px;
  }

  /* One clean dark card (same as HOME mobile) */
  :where(.resources-page) .resources-hero-content{
    width:min(92vw,560px);
    margin:0 auto;
    padding:18px 16px;
    border-radius:18px;
    background:rgba(0,0,0,0.56);
    backdrop-filter:blur(2px);
    -webkit-backdrop-filter:blur(2px);
  }

  /* Remove pills on mobile */
  :where(.resources-page) .resources-hero h1{
    font-size:clamp(30px,8.2vw,40px);
    line-height:1.12;
    margin:0 0 12px;
    background:transparent;
    padding:0;
    border-radius:0;
    -webkit-box-decoration-break:initial;
    box-decoration-break:initial;
  }

  :where(.resources-page) .resources-hero-lead{
    font-size:14px;
    line-height:1.55;
    margin:0 auto 18px;
    background:transparent;
    padding:0;
    border-radius:0;
    -webkit-box-decoration-break:initial;
    box-decoration-break:initial;
  }

  :where(.resources-page) .resources-hero .hero-ctas{
    flex-direction:column;
    gap:14px;
    max-width:320px;
    margin:0 auto;
  }
}


 /* end @layer pages */

/* =========================================================
   Resource filters (chips system)
   FIX: spacing + hierarchy + responsive wrap
   FIX: force chip text color against global a:hover !important (layer issue)
   Pages:
   - /ressources/
   - /annuaire-ressources/
   - /domaine-ressource/{term}/
========================================================= */


  /* 1) FILTERS WRAPPER */
  :where(.resources-page) .ac-filters{
    margin-top: clamp(14px, 2vw, 22px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  /* 2) CHIP GROUP */
  :where(.resources-page) .ac-filters__chips{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    column-gap: 10px;
    row-gap: 10px;
    max-width: 920px;
    width: 100%;
    padding: 6px 8px;
  }

  /* Back links group */
  :where(.resources-page) .ac-filters--back{ margin-top: 10px; }

  :where(.resources-page) .ac-filters__back{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  /* 3) CHIP */
  :where(.resources-page) .ac-chip{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 44px;
    padding: 10px 16px;
    border-radius: var(--radius-pill);

    background: var(--color-primary) !important;
    color: #111 !important;

    font-weight: 700;         /* 800 looks “shouty” on mobile */
    font-size: 0.95rem;
    line-height: 1.1;

    border: 2px solid rgba(0,0,0,0.10);
    box-shadow: var(--shadow-soft);

    text-decoration: none !important;
    transition:
      transform var(--anim-speed-fast) var(--anim-ease),
      filter var(--anim-speed-fast) var(--anim-ease);
  }

  /* Keep icon/text inside chip consistent (TranslatePress wrappers too) */
  :where(.resources-page) .ac-chip *{
    color: inherit !important;
    text-decoration: none !important;
  }

  :where(.resources-page) .ac-chip:hover{
    transform: translateY(-1px);
    filter: brightness(0.98);
  }

  :where(.resources-page) .ac-chip:focus-visible{
    outline: 3px solid var(--color-hot);
    outline-offset: 2px;
  }

  :where(.resources-page) .ac-chip--active{
    background: var(--color-gold) !important;
    color: #111 !important;
  }

  :where(.resources-page) .ac-chip--primary{
    background: var(--color-gold) !important;
    border-color: transparent;
    color: #111 !important;
  }

  :where(.resources-page) .ac-chip--ghost{
    background: transparent !important;
    box-shadow: none;
    border: 2px solid rgba(17,17,17,.18);
    color: #111 !important;
  }

  :where(.resources-page) .ac-chip--ghost:hover{
    background: rgba(62,193,211,0.12) !important;
    border-color: rgba(62,193,211,0.55);
  }

  /* 4) MOBILE */
  @media (max-width: 520px){
    :where(.resources-page) .ac-filters{ gap: 10px; }

    :where(.resources-page) .ac-filters__chips{
      max-width: 420px;
      padding: 6px;
      column-gap: 8px;
      row-gap: 8px;
    }

    :where(.resources-page) .ac-chip{
      min-height: 42px;
      padding: 10px 14px;
      font-size: 0.92rem;
    }
  }

  /* 5) TINY SCREENS */
  @media (max-width: 380px){
    :where(.resources-page) .ac-chip{
      padding: 10px 12px;
      font-size: 0.90rem;
    }
  }


/* =========================================================
   CRITICAL: Layer override for global a:hover !important
   Your global utilities layer likely sets a:hover color with !important,
   and utilities > pages in your layer order.
   So we win by overriding in utilities layer, but only for chips.
========================================================= */

  .resources-page .ac-filters__chips a.ac-chip,
  .resources-page .ac-filters__chips a.ac-chip:link,
  .resources-page .ac-filters__chips a.ac-chip:visited,
  .resources-page .ac-filters__chips a.ac-chip:hover,
  .resources-page .ac-filters__chips a.ac-chip:active,
  .resources-page .ac-filters__chips a.ac-chip:focus,
  .resources-page .ac-filters__chips a.ac-chip:focus-visible{
    color: #111 !important;
    text-decoration: none !important;
  }

  .resources-page .ac-filters__chips a.ac-chip:hover *{
    color: inherit !important;
  }

