/**
 * Styles globaux — thème « Earthbound Curator » (stitch/)
 * - Jetons CSS + typo / éléments HTML par défaut (sans classe Tailwind).
 * - Les utilitaires Tailwind dans les templates restent prioritaires (plus forte spécificité).
 */

:root {
  /* Aligné sur stitch / tailwind.config (base.html) */
  --color-background: #faf9f6;
  --color-surface: #faf9f6;
  --color-surface-container: #efeeeb;
  --color-surface-container-high: #e9e8e5;
  --color-surface-container-lowest: #ffffff;
  --color-on-surface: #1a1c1a;
  --color-on-surface-variant: #54433a;
  --color-primary: #6c2f00;
  --color-on-primary: #ffffff;
  --color-primary-container: #8b4513;
  --color-secondary: #795900;
  --color-secondary-container: #fcc340;
  --color-on-secondary-container: #6f5100;
  --color-tertiary: #004c29;
  --color-outline: #877369;
  --color-outline-variant: #dac2b6;
  --color-error: #ba1a1a;
  --font-headline: "Newsreader", ui-serif, Georgia, serif;
  --font-body: "Work Sans", ui-sans-serif, system-ui, sans-serif;
  --font-label: "Work Sans", ui-sans-serif, system-ui, sans-serif;
  --leading-tight: 1.15;
  --leading-snug: 1.35;
  --leading-normal: 1.55;
  --leading-relaxed: 1.65;
  --space-content-max: 65ch;
}

/* ----- Base document ----- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: var(--leading-normal);
  color: var(--color-on-surface);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
}

/* ----- Titres (éléments nus ; les classes Tailwind surchargent) ----- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-headline);
  font-weight: 600;
  color: var(--color-on-surface);
  line-height: var(--leading-tight);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.75em;
}

h2 {
  font-size: clamp(1.875rem, 3.5vw, 3rem);
  font-weight: 600;
  margin: 0 0 0.65em;
}

h3 {
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
  font-weight: 600;
  margin: 0 0 0.55em;
}

h4 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 600;
  margin: 0 0 0.5em;
}

h5 {
  font-family: var(--font-label);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-secondary);
  margin: 0 0 0.5em;
}

h6 {
  font-family: var(--font-label);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-on-surface-variant);
  margin: 0 0 0.5em;
}

/* ----- Texte courant ----- */
p {
  margin: 0 0 1em;
  max-width: var(--space-content-max);
}

p:last-child {
  margin-bottom: 0;
}

small {
  font-size: 0.875rem;
  color: var(--color-on-surface-variant);
}

strong,
b {
  font-weight: 600;
  color: var(--color-on-surface);
}

em,
i {
  font-style: italic;
}

/* Liens sans classe utilitaire : style éditorial */
a:not([class]) {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:not([class]):hover {
  color: var(--color-secondary);
}

a:not([class]):focus-visible {
  outline: 2px solid var(--color-secondary-container);
  outline-offset: 3px;
}

/* ----- Listes ----- */
ul,
ol {
  margin: 0 0 1em 1.25em;
  padding: 0;
  max-width: var(--space-content-max);
}

ul {
  list-style-type: disc;
}

ol {
  list-style-type: decimal;
}

li {
  margin-bottom: 0.35em;
  line-height: var(--leading-relaxed);
}

li::marker {
  color: var(--color-secondary);
}

/* ----- Citations & séparateurs ----- */
blockquote {
  margin: 1.5em 0;
  padding: 0.75em 0 0.75em 1.25em;
  border-left: 3px solid color-mix(in srgb, var(--color-outline-variant) 45%, transparent);
  font-family: var(--font-headline);
  font-style: italic;
  font-size: 1.125rem;
  color: var(--color-on-surface-variant);
  max-width: var(--space-content-max);
}

hr {
  border: none;
  height: 1px;
  margin: 2.5rem 0;
  background: color-mix(in srgb, var(--color-outline) 18%, transparent);
}

/* ----- Code ----- */
code,
kbd {
  font-family: ui-monospace, monospace;
  font-size: 0.9em;
  background: color-mix(in srgb, var(--color-outline-variant) 25%, transparent);
  padding: 0.15em 0.4em;
  border-radius: 0.25rem;
}

pre {
  font-family: ui-monospace, monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  padding: 1rem 1.25rem;
  margin: 0 0 1em;
  overflow-x: auto;
  background: var(--color-surface-container-high);
  border-radius: 0.5rem;
  max-width: 100%;
}

pre code {
  background: none;
  padding: 0;
}

/* ----- Médias & figures ----- */
img,
video {
  max-width: 100%;
  height: auto;
}

figure {
  margin: 0 0 1.5em;
}

figcaption {
  margin-top: 0.5em;
  font-size: 0.875rem;
  color: var(--color-on-surface-variant);
  font-family: var(--font-body);
  max-width: var(--space-content-max);
}

/* ----- Tableaux (contenu riche) ----- */
table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25em;
  font-size: 0.9375rem;
}

th,
td {
  padding: 0.65em 0.85em;
  text-align: left;
  border-bottom: 1px solid color-mix(in srgb, var(--color-outline-variant) 35%, transparent);
}

th {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-on-surface-variant);
  background: color-mix(in srgb, var(--color-surface-container) 85%, var(--color-background));
}

/* ----- Boutons & champs nus (hors composants stylés) ----- */
button:not([class]),
input:not([class]),
textarea:not([class]),
select:not([class]) {
  font-family: inherit;
  font-size: 1rem;
}

button:not([class]) {
  cursor: pointer;
  padding: 0.5em 1em;
  border-radius: 0.5rem;
  border: none;
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: 500;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

button:not([class]):hover {
  opacity: 0.92;
}

button:not([class]):active {
  transform: scale(0.98);
}

button:not([class]):focus-visible {
  outline: 2px solid var(--color-secondary-container);
  outline-offset: 2px;
}

input:not([class]),
textarea:not([class]),
select:not([class]) {
  border: 1px solid color-mix(in srgb, var(--color-outline-variant) 50%, transparent);
  border-radius: 0.5rem;
  padding: 0.5em 0.75em;
  background: var(--color-surface-container-lowest);
}

input:not([class]):focus-visible,
textarea:not([class]):focus-visible,
select:not([class]):focus-visible {
  outline: 2px solid var(--color-secondary-container);
  outline-offset: 1px;
}

/* Détails / résumé (FAQ native) */
details {
  margin-bottom: 0.75em;
}

summary {
  font-family: var(--font-headline);
  font-weight: 600;
  cursor: pointer;
  color: var(--color-primary);
}

summary:hover {
  color: var(--color-secondary);
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;
}

.tonal-shift-on-scroll {
  transition: background-color 0.4s ease, backdrop-filter 0.4s ease;
}

.asymmetric-image-container {
  border-radius: 1.5rem 0 1.5rem 1.5rem;
}

.linen-texture {
  background-image: url("https://lh3.googleusercontent.com/aida-public/AB6AXuDg_9tjxcSlWFEcqd7s58w9SmydIh1pYCIOr1aHlxpclRFS7-9dqk8O7QA-lXOftAVJvqE1uIaflSDegFIIBe_1huDkXDgecspzVabMXGcrO14OexPFsPK9d5rpcK_HNGtYL8XZ_ekIZu5Y_rRX2LkpC8N9Un8hjHIFp9PQyVaLIArGdQtoN5QxqGyh9XCPSsHQ_PvmO4P5iCSQvfGdbn6c783daAj2jMgOrTQvglddh5RFxtAJ1hToClXQ7g0HSPjwkHRY8-reYPk");
}

/* Menu mobile */
#mobile-menu-panel:not(.is-open) {
  pointer-events: none;
}

#mobile-menu-panel.is-open #mobile-menu-backdrop {
  opacity: 1;
}

#mobile-menu-panel.is-open #mobile-menu-drawer {
  transform: translateX(0);
}

#mobile-menu-backdrop {
  opacity: 0;
  transition: opacity 0.3s ease;
}

#mobile-menu-drawer {
  transform: translateX(100%);
  transition: transform 0.35s ease;
}

#mobile-menu-panel.is-open {
  pointer-events: auto;
}

/* FAQ : icône ouverte */
.faq-item--open .faq-chevron {
  transform: rotate(180deg);
}

#site-nav.nav-scrolled {
  background-color: rgba(250, 249, 246, 0.92);
  box-shadow: 0 4px 24px rgba(26, 28, 26, 0.06);
}

/* ----- Texte sur photographies (lisibilité type « magazine ») ----- */

/**
 * Dégradé bas : assombrit surtout le tiers inférieur pour le texte blanc.
 * Ne pas alléger ce calque au survol (seule la photo peut s’animer).
 */
.hp-photo-scrim {
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(12, 10, 8, 0.94) 0%,
    rgba(12, 10, 8, 0.75) 28%,
    rgba(12, 10, 8, 0.35) 52%,
    rgba(12, 10, 8, 0) 100%
  );
}

/**
 * Voile léger sur toute l’image : se retire au survol pour laisser respirer la photo,
 * le scrim bas garde le contraste sous le texte.
 */
.hp-photo-veil {
  pointer-events: none;
  background-color: rgba(0, 0, 0, 0.22);
  transition: background-color 0.65s ease;
}

.group:hover .hp-photo-veil {
  background-color: rgba(0, 0, 0, 0.06);
}

/**
 * Ombre portée typographique (héritée par le texte du bloc).
 */
.hp-text-on-photo {
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.95),
    0 2px 14px rgba(0, 0, 0, 0.55);
}

/* Les titres globaux h3 / paragraphes ont une couleur « on-surface » qui casse l’héritage de text-white */
.hp-text-on-photo h3,
.hp-text-on-photo p {
  color: #ffffff;
}
