/*
Theme Name: Bien Rédiger Custom
Theme URI: https://bien-rediger.fr
Author: Héséd CAKPOVI
Description: Thème WordPress sur mesure pour la vente d'ebooks d'orthographe et rédaction.
Version: 4.1
Text Domain: bien-rediger
*/

/* ── Variables ───────────────────────────────────────────── */
:root {
  --font-sans:    "Fira Sans Condensed", sans-serif;
  --font-cursive: "Pinyon Script", cursive;
  --primary:   #0F172A;
  --accent:    #C0162A;
  --purple:    #3D1A8E;
  --secondary: #d4e0ef;
  --text-dark: #1A1207;
}

/* ── Reset & base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  color: var(--text-dark);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ── Typographie ─────────────────────────────────────────── */
h1 { font-family: var(--font-cursive); line-height: 1.15; }
h2, h3, h4 { font-weight: 700; }

/* ── Prose (contenu Gutenberg) ───────────────────────────── */
.prose { color: var(--text-dark); font-family: var(--font-sans); line-height: 1.75; }
.prose h1 { font-family: var(--font-cursive); font-size: 3rem; margin-bottom: 1.5rem; }
.prose h2 { font-size: 1.875rem; font-weight: 700; color: var(--primary); margin: 2.5rem 0 1.25rem; border-bottom: 2px solid #f3f4f6; padding-bottom: .5rem; }
.prose h3 { font-size: 1.375rem; font-weight: 700; color: var(--purple); margin: 2rem 0 .75rem; }
.prose p  { margin-bottom: 1.25rem; }
.prose ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1.25rem; }
.prose ol { list-style: decimal; padding-left: 1.5rem; margin-bottom: 1.25rem; }
.prose li { margin-bottom: .4rem; }
.prose strong { font-weight: 700; color: var(--text-dark); }
.prose a  { color: var(--accent); text-decoration: underline; font-weight: 600; }
.prose a:hover { color: #9e1122; }
.prose blockquote { border-left: 4px solid var(--accent); padding: 1rem 1.5rem; margin: 1.5rem 0; background: #fef9f9; border-radius: 0 .75rem .75rem 0; font-style: italic; color: #555; }
.prose code { background: #f3f4f6; padding: .15em .4em; border-radius: .3em; font-size: .9em; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.prose th, .prose td { padding: .75rem 1rem; border: 1px solid #e5e7eb; }
.prose th { background: #f9fafb; font-weight: 700; }

/* ── Animations ──────────────────────────────────────────── */
@keyframes blob {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%       { transform: translate(30px,-50px) scale(1.1); }
  66%       { transform: translate(-20px,20px) scale(.9); }
}
.animate-blob { animation: blob 7s infinite; }
.animation-delay-2000 { animation-delay: 2s; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { opacity: 0; }
.fade-in-up.is-visible { animation: fadeInUp .55s ease forwards; }

/* ── Newsletter feedback ─────────────────────────────────── */
.newsletter-msg { min-height: 1.5em; }
.nl-success { color: #bbf7d0; }
.nl-error   { color: #fca5a5; }
.nl-submitted .newsletter-form { opacity: .6; pointer-events: none; }

/* ── FAQ ─────────────────────────────────────────────────── */
.faq-icon { transition: transform .25s ease; }

/* ── Page Ressources ─────────────────────────────────────── */
.ressources-hero { background: linear-gradient(135deg,#0F172A 0%,#1e293b 60%,#C0162A22 100%); position: relative; overflow: hidden; }
.ressources-hero::before { content:''; position:absolute; inset:0; background-image: radial-gradient(circle at 20% 80%,#C0162A18 0%,transparent 50%), radial-gradient(circle at 80% 20%,#d4e0ef12 0%,transparent 50%); }

.badge-free { background: linear-gradient(135deg,#16a34a,#15803d); color:white; font-size:.7rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; padding:.25rem .65rem; border-radius:999px; box-shadow:0 0 0 3px #dcfce7; }
.card-free  { background:white; border-radius:1.25rem; border:1.5px solid #f0fdf4; box-shadow:0 2px 12px rgba(22,163,74,.07); transition:transform .2s,box-shadow .2s; display:flex; flex-direction:column; }
.card-free:hover  { transform:translateY(-4px); box-shadow:0 8px 28px rgba(22,163,74,.13); }
.card-premium     { background:white; border-radius:1.25rem; border:1.5px solid #ede9fe; box-shadow:0 2px 12px rgba(109,40,217,.06); transition:transform .2s,box-shadow .2s; display:flex; flex-direction:column; }
.card-premium:hover { transform:translateY(-4px); box-shadow:0 8px 28px rgba(109,40,217,.12); }

.category-block  { background:white; border-radius:1.5rem; border:1.5px solid #ede9fe; overflow:hidden; box-shadow:0 2px 16px rgba(109,40,217,.06); }
.category-header { background:linear-gradient(135deg,#7c3aed,#6d28d9); padding:1.5rem 2rem; display:flex; align-items:flex-start; gap:1rem; }
.category-header-icon { width:2.75rem; height:2.75rem; background:rgba(255,255,255,.15); border-radius:.75rem; display:flex; align-items:center; justify-content:center; flex-shrink:0; margin-top:2px; }
.category-header h2   { color:white; font-size:1.35rem; font-weight:800; margin:0 0 .35rem; line-height:1.2; }
.category-header p    { color:rgba(255,255,255,.82); font-size:.9rem; margin:0; line-height:1.5; }
.category-count-badge { margin-left:auto; flex-shrink:0; background:rgba(255,255,255,.2); color:white; font-size:.75rem; font-weight:700; padding:.3rem .75rem; border-radius:999px; white-space:nowrap; align-self:flex-start; }
.category-products    { padding:1.5rem; background:#faf8ff; }

.section-divider      { display:flex; align-items:center; gap:1.25rem; margin-bottom:2rem; }
.section-divider h2   { white-space:nowrap; font-size:1.75rem; font-weight:800; margin:0; }
.section-divider-line { height:2px; flex-grow:1; border-radius:1px; }

.btn-download { display:flex; align-items:center; justify-content:center; gap:.5rem; width:100%; padding:.65rem 1rem; border-radius:.75rem; font-weight:600; font-size:.9rem; border:2px solid #C0162A; color:#C0162A; background:white; transition:background .18s,color .18s; text-decoration:none; }
.btn-download:hover { background:#C0162A; color:white; }
.btn-buy      { display:flex; align-items:center; justify-content:center; gap:.5rem; width:100%; padding:.75rem 1rem; border-radius:.75rem; font-weight:700; font-size:.9rem; background:linear-gradient(135deg,#7c3aed,#6d28d9); color:white; text-decoration:none; box-shadow:0 4px 14px rgba(109,40,217,.3); transition:box-shadow .2s,transform .15s; }
.btn-buy:hover { box-shadow:0 6px 20px rgba(109,40,217,.45); transform:translateY(-1px); }

.resource-icon { width:2.75rem; height:2.75rem; border-radius:.75rem; display:flex; align-items:center; justify-content:center; }
.price-tag     { font-size:1.5rem; font-weight:800; color:#0F172A; line-height:1; }

/* ── Page produit single-ressources ─────────────────────── */
.product-hero { background: linear-gradient(135deg,#0F172A 0%,#1e293b 60%,#3D1A8E22 100%); }

/* ── Breadcrumb ──────────────────────────────────────────── */
nav[aria-label="Fil d'Ariane"] { background: #f9fafb; border-bottom: 1px solid #f3f4f6; }
nav[aria-label="Fil d'Ariane"] a:hover { color: var(--accent); }

/* ── Boutons globaux ─────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 1rem 2rem; border-radius: 9999px; font-size: 1.125rem; font-weight: 700;
  color: white; background: var(--accent); box-shadow: 0 4px 14px rgba(192,22,42,.3);
  text-decoration: none; transition: all .2s;
}
.btn-primary:hover { box-shadow: 0 8px 24px rgba(192,22,42,.45); transform: translateY(-2px); }

/* ── Responsive images ───────────────────────────────────── */
.aspect-\[4\/5\] { aspect-ratio: 4/5; }

/* ── Focus visible (accessibilité) ──────────────────────── */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ── Skip to content ─────────────────────────────────────── */
.skip-link {
  position: absolute; left: -9999px; top: 1rem; z-index: 9999;
  background: var(--accent); color: white; padding: .75rem 1.5rem;
  border-radius: 0 .5rem .5rem 0; font-weight: 700; text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ── WP classes ──────────────────────────────────────────── */
.aligncenter { display: block; margin: 0 auto; }
.alignleft   { float: left; margin: 0 1.5rem 1rem 0; }
.alignright  { float: right; margin: 0 0 1rem 1.5rem; }
.wp-caption  { max-width: 100%; }

/* ── 404 ─────────────────────────────────────────────────── */
.error-404-hero { background: linear-gradient(135deg,#0F172A,#1e293b); }

/* ── Accessibilité — réduction de mouvement ──────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
