/* =========================================================
   PSYCH&POTES ASBL — DESIGN MAGAZINE RESPONSIVE, YOUTUBE LITE & ZOOM
   Optimisé Core Web Vitals (Anti-CLS + Content-Visibility)
========================================================= */

/* 1. Réservation d'espace verticale (Élimine le saut de page CLS = 0.00) */
#homeFbFeedGrid {
  min-height: 780px;
}
#allFbFeedGrid {
  min-height: 920px;
}

.news-page .nav-link--active {
  color: var(--color-accent) !important;
  border-bottom: 2px solid var(--color-accent);
}
.news-page .nav-link--active:hover {
  color: #ffffff !important;
  border-bottom-color: #ffffff !important;
}

.fb-feed-grid {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vw, 30px);
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
}

.fb-article {
  width: 100%;
  background: linear-gradient(145deg, rgba(13, 37, 68, 0.95), rgba(8, 23, 44, 0.98));
  border: 1px solid rgba(216, 159, 34, 0.32);
  border-radius: var(--radius);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  padding: clamp(16px, 3vw, 28px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}

/* 2. Optimisation CPU Chromium : ne calcule le rendu des articles hors-écran qu'au scroll */
.fb-article:nth-child(n + 3) {
  content-visibility: auto;
  contain-intrinsic-size: 0 420px;
}

.fb-article:hover {
  border-color: rgba(216, 159, 34, 0.65);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.6);
}

.fb-article__Flow {
  display: block;
}
.fb-article__Flow::after {
  content: "";
  display: table;
  clear: both;
}

/* =========================================================
   COLONNE MÉDIA (PHOTOS OU LECTEUR YOUTUBE LITE)
========================================================= */
.fb-article__media-col {
  width: 100%;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(5, 16, 32, 0.65);
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(248, 247, 243, 0.1);
}

@media (min-width: 768px) {
  .fb-article--has-media .fb-article__media-col {
    float: left;
    width: 44%;
    max-width: 390px;
    margin-right: 24px;
    margin-bottom: 14px;
  }
}

@media (min-width: 960px) {
  .fb-article--has-media .fb-article__media-col {
    width: 430px;
    max-width: 430px;
    margin-right: 30px;
    margin-bottom: 16px;
  }
}

.fb-article__main-img {
  margin: 0;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: #040d1a;
  cursor: zoom-in;
  border: 1px solid rgba(248, 247, 243, 0.14);
}

.fb-article__main-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.fb-article__main-img:hover img {
  transform: scale(1.04);
}

/* Vignette Vidéo YouTube Lite (Ultra-performante) */
.fb-yt-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  border: 1px solid rgba(216, 159, 34, 0.4);
}

.fb-yt-player img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
  transition: transform 0.35s ease, opacity 0.25s ease;
}

.fb-yt-player:hover img {
  transform: scale(1.04);
  opacity: 1;
}

.fb-yt-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 48px;
  background: rgba(220, 38, 38, 0.92);
  border: 2px solid #ffffff;
  border-radius: 14px;
  color: #ffffff;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.fb-yt-player:hover .fb-yt-play-btn {
  transform: translate(-50%, -50%) scale(1.1);
  background: #ef4444;
}

.fb-yt-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(10, 29, 55, 0.9);
  color: #fff;
  border: 1px solid rgba(248, 247, 243, 0.25);
  border-radius: 999px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  pointer-events: none;
}

.fb-yt-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Grille de 4 miniatures */
.fb-article__thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  height: 64px;
}

.fb-thumb {
  position: relative;
  height: 100%;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  cursor: zoom-in;
  border: 1px solid rgba(248, 247, 243, 0.2);
  background: #07162b;
  padding: 0;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.fb-thumb:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.fb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fb-thumb__more {
  position: absolute;
  inset: 0;
  background: rgba(10, 29, 55, 0.85);
  color: var(--color-accent);
  font-family: var(--font-title);
  font-size: 1.3rem;
  display: grid;
  place-items: center;
}

.fb-zoom-hint {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(10, 29, 55, 0.9);
  color: var(--color-accent);
  border: 1px solid rgba(216, 159, 34, 0.55);
  border-radius: 999px;
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(6px);
  pointer-events: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.fb-article__main-img:hover .fb-zoom-hint {
  background: var(--color-accent);
  color: #0a1d37;
}

/* =========================================================
   EN-TÊTE AUTEUR & TEXTE DÉROULANT FLUIDE
========================================================= */
.fb-article__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(248, 247, 243, 0.12);
}

.fb-article__author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fb-article__avatar-img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-accent);
  background: #0a1d37;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.fb-article__author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fb-article__author-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-light);
}

.fb-article__date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-accent);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.fb-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(8, 105, 95, 0.38);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #f8f7f3;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
}

/* Zone de texte avec animation fluide */
.fb-article__body-wrap {
  position: relative;
  overflow: hidden;
  max-height: 230px;
  transition: max-height 0.55s cubic-bezier(0.25, 1, 0.5, 1);
}

@media (max-width: 767px) {
  .fb-article__body-wrap {
    max-height: 260px;
  }
}

.fb-article__body-wrap.is-collapsible::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 65px;
  background: linear-gradient(180deg, transparent, rgba(9, 26, 49, 0.96));
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.fb-article.is-expanded .fb-article__body-wrap {
  max-height: 3500px;
}

.fb-article.is-expanded .fb-article__body-wrap.is-collapsible::after {
  opacity: 0;
}

.fb-article__body {
  margin: 0;
  font-size: clamp(0.96rem, 1.5vw, 1.03rem);
  color: rgba(248, 247, 243, 0.94);
  line-height: 1.68;
  white-space: pre-line;
  word-break: break-word;
}

.fb-article__body a {
  color: var(--color-accent);
  text-decoration: underline;
  font-weight: 600;
}

/* =========================================================
   PIED DE CARTE :
   - Sur actualite.html : Grille 3 colonnes (Flèche pile au centre + Voir la publication à droite)
   - Sur index.html : Uniquement "Lire dans Actualités" aligné à droite
========================================================= */
.fb-article__footer {
  clear: both;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(248, 247, 243, 0.12);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.fb-article__footer--home {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.fb-footer-right {
  justify-self: end;
}

/* Bouton Flèche Ronde Centrée (sans texte, sur actualite.html) */
.fb-expand-arrow-btn {
  justify-self: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(216, 159, 34, 0.16);
  border: 2px solid var(--color-accent);
  color: var(--color-accent);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.fb-expand-arrow-btn:hover {
  background: var(--color-accent);
  color: #0a1d37;
  transform: translateY(2px) scale(1.06);
}

.fb-expand-arrow-btn .svg-icon {
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.fb-article.is-expanded .fb-expand-arrow-btn .svg-icon {
  transform: rotate(180deg);
}

@media (max-width: 560px) {
  .fb-article__footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }
  .fb-footer-right,
  .fb-footer-right .btn,
  .fb-article__footer--home .btn {
    width: 100%;
    justify-content: center;
  }
}

.fb-section-actions {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* =========================================================
   🔍 LIGHTBOX PLEIN ÉCRAN (ZOOM IMAGE AU CLIC)
========================================================= */
.pp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(5, 14, 28, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeInModal 0.25s ease-out forwards;
}

.pp-lightbox[hidden] {
  display: none !important;
}

.pp-lightbox__inner {
  position: relative;
  max-width: 1000px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.pp-lightbox__img-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 74vh;
  width: 100%;
}

.pp-lightbox__img {
  max-width: 100%;
  max-height: 74vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(216, 159, 34, 0.45);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
}

.pp-lightbox__close {
  position: absolute;
  top: -12px;
  right: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(143, 42, 60, 0.9);
  border: 2px solid rgba(248, 247, 243, 0.4);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 10;
  transition: transform 0.15s ease, background-color 0.2s ease;
}

.pp-lightbox__close:hover {
  transform: scale(1.08);
  background: #b91c1c;
}

.pp-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(10, 29, 55, 0.88);
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color 0.2s ease;
}

.pp-lightbox__nav:hover {
  background: var(--color-accent);
  color: #0a1d37;
}

.pp-lightbox__nav--prev { left: 10px; }
.pp-lightbox__nav--next { right: 10px; }

.pp-lightbox__caption {
  background: rgba(10, 29, 55, 0.9);
  border: 1px solid rgba(248, 247, 243, 0.14);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  max-width: 780px;
  width: 100%;
  max-height: 16vh;
  overflow-y: auto;
  font-size: 0.9rem;
  color: var(--color-light);
  text-align: left;
  white-space: pre-line;
}