/* ============================================================
   HEKLA — Page Projets (listing)
   Le section-menu utilise exactement les mêmes règles CSS
   que sur la homepage (sticky dans float-nav.css) — aucun override.
   ============================================================ */


/* Padding haut de la liste */
.projets-list {
  padding-top: 20px;
  padding-bottom: 120px;
  position: relative;
  z-index: 1;
}

/* ── Marges latérales + espacement des bandes (listing seul) ── */
.projets-list .project-band {
  margin: 0 10px 6px;
}

@media (max-width: 768px) {
  /* Dégager la zone sous le filter-pill sticky (≈ 50px hauteur + 20px top + marge) */
  .projets-list { padding-top: 140px; padding-bottom: 80px; }
}

/* ============================================================
   FILTRE PROJETS
   État 1 : pill centrée (fond clair)
   État 2 : 3 cartes blanches côte à côte
   ============================================================ */

.projects-filter {
  padding: 20px 80px 40px;
  margin-top: -110px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 25;
  background: transparent;
  overflow: visible;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.projects-filter.is-hidden {
  opacity: 0;
  pointer-events: none;
}


/* ── État 1 : pill — glass identique au float-nav ────────── */
.filter-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  padding: 13px 26px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 100px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: var(--c-black, #111110);
  font-size: var(--fs-nav, 0.8125rem);
  font-family: var(--f-sans, 'Inter', sans-serif);
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.4s ease, background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.22);
  box-shadow:
    0 6px 32px rgba(0, 0, 0, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

/* Fond sombre détecté (hover bande orange) */
.filter-pill.is-light {
  color: var(--c-white, #fff);
  background: rgba(0, 0, 0, 0.18);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 4px 32px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}


.filter-pill em {
  font-style: normal;
  color: var(--c-black, #111110);
  font-family: var(--f-serif, 'Romie', Georgia, serif);
  transition: color 0.4s ease;
}

.filter-pill:hover em {
  color: var(--c-orange, #F26322);
}

.filter-pill.is-light em {
  color: var(--c-white, #fff);
}

.filter-pill.is-light:hover em {
  color: #a6b28b;
}

/* Badge compteur de filtres actifs */
.filter-pill__count {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--c-orange, #F26322);
  border-radius: 100px;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  margin-left: 10px;
  line-height: 1;
}

.filter-pill__count.has-count {
  display: inline-flex;
}

/* ── État 2 : panneaux ───────────────────────────────────── */
.filter-panels {
  display: none;
  width: auto;
  gap: 10px;
  align-items: stretch;
  pointer-events: auto;
}

.filter-panels.is-visible {
  display: flex;
}

/* Dernier panneau = containing block du bouton fermer */
.filter-panel--last {
  position: relative;
  overflow: visible;
}

/* Wrapper croix + pill reset — ancré à 15px du bord droit du dernier panneau */
.filter-controls {
  position: absolute;
  top: 0;
  left: calc(100% + 15px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 2;
}

/* Bouton fermer */
.filter-panels__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  color: var(--c-orange, #F26322);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transform-origin: center;
  transition: opacity 0.2s ease;
  opacity: 0.85;
}

/* Pill reset */
.filter-reset {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 100px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: var(--c-black, #111110);
  font-size: 0.6875rem;
  font-family: var(--f-sans, 'Inter', sans-serif);
  font-weight: 400;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.filter-reset.has-active {
  opacity: 0.85;
  pointer-events: auto;
}

.filter-reset:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.24);
}

.filter-reset.is-light {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.18);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.filter-reset.is-light:hover {
  color: #fff;
  background: rgba(0, 0, 0, 0.28);
}

.filter-panels__close svg {
  display: block;
  flex-shrink: 0;
  transition: transform 0.4s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
  will-change: transform;
  /* Évite les artefacts aux extrémités des lignes pendant la rotation */
  transform: translateZ(0);
}

.filter-panels__close:hover {
  opacity: 1;
}

.filter-panels__close:hover svg {
  transform: rotate(180deg);
}


/* Panneau individuel — glass identique au float-nav */
.filter-panel {
  flex: 0 0 160px;
  padding: 14px 28px 14px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* Fond sombre (hover bande orange) */
.filter-panel.is-light {
  background: rgba(0, 0, 0, 0.18);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 4px 32px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.filter-panel.is-light .filter-panel__title {
  color: var(--c-amber, #F5C118);
}

.filter-panel.is-light .filter-tag {
  color: rgba(255, 255, 255, 0.75);
}

.filter-panel.is-light .filter-tag.is-active {
  color: var(--c-amber, #F5C118);
}

@media (hover: hover) {
  .filter-panel.is-light .filter-tag:hover {
    color: var(--c-amber, #F5C118);
  }
}

.filter-panels__close.is-light {
  color: #fff;
}

.filter-panel__title {
  margin: 0 0 18px;
  font-size: 0.9375rem;   /* 15px */
  font-weight: 400;
  color: var(--c-orange, #F26322);
  font-family: var(--f-serif, 'Romie', Georgia, serif);
  letter-spacing: 0;
  text-transform: none;
}

.filter-panel__tags {
  display: flex;
  flex-direction: row;
  gap: 35px;
  overflow: hidden;
}

/* Tags filtrables — texte simple, pas de pill */
.filter-tag {
  display: block;
  padding: 5px 0;
  white-space: nowrap;
  background: none;
  border: none;
  color: var(--c-black, #111110);
  font-size: 0.875rem;    /* 14px */
  font-family: var(--f-sans, 'Inter', sans-serif);
  font-weight: 300;
  letter-spacing: 0;
  cursor: pointer;
  text-align: left;
  line-height: 1.5;
  transition: color 0.15s ease;
}

@media (hover: hover) {
  .filter-tag:hover {
    color: var(--c-orange, #F26322);
  }
}

.filter-tag.is-active {
  color: var(--c-orange, #F26322);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .projects-filter {
    padding: 40px 40px 0;
  }
}

@media (max-width: 768px) {
  .projects-filter {
    padding: 0 0 12px 0;
    position: sticky;
    top: 20px;
    z-index: 25;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .filter-pill {
    font-size: 15px;
    padding: 11px 20px;
    align-self: center;
  }

  /* État 2 : panneaux empilés, tags horizontaux */
  .filter-panels {
    flex-direction: column;
    gap: 6px;
    padding: 0 20px 4px;
    width: 100%;
    box-sizing: border-box;
  }

  .filter-panel {
    flex: none;
    width: 100%;
    padding: 10px 14px 12px;
    border-radius: 12px;
  }

  .filter-panel__title {
    font-size: 1.5rem;
    margin-bottom: 8px;
    letter-spacing: 0;
    text-transform: none;
  }

  /* Tags en ligne avec retour à la ligne */
  .filter-panel__tags {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 10px;
  }

  .filter-tag {
    font-size: 1.1rem;
    padding: 2px 0;
    line-height: 1.4;
    white-space: nowrap;
  }

  /* Séparateur visuel entre tags */
  .filter-tag:not(:last-child)::after {
    content: '·';
    margin-left: 10px;
    opacity: 0.3;
    pointer-events: none;
  }

  /* Contrôles en haut à droite, alignés avec les pills */
  .filter-panel--last { overflow: visible; }

  .filter-panels__close { order: 2; }
  .filter-reset         { order: 1; }

  .filter-controls {
    position: static !important;
    left: auto !important;
    top: auto !important;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 0 8px 0;
    width: 100%;
    box-sizing: border-box;
    pointer-events: auto;
  }
}
