/* =========================================================
   SH6 Calendar — RESPONSIVE FINAL (MOBILE + DESKTOP)
   ========================================================= */

/* =========================
   VARIABLES
   ========================= */
:root {
  --sh6-col-w: 90px;
  --sh6-cols: 9;
  --sh6-gap: 8px;

  --sh6-bg-day: rgba(0,0,0,.03);
  --sh6-today: rgba(244,196,48,.15);
  --sh6-today-border: #f4c430;

  --sh6-shadow: 0 3px 8px rgba(0,0,0,.18);
  --sh6-radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --sh6-bg-day: rgba(255,255,255,.06);
    --sh6-shadow: 0 6px 14px rgba(0,0,0,.35);
  }
}

/* =========================
   WRAP
   ========================= */
.sh6-cal-wrap {
  padding: 12px;
  position: relative;
  overflow: hidden;
}

/* =========================
   HEADER
   ========================= */
.sh6-cal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  background: rgba(255,255,255,.35);
  backdrop-filter: blur(2px);
  border-radius: 12px;
  padding: 6px 10px;
}

@media (prefers-color-scheme: dark) {
  .sh6-cal-head {
    background: rgba(15,15,15,.45);
  }
}

.sh6-cal-title {
  margin: 0;
  font-size: 1.05rem;
}

.sh6-cal-meta {
  font-size: .85rem;
  opacity: .85;
  text-align: right;
}

/* =========================================================
   SCROLL ZONE
   ========================================================= */
.sh6-cal-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}

/* MOBILE: largeur fixe (pixel-perfect) */
.sh6-cal-inner {
  width: calc(
    (var(--sh6-col-w) * var(--sh6-cols))
    + (var(--sh6-gap) * (var(--sh6-cols) - 1))
  );
}

/* =========================================================
   DAYS (MOBILE)
   ========================================================= */
.sh6-cal-days {
  display: grid;
  grid-template-columns: repeat(var(--sh6-cols), var(--sh6-col-w));
  gap: var(--sh6-gap);
  margin-bottom: 10px;
}

.sh6-cal-day {
  padding: 6px 8px;
  border-radius: var(--sh6-radius);
  text-align: center;
  background: var(--sh6-bg-day);
  font-size: .85rem;
  white-space: nowrap;
  box-sizing: border-box;
}

.sh6-cal-day.is-today {
  position: relative;
  background: var(--sh6-today);
}

.sh6-cal-day.is-today::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--sh6-today-border);
  border-radius: var(--sh6-radius);
  pointer-events: none;
  box-sizing: border-box;
}

/* =========================================================
   ROWS (MOBILE)
   ========================================================= */
.sh6-cal-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sh6-cal-row {
  display: grid;
  grid-template-columns: repeat(var(--sh6-cols), var(--sh6-col-w));
  gap: var(--sh6-gap);
  align-items: center;
  min-height: 28px;
  box-sizing: border-box;
}

.sh6-cal-cell {
  height: 28px;
}

/* =========================================================
   EVENTS
   ========================================================= */
.sh6-cal-bar {
  grid-row: 1;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: var(--sh6-shadow);
  box-sizing: border-box;
}

.sh6-cal-bar img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 auto;
}

/* =========================================================
   COLORS
   ========================================================= */
.type-alliance { background: rgba(52,199,89,.25); }
.type-svs      { background: rgba(255,59,48,.22); }
.type-trade    { background: rgba(255,149,0,.22); }
.type-offer    { background: rgba(0,122,255,.22); }
.type-pve      { background: rgba(175,82,222,.22); }
.type-other    { background: rgba(142,142,147,.22); }
.type-special  { background: rgba(255,0,0,.38); }
.type-valentin { background: rgba(255,0,181,.22); }
.sh6-cal-bar.type-snow { background: rgba(113,245,255,.22); }
.sh6-cal-bar.type-jade { background: rgba(255,229,8,.22); }
.sh6-cal-bar.type-lanterne { background: rgba(255,144,2,.22); }

@media (prefers-color-scheme: dark) {
  .type-alliance { background: rgba(52,199,89,.30); }
  .type-svs      { background: rgba(255,59,48,.28); }
  .type-trade    { background: rgba(255,149,0,.26); }
  .type-offer    { background: rgba(0,122,255,.26); }
  .type-pve      { background: rgba(175,82,222,.28); }
  .type-other    { background: rgba(142,142,147,.25); }
  .type-special  { background: rgba(255,0,0,.38); }
  .type-valentin { background: rgba(255,0,181,.22); }
  .type-snow 	 { background: rgba(113,245,255,.22); }
  .sh6-cal-bar.type-snow { background: rgba(113,245,255,.22); }
  .sh6-cal-bar.type-jade { background: rgba(255,229,8,.22); }
  .sh6-cal-bar.type-lanterne { background: rgba(255,144,2,.22); }
}

/* =========================================================
   DESKTOP — FULL WIDTH (LA DIFF CLÉ 🔥)
   ========================================================= */
@media (min-width: 980px) {

  .sh6-cal-scroll {
    overflow-x: visible;
  }

  .sh6-cal-inner {
    width: 100%;
  }

  .sh6-cal-days,
  .sh6-cal-row {
    grid-template-columns: repeat(var(--sh6-cols), 1fr);
  }
}

/* =========================================================
   BACKGROUND IMAGE
   ========================================================= */
.sh6-cal-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("/static/img/calendar/calendar_bg.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* opacity: .30; */
  z-index: 0;
}

.sh6-cal-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,.85),
    rgba(255,255,255,.75)
  );
  z-index: 1;
}

@media (prefers-color-scheme: dark) {
  .sh6-cal-wrap::after {
    background: linear-gradient(
      to bottom,
      rgba(15,15,15,.85),
      rgba(15,15,15,.75)
    );
  }
}

.sh6-cal-wrap > * {
  position: relative;
  z-index: 2;
}

/* =========================================================
   FOOTER
   ========================================================= */
.sh6-cal-footer {
  margin-top: 6px;
  font-size: .75rem;
  opacity: .75;
}
