/*
 * style-shared.css — Element4
 * CSS commun à toutes les pages (tokens, reset, grain, nav, footer)
 * Chargé via wp_enqueue_style() dans functions.php
 */

/* ─── TOKENS ──────────────────────────────────────────────── */
:root {
  --coral: #e8735f;
  --ink: #2c3e50;
  --cream: #fff9f2;
  --muted: #d05b46;
  --bg: #e8735f;
  --ink-60: rgba(44, 62, 80, 0.65);
  --ink-12: rgba(44, 62, 80, 0.12);

  --font-display: 'League Spartan', sans-serif;
  --font-sub: 'Urbanist', sans-serif;
  --font-body: 'Quicksand', sans-serif;

  --pad-x: clamp(1.5rem, 7vw, 6rem);
  --nav-h: clamp(4.5rem, 7vh, 5.5rem);
}

/* ─── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(44, 62, 80, 0.45);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(44, 62, 80, 0.70);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(44, 62, 80, 0.45) transparent;
}

/* ─── RESET ───────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  background-color: var(--cream);
  color: var(--ink);
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ─── GRAIN ───────────────────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.020;
  pointer-events: none;
  z-index: 999;
}

/* ─── NAV ─────────────────────────────────────────────────── */
/*
 * Identique à index.html :
 * - Wordmark et liens TOUJOURS cream (hero coral en arrière-plan)
 * - .scrolled ajoute uniquement le fond charcoal + blur
 * - Pas d'état "repos sur fond clair"
 */
nav#main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: 1.5rem var(--pad-x);
  transition: background-color 0.45s ease, box-shadow 0.45s ease;
}

.nav-inner {
  max-width: 1340px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav#main-nav.scrolled {
  background-color: rgba(44, 62, 80, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(255, 249, 242, 0.08);
}

/* Wordmark — toujours cream */
.nav-wordmark {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  letter-spacing: 0.02em;
  color: var(--cream);
  text-decoration: none;
}

.nav-wordmark .accent {
  color: var(--cream);
}

/* Links — toujours cream, comme index.html */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link {
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(255, 249, 242, 0.75);
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: 100px;
  transition: color 0.25s ease, background-color 0.25s ease;
}

.nav-link:hover {
  color: var(--cream);
  background-color: rgba(255, 249, 242, 0.15);
}

/* Active state — page courante */
.nav-link.active {
  color: var(--cream);
  background-color: rgba(232, 115, 95, 0.35);
}

.nav-link.active:hover {
  background-color: rgba(232, 115, 95, 0.50);
}

/* CTA pill Contact */
.nav-cta-pill {
  font-size: 0.80rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(255, 249, 242, 0.75);
  background: transparent;
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: 100px;
  transition: color 0.25s ease, background-color 0.25s ease;
}

.nav-cta-pill:hover {
  color: var(--cream);
  background-color: rgba(255, 249, 242, 0.15);
}

.nav-cta-pill.active {
  color: var(--cream);
  background-color: rgba(232, 115, 95, 0.35);
}

/* Theme toggle */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.45rem;
  border-radius: 100px;
  color: rgba(255, 249, 242, 0.75);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.25s ease, background-color 0.25s ease;
}

.theme-toggle:hover {
  color: var(--cream);
  background-color: rgba(255, 249, 242, 0.15);
}

.theme-toggle svg {
  width: 1.05rem;
  height: 1.05rem;
  pointer-events: none;
}

.theme-toggle .icon-brain {
  display: none;
}

.theme-toggle .icon-cpu {
  display: block;
}

/* Light mode — nav scrolled devient blanc */
body.light-mode nav#main-nav.scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 0 rgba(44, 62, 80, 0.10);
}

/* Wordmark reste cream même en light mode (hero toujours coral) */

/* Light mode — toggle icon (brain visible, cpu hidden) */
body.light-mode .theme-toggle .icon-brain {
  display: block;
}

body.light-mode .theme-toggle .icon-cpu {
  display: none;
}

/* ─── FOOTER ──────────────────────────────────────────────── */
footer {
  background: var(--ink);
  padding: 3.5rem var(--pad-x) 4rem;
  border-top: 1px solid rgba(255, 249, 242, 0.08);
}

.footer-inner {
  max-width: 1340px;
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.5fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 249, 242, 0.08);
  margin-bottom: 1.8rem;
}

.footer-brand {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--cream);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0.85rem;
}

.footer-accent {
  color: var(--coral);
}

.footer-tagline {
  font-family: var(--font-body);
  font-size: 0.83rem;
  color: rgba(255, 249, 242, 0.38);
  line-height: 1.6;
  max-width: 20ch;
}

.footer-col-label {
  font-family: var(--font-body);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 249, 242, 0.28);
  margin-bottom: 0.75rem;
}

.footer-col-text {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: rgba(255, 249, 242, 0.50);
  line-height: 1.75;
}

.footer-col-link {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: rgba(255, 249, 242, 0.50);
  text-decoration: none;
  display: block;
  line-height: 1.75;
  transition: color 0.25s ease;
}

.footer-col-link:hover {
  color: var(--coral);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: rgba(255, 249, 242, 0.20);
  letter-spacing: 0.04em;
}

.footer-map {
  width: 100%;
  height: 160px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 249, 242, 0.10);
  margin-top: 0.75rem;
}

.footer-map iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  filter: grayscale(60%) brightness(0.60) contrast(1.1);
  transition: filter 0.4s ease;
}

.footer-map:hover iframe {
  filter: grayscale(20%) brightness(0.75) contrast(1.1);
}

/* Light mode — footer */
body.light-mode footer {
  background-color: #f0ebe6;
  border-top-color: rgba(44, 62, 80, 0.10);
}

body.light-mode .footer-top {
  border-bottom-color: rgba(44, 62, 80, 0.10);
}

body.light-mode .footer-brand {
  color: var(--ink);
}

body.light-mode .footer-tagline {
  color: rgba(44, 62, 80, 0.45);
}

body.light-mode .footer-col-label {
  color: rgba(44, 62, 80, 0.35);
}

body.light-mode .footer-col-text {
  color: rgba(44, 62, 80, 0.60);
}

body.light-mode .footer-col-link {
  color: rgba(44, 62, 80, 0.60);
}

body.light-mode .footer-copy {
  color: rgba(44, 62, 80, 0.25);
}

body.light-mode .footer-map {
  border-color: rgba(44, 62, 80, 0.12);
}

body.light-mode .footer-map iframe {
  filter: grayscale(20%) brightness(1.05) contrast(1.0);
}

@media (max-width: 767px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .footer-top>div:last-child {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (max-width: 479px) {
  .footer-top {
    grid-template-columns: 1fr;
  }

  .nav-links .nav-link--approche {
    display: none;
  }

  /* Notre approche hidden — News + Contact visible */
}