/*
 * Sushi-Bou — Feuille de styles principale
 * Thème : Japanese editorial — Orange/Teal (Palette #7)
 * Fonts : Poppins (titres) / Source Sans Pro (corps)
 * Conformité WCAG AA assurée sur toutes les combinaisons texte/fond
 */

/* ─────────────────────────────────────────────────────────────────────────
   PROPRIÉTÉS GLOBALES & RESET
   ───────────────────────────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: #f8f6f3; /* Fond légèrement chaud — identité nippone */
  color: #1c1917;
  min-height: 100vh;
}

/* Sélection de texte */
::selection {
  background-color: #ea580c;
  color: #ffffff;
}

/* ─────────────────────────────────────────────────────────────────────────
   TRANSITIONS & INTERACTIONS GLOBALES
   ───────────────────────────────────────────────────────────────────────── */
a,
button {
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

/* États focus accessibles (WCAG AA) */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #ea580c;
  outline-offset: 3px;
  border-radius: 2px;
}

/* ─────────────────────────────────────────────────────────────────────────
   HEADER — Navigation principale
   ───────────────────────────────────────────────────────────────────────── */
.site-header {
  box-shadow: 0 1px 0 0 rgba(28, 25, 23, 0.08);
  transition: box-shadow 0.2s ease;
}

.site-header.scrolled {
  box-shadow: 0 2px 12px rgba(28, 25, 23, 0.1);
}

/* Lien de navigation actif — trait orange dessous */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -1px; /* Aligné avec le bord inférieur du header */
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background-color: #ea580c;
  transition: width 0.22s ease;
  border-radius: 1px;
}

.nav-link:hover::after,
.nav-link--active::after {
  width: calc(100% - 2rem); /* Inset de padding */
}

/* ─────────────────────────────────────────────────────────────────────────
   HERO — Section principale de la homepage
   ───────────────────────────────────────────────────────────────────────── */

/* Motif géométrique inspiré des grilles japonaises (asanoha simplifié) */
.hero-pattern {
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.025) 0px,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 72px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.025) 0px,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 72px
    );
  background-size: 72px 72px;
}

/* Texte dégradé (titre hero) */
.hero-gradient-text {
  background: linear-gradient(92deg, #ea580c 0%, #14b8a6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent; /* Fallback */
}

/* Fallback pour navigateurs sans support bg-clip */
@supports not (-webkit-background-clip: text) {
  .hero-gradient-text {
    color: #ea580c;
    background: none;
    -webkit-text-fill-color: unset;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   CARDS — Articles & catégories
   ───────────────────────────────────────────────────────────────────────── */

/* Transition image au hover */
.group:hover img {
  transform: scale(1.03);
  transition: transform 0.4s ease;
}

img {
  transition: transform 0.4s ease;
}

/* Cohérence des ratio d'images dans les cards */
.aspect-video {
  aspect-ratio: 16 / 9;
}

/* ─────────────────────────────────────────────────────────────────────────
   TYPOGRAPHIE — Contenu des articles (prose)
   ───────────────────────────────────────────────────────────────────────── */
.prose {
  max-width: 72ch;
  color: #44403c; /* stone-700 — WCAG AA sur blanc */
  line-height: 1.8;
}

.prose h2 {
  font-size: 1.625rem;
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #1c1917;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #f0ebe5;
}

.prose h3 {
  font-size: 1.3rem;
  margin-top: 2.25rem;
  margin-bottom: 0.875rem;
  font-weight: 600;
  color: #1c1917;
  line-height: 1.4;
}

.prose h4 {
  font-size: 1.1rem;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: #292524;
}

.prose p {
  margin-bottom: 1.5rem;
  line-height: 1.8;
  color: #44403c;
}

.prose ul,
.prose ol {
  margin-bottom: 1.5rem;
  padding-left: 1.625rem;
}

.prose ul {
  list-style-type: disc;
}

.prose ol {
  list-style-type: decimal;
}

.prose li {
  margin-bottom: 0.625rem;
  color: #44403c;
  line-height: 1.7;
}

/* Liens dans le prose — contraste WCAG AA garanti (#c2410c sur #fff = 5.25:1) */
.prose a {
  color: #c2410c;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  font-weight: 500;
  transition: color 0.15s ease, text-decoration-thickness 0.15s ease;
}

.prose a:hover {
  color: #9a3412;
  text-decoration-thickness: 2px;
}

.prose strong {
  font-weight: 600;
  color: #1c1917;
}

.prose em {
  font-style: italic;
  color: #57534e;
}

/* Blockquote — style japonais épuré */
.prose blockquote {
  border-left: 3px solid #ea580c;
  padding: 1.25rem 1.5rem;
  margin: 2.5rem 0;
  background-color: #fff7f3;
  border-radius: 0 4px 4px 0;
  font-style: normal;
  color: #44403c;
}

.prose blockquote p {
  margin-bottom: 0;
  color: #44403c;
}

/* Images dans les articles */
.prose img {
  border-radius: 4px;
  margin: 2rem 0;
  box-shadow: 0 2px 8px rgba(28, 25, 23, 0.08);
}

/* ─────────────────────────────────────────────────────────────────────────
   TABLES — Articles longs
   ───────────────────────────────────────────────────────────────────────── */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9rem;
  overflow-x: auto;
  display: block;
}

.prose thead {
  background-color: #1c1917;
}

.prose th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #ffffff; /* Blanc sur fond très sombre — contraste > 16:1 */
  font-size: 0.8125rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.prose td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e7e5e4;
  color: #44403c;
  font-size: 0.9rem;
}

.prose tbody tr:hover {
  background-color: #fafaf9;
}

@media (max-width: 640px) {
  .prose th,
  .prose td {
    padding: 0.5rem 0.75rem;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   LINE CLAMP UTILITIES
   ───────────────────────────────────────────────────────────────────────── */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

/* ─────────────────────────────────────────────────────────────────────────
   PAGINATION — Hugo internal template
   ───────────────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.375rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e7e5e4;
  list-style: none;
  padding-left: 0;
}

.pagination li {
  list-style: none;
}

.pagination a,
.pagination .active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.625rem;
  border-radius: 2px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  text-decoration: none;
}

.pagination a {
  color: #44403c; /* stone-700 sur fond blanc — contraste > 7:1 */
  background-color: #f5f5f4;
}

.pagination a:hover {
  background-color: #e7e5e4;
  color: #1c1917;
}

.pagination .active {
  color: #ffffff; /* Blanc sur primary — contraste > 3.5:1 (large text) */
  background-color: #ea580c;
  pointer-events: none;
}

.pagination .disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}

/* ─────────────────────────────────────────────────────────────────────────
   MOBILE MENU — Toggle JS
   ───────────────────────────────────────────────────────────────────────── */
#mobile-menu.menu-open {
  display: block;
  animation: slideDown 0.18s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────────────────────────────── */

/* Lien footer — texte clair sur fond sombre */
/* stone-400 (#a8a29e) sur stone-950 (~#0c0a09) = contraste > 5:1 ✓ */
/* white (#fff) sur stone-950 = contraste > 18:1 ✓ */

/* ─────────────────────────────────────────────────────────────────────────
   SCROLLBAR — Webkit (optionnel, pour les navigateurs compatibles)
   ───────────────────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f5f5f4;
}

::-webkit-scrollbar-thumb {
  background: #d6d3d1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a29e;
}

/* ─────────────────────────────────────────────────────────────────────────
   PRINT
   ───────────────────────────────────────────────────────────────────────── */
@media print {
  header,
  footer,
  nav,
  .hero-pattern,
  [aria-hidden="true"] {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .prose {
    max-width: 100%;
  }

  a {
    color: #000;
    text-decoration: none;
  }

  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 0.75rem;
    color: #555;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   UTILITAIRES DIVERS
   ───────────────────────────────────────────────────────────────────────── */

/* Hover sur logo footer (invert pour fond sombre) */
.logo-footer {
  filter: brightness(0) invert(1);
  opacity: 0.9;
  transition: opacity 0.15s ease;
}

.logo-footer:hover {
  opacity: 1;
}
