/* ISERP GALLERY V9.0 — Styles de la galerie universitaire */

:root {
  /* Couleur du cycle universitaire */
  --p-universite: #3b82f6;

  /* Gradient de bannière */
  --grad-universite: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 50%, #3b82f6 100%);

  --card-radius: 8px;
}

/* ===== PAGE ===== */
body.gallery-mode {
  background-color: #f8fafc;
  font-family: 'Outfit', sans-serif;
}

/* ===== EN-TÊTE ===== */
.page-header-slanted {
  background: #0f172a;
  color: white;
  padding: 5rem 5% 7rem;
  clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
}

/* Décoration colorée selon le cycle universitaire */
.universite-mode .page-header-slanted{ background: linear-gradient(135deg, #0f172a 60%, #1e3a8a 100%); }

.phs-breadcrumb {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 2rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  text-transform: uppercase;
}
.phs-breadcrumb a { color: inherit; text-decoration: none; transition: color 0.2s; }
.phs-breadcrumb a:hover { color: white; }
.phs-breadcrumb .sep { margin: 0 0.8rem; color: #475569; }
.phs-breadcrumb .cur { color: #facc15; }

.phs-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  margin: 0 0 1rem;
  line-height: 1.1;
  color: white;
}
.phs-desc {
  font-size: 1.1rem;
  color: #94a3b8;
  max-width: 900px;
  line-height: 1.6;
}

/* ===== SECTION GALERIE ===== */
.gallery-section {
  padding: 0.9rem 4% 1.6rem;
  max-width: 1800px;
  margin: 0 auto;
  scroll-margin-top: 80px;
}

.row-header {
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: 1rem;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 12px;
}
.row-header::before {
  content: '';
  width: 7px; height: 28px;
  background: var(--cycle-color, #3b82f6);
  border-radius: 4px;
  flex-shrink: 0;
}

/* ===== RANGÉE — défilement horizontal façon Netflix, jamais de retour à la ligne ===== */
.row-nav { position: relative; }

.row-container {
  display: flex;
  gap: 14px;
  padding: 4px 2px 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Edge/IE legacy */
}
.row-container::-webkit-scrollbar { display: none; height: 0; } /* Chrome/Safari/Edge */

.row-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 6px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15,23,42,0.85);
  color: #fff;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  z-index: 5;
  opacity: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  transition: opacity 0.2s ease, background 0.2s ease;
}
.row-nav:hover .row-arrow:not(.is-hidden) { opacity: 1; }
.row-arrow:hover { background: var(--cycle-color); }
.row-arrow.is-hidden { opacity: 0 !important; pointer-events: none; }
.row-arrow-right { left: auto; right: 6px; }
@media (hover: none) {
  /* Écran tactile : pas de survol, les flèches ne servent à rien (le doigt fait défiler) */
  .row-arrow { display: none; }
}

/* ===== CARTE — poster plein cadre façon "streaming" ===== */
/* Structure : image/gradient en fond, dégradé de lisibilité, contenu ancré en bas.
   Hauteur fixée par aspect-ratio (pas par le texte) => toutes les cartes d'une même
   rangée restent alignées, quelle que soit la longueur du nom de parcours. */
.gallery-card {
  flex: 0 0 auto;
  width: clamp(300px, 22vw, 380px);
  scroll-snap-align: start;
  border-radius: var(--card-radius);
  overflow: hidden;
  position: relative;
  aspect-ratio: 3 / 4;
  cursor: pointer;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: var(--grad-universite);
}
.gallery-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 45px rgba(15,23,42,0.28);
}

.gc-media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s ease;
}
.gallery-card:hover .gc-media { transform: scale(1.08); }

/* Dégradé de lisibilité (le texte est toujours en bas, sur l'image) */
.gc-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
    rgba(5,10,25,.92) 0%,
    rgba(5,10,25,.6) 34%,
    rgba(5,10,25,.08) 66%,
    rgba(5,10,25,0) 100%);
}

/* Icône "voir les détails de l'offre" — au survol, se déplie en pilule vers la gauche
   (l'icône reste ancrée à droite via `right: 14px`, donc la pilule grandit à gauche). */
.gc-info-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  height: 34px;
  min-width: 34px;
  border-radius: 17px;
  background: rgba(15,23,42,0.45);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.28);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s ease;
  z-index: 2;
}
.gc-info-btn:hover { background: rgba(15,23,42,0.85); }

.gc-info-btn .gc-info-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
}

.gc-info-label {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, padding-left 0.35s ease;
}
.gc-info-btn:hover .gc-info-label {
  max-width: 220px;
  opacity: 1;
  padding-left: 14px;
}

.gc-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1.2rem 1.25rem 1.35rem;
  color: #fff;
  z-index: 1;
}

.gc-eyebrow {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--cycle-color) 40%, white);
  margin-bottom: 0.4rem;
}

/* Le niveau garde TOUJOURS le même traitement (même taille, même poids) sur toutes les
   cartes — "Licence 3" doit se lire comme "Licence 1"/"Licence 2", pas dans un style
   différent selon qu'un parcours existe ou non. Le parcours, quand il existe, est mis
   en évidence séparément via un badge coloré (.gc-parcours-chip), pas en volant le
   titre du niveau. */
.gc-heading {
  font-size: 1.28rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.7rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gc-parcours-chip {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
  padding: 3px 9px;
  border-radius: 5px;
  background: var(--cycle-color);
  color: #fff;
  margin-bottom: 0.7rem;
}

.gc-enroll {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}
.gc-enroll:hover { background: var(--cycle-color); color: #fff; gap: 0.6rem; }

/* ===== CSS VARIABLES PAR MODE ===== */
.universite-mode { --cycle-color: var(--p-universite); --cycle-color-rgb: 59, 130, 246; }

/* ===== RESPONSIVE ===== */
/* La rangée reste horizontale à toutes les tailles (le doigt fait défiler sur mobile) —
   seule la largeur des cartes s'adapte. */
@media (max-width: 768px) {
  .gallery-card { width: clamp(160px, 42vw, 210px); aspect-ratio: 4 / 3; }
  .phs-title { font-size: 2rem; }
}
@media (max-width: 480px) {
  .gallery-card { width: 72vw; aspect-ratio: 16 / 11; }
}
