/* ═══════════════════════════════════════════════════════════
   style.css — Généalogiste Narrative
   Complément au Tailwind CDN
═══════════════════════════════════════════════════════════ */

/* ─── Variables ─────────────────────────────────────────── */
:root {
  --navy:          #1E2B4A;
  --navy-light:    #2D3F6B;
  --terracotta:    #B5704F;
  --terra-light:   #C8896E;
  --sage:          #5D8A6E;
  --gold:          #C9A85C;
  --cream:         #FAFAF7;
  --parchment:     #F5ECD7;
  --parchment-dk:  #E8D9BD;
  --ink:           #2C2416;
  --ink-med:       #5C4D3C;
  --ink-light:     #8B7D70;
  --radius:        0.5rem;
  --transition:    0.25s ease;
}

/* ─── Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--cream);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar */
::-webkit-scrollbar        { width: 6px; }
::-webkit-scrollbar-track  { background: var(--cream); }
::-webkit-scrollbar-thumb  { background: var(--gold); border-radius: 3px; }

/* Selection */
::selection { background: var(--gold); color: var(--navy); }

/* ─── Focus visible (global, WCAG 2.1 AA) ───────────────── */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ─── Navigation ─────────────────────────────────────────── */
#navbar {
  background: transparent;
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

#navbar.scrolled {
  background: rgba(250, 250, 247, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 24px rgba(44, 36, 22, 0.08);
}

/* Logo / links colour flip when scrolled */
#navbar.scrolled .nav-logo  { color: var(--navy); }
#navbar.scrolled .nav-sub   { color: var(--gold); }
#navbar.scrolled .nav-link  { color: var(--ink-med); }
#navbar.scrolled .nav-link:hover { color: var(--terracotta); }
#navbar.scrolled .nav-burger-color { color: var(--navy); }

.nav-burger-color { color: white; }

/* ─── Hero ───────────────────────────────────────────────── */
.hero-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23C9A85C' fill-opacity='1' fill-rule='evenodd'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
}

.scroll-pulse {
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.35; transform: scaleY(1); }
  50%       { opacity: 0.7;  transform: scaleY(1.08); }
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn-primary {
  background-color: var(--terracotta);
  color: #fff;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn-primary:hover {
  background-color: var(--terra-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(181, 112, 79, 0.35);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: transparent;
  color: var(--cream);
  border: 1.5px solid rgba(201, 168, 92, 0.45);
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
.btn-secondary:hover {
  border-color: var(--gold);
  background: rgba(201, 168, 92, 0.08);
  transform: translateY(-2px);
}
.btn-secondary:active { transform: translateY(0); }

.btn-navy {
  background-color: var(--navy);
  color: var(--cream);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn-navy:hover {
  background-color: var(--navy-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(30, 43, 74, 0.28);
}
.btn-navy:active  { transform: translateY(0); }
.btn-navy:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ─── Portrait frame ─────────────────────────────────────── */
.portrait-frame {
  background: linear-gradient(135deg, var(--parchment) 0%, var(--parchment-dk) 100%);
}

/* ─── Method cards (dark bg) ─────────────────────────────── */
.method-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(201, 168, 92, 0.18);
  border-radius: var(--radius);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.method-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(201, 168, 92, 0.45);
  transform: translateY(-5px);
}

.method-num {
  font-size: 5rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(201, 168, 92, 0.09);
  position: absolute;
  top: 0.75rem;
  right: 1.25rem;
  pointer-events: none;
  user-select: none;
}

/* ─── Story card ─────────────────────────────────────────── */
.story-card {
  border: 1px solid var(--parchment-dk);
  background: var(--cream);
}

.story-image-side {
  background: linear-gradient(145deg, var(--navy) 0%, var(--navy-light) 100%);
  position: relative;
}

.story-caption {
  background: rgba(30, 43, 74, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(201, 168, 92, 0.2);
}

.context-badge {
  background: rgba(181, 112, 79, 0.07);
  border-left: 3px solid var(--terracotta);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ─── Service cards ──────────────────────────────────────── */
.service-card {
  /* hover handled by Tailwind utility classes in HTML */
}

/* ─── Form elements ──────────────────────────────────────── */
.form-label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 0.4rem;
}

.form-input {
  display: block;
  width: 100%;
  padding: 0.8125rem 1rem;
  background: #fff;
  border: 1.5px solid var(--parchment-dk);
  border-radius: 0.375rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  color: var(--ink);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}
.form-input::placeholder { color: var(--ink-light); }
.form-input:hover        { border-color: var(--ink-light); }
.form-input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30, 43, 74, 0.1);
}
.form-input.is-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.09);
}

/* Select arrow */
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238B7D70'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  background-size: 1.125rem;
  padding-right: 2.75rem;
  cursor: pointer;
}

/* Error messages */
.form-err {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: #dc2626;
  margin-top: 0.25rem;
}

/* ─── Reveal (scroll animation) ─────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Active nav link indicator ─────────────────────────── */
.nav-link.active-link { color: var(--gold) !important; }

/* ─── Mobile menu open state ─────────────────────────────── */
#mobile-menu.is-open { display: block; }

/* ─── Blockquote ─────────────────────────────────────────── */
blockquote p::before { content: '«\00a0'; }
blockquote p::after  { content: '\00a0»'; }

/* ─── Reduced motion (WCAG 2.1 — 1.4.3) ─────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .scroll-pulse { animation: none; }

  .btn-primary:hover,
  .btn-secondary:hover,
  .btn-navy:hover,
  .method-card:hover,
  .service-card:hover { transform: none; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── Print ──────────────────────────────────────────────── */
@media print {
  #navbar, footer, #contact { display: none; }
  .reveal { opacity: 1; transform: none; }
  body { background: #fff; }
}

/* ─── High contrast mode support ────────────────────────── */
@media (forced-colors: active) {
  .btn-primary,
  .btn-navy { border: 2px solid ButtonText; }
  .form-input { border: 2px solid ButtonText; }
}
