/* =====================================================================
   STYLE.CSS — Mur de témoignages Kaplan. Palette sobre, bleu Kaplan.
   ===================================================================== */

:root {
  --navy:        #240F6E;   /* violet Kaplan officiel (--brand-primary-color) */
  --navy-deep:   #160940;
  --blue:        #005DE8;   /* bleu accent Kaplan (--link-light-blue) */
  --blue-soft:   #ece9f9;
  --bg:          #f5f4fc;
  --card:        #ffffff;
  --ink:         #18233b;
  --ink-soft:    #5a6982;
  --line:        #e2dff2;
  --radius:      16px;
  --shadow:      0 6px 24px rgba(36, 15, 110, 0.08);
  --shadow-hover:0 12px 36px rgba(36, 15, 110, 0.16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff;
  padding: 54px 0 64px;
  position: relative;
  overflow: hidden;
}
.site-header::after {
  content: "";
  position: absolute;
  right: -120px; top: -120px;
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(0,93,232,0.40), transparent 65%);
  pointer-events: none;
}
.header-inner { position: relative; z-index: 1; }

.brand {
  display: block;
  margin-bottom: 22px;
}
.brand-logo {
  height: 30px;
  width: auto;
  display: block;
  opacity: 0.95;
}

.header-title {
  font-size: clamp(28px, 4.4vw, 46px);
  line-height: 1.08;
  font-weight: 800;
  margin: 0 0 14px;
  max-width: 820px;
  letter-spacing: -0.02em;
}
.header-subtitle {
  font-size: clamp(15px, 1.8vw, 19px);
  line-height: 1.55;
  color: #cfddf3;
  margin: 0;
  max-width: 640px;
}
.header-stats {
  margin-top: 26px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.header-stats .stat {
  display: flex;
  flex-direction: column;
}
.header-stats .stat b {
  font-size: 24px;
  font-weight: 800;
}
.header-stats .stat span {
  font-size: 13px;
  color: #aac4ec;
}
.stat-tp {
  text-decoration: none;
  color: inherit;
}
.stat-tp:hover b { opacity: 0.8; }
.tp-star { color: #00b67a; }
.tp-max { font-size: 16px; font-weight: 700; opacity: 0.65; }

/* ---------- CTA header ---------- */
.header-cta {
  display: inline-block;
  margin-top: 28px;
  background: #fff;
  color: var(--navy);
  font-weight: 700;
  font-size: 15px;
  padding: 13px 26px;
  border-radius: 999px;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.15s;
}
.header-cta:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ---------- Filtres ---------- */
.filters {
  margin: 28px 0 4px;
}
.filter-select {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 40px 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a6982' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  transition: border-color 0.15s;
  min-width: 220px;
}
.filter-select:hover { border-color: var(--blue); }
.filter-select:focus { outline: 2px solid var(--blue); outline-offset: 2px; border-color: var(--blue); }

/* ---------- Grille ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 26px;
  margin: 30px 0 60px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.card-media {
  position: relative;
  width: 100%;
  background: #0b0825;
  min-height: 560px;
}
.card-media iframe {
  display: block;
  width: 100%;
  height: 620px;
  border: 0;
}
/* TikTok embed est un peu plus haut */
.card-media.tiktok iframe { height: 740px; }

/* Overlay transparent : capture les clics pour le lightbox sans bloquer l'autoplay */
.card-click-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: pointer;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
}
.card-source {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge.instagram { background: #fdeef4; color: #c13584; }
.badge.tiktok    { background: #eafcfb; color: #0b8f95; }
.badge.youtube   { background: #fdecec; color: #d62b2b; }

.card-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
}
.card-link:hover { text-decoration: underline; }

/* ---------- Placeholder cliquable (remplace iframe dans la grille) ---------- */
.card-placeholder {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 620px;
  cursor: pointer;
  background-color: #120930;
  background-size: cover;
  background-position: center;
  transition: background-color 0.15s;
}
.card-media.tiktok .card-placeholder { height: 740px; }

/* Overlay sombre sur la miniature pour garder le play lisible */
.card-placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  transition: background 0.15s;
}
.card-placeholder:hover::after { background: rgba(0, 0, 0, 0.22); }

.play-icon {
  position: relative;
  z-index: 1;
  font-size: 2.8rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1;
  transition: color 0.15s, transform 0.15s;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.card-placeholder:hover .play-icon {
  color: #fff;
  transform: scale(1.12);
}

.placeholder-label {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  padding: 0 20px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}

/* ---------- Lightbox ---------- */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#lightbox[hidden] { display: none; }

.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: pointer;
}

.lightbox-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: min(380px, 90vw);
}

.lightbox-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  font-family: inherit;
  padding: 6px 13px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 8px;
  line-height: 1;
  transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.28); }

.lightbox-frame {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.lightbox-frame.youtube { aspect-ratio: 16 / 9; }

.lightbox-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ---------- Carte fallback (vidéo non intégrable) ---------- */
.card-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 560px;
  padding: 30px;
  text-align: center;
  background: linear-gradient(160deg, #240F6E, #160940);
  color: #fff;
}
.card-fallback p { margin: 0; color: #cfddf3; font-size: 15px; }
.card-fallback .open-btn {
  background: #fff;
  color: var(--navy);
  font-weight: 700;
  padding: 11px 22px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
}

/* ---------- Etats ---------- */
.state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}
.state.error {
  background: #fff4f4;
  border: 1px solid #f5d0d0;
  border-radius: var(--radius);
  color: #b22;
  margin: 30px 0;
}
.spinner {
  width: 34px; height: 34px;
  margin: 0 auto 16px;
  border: 3px solid var(--blue-soft);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 30px 0 44px;
}
.site-footer p {
  margin: 0 auto;
  max-width: 760px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}
.footer-fine { margin-top: 10px !important; font-size: 12px !important; color: #9aa7bd !important; }

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .site-header { padding: 40px 0 48px; }
}
