/* ===================================================================
   Azzkara — Catégories (accueil) — front
   Section « Nos univers » sous le slideshow : vignettes rectangulaires
   cliquables (image de couverture + nom) vers les pages catégories.

   Desktop : rectangles côte à côte (grille en ligne, largeurs égales).
   Mobile  : empilés pleine largeur (1 colonne).

   S'appuie sur les tokens du thème (theme.css :root). Replis définis ici
   au cas où la section serait rendue hors thème. Chargée UNIQUEMENT sur
   l'accueil.
=================================================================== */

.azzcat {
  background: var(--ink, #0c0c0e);
  padding: 64px 0;
}

/* --- En-tête --- */
.azzcat__head {
  text-align: center;
  margin: 0 0 30px;
}

.azzcat__eyebrow {
  margin: 0 0 10px;
}

.azzcat__title {
  font-family: var(--font-display, 'Cinzel'), serif;
  font-size: clamp(22px, 3vw, 32px);
  margin: 0;
  color: #ececef;
}

/* --- Grille : rectangles côte à côte, largeurs égales. Colonnes pilotées
   par .azzcat--cols-{N} (= nombre de catégories). Repli auto-fit si la
   classe d'effectif n'est pas connue. --- */
.azzcat__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.azzcat--cols-1 .azzcat__grid { grid-template-columns: 1fr; }
.azzcat--cols-2 .azzcat__grid { grid-template-columns: repeat(2, 1fr); }
.azzcat--cols-3 .azzcat__grid { grid-template-columns: repeat(3, 1fr); }
.azzcat--cols-4 .azzcat__grid { grid-template-columns: repeat(4, 1fr); }
.azzcat--cols-5 .azzcat__grid { grid-template-columns: repeat(5, 1fr); }
.azzcat--cols-6 .azzcat__grid { grid-template-columns: repeat(6, 1fr); }

/* --- Vignette --- */
.azzcat__tile {
  position: relative;
  display: block;
  min-width: 0;             /* anti-débordement en grille */
  max-width: 100%;
  aspect-ratio: 3 / 4;      /* rectangle portrait élégant */
  overflow: hidden;
  text-decoration: none;
  border: 1px solid var(--line, rgba(255, 255, 255, .10));
  background: var(--ink-2, #141417); /* fond de chargement */
}

.azzcat__img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}

/* Placeholder fallback : dégradé sombre cohérent thème (pas d'image cassée). */
.azzcat__ph {
  position: absolute;
  inset: 0;
  display: block;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(154, 128, 71, .16), transparent 60%),
    linear-gradient(160deg, var(--ink-3, #1c1c20) 0%, var(--ink, #0c0c0e) 100%);
}

/* Overlay nom : voile bas pour lisibilité, sur image comme sur placeholder. */
.azzcat__overlay {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  align-items: flex-end;
  padding: 18px 16px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, .72) 0%, rgba(0, 0, 0, .28) 55%, transparent 100%);
}

/* Sur le fallback, on centre verticalement le nom (pas d'image à laisser respirer). */
.azzcat__tile--noimg .azzcat__overlay {
  inset: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(to top, rgba(0, 0, 0, .45) 0%, rgba(0, 0, 0, .15) 100%);
}

.azzcat__name {
  font-family: var(--font-display, 'Cinzel'), serif;
  font-weight: 600;
  font-size: clamp(16px, 1.5vw, 20px);
  letter-spacing: .02em;
  color: #fff;
  line-height: 1.15;
}

/* --- Hover discret : léger zoom image + voile renforcé. --- */
.azzcat__tile:hover .azzcat__img {
  transform: scale(1.05);
}
.azzcat__tile:hover .azzcat__overlay {
  background: linear-gradient(to top, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .35) 60%, transparent 100%);
}
.azzcat__tile:focus-visible {
  outline: 2px solid var(--gold, #9a8047);
  outline-offset: 2px;
}

/* --- Responsive (breakpoints du thème). --- */
@media (max-width: 860px) {
  /* Empilés pleine largeur, hauteur raisonnable (ratio paysage) pour ne pas être trop hauts. */
  .azzcat__grid,
  .azzcat--cols-1 .azzcat__grid,
  .azzcat--cols-2 .azzcat__grid,
  .azzcat--cols-3 .azzcat__grid,
  .azzcat--cols-4 .azzcat__grid,
  .azzcat--cols-5 .azzcat__grid,
  .azzcat--cols-6 .azzcat__grid {
    grid-template-columns: 1fr;
  }
  .azzcat__tile {
    aspect-ratio: 16 / 9;   /* paysage : empilées sans être trop hautes */
  }
}

@media (max-width: 575px) {
  .azzcat {
    padding: 44px 0;
  }
  .azzcat__head {
    margin-bottom: 22px;
  }
  .azzcat__tile {
    aspect-ratio: auto;
    height: 200px;          /* hauteur fixe raisonnable sur petit mobile */
  }
}

@media (prefers-reduced-motion: reduce) {
  .azzcat__img,
  .azzcat__overlay {
    transition: none;
  }
  .azzcat__tile:hover .azzcat__img {
    transform: none;
  }
}

/* Arrondi global (piloté par --rounded du thème ; fallback 6px). */
.azzcat__tile { border-radius: var(--rounded, 6px); }
