/* ─────────────────────────────────────────────────────────────
   Chai N°5 — Page « Calendriers de l'Avent » (CMS calendriers-avent)
   Thème de fête posé sur le gabarit de la cave (la-cave.css, chargé avant).
   ───────────────────────────────────────────────────────────── */

.cave-page--avent {
  --d-box: var(--color-wine);
  --d-box-dark: #5A1F2B;
  --d-gold: #C8A24B;
  --d-cream: #F6F0E4;
  --d-num: #FAF7F2;
  --d-door-a: #8E3A4A;
  --d-door-b: #6B7F5E;
  --d-door-c: #A8544F;
  --d-door-d: #4F6144;
  --d-pine: var(--color-olive);
  --d-trunk: #7A5436;
  --d-shadow: rgba(44, 36, 32, .12);
}

.av-hero {
  min-height: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(200, 162, 75, .28) 0%, transparent 40%),
    linear-gradient(180deg, #7B2D3B 0%, #4A1A24 100%);
}
.av-hero .cave-hero__title { max-width: 16ch; text-wrap: balance; }
.av-hero__inner {
  display: grid;
  gap: var(--space-lg);
  align-items: center;
  padding-top: var(--space-2xl);
}
.av-hero__art svg {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 0 auto;
}

/* ── Grille produits ── */
.av-grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
}
.av-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--cave-radius);
  overflow: hidden;
}
.av-card__img {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: #fff;
}
/* Cadre carré identique pour toutes les cartes : la photo entière est centrée dedans, quel que soit son format */
.av-card__img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 18px;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center;
  display: block;
}
.av-card--soldout .av-card__img img { opacity: .5; }
.av-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--color-wine);
  color: #fff;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.av-badge--stock { background: var(--color-olive); }
.av-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-lg);
}
.av-card__brand {
  margin: 0 0 calc(-1 * var(--space-xs, 4px));
  height: 1.4em; /* ligne toujours réservée : les titres restent alignés même sans fabricant */
  line-height: 1.4;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-olive);
}
.av-card__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.02rem;
  font-weight: 400;
  line-height: 1.35;
  flex: 1 0 auto;
  /* Même hauteur de texte partout : 3 lignes réservées, au-delà le titre est tronqué */
  min-height: calc(3 * 1.35em);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.av-card__title a { color: var(--color-dark); text-decoration: none; }
.av-card__price {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-wine);
}
.av-btn {
  margin-top: var(--space-sm);
  background: var(--color-wine);
  color: #fff;
}
.av-btn:hover { background: var(--color-dark); color: #fff; }
.av-btn--off { background: var(--color-border); color: var(--color-text-muted); cursor: default; }
.av-btn--off:hover { background: var(--color-border); transform: none; color: var(--color-text-muted); }

.av-empty, .av-note, .av-sub { max-width: 60ch; }
.av-sub { margin: var(--space-md) 0 0; }
.av-note { margin-top: var(--space-xl); }

/* ── Étapes ── */
@media (min-width: 900px) { .cave-bento.av-steps > .cave-card:not(.cave-card--wine):not(.cave-card--gold) { grid-column: span 2; } }
.av-steps .cave-card__art svg { max-width: 150px; margin: 0 auto; display: block; }

/* ── FAQ ── */
.av-faq { max-width: 760px; }
.av-faq details { border-bottom: 1px solid var(--color-border); padding: var(--space-md) 0; }
.av-faq summary { cursor: pointer; font-weight: 600; list-style: none; }
.av-faq summary::-webkit-details-marker { display: none; }
.av-faq summary::after { content: "+"; float: right; color: var(--color-wine); }
.av-faq details[open] summary::after { content: "–"; }
.av-faq p { margin: var(--space-sm) 0 0; }
.av-legal { margin-top: var(--space-xl); font-size: .8rem; color: var(--color-text-muted); }

@media (min-width: 860px) {
  .av-hero__inner { grid-template-columns: 1.3fr 1fr; }
}

/* ── Neige (canvas posé par avent.js) ── */
.av-hero { position: relative; }
.av-snow {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.av-hero__inner, .cave-hero__bar { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  .av-snow { display: none; }
}
