/* ============================================================
   Portfolio — mise en page « galerie » (portfolio/index.php, body.pg-page)
   En-tête éditorial · barre d'univers collante · mosaïque aux vraies proportions · visionneuse immersive.
   Couleurs : jetons du site (style.css, :root / html.light) ; titres en Playfair Display (hébergée sur le site).
   ============================================================ */

@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url('/assets/fonts/playfair/playfair-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: 'Playfair Display'; font-style: italic; font-weight: 400 900; font-display: swap;
  src: url('/assets/fonts/playfair/playfair-italic-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122; }

.pg-page {
  --pg-bg: var(--bg-body, #07101a);
  --pg-ink: var(--text-main, #e5e7eb);
  --pg-muted: var(--text-muted, rgba(229,231,235,.68));
  --pg-gold: var(--accent, #E6CD95);
  --pg-line: var(--border-soft, rgba(255,255,255,.08));
  --pg-line-2: var(--border-strong, rgba(255,255,255,.12));
  --pg-surface: rgba(255,255,255,.035);
  --pg-chip: rgba(255,255,255,.05);
  --pg-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --pg-wrap: min(1380px, 100% - 2 * clamp(16px, 4vw, 48px));
  --pg-ease: cubic-bezier(.22, .68, 0, 1);
}
html.light .pg-page {
  --pg-surface: rgba(255,255,255,.7);
  --pg-chip: rgba(11,17,32,.04);
}
.pg-page .site-scroll { background: var(--pg-bg); }

/* ── Petites briques ── */
.pg-eyebrow {
  display: flex; align-items: center; gap: 12px; margin: 0 0 18px;
  font-size: .74rem; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: var(--pg-gold);
}
.pg-eyebrow__rule { width: 34px; height: 1px; background: currentColor; opacity: .7; }
.pg-eyebrow--center { justify-content: center; }

.pg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 24px;
  border-radius: 999px; font-weight: 800; font-size: .92rem; letter-spacing: .01em; text-decoration: none;
  transition: transform .2s var(--pg-ease), background .2s, border-color .2s, color .2s;
}
.pg-btn:hover { transform: translateY(-1px); }
.pg-btn--gold { background: var(--pg-gold); color: #0b1220; }
.pg-btn--gold:hover { background: #f0dcae; }
.pg-btn--ghost { border: 1px solid var(--pg-line-2); color: var(--pg-ink); }
.pg-btn--ghost:hover { border-color: var(--pg-gold); color: var(--pg-gold); }
.pg-btn:focus-visible, .pg-chip:focus-visible, .pg-round:focus-visible, .pg-item:focus-visible, .pg-feature__slide:focus-visible {
  outline: 2px solid var(--pg-gold); outline-offset: 3px;
}

.pg-round {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--pg-line-2); background: transparent;
  color: var(--pg-ink); font-size: 1.35rem; line-height: 1; cursor: pointer; display: inline-grid; place-items: center;
  transition: border-color .2s, color .2s, background .2s;
}
.pg-round:hover { border-color: var(--pg-gold); color: var(--pg-gold); }

/* ============================================================
   EN-TÊTE
   ============================================================ */
.pg-hero {
  width: var(--pg-wrap); margin: 0 auto; padding: clamp(36px, 7vw, 88px) 0 clamp(32px, 5vw, 56px);
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 5vw, 72px); align-items: center;
}
.pg-hero--compact { grid-template-columns: 1fr; padding-bottom: clamp(20px, 3vw, 32px); }
.pg-hero__text { min-width: 0; }
.pg-title {
  margin: 0; font-family: var(--pg-serif); font-weight: 500; color: var(--pg-ink);
  font-size: clamp(2.5rem, 6.2vw, 5.4rem); line-height: 1.02; letter-spacing: -.02em; text-wrap: balance;
}
.pg-title em { font-style: italic; color: var(--pg-gold); font-weight: 500; }
.pg-hero--compact .pg-title { font-size: clamp(2.3rem, 5.4vw, 4.4rem); }
.pg-lede { margin: 22px 0 0; max-width: 46ch; font-size: clamp(1rem, 1.25vw, 1.1rem); line-height: 1.75; color: var(--pg-muted); }
.pg-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 30px 0 0; padding: 0; color: var(--pg-muted); font-size: .9rem; }
.pg-facts li { display: flex; align-items: center; gap: 6px; line-height: 1; }
.pg-facts li + li::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--pg-gold); opacity: .6; margin-right: 22px; align-self: center; }
.pg-facts b { font-family: var(--pg-serif); font-size: 1.45rem; font-weight: 600; color: var(--pg-ink); }

/* Photo à la une */
.pg-feature { min-width: 0; }
.pg-feature__frame {
  position: relative; aspect-ratio: 4 / 5; max-height: min(72vh, 640px); margin-left: auto; overflow: hidden;
  border-radius: 22px; background: #0d1520; box-shadow: 0 40px 80px -30px rgba(0,0,0,.6);
}
html.light .pg-feature__frame { box-shadow: 0 40px 70px -34px rgba(15,23,36,.35); }
.pg-feature__slide { position: absolute; inset: 0; margin: 0; cursor: zoom-in; opacity: 0; transition: opacity 1.1s ease; }
.pg-feature__slide.is-active { opacity: 1; z-index: 1; }
.pg-feature__slide img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.06); transition: transform 7s ease-out; }
.pg-feature__slide.is-active img { transform: scale(1); }
.pg-feature__badge {
  position: absolute; z-index: 2; top: 18px; left: 18px; padding: 7px 13px; border-radius: 999px;
  background: rgba(7,16,26,.62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--pg-gold); font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
}
.pg-feature__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; }
.pg-feature__caption { position: relative; min-height: 3.2em; flex: 1; min-width: 0; }
.pg-feature__cap { position: absolute; inset: 0 auto auto 0; width: 100%; opacity: 0; transform: translateY(6px); transition: opacity .5s, transform .5s var(--pg-ease); pointer-events: none; }
.pg-feature__cap.is-active { opacity: 1; transform: none; position: relative; }
.pg-feature__title { margin: 0; font-family: var(--pg-serif); font-size: 1.3rem; font-style: italic; color: var(--pg-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-feature__loc { margin: 4px 0 0; display: flex; align-items: center; gap: 5px; font-size: .84rem; color: var(--pg-muted); }
.pg-feature__nav { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.pg-feature__count { font-size: .8rem; letter-spacing: .1em; color: var(--pg-muted); font-variant-numeric: tabular-nums; }
.pg-feature__count b { color: var(--pg-ink); font-weight: 800; }
.pg-feature__progress { height: 2px; margin-top: 14px; background: var(--pg-line); border-radius: 2px; overflow: hidden; }
.pg-feature__progress span { display: block; height: 100%; width: 0; background: var(--pg-gold); }

/* ============================================================
   BARRE D'UNIVERS (collante)
   ============================================================ */
.pg-filters {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--pg-bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-top: 1px solid var(--pg-line); border-bottom: 1px solid var(--pg-line);
}
.pg-filters__inner { width: var(--pg-wrap); margin: 0 auto; display: flex; align-items: center; gap: 16px; min-height: 66px; }
.pg-chips { display: flex; gap: 8px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 10px 0; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.pg-chips::-webkit-scrollbar { display: none; }
.pg-chip {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--pg-line-2); background: var(--pg-chip); color: var(--pg-ink); text-decoration: none;
  font-size: .88rem; font-weight: 700; white-space: nowrap; transition: border-color .2s, background .2s, color .2s;
}
.pg-chip span { font-size: .72rem; font-weight: 800; color: var(--pg-muted); font-variant-numeric: tabular-nums; }
.pg-chip:hover { border-color: color-mix(in srgb, var(--pg-gold) 60%, transparent); }
.pg-chip.is-active { background: var(--pg-gold); border-color: var(--pg-gold); color: #0b1220; }
.pg-chip.is-active span { color: rgba(11,18,32,.6); }

.pg-search {
  position: relative; display: flex; align-items: center; flex-shrink: 0; width: 42px; height: 42px; border-radius: 999px;
  border: 1px solid var(--pg-line-2); background: var(--pg-chip); transition: width .35s var(--pg-ease), border-color .2s;
}
.pg-search.is-open, .pg-search:focus-within { width: min(300px, 46vw); border-color: color-mix(in srgb, var(--pg-gold) 55%, transparent); }
.pg-search__icon { position: absolute; left: 13px; color: var(--pg-muted); cursor: pointer; }
.pg-search input {
  width: 100%; height: 100%; padding: 0 34px 0 38px; border: 0; background: transparent; color: var(--pg-ink);
  font: inherit; font-size: .9rem; outline: none; opacity: 0; transition: opacity .2s;
}
.pg-search.is-open input, .pg-search:focus-within input { opacity: 1; }
.pg-search input::-webkit-search-cancel-button { display: none; }
.pg-search__clear { position: absolute; right: 12px; color: var(--pg-muted); text-decoration: none; font-size: .8rem; }
.pg-search__clear:hover { color: var(--pg-ink); }

/* ============================================================
   MOSAÏQUE
   ============================================================ */
.pg-main { width: var(--pg-wrap); margin: 0 auto; padding: clamp(28px, 4vw, 48px) 0 clamp(48px, 7vw, 96px); }
.pg-masonry { columns: 3 320px; column-gap: clamp(14px, 1.8vw, 24px); }
.pg-item {
  position: relative; margin: 0 0 clamp(14px, 1.8vw, 24px); break-inside: avoid; cursor: zoom-in;
  border-radius: 16px; outline-offset: 4px;
  opacity: 0; transform: translateY(22px); transition: opacity .8s var(--pg-ease), transform .8s var(--pg-ease);
  transition-delay: calc(var(--i, 0) * 60ms);
}
.pg-item.is-in { opacity: 1; transform: none; }
.pg-item__media { position: relative; overflow: hidden; border-radius: 16px; background: #0d1520; }
html.light .pg-item__media { background: #dfe6ee; }
.pg-item__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--pg-ease), filter .6s; }
.pg-item__shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(4,9,15,.82)); opacity: 0; transition: opacity .45s; }

.pg-tag {
  position: absolute; top: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px;
  border-radius: 999px; background: rgba(7,16,26,.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: #fff; font-size: .7rem; font-weight: 800; letter-spacing: .04em;
}
.pg-tag--pin { left: 12px; color: var(--pg-gold); }
.pg-tag--multi { right: 12px; }

.pg-item__cap { padding: 14px 4px 4px; display: grid; gap: 4px; }
.pg-item__cat { font-size: .68rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--pg-gold); }
.pg-item__cat:empty { display: none; }
.pg-item__title { margin: 0; font-family: var(--pg-serif); font-size: 1.22rem; font-weight: 500; line-height: 1.25; color: var(--pg-ink); }
.pg-item__title a { color: inherit; text-decoration: none; }
.pg-item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: .8rem; color: var(--pg-muted); }
.pg-item__meta:empty { display: none; }
.pg-item__loc, .pg-item__stat { display: inline-flex; align-items: center; gap: 5px; }

/* Souris : légende sur la photo au survol */
@media (hover: hover) and (pointer: fine) {
  .pg-item__cap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 20px 20px 18px; opacity: 0; transform: translateY(10px); transition: opacity .45s, transform .45s var(--pg-ease); }
  .pg-item__cat { color: var(--pg-gold); }
  .pg-item__title, .pg-item__meta { color: #fff; }
  .pg-item__meta { color: rgba(255,255,255,.78); }
  .pg-item:hover .pg-item__media img, .pg-item:focus-visible .pg-item__media img { transform: scale(1.045); }
  .pg-item:hover .pg-item__shade, .pg-item:focus-visible .pg-item__shade,
  .pg-item:hover .pg-item__cap, .pg-item:focus-visible .pg-item__cap { opacity: 1; transform: none; }
}

/* Vide */
.pg-empty { max-width: 520px; margin: clamp(20px, 6vw, 60px) auto; padding: 48px 28px; text-align: center; border: 1px dashed var(--pg-line-2); border-radius: 22px; }
.pg-empty__title { margin: 0; font-family: var(--pg-serif); font-size: 1.6rem; color: var(--pg-ink); }
.pg-empty__text { margin: 10px 0 24px; color: var(--pg-muted); }

/* ============================================================
   APPEL À L'ACTION
   ============================================================ */
.pg-cta {
  width: var(--pg-wrap); margin: 0 auto clamp(48px, 7vw, 96px); padding: clamp(44px, 6vw, 80px) clamp(20px, 5vw, 64px);
  text-align: center; border-radius: 28px; border: 1px solid var(--pg-line);
  background:
    radial-gradient(120% 140% at 50% 0%, color-mix(in srgb, var(--pg-gold) 13%, transparent), transparent 60%),
    var(--pg-surface);
}
.pg-cta__title { margin: 0 auto; max-width: 20ch; font-family: var(--pg-serif); font-weight: 500; font-size: clamp(1.9rem, 4vw, 3.1rem); line-height: 1.12; color: var(--pg-ink); text-wrap: balance; }
.pg-cta__title em { color: var(--pg-gold); }
.pg-cta__text { margin: 16px auto 0; max-width: 52ch; color: var(--pg-muted); line-height: 1.7; }
.pg-cta__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }

/* ============================================================
   VISIONNEUSE (structure : portfolio.css ; ici, l'habillage de la page portfolio)
   ============================================================ */
.pg-page .pf-lb-backdrop { background: rgba(3,7,12,.94); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pg-page .pf-lb { padding: clamp(10px, 2.5vw, 32px) clamp(10px, 5vw, 80px); }
.pg-page .pf-lb-inner {
  grid-template-columns: minmax(0, 1fr) 360px; max-width: 1360px; height: min(88vh, 900px); max-height: none;
  background: #0b131d; border: 1px solid rgba(255,255,255,.08); border-radius: 22px;
  box-shadow: 0 50px 120px -30px rgba(0,0,0,.8); transform: scale(.985); transition: transform .4s var(--pg-ease);
}
.pg-page .pf-lb.is-open .pf-lb-inner { transform: none; }
.pg-page .pf-lb-img-wrap { background: #05090e; min-height: 0; }
.pg-page .pf-lb-img-wrap img { width: 100%; height: 100%; max-height: none; object-fit: contain; }
.pg-page .pf-lb-panel { background: #0b131d; color: #e5e7eb; overflow-y: auto; }
.pg-page .pf-lb-meta { padding: 26px 26px 18px; border-color: rgba(255,255,255,.08); }
.pg-page .pf-lb-badge { background: transparent; padding: 0; border: 0; color: var(--pg-gold); font-size: .68rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.pg-page .pf-lb-title { margin: 8px 0 10px; font-family: var(--pg-serif); font-size: 1.7rem; font-weight: 500; line-height: 1.2; color: #fff; }
.pg-page .pf-lb-loc { color: rgba(229,231,235,.7); font-size: .85rem; gap: 6px; margin-bottom: 12px; }
.pg-page .pf-lb-desc { font-size: .93rem; line-height: 1.7; color: rgba(229,231,235,.78); margin-bottom: 14px; }
.pg-page .pf-lb-stats span { font-size: .78rem; color: rgba(229,231,235,.55); }
.pg-page .pf-lb-actions { padding: 16px 26px; border-color: rgba(255,255,255,.08); gap: 10px; }
.pg-page .pf-lb-action-btn { border-radius: 999px; padding: 9px 16px; font-weight: 700; border-color: rgba(255,255,255,.14); color: #e5e7eb; }
.pg-page .pf-lb-action-btn.liked { color: #fb7185; border-color: rgba(251,113,133,.5); }
.pg-page .pf-lb-action-btn.liked .pf-heart { fill: currentColor; }
.pg-page .pf-lb-comments { padding: 18px 26px 26px; }
.pg-page .pf-lb-comm-list { max-height: none; }
.pg-page .pf-lb-close { top: 18px; right: 18px; width: 44px; height: 44px; background: rgba(255,255,255,.1); backdrop-filter: blur(6px); }
.pg-page .pf-lb-prev, .pg-page .pf-lb-next { width: 52px; height: 52px; border-radius: 50%; font-size: 1.6rem; background: rgba(255,255,255,.08); backdrop-filter: blur(6px); }
.pg-page .pf-lb-prev { left: clamp(8px, 1.6vw, 22px); }
.pg-page .pf-lb-next { right: clamp(8px, 1.6vw, 22px); }
.pg-page .pf-lb-prev:hover, .pg-page .pf-lb-next:hover { background: var(--pg-gold); color: #0b1220; }

/* ============================================================
   TABLETTE / TÉLÉPHONE
   ============================================================ */
@media (max-width: 960px) {
  .pg-hero { grid-template-columns: 1fr; }
  .pg-feature__frame { aspect-ratio: 16 / 11; max-height: none; margin: 0; }
  .pg-page .pf-lb-inner { grid-template-columns: 1fr; height: auto; max-height: 92vh; overflow-y: auto; }
  .pg-page .pf-lb-img-wrap { height: 58vh; }
}
@media (max-width: 640px) {
  .pg-hero { padding-top: 28px; gap: 26px; }
  .pg-lede { margin-top: 16px; }
  .pg-facts { margin-top: 20px; }
  .pg-feature__frame { aspect-ratio: 4 / 5; border-radius: 18px; }
  .pg-filters__inner { gap: 10px; min-height: 60px; }
  .pg-chip { min-height: 36px; padding: 0 13px; font-size: .84rem; }
  .pg-search.is-open, .pg-search:focus-within { width: min(220px, 60vw); }
  .pg-masonry { columns: 2; column-gap: 12px; }
  .pg-item { margin-bottom: 18px; border-radius: 12px; }
  .pg-item__media { border-radius: 12px; }
  .pg-item__cap { padding: 9px 2px 0; gap: 2px; }
  .pg-item__title { font-size: 1rem; }
  .pg-item__cat { font-size: .6rem; letter-spacing: .14em; }
  .pg-item__meta { font-size: .72rem; }
  .pg-tag { top: 8px; padding: 4px 8px; font-size: .62rem; }
  .pg-tag--pin { left: 8px; } .pg-tag--multi { right: 8px; }
  .pg-cta { border-radius: 22px; }
  .pg-page .pf-lb { padding: 0; }
  .pg-page .pf-lb-inner { border-radius: 0; max-height: 100vh; height: 100vh; border: 0; }
  .pg-page .pf-lb-img-wrap { height: 52vh; }
  .pg-page .pf-lb-prev, .pg-page .pf-lb-next { top: 26vh; width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .pg-item { opacity: 1; transform: none; transition: none; }
  .pg-feature__slide, .pg-feature__slide img, .pg-feature__cap, .pg-search, .pg-item__media img { transition: none; }
  .pg-feature__slide img { transform: none; }
}
