/* =======================================================
   Grille des programmes — 91 FM  (v11)
======================================================= */

/* ── Hero — style agenda ───────────────────────────── */
.gr-hero {
  position: relative;
  overflow: hidden; /* repli pour les navigateurs sans `clip` */
  overflow: clip;
  padding: 72px 0 64px;
}
.gr-hero::before {
  content: '';
  position: absolute;
  inset: -30px;
  background: url('https://media.webradio91fm.fr/assets/content/backgrounds/agenda.jpg') center / cover no-repeat;
  filter: blur(8px);
  transform: scale(1.08);
  opacity: .8;
  z-index: 0;
}
.gr-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(8,14,30,.62);
  z-index: 1;
}
.gr-hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  width: min(1100px, calc(100% - 48px));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.gr-hero-title {
  margin: 0 0 16px;
  font-size: clamp(3.8rem, 10vw, 7.5rem);
  font-weight: 900;
  font-style: italic;
  line-height: .9;
  letter-spacing: -.04em;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255,255,255,.82);
}
.gr-hero-sub {
  margin: 0;
  font-size: clamp(14px, 2vw, 17px);
  color: rgba(255,255,255,.55);
  max-width: 44ch;
}
.gr-hero-stats {
  margin: 14px 0 0;
  font-size: clamp(12px, 1.6vw, 14px);
  font-weight: 700;
  color: rgba(255,255,255,.75);
  letter-spacing: .02em;
}

/* ── Wrapper ───────────────────────────────────────── */
.gr-wrap {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 96px;
}

/* ── Barre navigation + onglets jours ─────────────── */
.gr-tabs-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 16px 0 20px;
  border-bottom: 1px solid #eee;
}

.gr-week-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  flex-shrink: 0;
  color: #aaa;
  text-decoration: none;
  border-radius: 8px;
  transition: background .15s, color .15s;
}
.gr-week-arrow:hover { background: #f5f5f5; color: #333; }

.gr-today-btn,
.gr-today-btn:visited {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 5px;
  padding: 0 14px;
  height: 36px;
  margin-left: 6px;
  border-radius: 8px;
  font-size: .63rem;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #fff !important;
  background: #D91319;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s;
}
.gr-today-btn:hover { background: #b8101b; }

/* Tabs : prennent tout l'espace restant */
.gr-tabs {
  display: flex;
  flex: 1;
  gap: 3px;
}

.gr-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 4px 10px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background .15s;
  position: relative;
  min-width: 0;
}
.gr-tab:hover { background: #f5f5f5; }

.gr-tab-wd {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #bbb;
  line-height: 1;
}
.gr-tab-d {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -.03em;
  color: #111;
  line-height: 1.05;
}
.gr-tab-m {
  font-size: .6rem;
  font-weight: 600;
  color: #ccc;
  line-height: 1;
}

/* Aujourd'hui inactif */
.gr-tab-today:not(.gr-tab-active) .gr-tab-d  { color: #dd3b2a; }
.gr-tab-today:not(.gr-tab-active) .gr-tab-wd { color: rgba(221,59,42,.65); }
.gr-tab-today:not(.gr-tab-active) .gr-tab-m  { color: rgba(221,59,42,.5); }

/* Actif — couleur charte radio */
.gr-tab-active {
  background: #D91319;
  box-shadow: 0 3px 12px rgba(217,19,25,.25);
}
.gr-tab-active .gr-tab-wd { color: rgba(255,255,255,.7); }
.gr-tab-active .gr-tab-d  { color: #fff; }
.gr-tab-active .gr-tab-m  { color: rgba(255,255,255,.65); }
.gr-tab-active:hover { background: #b8101b; }

/* ── Panneau jour ──────────────────────────────────── */
.gr-day { display: none; }
.gr-day-active { display: block; }
.gr-empty { padding: 64px 0; text-align: center; color: #bbb; font-size: .95rem; }

/* ── Liste ─────────────────────────────────────────── */
.gr-list { display: flex; flex-direction: column; }

/* ── Item émission ─────────────────────────────────── */
.gr-item {
  display: grid;
  grid-template-columns: 86px 200px 1fr;
  gap: 0 24px;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid #f2f2f2;
  position: relative;
}
.gr-item:last-child { border-bottom: none; }

.gr-item-live {
  background: rgba(221,59,42,.025);
  margin: 0 -18px;
  padding: 22px 18px;
  border-radius: 12px;
  border-bottom-color: transparent;
}
.gr-item-live::before {
  content: '';
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  background: #dd3b2a;
  border-radius: 0 3px 3px 0;
}

/* ── Colonne heure ─────────────────────────────────── */
.gr-item-timecol {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1px;
  font-variant-numeric: tabular-nums;
}
.gr-tc-start {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--item-color, #dd3b2a);
  line-height: 1.1;
  letter-spacing: -.02em;
}
.gr-tc-dot {
  width: 5px; height: 5px;
  background: var(--item-color, #dd3b2a);
  border-radius: 50%;
  opacity: .3;
  margin: 2px 0;
}
.gr-tc-end {
  font-size: .95rem;
  font-weight: 700;
  color: var(--item-color, #dd3b2a);
  opacity: .55;
  line-height: 1.1;
}
.gr-tc-duration {
  font-size: .65rem;
  font-weight: 600;
  color: #aaa;
  margin-top: 5px;
  letter-spacing: .02em;
}
/* ── Badges live / prochain ────────────────────────── */
.gr-badge-live,
.gr-badge-next {
  display: inline-block;
  flex-shrink: 0;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  vertical-align: middle;
}
.gr-badge-live {
  color: #fff;
  background: #dd3b2a;
}
.gr-badge-next {
  color: #fff;
  background: #1a1a1a;
}

/* ── Image 4/3 — propre, sans overlay ─────────────── */
.gr-item-img {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 10px;
  overflow: hidden;
  background: #e8e8e8;
  flex-shrink: 0;
}
.gr-item-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.gr-item:hover .gr-item-img img { transform: scale(1.04); }

.gr-item-img-fallback {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--item-color, #D91319), rgba(0,0,0,.5));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 900;
  color: rgba(255,255,255,.2);
  font-style: italic;
}

/* Logo en verre — couvre toute l'image, logo centré, toujours visible */
.gr-item-logo-glass {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}
.gr-item-logo-glass img {
  max-width: 55%;
  max-height: 55%;
  object-fit: contain;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.35));
}

/* ── Corps ─────────────────────────────────────────── */
.gr-item-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.gr-item-cat {
  display: inline-block;
  width: fit-content;
  align-self: flex-start;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--item-color, #D91319);
  padding: 3px 10px;
  border-radius: 999px;
  border: none;
}

.gr-item-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.gr-broadcast-inedit,
.gr-broadcast-rediff {
  display: inline-block;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
}
.gr-broadcast-inedit {
  color: #166534;
  background: #dcfce7;
}
.gr-broadcast-rediff {
  color: #6b7280;
  background: #f3f4f6;
}

.gr-item-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: #111;
  text-transform: uppercase;
  letter-spacing: -.01em;
  line-height: 1.15;
  text-decoration: none;
  display: block;
}
a.gr-item-title:hover { color: var(--item-color, #dd3b2a); }

.gr-item-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.gr-item-title-row .gr-item-title {
  width: fit-content;
}

.gr-item-slogan {
  font-size: .83rem;
  color: var(--item-color, #dd3b2a);
  font-style: italic;
  margin: 0;
  font-weight: 500;
}

.gr-item-desc {
  font-size: .82rem;
  color: #888;
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden; /* repli pour les navigateurs sans `clip` */
  overflow: clip;
}


/* ── Boutons en ligne horizontale ──────────────────── */
.gr-item-actions {
  display: flex;
  flex-direction: row;
  gap: 7px;
  margin-top: 4px;
  flex-wrap: wrap;
  align-items: center;
}
.gr-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: #777;
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  border: 1.5px solid #e5e5e5;
  border-radius: 999px;
  padding: 5px 11px;
  transition: border-color .15s, color .15s;
  white-space: nowrap;
  width: fit-content;
  flex-shrink: 0;
}
.gr-action:hover {
  border-color: var(--item-color, #dd3b2a);
  color: var(--item-color, #dd3b2a);
}
/* Écouter — plein rouge, texte blanc, cursor pointer (c'est un button) */
.gr-action-live {
  background: #D91319;
  border-color: #D91319;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}
.gr-action-live:hover {
  background: #b8101b;
  border-color: #b8101b;
  color: #fff;
}

/* Podcast — même style que les autres, bordure légèrement plus épaisse */
.gr-action-podcast {
  border-width: 2px;
  font-weight: 700;
}

/* ── Filler musical ────────────────────────────────── */
.gr-music-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 12px 11px 0;
  border-bottom: 1px solid #f8f8f8;
}
.gr-music-strip:last-child { border-bottom: none; }
.gr-music-strip-live {
  position: relative;
  background: rgba(221,59,42,.04);
  padding-left: 12px;
  margin-left: -12px;
  border-radius: 0 8px 8px 0;
  border-bottom-color: transparent;
}
.gr-music-strip-live::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: #dd3b2a;
  border-radius: 0 3px 3px 0;
}
.gr-music-strip-live .gr-music-label { color: #555; }
.gr-music-strip-live .gr-music-time-start { color: #dd3b2a; opacity: .8; }

.gr-music-timecol {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 86px;
  font-variant-numeric: tabular-nums;
}
.gr-music-time-start {
  font-size: .88rem;
  font-weight: 700;
  color: #999;
  line-height: 1.2;
}
.gr-music-time-end {
  font-size: .72rem;
  font-weight: 500;
  color: #bbb;
  line-height: 1.2;
}
.gr-music-label-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.gr-music-label {
  font-size: .83rem;
  color: #999;
  font-style: italic;
}
.gr-music-duration {
  font-size: .75rem;
  color: #aaa;
  font-weight: 600;
  flex-shrink: 0;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 880px) {
  .gr-wrap { width: calc(100% - 28px); }

  /* Image à droite, texte à gauche — sur une seule rangée */
  .gr-item {
    grid-template-columns: 72px 1fr 140px;
    grid-template-rows: auto;
    gap: 0 14px;
    align-items: center;
    padding: 18px 0;
  }
  .gr-item-timecol { grid-column: 1; grid-row: 1; align-self: center; }
  .gr-item-body    { grid-column: 2; grid-row: 1; }
  .gr-item-img     { grid-column: 3; grid-row: 1; }
  .gr-item-live    { margin: 0 -10px; padding: 18px 10px; }
  .gr-tc-start { font-size: 1rem; }
  .gr-tc-end   { font-size: .82rem; }

  .gr-tab-d  { font-size: 1.15rem; }
  .gr-tab-wd { font-size: .52rem; }
  .gr-tab-m  { font-size: .52rem; }

  .gr-music-timecol { min-width: 72px; }
}

@media (max-width: 560px) {
  /* Image plus petite, colonnes serrées */
  .gr-item {
    grid-template-columns: 56px 1fr 100px;
    gap: 0 10px;
  }
  .gr-week-arrow { width: 28px; }
  .gr-tab { padding: 7px 2px 9px; }
  .gr-tab-d { font-size: 1rem; }
  .gr-action { font-size: .62rem; padding: 5px 9px; }

  /* "Revenir à aujourd'hui" passe sur sa propre ligne sous les tabs */
  .gr-tabs-row { flex-wrap: wrap; }
  .gr-today-btn {
    order: 10;
    width: 100%;
    justify-content: center;
    margin: 10px 0 0 0;
    height: 38px;
  }
}
