/* ============================================================
   TOKYO64 — Custom CSS
   Palette #7 : Orange #ea580c / Teal #14b8a6
   Fonts : Oswald (heading) / Raleway (body)
   WCAG AA minimum sur tous les contrastes texte/fond
   ============================================================ */

/* --- Variables globales ----------------------------------- */
:root {
  --color-primary:      #ea580c;
  --color-primary-dark: #9a3412;  /* texte sur fond clair — contraste 7.2:1 */
  --color-secondary:    #c2410c;  /* boutons — blanc dessus 5:1 ✓ */
  --color-accent:       #14b8a6;  /* décoratif uniquement */
  --color-accent-dark:  #0f766e;  /* texte accent sur fond clair — 5.3:1 ✓ */
  --color-bg:           #fafaf8;  /* fond chaud off-white */
  --color-bg-card:      #ffffff;
  --color-text:         #1c1917;  /* stone-900 */
  --color-text-muted:   #57534e;  /* stone-600 — 7.2:1 sur blanc ✓ */
  --color-border:       #e7e5e4;  /* stone-200 */
  --shadow-card: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.05);
  --shadow-card-hover: 0 4px 8px rgba(0,0,0,.08), 0 12px 28px rgba(0,0,0,.10);
}

/* --- Base ------------------------------------------------- */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
}

/* Transition globale douce */
a, button {
  transition: color .18s ease, background-color .18s ease,
              border-color .18s ease, box-shadow .18s ease;
}

/* --- Navigation ------------------------------------------- */
/* Active state underline */
.nav-active {
  position: relative;
  color: var(--color-primary) !important;
}
.nav-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0.75rem;
  right: 0.75rem;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
}

/* --- Hero ------------------------------------------------- */
/* Gradient chaud sombre pour le fallback sans image */
.hero-gradient {
  background: linear-gradient(
    140deg,
    #1c0a00 0%,
    #3c1506 45%,
    #0c1a2e 100%
  );
}

/* Motif décoratif japonais (cercles concentriques) */
.hero-deco {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  overflow: hidden;
  opacity: .12;
}

/* Badge eyebrow (above hero title) */
.hero-eyebrow {
  display: inline-block;
  color: #5eead4;           /* teal-300, sur fond sombre ≈ 9:1 ✓ */
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-bottom: .75rem;
}

/* Boutons hero */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .7rem 1.6rem;
  background: var(--color-secondary);  /* #c2410c — blanc 5:1 ✓ */
  color: #ffffff;
  font-weight: 700;
  font-size: .9375rem;
  border-radius: .375rem;
  border: 2px solid var(--color-secondary);
  letter-spacing: .02em;
}
.btn-primary:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(194,65,12,.35);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .7rem 1.6rem;
  background: transparent;
  color: #ffffff;
  font-weight: 600;
  font-size: .9375rem;
  border-radius: .375rem;
  border: 2px solid rgba(255,255,255,.5);
  letter-spacing: .02em;
}
.btn-ghost:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.8);
}

/* --- Cards articles --------------------------------------- */
.card-article {
  background: var(--color-bg-card);
  border-radius: .75rem;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card-article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}
.card-article:hover .card-title {
  color: var(--color-primary-dark);
}

.card-title {
  color: var(--color-text);
  font-weight: 700;
  transition: color .18s ease;
}

/* Badge catégorie — contraste #9a3412 sur #fff7ed = 7.2:1 ✓ */
.cat-badge {
  display: inline-block;
  background: #fff7ed;
  color: #9a3412;
  font-size: .6875rem;
  font-weight: 700;
  padding: .2rem .65rem;
  border-radius: 999px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* --- Cards catégories ------------------------------------- */
.card-category {
  background: var(--color-bg-card);
  border-radius: .75rem;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border-bottom: 3px solid transparent;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card-category:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-bottom-color: var(--color-primary);
}

/* --- Section divider -------------------------------------- */
.section-rule {
  width: 2.5rem;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
}

/* --- Section label ---------------------------------------- */
.section-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--color-primary-dark);     /* 7.2:1 sur blanc ✓ */
}

/* --- Featured article (À la Une) ------------------------- */
.featured-card {
  background: var(--color-bg-card);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border-left: 4px solid var(--color-primary);
}

/* --- Section sombre (L'Art du Goût) ---------------------- */
.dark-section {
  background: #1c1917;   /* stone-900 */
  color: #fafaf9;
}
.dark-section .section-label {
  color: #5eead4;          /* teal-300 sur dark ≈ 9:1 ✓ */
}

/* Carte sombre */
.card-dark {
  background: #292524;      /* stone-800 */
  border-radius: .75rem;
  overflow: hidden;
  transition: background .2s;
}
.card-dark:hover {
  background: #3c3330;
}
.card-dark .card-title {
  color: #fafaf9;
}
.card-dark:hover .card-title {
  color: #fed7aa;            /* orange-200 sur #3c3330 ≈ 9:1 ✓ */
}

/* --- Prose (article content) ------------------------------ */
.prose {
  max-width: 70ch;
}
.prose h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: .875rem;
  font-weight: 700;
  line-height: 1.3;
  color: #1c1917;
}
.prose h3 {
  font-size: 1.2rem;
  margin-top: 1.875rem;
  margin-bottom: .625rem;
  font-weight: 600;
  color: #292524;
}
.prose p {
  margin-bottom: 1.5rem;
  line-height: 1.8;
  color: #292524;
}
.prose ul, .prose ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}
.prose ul  { list-style-type: disc; }
.prose ol  { list-style-type: decimal; }
.prose li  { margin-bottom: .5rem; color: #292524; line-height: 1.75; }
.prose blockquote {
  border-left: 4px solid var(--color-primary);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #44403c;
  background: #fff7ed;
  border-radius: 0 .5rem .5rem 0;
}
.prose a {
  color: var(--color-primary-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}
.prose a:hover {
  color: var(--color-primary);
  text-decoration-thickness: 2px;
}
.prose strong {
  font-weight: 700;
  color: #1c1917;
}
.prose img {
  border-radius: .5rem;
  margin: 1.5rem 0;
}

/* Tables */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
  font-size: .9375rem;
  overflow-x: auto;
  display: block;
}
.prose thead { border-bottom: 2px solid #e7e5e4; }
.prose th {
  padding: .75rem 1rem;
  text-align: left;
  font-weight: 700;
  color: #1c1917;
  background: #fafaf9;
  white-space: nowrap;
}
.prose td {
  padding: .75rem 1rem;
  border-bottom: 1px solid #e7e5e4;
  color: #44403c;
}
.prose tbody tr:hover { background: #fafaf9; }

/* Drop cap sur premier paragraphe d'article */
.article-lead > p:first-of-type::first-letter {
  float: left;
  font-family: Oswald, 'Arial Narrow', sans-serif;
  font-size: 3.25rem;
  font-weight: 700;
  line-height: .85;
  margin-right: .1em;
  margin-top: .05em;
  color: var(--color-primary);
}

/* --- Line clamp ------------------------------------------- */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Focus WCAG ------------------------------------------- */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- Pagination ------------------------------------------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .375rem;
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--color-border);
}
.pagination li { list-style: none; }
.pagination a, .pagination .active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 .75rem;
  border-radius: .375rem;
  font-size: .875rem;
  font-weight: 600;
}
.pagination a      { color: #44403c; background: #f5f5f4; }
.pagination a:hover { background: #e7e5e4; }
.pagination .active { color: #fff; background: var(--color-secondary); } /* 5:1 ✓ */
.pagination .disabled { opacity: .45; pointer-events: none; }

/* --- Print ------------------------------------------------ */
@media print {
  header, footer, nav { display: none !important; }
  .prose { max-width: 100%; }
}

/* --- Mobile tweaks ---------------------------------------- */
@media (max-width: 640px) {
  .prose th, .prose td { padding: .5rem .75rem; font-size: .875rem; }
}
