/* ============================================================
   EVORIS — COQUILLE COMMUNE
   Reset, base, utilitaires, en-tête, pied de page, boutons,
   formulaires, tableaux, prose et bandeau de consentement.
   Chargée sur toutes les pages. Dépend de tokens.css.
   ============================================================ */

/* ---- Reset --------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  font-weight: 400;
  letter-spacing: -0.015em;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) ease;
}

a:hover {
  color: var(--accent, var(--vermilion));
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

input,
select,
textarea {
  font: inherit;
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

/* `[hidden]` ne pose que `display:none` via la feuille du navigateur : la
   moindre règle de classe posant un `display` l'emporte. On tranche ici,
   une fois pour toutes, pour tous les éléments masqués par JavaScript. */
[hidden] {
  display: none !important;
}

code {
  font-family: var(--font-mono);
  font-size: 0.87em;
}

::selection {
  background: var(--vermilion);
  color: var(--on-accent);
}

:focus-visible {
  outline: 2.5px solid var(--vermilion);
  outline-offset: 3px;
}

/* ---- Utilitaires --------------------------------------------- */
.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.section {
  padding-block: var(--sec-y);
}

.page {
  padding-block: var(--page-y) var(--page-y-end);
}

.rule-top {
  border-top: 1px solid var(--rule);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  background: var(--paper);
  color: var(--ink);
  padding: 12px 18px;
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  transition: top var(--dur-fast) ease;
}

.skip-link:focus {
  top: 16px;
}

/* ---- Typographie transverse ---------------------------------- */
.kicker {
  font-size: var(--fs-kicker);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent);
}

.label {
  font-size: var(--fs-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--faint);
}

.label--accent {
  color: var(--accent);
}

.display {
  font-family: var(--font-display);
  line-height: 0.98;
}

.intro {
  font-size: var(--fs-intro);
  line-height: 1.55;
  color: var(--muted);
  max-width: 44ch;
}

.sec-head {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: var(--gap-head);
  align-items: end;
  margin-bottom: clamp(40px, 5vw, 64px);
}

.sec-head__kicker {
  margin-bottom: 18px;
}

.sec-head__title {
  font-size: var(--fs-h2);
}

/* ---- Boutons -------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--hit);
  padding: 15px 22px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition:
    background var(--dur-fast) ease,
    border-color var(--dur-fast) ease,
    color var(--dur-fast) ease,
    transform var(--dur-fast) ease;
}

.btn--lg {
  padding: 18px 28px;
  font-size: 14px;
}

.btn--accent {
  background: var(--vermilion);
  color: var(--on-accent);
}

.btn--accent:hover {
  background: var(--invert-bg);
  color: var(--invert-fg);
  transform: translateY(-2px);
}

.btn--outline {
  border-color: var(--rule-strong);
  color: inherit;
}

.btn--outline:hover {
  background: var(--invert-bg);
  color: var(--invert-fg);
}

.btn--outline-soft {
  border-color: var(--rule-strong);
  color: inherit;
}

.btn--outline-soft:hover {
  border-color: var(--fg);
  background: var(--tint);
  color: inherit;
}

/* ---- En-tête -------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(18, 17, 16, 0.82);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid transparent;
  transition:
    border-color var(--dur) ease,
    background var(--dur) ease;
}

.site-header.is-scrolled {
  background: rgba(18, 17, 16, 0.94);
  border-bottom-color: rgba(236, 233, 226, 0.16);
}

.nav {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 18px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav__brand {
  display: flex;
  align-items: center;
  flex: none;
}

.nav__brand img {
  height: 19px;
  width: auto;
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.2vw, 34px);
}

.nav__link {
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-muted);
  padding-bottom: 4px;
  background-image: linear-gradient(var(--vermilion), var(--vermilion));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition:
    color 0.2s ease,
    background-size 0.3s var(--ease);
}

.nav__link:hover,
.nav__link[aria-current="page"] {
  color: var(--paper);
  background-size: 100% 1px;
}

.nav__cta {
  flex: none;
}

.nav__burger {
  width: 48px;
  height: 48px;
  display: none;
  place-items: center;
  border: 1px solid rgba(236, 233, 226, 0.22);
  border-radius: var(--radius);
}

.nav__burger span {
  display: block;
  width: 22px;
  height: 9px;
  border-top: 2px solid var(--paper);
  border-bottom: 2px solid var(--paper);
}

.progress {
  height: 2px;
  width: 0;
  background: var(--vermilion);
  transition: width 0.12s linear;
}

@media (max-width: 1079px) {
  .nav__menu,
  .nav__cta {
    display: none;
  }

  .nav__burger {
    display: grid;
  }
}

/* ---- Menu mobile ---------------------------------------------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: var(--ink);
  padding: 24px clamp(20px, 5vw, 48px);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  animation: evMenuIn 0.32s var(--ease) both;
}

.mobile-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(236, 233, 226, 0.14);
}

.mobile-menu__head img {
  height: 19px;
  width: auto;
}

.mobile-menu__close {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(236, 233, 226, 0.22);
  border-radius: var(--radius);
  font-size: 22px;
  line-height: 1;
}

.mobile-menu__list {
  display: flex;
  flex-direction: column;
  margin: 8px 0 24px;
}

.mobile-menu__list a {
  display: block;
  padding: 20px 0;
  border-bottom: 1px solid rgba(236, 233, 226, 0.14);
  font-family: var(--font-display);
  font-size: 34px;
}

.mobile-menu__cta {
  margin-top: auto;
  padding-block: 20px;
  justify-content: center;
  font-size: 14px;
  letter-spacing: 0.08em;
}

/* ---- Fil d'Ariane et en-tête de page -------------------------- */
.breadcrumb {
  font-size: var(--fs-kicker);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--faint);
  margin-bottom: 36px;
}

.page__title {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  line-height: 1;
  max-width: 22ch;
}

.page__updated {
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  color: var(--faint);
  margin-top: 18px;
}

.page__body {
  margin-top: clamp(36px, 4vw, 56px);
  border-top: 1px solid var(--rule);
  padding-top: clamp(28px, 3vw, 40px);
}

/* ---- Tableaux (base partagée) --------------------------------- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.table caption {
  text-align: left;
  font-size: var(--fs-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--faint);
  padding-bottom: 12px;
}

.table th {
  text-align: left;
  font-weight: 400;
}

.table-scroll {
  overflow-x: auto;
  margin-top: 16px;
}

/* ---- Cartes d'article (carnet + teaser accueil) --------------- */
.posts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.post {
  background: var(--bg);
  padding: clamp(24px, 2.2vw, 34px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post__cat {
  font-size: var(--fs-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent);
}

.post__title {
  font-family: var(--font-display);
  font-size: var(--fs-h3-sm);
  line-height: 1.1;
}

.post__text {
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

.post__meta {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: var(--fs-kicker);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}

/* ---- Cases à cocher ------------------------------------------- */
.checkbox {
  width: 22px;
  height: 22px;
  flex: none;
  margin-top: 1px;
  accent-color: var(--vermilion);
}

.checkbox--muted {
  accent-color: var(--ink-faint);
}

/* ---- Pied de page --------------------------------------------- */
.footer__inner {
  padding-block: clamp(48px, 5vw, 80px) 32px;
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: clamp(32px, 4vw, 56px);
  padding-bottom: clamp(36px, 4vw, 56px);
  border-bottom: 1px solid var(--rule);
}

.footer__brand {
  grid-column: span 2;
  min-width: 0;
}

.footer__brand img {
  height: 26px;
  width: auto;
}

.footer__tagline {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1rem + 0.8vw, 1.7rem);
  line-height: 1.2;
  margin-top: 22px;
  max-width: 30ch;
}

.footer__email {
  display: inline-block;
  margin-top: 20px;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--vermilion);
  padding-bottom: 2px;
}

.footer__social {
  display: flex;
  gap: 10px;
  margin-top: 26px;
}

.footer__social span {
  width: var(--hit);
  height: var(--hit);
  display: grid;
  place-items: center;
  border: 1px solid rgba(236, 233, 226, 0.22);
  border-radius: var(--radius);
  color: var(--muted);
}

.footer__col h2 {
  font-size: var(--fs-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--faint);
  margin-bottom: 18px;
}

/* Seconde rubrique dans une même colonne de pied de page. */
.footer__col-second {
  margin-top: 28px;
}

.footer__col ul {
  display: flex;
  flex-direction: column;
  gap: 11px;
  font-size: var(--fs-sm);
}

.footer__col address {
  font-style: normal;
  font-size: var(--fs-sm);
  line-height: 1.7;
  color: var(--muted);
}

.footer__vat {
  font-size: var(--fs-sm);
  line-height: 1.7;
  color: var(--muted);
  margin-top: 14px;
}

.footer__vat span {
  color: var(--fg);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  padding-top: 26px;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.link-btn {
  text-align: left;
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 1px;
  transition: color var(--dur-fast) ease;
}

.link-btn:hover {
  color: var(--accent);
}

/* ---- Consentement --------------------------------------------- */
.cookie-banner {
  position: fixed;
  left: clamp(12px, 2vw, 24px);
  right: clamp(12px, 2vw, 24px);
  bottom: clamp(12px, 2vw, 24px);
  z-index: 150;
  max-width: 620px;
  border: 1px solid var(--rule-strong);
  box-shadow: var(--shadow-pop);
  padding: clamp(20px, 2vw, 28px);
  animation: evPanelIn 0.28s var(--ease) both;
}

.cookie-banner__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.15;
}

.cookie-banner__text {
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--muted);
  margin-top: 10px;
  max-width: 62ch;
}

.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.cookie-banner__legal {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 14px;
}

.cookie-banner__legal a {
  border-bottom: 1px solid var(--rule-strong);
}

.btn--consent {
  flex: 1 1 180px;
  justify-content: center;
  padding: 16px 22px;
  font-size: 13.5px;
  min-height: 48px;
}

.btn--consent-solid {
  background: var(--invert-bg);
  color: var(--invert-fg);
}

.btn--consent-solid:hover {
  opacity: 0.85;
}

/* L'accent suit le fond : vermillon sur encre, vermillon profond sur papier. */
.btn--consent-accent {
  flex: 1 1 200px;
  border-color: var(--accent);
  color: var(--accent);
}

.btn--consent-accent:hover {
  background: var(--accent);
  color: var(--bg);
}

.cookie-panel {
  position: fixed;
  inset: 0;
  z-index: 160;
  background: rgba(18, 17, 16, 0.72);
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 32px);
  overflow: auto;
}

.cookie-panel__dialog {
  width: min(100%, 680px);
  border: 1px solid var(--rule-strong);
  padding: clamp(22px, 2.6vw, 40px);
  animation: evPanelIn 0.28s var(--ease) both;
}

.cookie-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cookie-panel__title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1.3rem + 1vw, 2.2rem);
  line-height: 1.1;
}

.cookie-panel__close {
  width: var(--hit);
  height: var(--hit);
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  font-size: 20px;
  line-height: 1;
}

.cookie-panel__intro {
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--muted);
  margin-top: 12px;
}

.cookie-cats {
  margin-top: 24px;
  border-top: 1px solid var(--rule);
}

.cookie-cats li {
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.cookie-cats label {
  font-size: 16.5px;
  font-weight: 600;
}

.cookie-cats label span {
  font-size: var(--fs-kicker);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: 8px;
}

.cookie-cats p {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 6px;
}

/* ---- Mouvement ------------------------------------------------ */
@keyframes evMenuIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: none;
  }
}

@keyframes evSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes evFadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes evPanelIn {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
