/* ============================================================
   kerbala.fr — Main stylesheet
   Sacred Minimalism / High-Contrast Editorial
   Importe tokens.css en premier (via enqueue PHP).
   ============================================================ */

/* ---------- FONTS SELF-HOSTED ----------
   Les fichiers doivent être placés dans assets/fonts/.
   Téléchargement : https://gwfh.mranftl.com/fonts (google-webfonts-helper)
   ou https://fonts.bunny.net (RGPD-friendly).
   Formats recommandés : woff2 uniquement (suffit en 2026).
*/

/* Instrument Serif — Regular 400 */
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/InstrumentSerif-Regular.woff2') format('woff2'),
       url('../fonts/InstrumentSerif-Regular.woff')  format('woff');
}

/* Instrument Serif — Italic 400 */
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/InstrumentSerif-Italic.woff2') format('woff2'),
       url('../fonts/InstrumentSerif-Italic.woff')  format('woff');
}

/* Empêche le navigateur de simuler un faux-bold ou faux-italic
   (Instrument Serif n'existe qu'en Regular — synthèse interdite pour préserver la pureté du tracé) */
.t-display-xl,
.t-headline-lg,
.t-headline-md,
.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4,
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  font-synthesis: none;
}

/* Hanken Grotesk — Light 300 */
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/hanken-grotesk-v12-latin_latin-ext-300.woff2') format('woff2');
}

/* Hanken Grotesk — Regular 400 */
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/hanken-grotesk-v12-latin_latin-ext-regular.woff2') format('woff2');
}

/* Hanken Grotesk — Semibold 600 */
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/hanken-grotesk-v12-latin_latin-ext-600.woff2') format('woff2');
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-sans);
  font-size: var(--type-body-md-size);
  line-height: var(--type-body-md-lh);
  font-weight: var(--type-body-md-weight);
  min-height: 100dvh;
  overflow-x: hidden;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
table { border-collapse: collapse; border-spacing: 0; }

/* ---------- TYPOGRAPHIE — CLASSES UTILITAIRES ---------- */
.t-display-xl {
  font-family: var(--font-serif);
  font-size: var(--type-display-xl-size);
  line-height: var(--type-display-xl-lh);
  letter-spacing: var(--type-display-xl-ls);
  font-weight: 400;
}

.t-headline-lg {
  font-family: var(--font-serif);
  font-size: var(--type-headline-lg-size);
  line-height: var(--type-headline-lg-lh);
  letter-spacing: var(--type-headline-lg-ls);
  font-weight: 400;
}

.t-headline-md {
  font-family: var(--font-serif);
  font-size: var(--type-headline-md-size);
  line-height: var(--type-headline-md-lh);
  letter-spacing: var(--type-headline-md-ls);
  font-weight: 400;
}

.t-body-lg {
  font-family: var(--font-sans);
  font-size: var(--type-body-lg-size);
  line-height: var(--type-body-lg-lh);
  letter-spacing: var(--type-body-lg-ls);
  font-weight: var(--type-body-lg-weight);
}

.t-body-md {
  font-family: var(--font-sans);
  font-size: var(--type-body-md-size);
  line-height: var(--type-body-md-lh);
  font-weight: var(--type-body-md-weight);
}

.t-body-sm {
  font-family: var(--font-sans);
  font-size: var(--type-body-sm-size);
  line-height: var(--type-body-sm-lh);
}

.t-label-caps {
  font-family: var(--font-sans);
  font-size: var(--type-label-caps-size);
  line-height: var(--type-label-caps-lh);
  letter-spacing: var(--type-label-caps-ls);
  font-weight: var(--type-label-caps-weight);
  text-transform: uppercase;
}

.t-italic { font-style: italic; }
.t-muted  { color: var(--color-fg-muted); }
.t-soft   { color: var(--color-fg-soft); }

/* ---------- GRILLE & CONTENEURS ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-mobile-margin);
}

@media (min-width: 768px) {
  .container { padding-inline: var(--space-3xl); }
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
}

/* Espacements verticaux signature */
.section {
  padding-block: var(--space-4xl);
}

@media (min-width: 1024px) {
  .section { padding-block: var(--space-5xl); }
}

.section + .section {
  border-top: 0.5px solid var(--color-line);
}

/* ---------- HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  height: var(--header-height);
  background: var(--color-bg);
  border-bottom: 0.5px solid var(--color-line);
  display: flex;
  align-items: center;
  backdrop-filter: blur(8px);
}

.site-header__inner {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-l);
}

.site-header__brand {
  font-family: var(--font-serif);
  font-size: 20px;
  letter-spacing: -0.01em;
}

.site-header__nav {
  display: flex;
  justify-content: center;
}

.site-header__nav-list {
  display: flex;
  gap: var(--space-xl);
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-header__nav-list li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-header__nav-list li::before,
.site-header__nav-list li::marker {
  content: none !important;
  display: none !important;
}

.site-header__nav a {
  position: relative;
  display: inline-block;
  padding-block: var(--space-2xs);
  font-family: var(--font-sans);
  font-size: var(--type-label-caps-size);
  line-height: var(--type-label-caps-lh);
  letter-spacing: var(--type-label-caps-ls);
  font-weight: 700;            /* bold demandé */
  text-transform: uppercase;
  color: var(--color-fg);
  transition: opacity var(--duration-base) var(--ease-out-soft);
}

.site-header__nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-base) var(--ease-out-soft);
}

.site-header__nav a:hover::after,
.site-header__nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.site-header__actions {
  display: flex;
  gap: var(--space-m);
  justify-content: flex-end;
  align-items: center;
}

.site-header__icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--duration-base) var(--ease-out-soft);
}

.site-header__icon:hover { opacity: 0.6; }

/* ---------- BOUTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  padding: 14px 28px;
  border-radius: 0;
  font-family: var(--font-sans);
  font-size: var(--type-label-caps-size);
  letter-spacing: var(--type-label-caps-ls);
  font-weight: var(--type-label-caps-weight);
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color var(--duration-base) var(--ease-out-soft),
              color var(--duration-base) var(--ease-out-soft),
              border-color var(--duration-base) var(--ease-out-soft);
  border: 1px solid transparent;
}

.btn--primary {
  background: var(--color-fg);
  color: var(--color-bg);
}

.btn--primary:hover {
  background: transparent;
  color: var(--color-fg);
  border-color: var(--color-fg);
}

.btn--ghost {
  background: transparent;
  color: var(--color-fg);
  border-color: var(--color-fg);
}

.btn--ghost:hover {
  background: var(--color-fg);
  color: var(--color-bg);
}

/* ---------- HERO HOME ---------- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.35;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, var(--color-bg) 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  padding-block: var(--space-3xl);
}

.hero__kicker {
  margin-bottom: var(--space-m);
  color: var(--color-fg-soft);
}

.hero__title {
  font-style: italic;
  max-width: 12ch;
  margin-bottom: var(--space-xl);
}

/* ---------- PRODUCT CARD ---------- */
.product-card {
  display: block;
  position: relative;
}

.product-card__media {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  background: var(--color-bg-elevated-1);
}

.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-glacial) var(--ease-out-soft);
}

.product-card:hover .product-card__media img {
  transform: scale(1.04);
}

.product-card__info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-m);
  margin-top: var(--space-m);
}

.product-card__title {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 130%;
}

.product-card__meta {
  display: block;
  margin-top: var(--space-3xs);
  color: var(--color-fg-soft);
  font-size: var(--type-body-sm-size);
}

.product-card__price {
  font-family: var(--font-sans);
  font-size: var(--type-body-md-size);
  color: var(--color-fg);
  white-space: nowrap;
}

/* ---------- FOOTER ---------- */
.site-footer {
  border-top: 0.5px solid var(--color-line);
  padding-block: var(--space-3xl);
  color: var(--color-fg-muted);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

@media (min-width: 768px) {
  .site-footer__grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.site-footer__brand-name {
  font-family: var(--font-serif);
  font-size: 32px;
  color: var(--color-fg);
  margin-bottom: var(--space-s);
}

.site-footer__col-title {
  margin-bottom: var(--space-m);
  color: var(--color-fg);
}

.site-footer__col ul li {
  margin-bottom: var(--space-2xs);
}

.site-footer__col a {
  transition: color var(--duration-base) var(--ease-out-soft);
}

.site-footer__col a:hover {
  color: var(--color-fg);
}

.site-footer__legal {
  margin-top: var(--space-xl);
  padding-top: var(--space-l);
  border-top: 0.5px solid var(--color-line);
  display: flex;
  justify-content: space-between;
  font-size: var(--type-body-sm-size);
  color: var(--color-fg-soft);
}

/* ---------- WOOCOMMERCE — LAYOUTS PDP & CART ---------- */

/* PDP : layout 2 colonnes (galerie à gauche, summary à droite) */
.pdp__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3xl);
}

@media (min-width: 1024px) {
  .pdp__layout {
    grid-template-columns: 1.2fr 1fr;
    gap: var(--space-4xl);
    align-items: start;
  }
}

/* PDP : section storytelling "La Perfection dans le Détail" */
.pdp-story__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  align-items: start;
}

@media (min-width: 1024px) {
  .pdp-story__grid {
    grid-template-columns: 1fr 1.2fr;
    gap: var(--space-3xl);
  }
}

/* Cart : layout 2 colonnes (items à gauche, récap sticky à droite) */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
}

@media (min-width: 1024px) {
  .cart-layout {
    grid-template-columns: 1.6fr 1fr;
    gap: var(--space-3xl);
    align-items: start;
  }
}

/* PDP — assure que le summary respecte la palette globale (titre, ATC, accordéons) */
.pdp__summary .t-headline-lg {
  font-family: var(--font-serif);
}

.pdp__atc .button,
.pdp__atc .single_add_to_cart_button {
  width: 100%;
  background: var(--color-fg);
  color: var(--color-bg);
  border: 1px solid var(--color-fg);
  padding: 16px 28px;
  font-family: var(--font-sans);
  font-size: var(--type-label-caps-size);
  letter-spacing: var(--type-label-caps-ls);
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 0;
  cursor: pointer;
  transition: background-color var(--duration-base) var(--ease-out-soft),
              color var(--duration-base) var(--ease-out-soft);
}

.pdp__atc .button:hover,
.pdp__atc .single_add_to_cart_button:hover {
  background: transparent;
  color: var(--color-fg);
}

.pdp__atc .quantity {
  margin-bottom: var(--space-m);
}

.pdp__atc .quantity input {
  background: transparent;
  border: 1px solid var(--color-line);
  color: var(--color-fg);
  padding: var(--space-s);
  width: 80px;
  border-radius: 0;
  font-family: var(--font-sans);
}

.pdp__accordion summary::-webkit-details-marker {
  display: none;
}

.pdp__accordion[open] summary span:last-child {
  transform: rotate(45deg);
  display: inline-block;
}

.pdp__accordion summary span:last-child {
  transition: transform var(--duration-base) var(--ease-out-soft);
}

/* ---------- PAGE TRANSITION (Swup) ---------- */
.transition-fade {
  transition: opacity var(--duration-base) var(--ease-out-soft);
  opacity: 1;
}

html.is-animating .transition-fade {
  opacity: 0;
}

/* ---------- CONTENU ÉDITORIAL (pages WP + articles) ---------- */
/*
   Les pages générées par WordPress sortent dans .page-content (page.php)
   et .entry-content (single.php). On y restaure les marges et on style
   tous les éléments markdown / Gutenberg de manière cohérente avec le
   design system éditorial.
*/

.page-content,
.entry-content {
  color: var(--color-fg);
}

.page-content > * + *,
.entry-content > * + * {
  margin-top: var(--space-m);
}

.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4,
.page-content h5,
.page-content h6,
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 130%;
  color: var(--color-fg);
}

.page-content h1,
.entry-content h1 {
  font-size: var(--type-headline-lg-size);
  line-height: var(--type-headline-lg-lh);
  letter-spacing: var(--type-headline-lg-ls);
  margin-top: var(--space-3xl);
  margin-bottom: var(--space-l);
}

.page-content h2,
.entry-content h2 {
  font-size: var(--type-headline-md-size);
  line-height: var(--type-headline-md-lh);
  letter-spacing: var(--type-headline-md-ls);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-m);
  padding-top: var(--space-l);
  border-top: 0.5px solid var(--color-line);
}

.page-content h3,
.entry-content h3 {
  font-size: 24px;
  line-height: 130%;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-s);
}

.page-content h4,
.entry-content h4 {
  font-size: 20px;
  line-height: 140%;
  margin-top: var(--space-l);
  margin-bottom: var(--space-xs);
}

.page-content h5,
.page-content h6,
.entry-content h5,
.entry-content h6 {
  font-size: 16px;
  line-height: 140%;
  margin-top: var(--space-m);
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-fg-soft);
}

/* Premier titre d'une page : on enlève la ligne du dessus pour éviter le doublon avec l'entête */
.page-content > h2:first-child,
.page-content > h1:first-child,
.entry-content > h2:first-child,
.entry-content > h1:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.page-content p,
.entry-content p {
  font-family: var(--font-sans);
  font-size: var(--type-body-lg-size);
  line-height: var(--type-body-lg-lh);
  font-weight: var(--type-body-lg-weight);
  color: var(--color-fg-muted);
  margin-bottom: var(--space-m);
}

.page-content p strong,
.entry-content p strong {
  color: var(--color-fg);
  font-weight: 600;
}

.page-content a,
.entry-content a {
  color: var(--color-fg);
  text-decoration: underline;
  text-decoration-color: var(--color-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color var(--duration-base) var(--ease-out-soft);
}

.page-content a:hover,
.entry-content a:hover {
  text-decoration-color: var(--color-fg);
}

.page-content ul,
.page-content ol,
.entry-content ul,
.entry-content ol {
  padding-left: var(--space-l);
  margin-bottom: var(--space-m);
  color: var(--color-fg-muted);
  font-size: var(--type-body-lg-size);
  line-height: var(--type-body-lg-lh);
}

.page-content ul,
.entry-content ul {
  list-style: none;
  padding-left: 0;
}

.page-content ul li,
.entry-content ul li {
  position: relative;
  padding-left: var(--space-m);
  margin-bottom: var(--space-2xs);
}

.page-content ul li::before,
.entry-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 16px;
  height: 0.5px;
  background: var(--color-fg-soft);
}

.page-content ol,
.entry-content ol {
  list-style: decimal;
}

.page-content ol li,
.entry-content ol li {
  margin-bottom: var(--space-2xs);
}

.page-content blockquote,
.entry-content blockquote {
  margin: var(--space-xl) 0;
  padding: var(--space-l) var(--space-xl);
  border-left: 1px solid var(--color-line);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--type-headline-md-size);
  line-height: 140%;
  color: var(--color-fg);
  letter-spacing: -0.01em;
}

.page-content blockquote em,
.entry-content blockquote em {
  font-style: normal;
}

.page-content blockquote cite,
.entry-content blockquote cite,
.page-content blockquote em:last-child,
.entry-content blockquote em:last-child {
  display: block;
  margin-top: var(--space-s);
  font-family: var(--font-sans);
  font-size: var(--type-label-caps-size);
  letter-spacing: var(--type-label-caps-ls);
  font-style: normal;
  text-transform: uppercase;
  color: var(--color-fg-soft);
  font-weight: 600;
}

.page-content hr,
.entry-content hr {
  margin: var(--space-2xl) 0;
  border: 0;
  border-top: 0.5px solid var(--color-line);
  height: 0;
}

.page-content table,
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-l) 0;
  font-size: var(--type-body-md-size);
}

.page-content th,
.page-content td,
.entry-content th,
.entry-content td {
  text-align: left;
  padding: var(--space-s) var(--space-m);
  border-bottom: 0.5px solid var(--color-line);
  color: var(--color-fg-muted);
}

.page-content th,
.entry-content th {
  font-family: var(--font-sans);
  font-size: var(--type-label-caps-size);
  letter-spacing: var(--type-label-caps-ls);
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-fg);
  border-bottom: 1px solid var(--color-line-strong);
}

.page-content code,
.entry-content code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.9em;
  padding: 2px 6px;
  background: var(--color-bg-elevated-1);
  border: 0.5px solid var(--color-line);
  color: var(--color-fg);
}

.page-content img,
.entry-content img {
  margin: var(--space-l) 0;
  width: 100%;
  height: auto;
}

.page-content figcaption,
.entry-content figcaption {
  font-size: var(--type-body-sm-size);
  color: var(--color-fg-soft);
  margin-top: var(--space-2xs);
  text-align: center;
}

/* ---------- ACCESSIBILITÉ ---------- */
:focus-visible {
  outline: 2px solid var(--color-fg);
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
