/* ==========================================================
   FRUX GROUPE — style/publications.css
   Page Publications (fil d'actualité type réseau social).
   Complète style/style.css (variables, navbar, footer, assistant…)
   ========================================================== */
body.pub-page { background: var(--bg-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Bannière ---------- */
.pub-hero {
  margin-top: var(--nav-h);
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(40px, 7vw, 84px) 24px clamp(70px, 9vw, 110px);
  text-align: center; color: #fff;
  background: linear-gradient(120deg, #4a0102 0%, var(--brand) 50%, #2b2b2e 100%);
}
.pub-hero::before, .pub-hero::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(60px); opacity: .5;
}
.pub-hero::before { width: 420px; height: 420px; left: -120px; top: -160px; background: #e11d2e; }
.pub-hero::after  { width: 360px; height: 360px; right: -100px; bottom: -180px; background: #ffffff22; }
.crumbs ol { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; font-size: 13px; color: rgba(255, 255, 255, .75); margin-bottom: 18px; }
.crumbs li + li::before { content: "/"; margin-right: 8px; opacity: .6; }
.crumbs a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.crumbs li[aria-current] { color: #fff; }
.pub-hero h1 { font-size: clamp(2.6rem, 7vw, 5rem); font-weight: 700; letter-spacing: -.04em; line-height: 1.02; }
.pub-sub { margin-top: 14px; font-size: clamp(1.05rem, 2vw, 1.4rem); color: rgba(255, 255, 255, .85); }
.pub-count {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 22px;
  font-size: 13px; font-weight: 500; padding: 7px 16px; border-radius: 980px;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}

/* ---------- Mise en page ---------- */
.pub-layout {
  position: relative; z-index: 2;
  max-width: 1160px; margin: -44px auto 0; padding: 0 20px clamp(60px, 8vw, 100px);
  display: grid; grid-template-columns: minmax(0, 700px) 330px; gap: 28px;
  justify-content: center; align-items: start;
}
.feed { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

/* ---------- Onglets de filtre ---------- */
.pub-tabs {
  position: sticky; top: calc(var(--nav-h) + 12px); z-index: 20;
  display: flex; gap: 4px; padding: 5px; border-radius: 980px;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--line); box-shadow: 0 10px 34px rgba(0, 0, 0, .1);
}
.pub-tabs a {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 14px; border-radius: 980px; font-size: 14px; font-weight: 500; color: var(--ink-2);
  transition: background .3s, color .3s;
}
.pub-tabs a:hover { color: var(--ink); background: rgba(0, 0, 0, .05); }
.pub-tabs a.on { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(125, 1, 3, .35); }

/* ---------- Publication ---------- */
.post {
  background: #fff; border-radius: 26px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: 0 2px 6px rgba(0, 0, 0, .03), 0 18px 50px rgba(0, 0, 0, .06);
  transition: box-shadow .5s var(--ease);
}
.post:hover { box-shadow: 0 2px 6px rgba(0, 0, 0, .04), 0 26px 64px rgba(0, 0, 0, .1); }
.post-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 6px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--bg-soft); border: 1px solid var(--line); padding: 4px; }
.who { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; flex: 1; }
.who strong { font-size: 15px; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 5px; }
.who strong i { color: #0a84ff; font-size: 16px; }
.who time { font-size: 12.5px; color: var(--ink-2); }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 980px; background: var(--bg-soft); color: var(--ink-2); white-space: nowrap; }
.post-body { padding: 10px 20px 16px; }
.post-title { font-size: clamp(1.15rem, 2.2vw, 1.4rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.25; margin: 0 0 8px; color: var(--ink); text-transform: none; }
.post-title a:hover { color: var(--brand); }
.post-text { font-size: 15.5px; line-height: 1.55; color: #424245; }

/* ---------- Média (photo / vidéo) ---------- */
.media { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; background: #0b0b0c; isolation: isolate; border: 0; padding: 0; }
.media-img { cursor: zoom-in; }
.media-img::before {   /* fond flouté = remplit les bandes quand la photo n'a pas le même format */
  content: ""; position: absolute; inset: -30px; z-index: -1;
  background: var(--bg) center / cover no-repeat; filter: blur(30px) brightness(.8) saturate(1.3);
}
.media img { width: 100%; height: 100%; object-fit: contain; transition: transform 1.2s var(--ease); }
.media-img:hover img { transform: scale(1.03); }
.zoom {
  position: absolute; right: 14px; bottom: 14px; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; font-size: 20px; color: #fff;
  background: rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transform: scale(.85); transition: opacity .35s, transform .35s var(--ease);
}
.media-img:hover .zoom, .media-img:focus-visible .zoom { opacity: 1; transform: none; }
.media-video { aspect-ratio: 16 / 9; }
.media-video video { width: 100%; height: 100%; object-fit: contain; display: block; cursor: pointer; }
.v-play {
  position: absolute; left: 50%; top: 50%; width: 74px; height: 74px; margin: -37px 0 0 -37px; border-radius: 50%;
  display: grid; place-items: center; font-size: 34px; color: #fff;
  background: rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: opacity .35s, transform .35s var(--ease);
}
.v-play:hover { transform: scale(1.08); }
.media-video.is-playing .v-play { opacity: 0; pointer-events: none; }
.media-video.is-playing:hover .v-play { opacity: .9; pointer-events: auto; transform: scale(.8); }
.v-sound {
  position: absolute; right: 14px; bottom: 18px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-size: 19px; color: #fff;
  background: rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: transform .3s var(--ease), background .3s;
}
.v-sound:hover { transform: scale(1.1); background: rgba(0, 0, 0, .7); }
.v-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .25); cursor: pointer; }
.v-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--brand), #ff3b4a); transform: scaleX(0); transform-origin: left; }

/* ---------- Actions ---------- */
.post-actions { display: flex; align-items: center; gap: 6px; padding: 10px 14px 12px; border-top: 1px solid var(--line); }
.act {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 980px;
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  transition: background .25s, color .25s, transform .25s var(--ease);
}
.act i { font-size: 19px; }
.act:hover { background: var(--bg-soft); color: var(--ink); }
.like.on { color: #e11d2e; }
.like.pop i { animation: pop .45s var(--ease); }
@keyframes pop { 30% { transform: scale(1.5); } 100% { transform: scale(1); } }
.act.more { margin-left: auto; background: var(--brand); color: #fff; padding: 10px 18px; }
.act.more:hover { background: var(--brand-2); color: #fff; transform: translateX(3px); }
.act.more i { font-size: 17px; }

/* ---------- Pagination ---------- */
.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pg {
  min-width: 46px; height: 46px; padding: 0 14px; border-radius: 980px;
  display: inline-grid; place-items: center; font-size: 15px; font-weight: 500;
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  transition: background .3s, color .3s, transform .3s var(--ease), box-shadow .3s;
}
a.pg:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .1); }
.pg.nav { font-size: 22px; padding: 0; width: 46px; }
.pg.cur { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 8px 22px rgba(125, 1, 3, .35); }
.pg.dots { background: transparent; border: 0; color: var(--ink-2); min-width: 20px; padding: 0; }
.pager-info { text-align: center; font-size: 13px; color: var(--ink-2); }

/* ---------- Vide ---------- */
.empty { text-align: center; padding: 64px 24px; background: #fff; border-radius: 26px; border: 1px solid var(--line); }
.empty > i { font-size: 52px; color: #c7c7cc; }
.empty h2 { font-size: 1.4rem; margin: 10px 0 6px; text-transform: none; }
.empty p { color: var(--ink-2); margin-bottom: 20px; }

/* ---------- Colonne latérale ---------- */
.side { position: sticky; top: calc(var(--nav-h) + 24px); display: grid; gap: 18px; }
.card-side { background: #fff; border-radius: 24px; padding: 22px; border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(0, 0, 0, .05); }
.card-side h3 { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 14px; }
.about { text-align: center; }
.about-logo { height: 44px; width: auto; margin: 0 auto 14px; }
.about p { font-size: 14.5px; color: var(--ink-2); margin-bottom: 18px; }
.about-btns { display: flex; gap: 8px; margin-bottom: 8px; }
.btn-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 1;
  padding: 11px 16px; border-radius: 980px; font-size: 14px; font-weight: 500;
  background: var(--brand); color: #fff; transition: background .3s, transform .3s var(--ease);
}
.btn-pill:hover { background: var(--brand-2); transform: scale(1.03); }
.btn-pill.ghost { background: var(--bg-soft); color: var(--ink); }
.btn-pill.ghost:hover { background: rgba(0, 0, 0, .1); }
.btn-pill.wide { width: 100%; }
.latest { display: grid; gap: 14px; }
.latest a { display: flex; gap: 12px; align-items: center; }
.latest a:hover strong { color: var(--brand); }
.thumb { flex: none; width: 64px; height: 64px; border-radius: 16px; overflow: hidden; background: var(--bg-soft); display: grid; place-items: center; font-size: 26px; color: var(--ink-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.is-video { background: #1d1d1f; color: #fff; }
.l-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.l-txt strong { font-size: 14px; font-weight: 600; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color .25s; }
.l-txt small { font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.side-social { display: flex; gap: 10px; }
.side-social a { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; background: var(--bg-soft); transition: background .3s, color .3s, transform .3s var(--ease); }
.side-social a:hover { background: var(--brand); color: #fff; transform: translateY(-3px); }

/* ---------- Visionneuse ---------- */
.lb {
  position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s;
}
.lb.open { opacity: 1; visibility: visible; }
.lb figure { margin: 0; max-width: min(94vw, 1400px); text-align: center; }
.lb img { max-width: 100%; max-height: 82vh; border-radius: 14px; opacity: 0; transform: scale(.96); transition: opacity .4s, transform .5s var(--ease); }
.lb img.in { opacity: 1; transform: none; }
.lb figcaption { color: rgba(255, 255, 255, .85); font-size: 14.5px; margin-top: 14px; }
.lb-close, .lb-nav {
  position: absolute; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center;
  font-size: 26px; color: #fff; background: rgba(255, 255, 255, .14); transition: background .3s, transform .3s var(--ease);
}
.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, .28); transform: scale(1.08); }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 18px; top: 50%; margin-top: -25px; }
.lb-next { right: 18px; top: 50%; margin-top: -25px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; z-index: 3100; transform: translate(-50%, 20px);
  padding: 12px 22px; border-radius: 980px; font-size: 14px; font-weight: 500; color: #fff;
  background: rgba(29, 29, 31, .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  opacity: 0; pointer-events: none; transition: opacity .4s, transform .5s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .pub-layout { grid-template-columns: minmax(0, 1fr); max-width: 720px; }
  .side { position: static; }
}
@media (max-width: 560px) {
  .pub-layout { padding-left: 12px; padding-right: 12px; margin-top: -36px; }
  .post { border-radius: 22px; }
  .post-head { padding: 16px 16px 4px; }
  .post-body { padding: 8px 16px 14px; }
  .act { padding: 10px 12px; }
  .act span { font-size: 13.5px; }
  .act.more { padding: 10px 14px; }
  .pub-tabs a { padding: 10px 8px; font-size: 13px; }
  .pub-tabs a i { display: none; }
  .lb-prev { left: 8px; } .lb-next { right: 8px; }
}
/* ==========================================================
   PAGE DÉTAIL (publications_detail.php)
   ========================================================== */
.pub-hero.detail { padding-bottom: clamp(70px, 9vw, 100px); }
.pub-hero.detail h1 {
  font-size: clamp(1.8rem, 4.6vw, 3.2rem); line-height: 1.12; letter-spacing: -.03em;
  max-width: 24ch; margin: 0 auto; overflow-wrap: anywhere;
}
.pub-hero.detail .pub-sub { font-size: 1rem; margin-top: 18px; display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.pub-hero.detail .pub-sub span { display: inline-flex; align-items: center; gap: 6px; }

.post-full .post-head { padding: 22px 24px 14px; }
.post-full .post-body { padding: 22px 26px 26px; }
.prose p { font-size: clamp(1rem, 1.5vw, 1.12rem); line-height: 1.8; color: #2c2c2e; margin: 0 0 1.15em; letter-spacing: -.005em; overflow-wrap: anywhere; }
.prose p:last-child { margin-bottom: 0; }
.prose a { color: var(--brand); text-decoration: underline !important; text-underline-offset: 3px; }
.prose a:hover { color: var(--brand-2); }
.post-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.post-meta span { display: inline-flex; align-items: center; gap: 6px; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pn {
  display: flex; flex-direction: column; gap: 5px; padding: 18px 20px; background: #fff;
  border: 1px solid var(--line); border-radius: 22px;
  transition: transform .35s var(--ease), box-shadow .35s;
}
a.pn:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(0, 0, 0, .08); }
.pn small { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.pn strong { font-size: 15px; letter-spacing: -.01em; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pn.next { text-align: right; align-items: flex-end; }
.pn.empty-slot { visibility: hidden; border: 0; padding: 0; }

.related h2 { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 14px; text-transform: none; color: var(--ink); }
.rel-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.rel-card {
  display: flex; flex-direction: column; background: #fff; border-radius: 22px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(0, 0, 0, .05);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.rel-card:hover { transform: translateY(-5px); box-shadow: 0 26px 60px rgba(0, 0, 0, .12); }
.rel-media { aspect-ratio: 16 / 10; display: grid; place-items: center; font-size: 40px; color: var(--ink-2); background: var(--bg-soft); overflow: hidden; }
.rel-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.rel-card:hover .rel-media img { transform: scale(1.06); }
.rel-media.is-video { background: #1d1d1f; color: #fff; }
.rel-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; flex: 1; }
.rel-body strong { font-size: 15.5px; font-weight: 700; letter-spacing: -.015em; line-height: 1.3; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rel-body small { font-size: 12.5px; color: var(--ink-2); }
.rel-more { margin-top: auto; padding-top: 6px; font-size: 13.5px; font-weight: 600; color: var(--brand); display: inline-flex; align-items: center; gap: 4px; }

/* Recherche en direct */
.search { position: relative; }
.search > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #86868b; pointer-events: none; font-size: 18px; }
.search input {
  width: 100%; font: inherit; font-size: 15px; padding: 13px 16px 13px 44px; border-radius: 980px;
  border: 1px solid var(--line); background: var(--bg-soft); outline: none; transition: border-color .3s, background .3s, box-shadow .3s;
}
.search input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(125, 1, 3, .1); }
.sugg {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .18);
}
.sugg[hidden] { display: none; }
.sugg a, .sugg .none { display: block; padding: 11px 14px; border-radius: 14px; font-size: 14px; line-height: 1.35; color: var(--ink); }
.sugg .none { color: var(--ink-2); }
.sugg a:hover, .sugg a.sel { background: var(--bg-soft); color: var(--brand); }

.adv p { font-size: 14px; line-height: 1.65; color: var(--ink-2); margin-bottom: 12px; }
.adv p:last-child { margin-bottom: 0; }
.links-list { display: grid; gap: 2px; }
.links-list a { display: flex; align-items: center; gap: 4px; padding: 10px 8px; border-radius: 12px; font-size: 15px; font-weight: 500; transition: background .25s, color .25s, padding .3s var(--ease); }
.links-list a:hover { background: var(--bg-soft); color: var(--brand); padding-left: 14px; }
.links-list i { color: var(--brand); font-size: 18px; }

@media (max-width: 560px) {
  .post-full .post-head { padding: 18px 18px 10px; }
  .post-full .post-body { padding: 16px 18px 20px; }
  .post-nav, .rel-grid { grid-template-columns: 1fr; }
  .pn.empty-slot { display: none; }
  .pn.next { text-align: left; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .media img, .lb img, .rel-media img { transition: none; }
}
