/*
 * ♠ MAISON AUREL — Design system
 * Documentation : docs/CHARTE_GRAPHIQUE.md
 *
 * Ce fichier ne contient que ce qui est partagé par au moins deux pages.
 * Le style propre à une page va dans static/css/pages/<page>.css,
 * chargé via {% block extra_css %}.
 *
 *  1. Tokens
 *  2. Reset
 *  3. Typographie
 *  4. Pique ♠
 *  5. Boutons
 *  6. Sections & en-têtes de page
 *  7. Navigation
 *  8. Cartes produit
 *  9. Pied de page
 * 10. Formulaires & messages
 * 11. Texte long & pages de message
 * 12. Pagination
 * 13. Utilitaires
 */


/* ═══════ 1. TOKENS ═══════ */

:root {
  /* Palette */
  --navy:          #0D1B2A;
  --navy-deep:     #070F18;
  --navy-mid:      #1B2D44;
  --gold:          #C5A258;
  --gold-light:    #D4B978;
  --gold-muted:    #A8935A;
  --ivory:         #F5F0E8;
  --ivory-warm:    #EDE6D8;
  --white:         #FDFBF7;
  --charcoal:      #1B1B1B;
  --taupe:         #8B7D6B;
  --taupe-light:   #B5A998;

  /*
   * Variantes réservées au TEXTE sur fond clair. Les tokens ci-dessus
   * conservent la teinte d'origine pour le décoratif (♠, bordures, boutons,
   * texte sur fond sombre) ; ceux-ci sont assombris pour atteindre le
   * contraste WCAG AA de 4,5:1 exigé par un texte de petite taille.
   *   --taupe-texte  : 4,95:1 sur blanc cassé — 4,51:1 sur ivoire
   *   --gold-texte   : 4,98:1 sur blanc cassé — 4,54:1 sur ivoire
   */
  --taupe-texte:   #786C5D;
  --gold-texte:    #7C6C41;

  /* États (jamais de couleur vive saturée — cf. charte) */
  --success:       #4A8C4A;
  --success-bg:    rgba(74, 140, 74, 0.12);
  --danger:        #A04040;
  --danger-bg:     rgba(160, 64, 64, 0.10);

  /* Bordures contextuelles */
  --border-gold-subtle: rgba(197, 162, 88, 0.12);
  --border-gold-light:  rgba(197, 162, 88, 0.15);
  --border-gold-med:    rgba(197, 162, 88, 0.30);

  /* Typographie */
  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Rythme */
  --section-pad-x: 6rem;
  --section-pad-y: 6rem;
  --nav-height:    72px;

  /* Transitions */
  --t-fast: 0.3s;
  --t-slow: 0.4s;
}

@media (max-width: 1024px) {
  :root {
    --section-pad-x: 3rem;
    --section-pad-y: 4rem;
  }
}

@media (max-width: 640px) {
  :root {
    --section-pad-x: 1.5rem;
    --section-pad-y: 3rem;
  }
}


/* ═══════ 2. RESET ═══════ */

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  color: var(--charcoal);
  background: var(--white);
  line-height: 1.7;
  /*
   * Pas de -webkit-font-smoothing: antialiased. Sur macOS il amincit les
   * glyphes d'environ une demi-graisse : combiné à de l'Inter Light, le texte
   * paraissait délavé. Le rendu par défaut est plus net.
   */
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/*
 * Sans « color: inherit », tout <a> non stylé explicitement — un titre de carte
 * produit, un lien glissé dans un paragraphe — repasse au bleu du navigateur.
 * Les règles qui définissent une couleur (nav, pied de page, .prose…) priment.
 */
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* Respecte les préférences système d'accessibilité */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible cohérent sur tout le site */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 200;
  padding: 12px 20px;
  background: var(--gold);
  color: var(--navy-deep);
  font-family: var(--font-serif);
  font-size: 14px;
  transition: top var(--t-fast);
}
.skip-link:focus { top: 1rem; }


/* ═══════ 3. TYPOGRAPHIE ═══════ */

.t-serif { font-family: var(--font-serif); }
.t-sans  { font-family: var(--font-sans); }

.t-hero {
  font-family: var(--font-serif);
  font-size: clamp(42px, 5vw, 64px);
  font-weight: 300;
  line-height: 1.1;
}

.t-section {
  font-family: var(--font-serif);
  font-size: clamp(32px, 3.5vw, 44px);
  font-weight: 300;
  line-height: 1.15;
}

.t-card {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 400;
}

.t-product {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 500;
}

.t-eyebrow {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2em;
}

.t-body {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
}

.t-meta {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.03em;
}

.t-italic { font-style: italic; }

/* Couleurs de texte */
.tc-ivory      { color: var(--ivory); }
.tc-gold       { color: var(--gold); }
.tc-gold-light { color: var(--gold-light); }
.tc-gold-muted { color: var(--gold-muted); }   /* fond sombre / décoratif */
.tc-gold-texte { color: var(--gold-texte); }   /* fond clair — contraste AA */
.tc-charcoal   { color: var(--charcoal); }
.tc-taupe      { color: var(--taupe-texte); }  /* fond clair */
.tc-taupe-lt   { color: var(--taupe-light); }  /* fond sombre */


/* ═══════ 4. PIQUE — ÉLÉMENT SIGNATURE ═══════ */

.spade {
  display: inline-block;
  color: var(--gold);
  font-size: inherit;
  line-height: 1;
}

.spade-divider {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: center;
  margin: 2rem 0;
}

.spade-divider::before,
.spade-divider::after {
  content: '';
  height: 1px;
  width: 60px;
  background: var(--gold-muted);
}

.spade-divider .spade {
  font-size: 16px;
  opacity: 0.7;
}


/* ═══════ 5. BOUTONS ═══════ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background var(--t-slow), color var(--t-slow),
              border-color var(--t-slow), transform var(--t-slow);
}

.btn-primary {
  padding: 14px 32px;
  background: var(--gold);
  color: var(--navy-deep);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.btn-primary:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
}

.btn-outline {
  padding: 10px 24px;
  border: 1px solid var(--gold-muted);
  color: var(--gold-texte);
  background: transparent;
  font-size: 15px;
}
.btn-outline:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
}

.btn-ghost {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--taupe-light);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--taupe);
  letter-spacing: 0.05em;
}
.btn-ghost:hover {
  color: var(--gold-light);
  border-color: var(--gold-light);
}

/* Sur mobile les boutons pleins occupent la largeur — cf. charte, règles mobile. */
@media (max-width: 640px) {
  .btn-primary { width: 100%; justify-content: center; }
}


/* ═══════ 6. SECTIONS & EN-TÊTES DE PAGE ═══════ */

.section {
  padding: var(--section-pad-y) var(--section-pad-x);
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 4rem;
}

/*
 * En-tête sombre en haut des pages intérieures (catalogue, contact,
 * à propos, mariage). Le padding haut dégage la nav fixe.
 */
.page-header {
  padding: calc(var(--nav-height) + 3rem) var(--section-pad-x) 3rem;
  background: var(--navy-deep);
  text-align: center;
}
.page-header .spade-divider:last-child { margin-bottom: 0; }

.page-header-intro {
  max-width: 640px;
  margin: 2rem auto 0;
  font-size: 15px;
  color: var(--taupe-light);
  line-height: 1.8;
}

.bg-white { background: var(--white); }
.bg-ivory { background: var(--ivory); }
.bg-navy  { background: var(--navy); }
.bg-deep  { background: var(--navy-deep); }


/* ═══════ 7. NAVIGATION ═══════ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 var(--section-pad-x);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13, 27, 42, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-gold-light);
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--ivory);
  letter-spacing: 0.15em;
}
.nav-logo .spade { font-size: 18px; margin: 0 8px; }

.nav-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-links a {
  color: var(--taupe-light);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.08em;
  transition: color var(--t-fast);
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--gold-light); }

.nav-cta {
  padding: 9px 24px;
  border: 1px solid var(--gold-muted);
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 0.05em;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-links .nav-cta { font-size: 14px; }
.nav-cta:hover {
  background: var(--gold);
  color: var(--navy);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--ivory);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.75rem var(--section-pad-x) 2rem;
    background: var(--navy-deep);
    border-bottom: 1px solid var(--border-gold-light);
  }
  .nav-links.is-open { display: flex; }
}


/* ═══════ 8. CARTES PRODUIT ═══════ */

.product-card { display: block; }
.product-card h3 { margin-bottom: 2px; }

.product-card-image {
  aspect-ratio: 3 / 4;
  background: var(--ivory);
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--t-slow);
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-image__empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  opacity: 0.12;
}

.product-card:hover .product-card-image { transform: translateY(-4px); }

.product-card-image::after {
  content: 'Voir le détail';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background: rgba(13, 27, 42, 0.9);
  color: var(--gold-light);
  font-family: var(--font-serif);
  font-size: 13px;
  text-align: center;
  letter-spacing: 0.05em;
  transform: translateY(100%);
  transition: transform var(--t-slow);
}

.product-card:hover .product-card-image::after,
.product-card:focus-visible .product-card-image::after {
  transform: translateY(0);
}

.product-price {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--gold-texte);
  font-weight: 500;
  margin-top: 6px;
}


/* ═══════ 9. PIED DE PAGE ═══════ */

.footer {
  background: var(--navy-deep);
  padding: 4rem var(--section-pad-x) 2rem;
  border-top: 1px solid var(--border-gold-subtle);
}

.footer a {
  color: var(--taupe);
  font-size: 14px;
  font-weight: 400;
  transition: color var(--t-fast);
}
.footer a:hover { color: var(--gold-light); }

.footer h2 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--ivory);
  margin-bottom: 1.2rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
}

.footer-brand p {
  margin-top: 1rem;
  max-width: 320px;
  font-size: 14px;
  color: var(--taupe);
  line-height: 1.7;
}

.footer-col li { margin-bottom: 0.6rem; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 2rem;
  border-top: 1px solid var(--border-gold-subtle);
}
.footer-bottom p {
  font-size: 13px;
  color: var(--taupe);
}

.footer-social {
  display: flex;
  gap: 1rem;
}
.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-gold-subtle);
  color: var(--taupe);
}
.footer-social a:hover {
  border-color: var(--gold-muted);
  color: var(--gold-light);
}

@media (max-width: 900px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
}
@media (max-width: 640px) {
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { justify-content: center; text-align: center; }
}


/* ═══════ 10. FORMULAIRES & MESSAGES ═══════ */

.form-field { margin-bottom: 1.5rem; }

.form-field label {
  display: block;
  font-size: 14px;
  color: var(--taupe-texte);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--ivory-warm);
  background: var(--white);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  color: var(--charcoal);
  transition: border-color var(--t-fast);
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--gold-muted);
}

.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--taupe-light); }

.form-field .form-error {
  margin-top: 4px;
  font-size: 12px;
  color: var(--danger);
}
.form-field .form-help {
  margin-top: 4px;
  font-size: 12px;
  color: var(--taupe-light);
}

/* Champ anti-spam : invisible pour l'humain, rempli par les robots */
.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.alert {
  padding: 12px 20px;
  margin-bottom: 1rem;
  font-size: 14px;
  border: 1px solid;
}
.alert-success { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.alert-error   { background: var(--danger-bg);  border-color: var(--danger);  color: var(--danger); }
.alert-info    { background: rgba(197, 162, 88, 0.1); border-color: var(--gold-muted); color: var(--gold-texte); }


/* ═══════ 11. TEXTE LONG ═══════ */

/* Pages légales, « notre histoire » — colonne de lecture centrée. */
.prose {
  max-width: 720px;
  margin: 0 auto;
}

.prose h1 { margin-bottom: 2rem; }

.prose h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--charcoal);
  margin: 2.5rem 0 0.75rem;
}

.prose p {
  font-size: 15px;
  color: var(--taupe-texte);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.prose a {
  color: var(--gold-texte);
  border-bottom: 1px solid var(--gold-texte);
}
.prose a:hover { color: var(--gold); border-color: var(--gold); }

/* Variante aérée pour les pages éditoriales */
.prose--large p { font-size: 15px; line-height: 1.9; margin-bottom: 1.5rem; }
.prose--large h2 { font-size: 28px; margin: 3rem 0 1rem; }

/* Page de texte autonome, sans en-tête sombre */
.page-prose {
  padding: calc(var(--nav-height) + 3rem) var(--section-pad-x) var(--section-pad-y);
}


/* ─── Page de message centrée : erreurs, confirmation de commande ─── */
.message-page {
  padding: calc(var(--nav-height) + 6rem) var(--section-pad-x) var(--section-pad-y);
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}
.message-page > .spade {
  font-size: 56px;
  display: block;
  margin-bottom: 2rem;
  opacity: 0.2;
}
.message-page p { margin: 1.5rem 0 2rem; }

/* ═══════ 12. PAGINATION ═══════ */

.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.pagination a,
.pagination span {
  padding: 8px 16px;
  font-family: var(--font-serif);
  font-size: 15px;
  border: 1px solid var(--ivory-warm);
  color: var(--taupe-texte);
  transition: border-color var(--t-fast), color var(--t-fast);
}
.pagination a:hover { border-color: var(--gold-muted); color: var(--gold-texte); }
.pagination .is-current {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy-deep);
}


/* ═══════ 13. UTILITAIRES ═══════ */

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}
.empty-state .spade {
  font-size: 48px;
  opacity: 0.15;
  display: block;
  margin-bottom: 1.5rem;
}
.empty-state p { margin-top: 1rem; }

.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;
}
