/* =============================
   Dusty Tales École de Mode — style.css
   Warm & Friendly theme
   Mobile-first, Flexbox-only layouts
   ============================= */

/* ---------- CSS Reset & Normalize ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { line-height: 1.5; -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
ul, ol { margin: 0 0 16px 0; padding-left: 20px; }
h1, h2, h3, h4, p, figure, blockquote { margin: 0 0 16px 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- Theme variables (with fallbacks) ---------- */
:root {
  --color-primary: #1F1F1F; /* brand dark */
  --color-secondary: #A36D7D; /* warm rose */
  --color-accent: #F5F1EA; /* warm cream */
  --color-bg: #FFF9F4; /* soft warm background */
  --color-surface: #FFFFFF; /* cards, surfaces */
  --color-muted: #6F6F6F; /* body muted */
  --color-border: #EADBD4; /* soft warm border */
  --color-success: #2F9E44;
  --color-danger: #D64545;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 3px rgba(31,31,31,0.08), 0 1px 2px rgba(31,31,31,0.06);
  --shadow-md: 0 6px 14px rgba(31,31,31,0.08), 0 2px 6px rgba(31,31,31,0.06);
  --shadow-lg: 0 14px 30px rgba(31,31,31,0.10), 0 4px 12px rgba(31,31,31,0.08);

  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-60: 60px;
}

/* ---------- Base typography ---------- */
body {
  background: var(--color-bg);
  color: var(--color-primary);
  font-family: Arial, Helvetica, sans-serif; /* brand body */
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: Georgia, 'Times New Roman', serif; /* brand display */
  color: var(--color-primary);
}

h1 { font-size: 32px; line-height: 1.2; letter-spacing: -0.3px; }
h2 { font-size: 24px; line-height: 1.3; margin-bottom: var(--space-16); }
h3 { font-size: 18px; line-height: 1.4; }

p { color: var(--color-primary); opacity: 0.95; }
small { font-size: 14px; color: var(--color-muted); }

a { color: var(--color-secondary); text-underline-offset: 2px; }
a:hover { text-decoration: underline; }

/* Accessible focus */
:focus-visible { outline: 3px solid rgba(163,109,125,0.45); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ---------- Layout containers (Flexbox-only) ---------- */
.container {
  display: flex; /* flex-only rule */
  flex-direction: column;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.content-wrapper {
  display: flex; /* flex-only rule */
  flex-direction: column;
  gap: var(--space-20);
}

/* Mandatory spacing patterns */
.section { margin-bottom: 60px; padding: 40px 20px; }
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-sm); padding: var(--space-20); }
.content-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.text-image-section { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.testimonial-card { display: flex; align-items: center; gap: 20px; padding: 20px; }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* General section spacing (applies even without .section class) */
section { padding: var(--space-32) 0; }
section .container { gap: var(--space-24); }

/* ---------- Header & Navigation ---------- */
header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: relative;
  z-index: 50;
}

header .content-wrapper {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  padding: var(--space-12) 0;
}

.logo { display: flex; align-items: center; }
.logo img { height: 32px; width: auto; }

.main-nav {
  display: none; /* mobile hidden */
  align-items: center;
  gap: var(--space-16);
}

.main-nav a {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--color-primary);
}

.main-nav a:hover { background: var(--color-accent); text-decoration: none; }

.mobile-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.mobile-menu-toggle:hover { background: var(--color-accent); }

/* Primary Call to Action in header */
header .button.primary { display: none; }

/* ---------- Mobile Menu (overlay) ---------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--color-surface);
  display: flex; /* flex-only rule */
  flex-direction: column;
  padding: var(--space-20);
  gap: var(--space-20);
  transform: translateX(100%);
  opacity: 0; visibility: hidden;
  transition: transform 320ms ease, opacity 240ms ease, visibility 240ms ease;
  z-index: 1000;
}

.mobile-menu.open,
.mobile-menu.active,
body.menu-open .mobile-menu,
body.show-menu .mobile-menu { transform: translateX(0); opacity: 1; visibility: visible; }

.mobile-menu-close {
  align-self: flex-end;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-accent);
  cursor: pointer;
}
.mobile-menu-close:hover { background: #F8EFE6; }

.mobile-nav { display: flex; flex-direction: column; gap: 12px; }
.mobile-nav a {
  padding: 12px 10px;
  border-radius: var(--radius-md);
  background: var(--color-accent);
  color: var(--color-primary);
}
.mobile-nav a:hover { background: #F0E8E0; text-decoration: none; }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 120ms ease;
  text-align: center;
}

.button.primary { background: var(--color-secondary); color: #FFFFFF; box-shadow: var(--shadow-sm); }
.button.primary:hover { background: #915E6D; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.button.primary:active { transform: translateY(0); }

.button.secondary { background: var(--color-accent); color: var(--color-primary); border-color: var(--color-border); }
.button.secondary:hover { background: #F0E6DC; }

.button.ghost { background: transparent; color: var(--color-secondary); border-color: var(--color-secondary); }
.button.ghost:hover { background: rgba(163,109,125,0.08); }

.cta-group { display: flex; flex-wrap: wrap; gap: var(--space-12); }

/* ---------- Hero ---------- */
.hero {
  background: var(--color-accent);
  border-bottom: 1px solid var(--color-border);
}
.hero .container { padding-top: var(--space-32); padding-bottom: var(--space-32); }
.hero .content-wrapper { align-items: flex-start; gap: var(--space-16); }
.hero h1 { font-size: 28px; }
.hero p { max-width: 70ch; }

/* ---------- Text & lists ---------- */
.text-section { display: flex; flex-direction: column; gap: var(--space-16); max-width: 950px; }
.text-section ul, .text-section ol { display: flex; flex-direction: column; gap: 10px; }
.text-section li { display: flex; align-items: center; gap: 10px; }
.text-section li img { width: 20px; height: 20px; }

/* As cards inside text-sections when using inner <div> blocks */
.text-section > div {
  display: flex; /* flex-only */
  flex-direction: column;
  gap: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-20);
}
.text-section > div:hover { box-shadow: var(--shadow-md); }

/* ---------- Testimonials (light bg with dark text for readability) ---------- */
.testimonial-card {
  background: #FFFAF5; /* very light warm */
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  color: var(--color-primary);
}
.testimonial-card p { margin: 0; }

/* ---------- Footer ---------- */
footer {
  background: var(--color-primary);
  color: #F7F3EF;
  padding: var(--space-32) 0;
  margin-top: var(--space-40);
}
footer .content-wrapper { gap: var(--space-16); }
footer .logo img { height: 28px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 12px; }
.footer-nav a { color: #F7F3EF; opacity: 0.9; padding: 6px 8px; border-radius: var(--radius-sm); }
.footer-nav a:hover { background: rgba(255,255,255,0.08); text-decoration: none; }
footer address { font-style: normal; opacity: 0.9; }
footer a { color: #F7F3EF; }

/* ---------- Cards & utility elements ---------- */
.card:hover { box-shadow: var(--shadow-md); }

.content-grid > * { flex: 1 1 280px; min-width: 260px; }
.card-container > * { flex: 1 1 280px; min-width: 260px; }

/* ---------- Mobile navigation visibility rules ---------- */
@media (min-width: 992px) {
  .main-nav { display: flex; }
  header .button.primary { display: inline-flex; }
  .mobile-menu-toggle { display: none; }
}

/* ---------- Responsive Typography ---------- */
@media (min-width: 768px) {
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
  h3 { font-size: 20px; }
  .hero h1 { font-size: 48px; }
}

/* ---------- Responsive Layout Adjustments ---------- */
@media (min-width: 768px) {
  .hero .content-wrapper { flex-direction: column; align-items: flex-start; }
  .text-image-section { flex-direction: row; }
}

/* ---------- Accessibility helpers ---------- */
.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; }

/* ---------- Cookie Consent Banner ---------- */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex; /* flex-only */
  flex-direction: column;
  gap: var(--space-12);
  background: #FFF7EF;
  color: var(--color-primary);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -8px 20px rgba(31,31,31,0.08);
  padding: var(--space-16) var(--space-20);
  transform: translateY(100%);
  opacity: 0; visibility: hidden;
  transition: transform 280ms ease, opacity 200ms ease, visibility 200ms ease;
  z-index: 1100;
}
.cookie-banner.show,
.cookie-banner.visible,
body.cookie-open .cookie-banner { transform: translateY(0); opacity: 1; visibility: visible; }

.cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-actions .button { flex: 0 1 auto; }
.cookie-actions .button.primary { background: var(--color-secondary); color: #fff; }
.cookie-actions .button.secondary { background: var(--color-accent); border: 1px solid var(--color-border); }
.cookie-actions .button.ghost { border-color: var(--color-primary); color: var(--color-primary); }

/* ---------- Cookie Preferences Modal ---------- */
.cookie-modal {
  position: fixed;
  inset: 0;
  display: flex; /* flex-only */
  align-items: center;
  justify-content: center;
  background: rgba(31,31,31,0.45);
  padding: var(--space-20);
  opacity: 0; visibility: hidden;
  transition: opacity 220ms ease, visibility 220ms ease;
  z-index: 1200;
}
.cookie-modal.open,
.cookie-modal.active,
body.cookie-modal-open .cookie-modal { opacity: 1; visibility: visible; }

.cookie-modal-content {
  display: flex; /* flex-only */
  flex-direction: column;
  gap: var(--space-16);
  background: var(--color-surface);
  color: var(--color-primary);
  width: 100%; max-width: 720px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  padding: var(--space-24);
}
.cookie-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cookie-modal-body { display: flex; flex-direction: column; gap: 12px; }
.cookie-modal-footer { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* Cookie category rows */
.cookie-category { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-accent); }
.cookie-note { color: var(--color-muted); font-size: 14px; }

/* Toggle switch (checkbox) */
.toggle { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.toggle input[type="checkbox"] { appearance: none; width: 44px; height: 26px; border-radius: 26px; background: #DDD1C9; position: relative; outline: none; transition: background-color 160ms ease; }
.toggle input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #FFFFFF; box-shadow: var(--shadow-sm); transition: transform 160ms ease; }
.toggle input[type="checkbox"]:checked { background: var(--color-secondary); }
.toggle input[type="checkbox"]:checked::after { transform: translateX(18px); }

/* ---------- Micro-interactions ---------- */
.card, .text-section > div, .testimonial-card, .button { transition: box-shadow 180ms ease, transform 120ms ease, background-color 180ms ease, color 180ms ease; }
.card:hover, .text-section > div:hover, .testimonial-card:hover { transform: translateY(-2px); }

/* ---------- Tables (if any appear) ---------- */
table { width: 100%; border-collapse: collapse; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--color-border); }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid var(--color-border); }
th { background: var(--color-accent); font-weight: 600; }

/* ---------- Forms (generic) ---------- */
input[type="text"], input[type="email"], input[type="tel"], textarea, select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm) inset;
}
input:focus, textarea:focus, select:focus { border-color: var(--color-secondary); outline: none; box-shadow: 0 0 0 3px rgba(163,109,125,0.15); }
label { display: block; margin-bottom: 6px; font-weight: 600; }

/* ---------- Utility spacing ---------- */
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-20 { margin-top: 20px !important; }
.mb-20 { margin-bottom: 20px !important; }

/* ---------- Page-specific gentle touches ---------- */
/* Hero headings spacing */
.hero .cta-group { margin-top: 6px; }

/* Index: featured formations blocks already styled via .text-section > div */

/* Pricing page: emphasize money values */
.page-tarifs h3 + p { font-weight: 600; }

/* Contact link list spacing handled by .text-section li */

/* ---------- Desktop refinements ---------- */
@media (min-width: 992px) {
  .container { padding: 0 24px; }
  header .content-wrapper { gap: var(--space-20); }
  .hero .container { padding-top: var(--space-40); padding-bottom: var(--space-40); }
  .cta-group { gap: var(--space-16); }
}

/* ---------- Ensure adequate gaps between all cards/sections ---------- */
section > .container > .content-wrapper > * + * { margin-top: 0; }

/* ---------- Prevent overlapping by spacing ---------- */
section .testimonial-card + .testimonial-card { margin-top: var(--space-16); }

/* ---------- Link styles in content ---------- */
.text-section a { color: var(--color-secondary); text-decoration: underline; text-underline-offset: 3px; }
.text-section a:hover { text-decoration-thickness: 2px; }

/* ---------- Decorative (non-content) only absolute/fixed used above for overlays ---------- */

/* ---------- Warm dividers ---------- */
hr { border: none; border-top: 1px solid var(--color-border); margin: var(--space-24) 0; }

/* ---------- Print basics ---------- */
@media print {
  .mobile-menu, .cookie-banner, .cookie-modal { display: none !important; }
  a { text-decoration: underline; }
}
