/* Val Informatique 78 — shared component layer (built on top of Tailwind utilities) */

@font-face {
  font-family: "Instrument";
  src: url("../../fonts/InstrumentSans-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Instrument";
  src: url("../../fonts/InstrumentSans-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600 900;
  font-display: swap;
}

:root {
  --header-height: 108px;
  --header-height-mobile: 96px;
  color-scheme: light;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #f7f5ef;
  color: #0f2a4a;
  font-family: "Instrument", "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visibility (WCAG) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #126948;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: #fffefa;
  color: #0f2a4a;
  border: 2px solid #0f2a4a;
  border-radius: 8px;
  font-weight: 700;
}
.skip-link:focus {
  top: 12px;
}

/* Shell / container */
.shell {
  width: min(100% - 2.5rem, 1180px);
  margin-inline: auto;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  background: rgba(255, 254, 250, 0.98);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #d8ddd8;
}
.header-utility {
  height: 32px;
  display: flex;
  align-items: center;
  background: #0f2a4a;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
}
.header-utility .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.header-utility a {
  color: #a7e1bd;
  font-weight: 700;
}
.header-nav {
  height: 76px;
  display: grid;
  grid-template-columns: minmax(200px, auto) 1fr auto;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand img {
  height: 34px;
  width: auto;
}
.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  color: #34475b;
  font-size: 14px;
  font-weight: 650;
  transition: background-color 150ms ease, color 150ms ease;
}
.nav-links a:hover {
  background: #edf1eb;
  color: #0f2a4a;
}
.nav-links a[aria-current="page"] {
  background: #e8f3ec;
  color: #126948;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8ddd8;
  border-radius: 8px;
  background: #fffefa;
  color: #0f2a4a;
}
.mobile-nav {
  display: none;
  border-top: 1px solid #d8ddd8;
  background: #fffefa;
  padding: 14px 20px 20px;
}
.mobile-nav.is-open {
  display: grid;
  gap: 4px;
}
.mobile-nav a:not(.btn) {
  padding: 12px 6px;
  border-bottom: 1px solid #edf1eb;
  color: #0f2a4a;
  font-weight: 700;
}
.mobile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 12px;
}

@media (max-width: 1024px) {
  .nav-links { display: none; }
  .menu-toggle { display: inline-flex; }
  .header-actions .btn-ghost { display: none; }
}

@media (max-width: 640px) {
  :root { --header-height-mobile: 88px; }
  .header-utility a { display: none; }
  .brand img { height: 28px; }
}

@media (max-width: 480px) {
  .header-actions > .btn { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color 180ms ease, border-color 180ms ease, transform 120ms ease, box-shadow 180ms ease;
  cursor: pointer;
}
.btn:active {
  transform: translateY(1px);
}
.btn-sm {
  height: 40px;
  padding: 0 16px;
  font-size: 13.5px;
}
.btn-primary {
  background: #126948;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(18, 105, 72, 0.22);
}
.btn-primary:hover {
  background: #0a5036;
}
.btn-secondary {
  background: #126948;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(18, 105, 72, 0.18);
}
.btn-secondary:hover {
  background: #0a5036;
}
.btn-outline {
  background: #fffefa;
  color: #0f2a4a;
  border: 1.5px solid #c0cec5;
}
.btn-outline:hover {
  border-color: #126948;
  background: #e8f3ec;
}
.btn-gcal-overlay {
  position: relative;
  display: inline-flex;
}
.btn-gcal-overlay button {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
}
.btn-ghost {
  background: #edf1eb;
  color: #0f2a4a;
}
.btn-ghost:hover {
  background: #d8ddd8;
}
.btn-block {
  width: 100%;
}

/* ---------- Cards & surfaces ---------- */
.card {
  background: #fffefa;
  border: 1px solid #d8ddd8;
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}
.card-hover {
  transition: box-shadow 200ms ease, transform 200ms ease;
}
.card-hover:hover {
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10);
  transform: translateY(-2px);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.badge-green {
  background: #e8f3ec;
  color: #126948;
}
.badge-navy {
  background: #edf1eb;
  color: #0f2a4a;
}
.badge-orange {
  background: #e8f3ec;
  color: #126948;
}

/* ---------- Section rhythm ---------- */
.section {
  padding-block: 4rem;
}
@media (max-width: 640px) {
  .section { padding-block: 3rem; }
}

/* ---------- Star rating ---------- */
.stars {
  display: inline-flex;
  align-items: center;
  color: #f59e0b;
}

/* ---------- Utility: image bg cover for anchor cards ---------- */
.bg-cover-card {
  background-size: cover;
  background-position: center;
}

/* ---------- Dark surface with depth (glow + dot grid) ---------- */
.dark-surface {
  position: relative;
  background:
    radial-gradient(1100px 560px at 8% -15%, rgba(134, 229, 194, 0.10), transparent 60%),
    radial-gradient(900px 520px at 105% 115%, rgba(18, 105, 72, 0.12), transparent 60%),
    linear-gradient(165deg, #0f2a4a 0%, #071e36 70%);
  isolation: isolate;
}
.card.dark-surface {
  border-color: rgba(255, 255, 255, 0.12);
}
.dark-surface::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.5;
  z-index: -1;
  pointer-events: none;
}

/* ---------- UNU environmental impact figure ---------- */
.unu-impact-figure {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}
.unu-total {
  position: relative;
  display: flex;
  width: 132px;
  aspect-ratio: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 12px solid rgba(139, 224, 185, 0.2);
  border-top-color: #8be0b9;
  border-right-color: #8be0b9;
  border-radius: 999px;
  background: rgba(0, 21, 47, 0.62);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06), 0 12px 32px rgba(0,0,0,0.18);
  text-align: center;
  transform: rotate(-12deg);
}
.unu-total > * { transform: rotate(12deg); }
.unu-total-value {
  color: #8be0b9;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}
.unu-total-value small {
  margin-right: 2px;
  font-size: 15px;
  vertical-align: 5px;
}
.unu-total-label {
  margin-top: 7px;
  color: #d9e4eb;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.unu-metrics {
  display: grid;
  gap: 8px;
}
.unu-metric {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  background: rgba(255,255,255,0.055);
}
.unu-metric .material-symbols-outlined {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: rgba(139,224,185,0.14);
  color: #8be0b9;
  font-size: 19px;
}
.unu-metric p {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 7px;
  color: #c7d3dd;
  font-size: 12px;
  line-height: 1.35;
}
.unu-metric strong {
  flex: 0 0 auto;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
}
.unu-impact-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 17px;
  color: #d9e4eb;
  font-size: 12px;
  line-height: 1.45;
}
.unu-impact-note .material-symbols-outlined {
  color: #8be0b9;
  font-size: 18px;
}
.unu-source {
  display: inline-block;
  margin-top: 8px;
  color: rgba(199,211,221,0.66);
  font-size: 11px;
}
.unu-source:hover { color: #fff; text-decoration: underline; }

@media (max-width: 520px) {
  .unu-impact-figure {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .unu-total {
    width: 124px;
  }
  .unu-metrics {
    width: 100%;
  }
  .unu-metric p {
    display: block;
  }
  .unu-metric p span {
    display: block;
    margin-top: 1px;
  }
}

/* ---------- Hero diagnostic animation ---------- */
/* Base styles are the finished state, so reduced-motion users see a complete diagnostic. */
.hero-diag {
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
  margin-inline: auto;
  overflow: visible;
}
.hero-diag text { font-family: inherit; }
.diag-status { font-size: 15px; font-weight: 700; fill: #e6f0f4; }
.diag-status-run { opacity: 0; }
.diag-label { font-size: 12.5px; fill: #b9cad6; }
.diag-track {
  fill: none;
  stroke: #fff;
  stroke-opacity: 0.12;
  stroke-width: 4;
  stroke-linecap: round;
}
.diag-row {
  fill: none;
  stroke: #8be0b9;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1 2;
  stroke-dashoffset: 0;
}
.diag-result text { font-size: 12px; font-weight: 700; fill: #fff; }
.diag-scan { opacity: 0; }

.diag-row-1 { animation: diag-row-1 8s ease-in-out infinite; }
.diag-row-2 { animation: diag-row-2 8s ease-in-out infinite; }
.diag-row-3 { animation: diag-row-3 8s ease-in-out infinite; }
.diag-row-4 { animation: diag-row-4 8s ease-in-out infinite; }
/* Negative delay = same loop, checkmark drawn 0.35s after its bar without an initial pause. */
.diag-check { animation-delay: -7.65s; }
.diag-scan { animation: diag-scan 8s ease-in-out infinite; }
.diag-status-run { animation: diag-run 8s ease-in-out infinite; }
.diag-status-done,
.diag-result { animation: diag-done 8s ease-in-out infinite; }
.diag-gear {
  transform-box: fill-box;
  transform-origin: center;
  animation: diag-spin 14s linear infinite;
}
.diag-badge { animation: diag-float 4s ease-in-out infinite; }

@keyframes diag-row-1 { 0%, 12% { stroke-dashoffset: 1; } 22%, 92% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 1; } }
@keyframes diag-row-2 { 0%, 22% { stroke-dashoffset: 1; } 32%, 92% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 1; } }
@keyframes diag-row-3 { 0%, 32% { stroke-dashoffset: 1; } 42%, 92% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 1; } }
@keyframes diag-row-4 { 0%, 42% { stroke-dashoffset: 1; } 52%, 92% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 1; } }
@keyframes diag-scan {
  0%, 6% { opacity: 0; transform: translateY(0); }
  10% { opacity: 1; }
  52% { opacity: 1; transform: translateY(208px); }
  58%, 100% { opacity: 0; transform: translateY(208px); }
}
@keyframes diag-run { 0%, 54% { opacity: 1; } 60%, 100% { opacity: 0; } }
@keyframes diag-done { 0%, 56% { opacity: 0; } 62%, 92% { opacity: 1; } 100% { opacity: 0; } }
@keyframes diag-spin { to { transform: rotate(360deg); } }
@keyframes diag-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- Card refinements ---------- */
.card {
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}
.card-hover:hover {
  border-color: #c0cec5;
}
.card-accent-top {
  position: relative;
  overflow: hidden;
}
.card-accent-top::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #126948, #8be0b9);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 250ms ease;
}
.card-accent-top:hover::before {
  transform: scaleX(1);
}

/* ---------- Buttons: lift on hover ---------- */
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}

/* ---------- Photo framing: ties stock photos into the brand palette ---------- */
.photo-frame {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.photo-frame img {
  filter: saturate(1.05) contrast(1.03);
}
.photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(165deg, rgba(15, 42, 74, 0.32), rgba(15, 98, 72, 0.10) 55%, transparent 85%);
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* ---------- Oversized stat typography ---------- */
.stat-num {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ---------- Scroll reveal ---------- */
/* Progressive enhancement: content is visible by default. Hiding only kicks in
   once JS confirms (html.reveal-ready) it will actually reveal the element —
   so a JS failure or slow load can never leave content permanently invisible. */
html.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 550ms ease, transform 550ms ease;
}
html.reveal-ready .reveal.is-visible {
  opacity: 1 !important;
  transform: none !important;
}
@media (prefers-reduced-motion: reduce) {
  html.reveal-ready .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Offer filter panel (Offres page) ---------- */
.filter-panel {
  position: sticky;
  top: calc(var(--header-height) + 16px);
}
.filter-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  color: #111827;
  font-size: 13.5px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}
.filter-btn .material-symbols-outlined {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 19px;
}
.filter-btn span:nth-child(2) {
  flex: 1 1 auto;
  min-width: 0;
}
.filter-btn strong {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 2px 8px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
}
.filter-btn:hover {
  background: #f1f5f9;
}
.filter-btn[aria-pressed="true"] {
  background: #e6f4ed;
  color: #0f6248;
}
.filter-btn[aria-pressed="true"] .material-symbols-outlined {
  color: #0f6248;
}
.filter-btn[aria-pressed="true"] strong {
  background: #0f6248;
  color: #ffffff;
}

@media (max-width: 1024px) {
  .filter-panel {
    position: static;
  }
  .filter-panel .filter-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .filter-buttons .filter-btn {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
  }
}

/* ---------- Decorative glow blob (light sections) ---------- */
.glow-blob {
  position: absolute;
  border-radius: 999px;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Homepage section labels ---------- */
.section-impact-label {
  gap: 10px !important;
  margin-bottom: 16px !important;
  padding: 7px 15px 7px 8px;
  border: 1px solid #bdd9c7;
  border-radius: 999px;
  background: linear-gradient(90deg, #e8f3ec 0%, #fffefa 100%);
  box-shadow: 0 7px 20px rgba(15, 42, 74, 0.07);
  color: #126948 !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.075em !important;
  line-height: 1.3;
}
.section-impact-label .material-symbols-outlined {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  place-items: center;
  border-radius: 999px;
  background: #126948;
  color: #fffefa;
  font-size: 18px !important;
  font-variation-settings: "FILL" 1, "wght" 600;
  box-shadow: 0 3px 9px rgba(18, 105, 72, 0.22);
}
@media (max-width: 480px) {
  .section-impact-label {
    align-items: flex-start !important;
    border-radius: 15px;
    font-size: 0.75rem !important;
  }
}
