/**
 * Calendrier de l'Avent LANDA — front
 *
 * @author    ICC Digital <contact@icc-digital.fr>
 * @copyright ICC Digital
 * @license   Proprietary
 */

.icc-advent {
  --icc-advent-red: #B71234;
  --icc-advent-pink: #E2577E;
  --icc-advent-yellow: #FDC82F;
  --icc-advent-green: #3E8E41;
  --icc-advent-gap: 12px;
  --icc-advent-row: 110px;
  --icc-advent-radius: 14px;

  margin: 0 auto;
  max-width: 1200px;
}

.icc-advent--align-left {
  margin-left: 0;
  margin-right: auto;
}

/* ── Bandeaux ─────────────────────────────── */

.icc-advent__notice,
.icc-advent__debug {
  margin: 0 0 var(--icc-advent-gap);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}

.icc-advent__notice {
  background: #eef4fb;
  color: #1d4e89;
}

.icc-advent__debug {
  background: #fff4cc;
  border: 2px dashed #c28f00;
  color: #5c4300;
}

.icc-advent__debug[hidden] {
  display: none;
}

/* ── Grille bento ─────────────────────────── */

.icc-advent__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: var(--icc-advent-row);
  grid-auto-flow: dense;
  gap: var(--icc-advent-gap);
}

.icc-advent__day {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  margin: 0;
  padding: 12px 16px;
  border: 0;
  border-radius: var(--icc-advent-radius);
  overflow: hidden;
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

/* Motif discret façon papier cadeau */
.icc-advent__day::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 25%, rgba(255, 255, 255, .18) 0 3px, transparent 4px),
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, .12) 0 2px, transparent 3px),
    linear-gradient(135deg, rgba(255, 255, 255, .14), rgba(0, 0, 0, .08));
  background-size: 46px 46px, 34px 34px, 100% 100%;
  pointer-events: none;
}

.icc-advent__number {
  position: relative;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
}

.icc-advent__day--2x2 .icc-advent__number {
  font-size: 64px;
}

.icc-advent__day--2x1 .icc-advent__number,
.icc-advent__day--1x2 .icc-advent__number {
  font-size: 46px;
}

/* Tailles */
.icc-advent__day--2x1 { grid-column: span 2; }
.icc-advent__day--1x2 { grid-row: span 2; }
.icc-advent__day--2x2 { grid-column: span 2; grid-row: span 2; }

/* Couleurs */
.icc-advent__day--red { background-color: var(--icc-advent-red); }
.icc-advent__day--pink { background-color: var(--icc-advent-pink); }
.icc-advent__day--yellow { background-color: var(--icc-advent-yellow); color: #3b2a00; }
.icc-advent__day--green { background-color: var(--icc-advent-green); }

/* États */
.icc-advent__day.is-locked,
.icc-advent__day:disabled {
  opacity: .5;
  cursor: default;
  pointer-events: none;
}

.icc-advent__day.is-today {
  opacity: 1;
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--icc-advent-red), 0 10px 24px rgba(0, 0, 0, .18);
  animation: icc-advent-pulse 2.4s ease-in-out infinite;
}

.icc-advent__day.is-today:hover {
  transform: translateY(-3px);
}

.icc-advent__day:focus-visible {
  outline: 3px solid #1d4e89;
  outline-offset: 3px;
}

.icc-advent__day[aria-busy="true"] {
  cursor: progress;
}

@keyframes icc-advent-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  .icc-advent__day,
  .icc-advent__day.is-today {
    animation: none;
    transition: none;
  }
}

/* Tablette */
@media (max-width: 991px) {
  .icc-advent {
    --icc-advent-row: 100px;
  }

  .icc-advent__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 575px) {
  .icc-advent {
    --icc-advent-gap: 8px;
    --icc-advent-row: 84px;
    --icc-advent-radius: 10px;
  }

  .icc-advent__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .icc-advent__day {
    padding: 8px 10px;
  }

  .icc-advent__number {
    font-size: 26px;
  }

  .icc-advent__day--2x2 .icc-advent__number {
    font-size: 44px;
  }

  .icc-advent__day--2x1 .icc-advent__number,
  .icc-advent__day--1x2 .icc-advent__number {
    font-size: 34px;
  }
}

/* ── Taille compacte : la grille entière tient dans la hauteur de l'écran ──
   6 colonnes sur tous les écrans (8 rangées avec la grille par défaut).
   Hauteur de rangée = (hauteur d'écran - en-tête/marges - 7 espaces) / 8, bornée. */

.icc-advent--compact {
  --icc-advent-gap: 8px;
  --icc-advent-radius: 10px;
  --icc-advent-row: clamp(44px, calc((100vh - 220px - 7 * var(--icc-advent-gap)) / 8), 88px);
  max-width: 960px;
}

.icc-advent--compact .icc-advent__grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.icc-advent--compact .icc-advent__day {
  padding: 6px 10px;
}

.icc-advent--compact .icc-advent__number {
  font-size: clamp(18px, calc(var(--icc-advent-row) * .32), 28px);
}

.icc-advent--compact .icc-advent__day--2x2 .icc-advent__number {
  font-size: clamp(28px, calc(var(--icc-advent-row) * .6), 52px);
}

.icc-advent--compact .icc-advent__day--2x1 .icc-advent__number,
.icc-advent--compact .icc-advent__day--1x2 .icc-advent__number {
  font-size: clamp(22px, calc(var(--icc-advent-row) * .45), 38px);
}

@media (max-width: 575px) {
  .icc-advent--compact {
    --icc-advent-gap: 6px;
    --icc-advent-radius: 8px;
    --icc-advent-row: clamp(44px, calc((100vw - 32px - 5 * 6px) / 6), 64px);
  }

  .icc-advent--compact .icc-advent__grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .icc-advent--compact .icc-advent__day {
    padding: 4px 6px;
  }
}

/* ── Pop-up ───────────────────────────────── */

html.icc-advent-modal-open {
  overflow: hidden;
}

.icc-advent-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.icc-advent-modal[hidden] {
  display: none;
}

.icc-advent-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 10, 15, .6);
}

.icc-advent-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 32px 28px 28px;
  border-top: 8px solid var(--icc-advent-red, #B71234);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  animation: icc-advent-pop .25s ease-out;
}

.icc-advent-modal__dialog:focus {
  outline: none;
}

@keyframes icc-advent-pop {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .icc-advent-modal__dialog {
    animation: none;
  }
}

.icc-advent-modal__close {
  position: absolute;
  top: 28px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #6b6b6b;
  line-height: 0;
  box-shadow: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, transform .15s ease;
}

.icc-advent-modal__close svg {
  display: block;
  flex: none;
}

.icc-advent-modal__close:hover {
  background: rgba(183, 18, 52, .1);
  color: #B71234;
  transform: rotate(90deg);
}

.icc-advent-modal__close:focus-visible {
  outline: 2px solid #B71234;
  outline-offset: 2px;
  color: #B71234;
}

@media (prefers-reduced-motion: reduce) {
  .icc-advent-modal__close:hover {
    transform: none;
  }
}

.icc-advent-modal__title {
  margin: 0 52px 16px 0;
  color: #B71234;
  line-height: 1.2;
  font-size: 26px;
  font-weight: 800;
}

.icc-advent-modal__image {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 16px;
  border-radius: 10px;
}

.icc-advent-modal__text {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.5;
}

.icc-advent-modal__text > :last-child {
  margin-bottom: 0;
}

.icc-advent-modal__promo {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 2px dashed #FDC82F;
  border-radius: 10px;
  background: #fffaf0;
}

.icc-advent-modal__promo-label {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.icc-advent-modal__promo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.icc-advent-modal__code {
  flex: 1 1 auto;
  padding: 8px 12px;
  border-radius: 6px;
  background: #fff;
  color: #222;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .08em;
  word-break: break-all;
}

.icc-advent-modal__copy,
.icc-advent-modal__button {
  display: inline-block;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  background: #B71234;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.icc-advent-modal__copy.is-copied {
  background: #3E8E41;
}

.icc-advent-modal__copy:hover,
.icc-advent-modal__button:hover,
.icc-advent-modal__button:focus {
  color: #fff;
  filter: brightness(1.1);
  text-decoration: none;
}

.icc-advent-modal__actions {
  margin: 0;
  text-align: center;
}
