/*
 * Template Editorial — Styles scopés
 * Fait partie de WP Vendor Nexus 3.9.0 — Templates de boutique personnalisables
 *
 * Toutes les règles sont préfixées sous .nx-template-editorial.
 * Les tokens dynamiques (--nxt-accent, --nxt-accent-hover, --nxt-accent-soft)
 * sont injectés au runtime par TemplateRenderer via <style id="nx-shop-tokens">.
 * Les imports Google Fonts sont gérés par TemplateRenderer selon $tokens['heading_font'].
 */

/* ── Reset local ─────────────────────────────────────────────────────────── */
.nx-template-editorial *,
.nx-template-editorial *::before,
.nx-template-editorial *::after {
  box-sizing: border-box;
}

.nx-template-editorial img {
  max-width: 100%;
  display: block;
}

.nx-template-editorial a {
  color: inherit;
}

/* ── Variables de mode ───────────────────────────────────────────────────── */
.nx-template-editorial.is-light:not(.nx-shop-theme-v2) {
  --nxt-bg:     #ffffff;
  --nxt-text:   #0a0a0a;
  --nxt-border: #0a0a0a;
  --nxt-muted:  #666;
}

.nx-template-editorial.is-dark:not(.nx-shop-theme-v2) {
  --nxt-bg:     #0a0a0a;
  --nxt-text:   #f4f4f4;
  --nxt-border: #f4f4f4;
  --nxt-muted:  #aaa;
}

/* ── Racine du template ──────────────────────────────────────────────────── */
.nx-template-editorial {
  background: var(--nx-color-page, var(--nxt-bg));
  color: var(--nx-color-text, var(--nxt-text));
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.55;
}

.nx-template-editorial h1,
.nx-template-editorial h2,
.nx-template-editorial h3 {
  margin: 0;
  font-family: var(--nxt-heading-font, 'Playfair Display', Georgia, serif);
  font-weight: 400;
  font-style: italic;
}

/* ── Cover bar ───────────────────────────────────────────────────────────── */
.nx-template-editorial .nxt-cover-bar {
  background: var(--nxt-text);
  color: var(--nxt-bg);
  padding: 11px clamp(20px, 5vw, 80px);
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
}

/* ── Header compact ──────────────────────────────────────────────────────── */
.nx-template-editorial .nxt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px clamp(20px, 5vw, 80px);
  border-bottom: 1px solid var(--nxt-border);
}

.nx-template-editorial .nxt-header-identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nx-template-editorial .nxt-header-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 50%;
  border: 1px solid var(--nxt-border);
}

.nx-template-editorial .nxt-header-name {
  font-size: clamp(22px, 2.4vw, 30px);
  font-style: italic;
  font-family: var(--nxt-heading-font, 'Playfair Display', Georgia, serif);
}

.nx-template-editorial .nxt-header-credits {
  display: flex;
  gap: 16px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--nxt-muted);
}

.nx-template-editorial .nxt-header-credits .nxt-credit-strong {
  color: var(--nxt-text);
}

@media (max-width: 768px) {
  .nx-template-editorial .nxt-header-credits {
    display: none;
  }
}

/* ── Hero scindé ─────────────────────────────────────────────────────────── */
.nx-template-editorial .nxt-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 60vh;
}

@media (max-width: 768px) {
  .nx-template-editorial .nxt-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }
}

.nx-template-editorial .nxt-hero-img {
  background: var(--nx-color-surface, #f4f4f4);
  overflow: hidden;
}

.nx-template-editorial .nxt-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .nx-template-editorial .nxt-hero-img img {
    aspect-ratio: 4/5;
  }
}

.nx-template-editorial .nxt-hero-content {
  padding: clamp(36px, 6vw, 80px) clamp(20px, 5vw, 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  border-left: 1px solid var(--nxt-border);
}

@media (max-width: 768px) {
  .nx-template-editorial .nxt-hero-content {
    border-left: 0;
    border-top: 1px solid var(--nxt-border);
  }
}

.nx-template-editorial .nxt-hero-label {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--nxt-muted);
}

.nx-template-editorial .nxt-hero-title {
  font-size: clamp(48px, 7vw, 88px);
  line-height: 0.95;
  font-style: italic;
  font-family: var(--nxt-heading-font, 'Playfair Display', Georgia, serif);
}

.nx-template-editorial .nxt-hero-subtitle {
  font-style: italic;
  font-family: var(--nxt-heading-font, 'Playfair Display', Georgia, serif);
  font-size: 18px;
  max-width: 38ch;
  color: var(--nxt-text);
}

.nx-template-editorial .nxt-hero-cta {
  display: inline-block;
  align-self: flex-start;
  background: var(--nxt-accent, var(--nxt-text));
  color: var(--nxt-bg);
  padding: 14px 28px;
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease, border 0.2s ease, padding 0.2s ease;
  margin-top: 8px;
}

.nx-template-editorial .nxt-hero-cta:hover {
  background: var(--nxt-bg);
  color: var(--nxt-text);
  border: 1px solid var(--nxt-border);
  padding: 13px 27px;
}

/* ── Section title ───────────────────────────────────────────────────────── */
.nx-template-editorial .nxt-section-title {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 14px;
  font-size: clamp(32px, 5vw, 56px);
  margin: 80px 0 32px;
  font-style: italic;
  padding: 0 clamp(20px, 5vw, 80px);
  font-family: var(--nxt-heading-font, 'Playfair Display', Georgia, serif);
}

.nx-template-editorial .nxt-section-num {
  font-size: 0.32em;
  font-style: normal;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--nxt-muted);
}

/* ── Édit / articles éditoriaux ──────────────────────────────────────────── */
.nx-template-editorial .nxt-edit-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 0 clamp(20px, 5vw, 80px);
}

@media (max-width: 1024px) {
  .nx-template-editorial .nxt-edit-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .nx-template-editorial .nxt-edit-list {
    grid-template-columns: 1fr;
  }
}

.nx-template-editorial .nxt-edit-item {
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
}

.nx-template-editorial .nxt-edit-item .nxt-edit-img-wrap {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--nx-color-surface, #f4f4f4);
}

.nx-template-editorial .nxt-edit-item .nxt-edit-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.35s ease;
}

.nx-template-editorial .nxt-edit-item .nxt-edit-img--hover {
  opacity: 0;
}

.nx-template-editorial .nxt-edit-item:hover .nxt-edit-img--rest {
  opacity: 0;
}

.nx-template-editorial .nxt-edit-item:hover .nxt-edit-img--hover {
  opacity: 1;
}

.nx-template-editorial .nxt-edit-item .nxt-edit-rule {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 1px;
  width: 0;
  background: var(--nxt-accent, var(--nxt-text));
  transition: width 0.45s ease;
}

.nx-template-editorial .nxt-edit-item:hover .nxt-edit-rule {
  width: 100%;
}

.nx-template-editorial .nxt-fig {
  font-style: italic;
  font-family: var(--nxt-heading-font, 'Playfair Display', Georgia, serif);
  font-size: 11px;
  color: var(--nxt-muted);
  display: block;
  margin-bottom: 8px;
}

.nx-template-editorial .nxt-edit-body {
  padding: 14px 0 0;
}

.nx-template-editorial .nxt-edit-name {
  font-size: 18px;
  font-style: italic;
  font-family: var(--nxt-heading-font, 'Playfair Display', Georgia, serif);
}

.nx-template-editorial .nxt-edit-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--nxt-muted);
}

.nx-template-editorial .nxt-edit-excerpt {
  font-size: 14px;
  line-height: 1.6;
  margin-top: 8px;
  color: var(--nxt-muted);
}

/* ── Atelier (story / vendeur incarné) ───────────────────────────────────── */
.nx-template-editorial .nxt-atelier {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 56px;
  align-items: center;
  padding: 96px clamp(20px, 5vw, 80px);
  max-width: 1280px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .nx-template-editorial .nxt-atelier {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 64px clamp(20px, 5vw, 80px);
  }
}

.nx-template-editorial .nxt-atelier-portrait img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
}

.nx-template-editorial .nxt-atelier-label {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--nxt-muted);
  display: block;
  margin-bottom: 12px;
}

.nx-template-editorial .nxt-atelier-heading {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  font-style: italic;
  margin-bottom: 20px;
  font-family: var(--nxt-heading-font, 'Playfair Display', Georgia, serif);
}

.nx-template-editorial .nxt-atelier-text {
  font-size: 16px;
  line-height: 1.7;
  max-width: 50ch;
  margin: 0;
}

.nx-template-editorial .nxt-atelier-stats {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--nxt-border);
}

/* Override stat-block partial dans ce contexte */
.nx-template-editorial .nxt-atelier-stats .nxt-stat-block {
  display: flex;
  gap: 32px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nx-template-editorial .nxt-atelier-stats .nxt-stat-block__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nx-template-editorial .nxt-atelier-stats .nxt-stat-block__number {
  display: block;
  font-family: var(--nxt-heading-font, 'Playfair Display', Georgia, serif);
  font-style: italic;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--nxt-text);
  margin-bottom: 4px;
}

.nx-template-editorial .nxt-atelier-stats .nxt-stat-block__label {
  color: var(--nxt-muted);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0;
}

.nx-template-editorial .nxt-atelier-cta {
  display: inline-block;
  margin-top: 28px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--nxt-text);
  border-bottom: 1px solid var(--nxt-border);
  padding-bottom: 4px;
  text-decoration: none;
}

/* ── Section produits phare ──────────────────────────────────────────────── */
.nx-template-editorial .nxt-featured {
  padding-bottom: 80px;
}

/* Override product-grid partial dans ce contexte éditorial */
.nx-template-editorial .nxt-featured .nxt-product-grid {
  display: grid;
  grid-template-columns: repeat(var(--nxt-cols, 4), 1fr);
  gap: 36px;
  padding: 32px clamp(20px, 5vw, 80px);
}

@media (max-width: 1024px) {
  .nx-template-editorial .nxt-featured .nxt-product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .nx-template-editorial .nxt-featured .nxt-product-grid {
    grid-template-columns: 1fr;
  }
}

.nx-template-editorial .nxt-product-card {
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.nx-template-editorial .nxt-product-card__image {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--nx-color-surface, #f4f4f4);
}

.nx-template-editorial .nxt-product-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.35s ease;
}

.nx-template-editorial .nxt-product-card__img--placeholder {
  display: block;
}

.nx-template-editorial .nxt-product-card__body {
  padding: 14px 0 0;
}

.nx-template-editorial .nxt-product-card__title {
  font-size: 18px;
  font-style: italic;
  font-family: var(--nxt-heading-font, 'Playfair Display', Georgia, serif);
  margin: 0;
}

.nx-template-editorial .nxt-product-card__price {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--nxt-muted);
}

/* ── Section articles éditoriaux ─────────────────────────────────────────── */
.nx-template-editorial .nxt-editorial-articles {
  padding-bottom: 96px;
  border-top: 1px solid var(--nxt-border);
}

/* ── Placeholder images ──────────────────────────────────────────────────── */
.nx-template-editorial .nxt-img-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 5;
  background:
    linear-gradient(135deg, var(--nxt-accent-soft) 0%, transparent 60%),
    linear-gradient(0deg, color-mix(in srgb, var(--nxt-text) 6%, var(--nxt-bg)), var(--nxt-bg));
  border-top: 1px solid color-mix(in srgb, var(--nxt-text) 8%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--nxt-text) 8%, transparent);
}

.nx-template-editorial .nxt-hero-img.nxt-img-placeholder {
  aspect-ratio: 3 / 4;
}

/* Sans média, le hero reste une composition éditoriale intentionnelle. */
.nx-template-editorial .nxt-editorial-media-fallback {
  position: relative;
  background:
    radial-gradient(circle at 72% 24%, var(--nxt-accent-soft) 0 7%, transparent 7.5%),
    linear-gradient(135deg, transparent 0 49%, color-mix(in srgb, var(--nxt-text) 9%, transparent) 49.2% 50%, transparent 50.2%),
    linear-gradient(135deg, var(--nxt-accent-soft), var(--nxt-bg));
}

.nx-template-editorial .nxt-editorial-media-fallback::after {
  content: 'IMAGE DE MARQUE À AJOUTER';
  position: absolute;
  right: 18px;
  bottom: 18px;
  font-size: 10px;
  letter-spacing: .16em;
  color: color-mix(in srgb, var(--nxt-text) 58%, transparent);
}

.nx-template-editorial .nxt-header-logo.nxt-img-placeholder {
  width: 44px;
  height: 44px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--nxt-accent-soft), color-mix(in srgb, var(--nxt-text) 10%, var(--nxt-bg)));
}

/* ── Demo flag ───────────────────────────────────────────────────────────── */
.nx-template-editorial .nxt-demo-flag {
  display: none; /* revealed by customizer CSS when nx-customizer-active */
}

/* ─── Section produits vendeur ─── */
.nx-template-editorial .nx-shop-front-products {
  padding: 0 clamp(20px, 5vw, 80px) 96px;
  max-width: none;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}

.nx-template-editorial .nx-shop-front-products__title {
  display: flex;
  justify-content: center;
  align-items: baseline;
  font-family: var(--nxt-heading-font, 'Playfair Display', Georgia, serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1;
  margin: 80px 0 32px;
  color: var(--nxt-text);
  text-align: center;
}

.nx-template-editorial .nx-shop-front-products .nxt-product-grid {
  display: grid;
  grid-template-columns: repeat(var(--nxt-cols, 3), 1fr);
  gap: 32px;
  padding: 0;
}

.nx-template-editorial .nx-shop-front-products .nxt-product-grid[data-columns="2"] { --nxt-cols: 2; }
.nx-template-editorial .nx-shop-front-products .nxt-product-grid[data-columns="3"] { --nxt-cols: 3; }
.nx-template-editorial .nx-shop-front-products .nxt-product-grid[data-columns="4"] { --nxt-cols: 4; }

@media (max-width: 1024px) {
  .nx-template-editorial .nx-shop-front-products .nxt-product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .nx-template-editorial .nx-shop-front-products .nxt-product-grid {
    grid-template-columns: 1fr;
  }
}

.nx-template-editorial .nx-shop-front-products .nxt-product-card {
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.nx-template-editorial .nx-shop-front-products .nxt-product-card__image {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--nx-color-surface, #f4f4f4);
}

.nx-template-editorial .nx-shop-front-products .nxt-product-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.35s ease, transform 0.6s ease;
}

.nx-template-editorial .nx-shop-front-products .nxt-product-card::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 0;
  background: var(--nxt-accent, var(--nxt-text));
  transition: width 0.45s ease;
}

.nx-template-editorial .nx-shop-front-products .nxt-product-card:hover::after {
  width: 100%;
}

.nx-template-editorial .nx-shop-front-products .nxt-product-card:hover .nxt-product-card__img {
  opacity: 0.92;
}

.nx-template-editorial .nx-shop-front-products .nxt-product-card__body {
  padding: 14px 0 0;
}

.nx-template-editorial .nx-shop-front-products .nxt-product-card__title {
  font-family: var(--nxt-heading-font, 'Playfair Display', Georgia, serif);
  font-style: italic;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.25;
  margin: 0;
  color: var(--nxt-text);
}

.nx-template-editorial .nx-shop-front-products .nxt-product-card__price {
  display: block;
  margin-top: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--nxt-muted);
}

.nx-template-editorial .nx-shop-front-products__pagination {
  margin-top: 48px;
  display: flex;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--nxt-muted);
}

.nx-template-editorial .nx-shop-front-products__pagination ul {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nx-template-editorial .nx-shop-front-products__pagination a,
.nx-template-editorial .nx-shop-front-products__pagination span {
  display: inline-block;
  padding: 8px 12px;
  border-bottom: 1px solid transparent;
  color: var(--nxt-muted);
  text-decoration: none;
}

.nx-template-editorial .nx-shop-front-products__pagination .current,
.nx-template-editorial .nx-shop-front-products__pagination a:hover {
  color: var(--nxt-text);
  border-bottom-color: var(--nxt-text);
}
