/* ─────────────────────────────────────────────────────────────────────────────
   PIXICASA — Public CSS
   Fond blanc, photos prioritaires, typographie soignée.
   Aucun effet gadget. Aucune surcharge visuelle.
───────────────────────────────────────────────────────────────────────────── */

/* ─── Reset & base ───────────────────────────────────────────────────────────*/
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  background: #FAFAFA;
  color: #1A1917;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }

/* ─── Variables publiques ────────────────────────────────────────────────────*/
:root {
  --pub-white:    #FAFAFA;
  --pub-black:    #0D0D0D;
  --pub-ink:      #1A1917;
  --pub-muted:    #9C9A92;
  --pub-border:   #E8E6E0;
  --pub-overlay:  rgba(10,10,10,.82);

  --pub-font:     "Inter", "Helvetica Neue", Arial, sans-serif;
  --pub-display:  "Helvetica Neue", Arial, sans-serif;

  --nav-h: 60px;
  --dur:   280ms;
  --ease:  cubic-bezier(.4, 0, .2, 1);
}

/* ─── Navigation ─────────────────────────────────────────────────────────────*/
.pub-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 100;
  transition: background var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}

.pub-nav.is-solid {
  background: var(--pub-white);
  border-bottom: 1px solid var(--pub-border);
}

.pub-nav-brand {
  display: flex;
  align-items: center;
  font-family: var(--pub-display);
  font-size: 18px;
  letter-spacing: -.01em;
  color: var(--pub-ink);
}

.pub-nav-logo {
  display: block;
  width: auto;
  max-width: min(500px, 30vw);
  max-height: 30px;
  object-fit: contain;
  object-position: left center;
}

.pub-nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.pub-nav-links a {
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--pub-muted);
  transition: color var(--dur) var(--ease);
}

.pub-nav-links a:hover,
.pub-nav-links a.is-active { color: var(--pub-ink); }

.pub-nav--home .pub-nav-brand,
.pub-nav--home .pub-nav-links a {
  color: rgba(255,255,255,.78);
  text-shadow: 0 1px 16px rgba(0,0,0,.35);
}

.pub-nav--home .pub-nav-links a:hover,
.pub-nav--home .pub-nav-links a.is-active {
  color: #fff;
}

.pub-nav--home.is-solid .pub-nav-brand,
.pub-nav--home.is-solid .pub-nav-links a {
  color: var(--pub-ink);
  text-shadow: none;
}

.pub-home-slideshow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
}

.pub-home-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1800ms ease;
}

.pub-home-slide.is-active {
  opacity: 1;
}

.pub-home-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  animation: homeSlideDrift 18s ease-in-out infinite alternate;
}

.pub-home-slideshow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.18);
  pointer-events: none;
}

.pub-home-empty {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--pub-muted);
}

@keyframes homeSlideDrift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to   { transform: scale(1.08) translate3d(-1.5%, -1%, 0); }
}

.pub-project-list-page {
  min-height: calc(100vh - var(--nav-h));
  padding: calc(var(--nav-h) + 56px) 40px 80px;
}

.pub-project-list-header h1 {
  font-family: var(--pub-display);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 400;
  color: var(--pub-ink);
  margin-bottom: 40px;
}

.pub-project-list {
  list-style: none;
  max-width: 760px;
  border-top: 1px solid var(--pub-border);
}

.pub-project-list li {
  border-bottom: 1px solid var(--pub-border);
}

.pub-project-list a {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0;
  color: var(--pub-ink);
}

.pub-project-list span {
  font-size: 18px;
}

.pub-project-list small,
.pub-project-list-empty {
  font-size: 13px;
  color: var(--pub-muted);
}

/* ─── Hero plein écran ───────────────────────────────────────────────────────*/
.pub-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: var(--pub-black);
}

.pub-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .92;
  transition: opacity 600ms var(--ease);
}

.pub-hero-caption {
  position: absolute;
  bottom: 48px;
  left: 48px;
  right: 48px;
}

.pub-hero-title {
  font-family: var(--pub-display);
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 400;
  color: var(--pub-white);
  letter-spacing: -.02em;
  line-height: 1.15;
  text-shadow: 0 1px 24px rgba(0,0,0,.25);
  max-width: 640px;
}

.pub-hero-sub {
  margin-top: 10px;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
}

.pub-hero-scroll {
  position: absolute;
  bottom: 48px;
  right: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
}

.pub-hero-scroll svg {
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(5px); }
}

/* ─── Section projets ────────────────────────────────────────────────────────*/
.pub-section {
  padding: 80px 40px;
}

.pub-section-label {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--pub-muted);
  margin-bottom: 40px;
}

/* ─── Grille projets ─────────────────────────────────────────────────────────*/
.pub-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2px;
}

.pub-project-card {
  position: relative;
  overflow: hidden;
  background: var(--pub-black);
  aspect-ratio: 4/3;
  cursor: pointer;
  display: block;
}

.pub-project-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .9;
  transition: transform 600ms var(--ease), opacity 400ms var(--ease);
}

.pub-project-card:hover .pub-project-card-img {
  transform: scale(1.04);
  opacity: .75;
}

.pub-project-card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 24px 24px;
  background: linear-gradient(to top, rgba(0,0,0,.7) 0%, transparent 100%);
  transform: translateY(4px);
  transition: transform var(--dur) var(--ease);
}

.pub-project-card:hover .pub-project-card-info {
  transform: translateY(0);
}

.pub-project-card-title {
  font-family: var(--pub-display);
  font-size: 18px;
  font-weight: 400;
  color: var(--pub-white);
  letter-spacing: -.01em;
  line-height: 1.3;
}

.pub-project-card-meta {
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
}

/* ─── Page projet ────────────────────────────────────────────────────────────*/
.pub-project-header {
  padding: calc(var(--nav-h) + 48px) 40px 48px;
  max-width: 720px;
}

.pub-project-eyebrow {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--pub-muted);
  margin-bottom: 16px;
}

.pub-project-title {
  font-family: var(--pub-display);
  font-size: clamp(20px, 0.3vw, 60px);
  font-weight: 400;
  letter-spacing: 0.3em;
  line-height: 1.1;
  color: var(--pub-ink);
  margin-bottom: 20px;
}

.pub-project-desc {
  font-size: 16px;
  line-height: 1.75;
  color: var(--pub-muted);
  max-width: 560px;
}

.pub-project-meta-row {
  display: flex;
  gap: 32px;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--pub-border);
}

.pub-project-meta-item {}
.pub-project-meta-label {
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--pub-muted);
  margin-bottom: 4px;
}
.pub-project-meta-value {
  font-size: 14px;
  color: var(--pub-ink);
}

/* ─── Filtre catégories internes ─────────────────────────────────────────────*/
.pub-cat-filter {
  display: flex;
  gap: 8px;
  padding: 0 40px 32px;
  flex-wrap: wrap;
}

.pub-cat-filter-btn {
  padding: 6px 18px;
  border: 1px solid var(--pub-border);
  border-radius: 40px;
  font-size: 12px;
  letter-spacing: .06em;
  background: transparent;
  color: var(--pub-muted);
  cursor: pointer;
  transition: background var(--dur) var(--ease),
              color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}

.pub-cat-filter-btn:hover {
  border-color: var(--pub-ink);
  color: var(--pub-ink);
}

.pub-cat-filter-btn.is-active {
  background: var(--pub-ink);
  color: var(--pub-white);
  border-color: var(--pub-ink);
}

.pub-category-section {
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.pub-category-separator {
  height: 1px;
  margin: 40px 40px 24px;
  background: var(--pub-border);
}

.pub-category-title {
  padding: 0 40px 24px;
  font-family: var(--pub-display);
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 400;
  color: var(--pub-muted);
}

.pub-gallery-item.is-hidden,
.pub-fp-img.is-hidden {
  display: none;
}

/* ─── Galerie projet : base ──────────────────────────────────────────────────*/
.pub-gallery {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ─── Mode Mosaïque (CSS columns) ────────────────────────────────────────────*/
.pub-gallery--masonry {
  display: block;
  column-gap: 4px;
}

.pub-gallery--masonry .pub-gallery-item {
  break-inside: avoid;
  width: 100%;
  margin-bottom: 4px;
  display: block;
}

/* ─── Items galerie ──────────────────────────────────────────────────────────*/
.pub-gallery-item {
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--pub-black);
}

.pub-gallery-item img,
.pub-gallery-item video {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity var(--dur) var(--ease);
}

.pub-gallery-item:hover img { opacity: .95; }

/* ─── Badge vidéo (masqué au survol, la vignette s'anime à la place) ─────────*/
.pub-video-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}

.pub-gallery-item:hover .pub-video-badge { opacity: 0; }

/* ─── Barre de chargement vignette (photo/vidéo en cours de récupération) ────*/
.thumb-loading-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: rgba(255,255,255,.14);
  overflow: hidden;
  z-index: 3;
  pointer-events: none;
}
.thumb-loading-bar::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  background: #fff;
  animation: thumb-loading-sweep 1.1s ease-in-out infinite;
}
@keyframes thumb-loading-sweep {
  0%   { left: -40%; }
  100% { left: 100%; }
}

/* ─── Mode Pleine page ───────────────────────────────────────────────────────*/
.pub-gallery--fullpage {
  position: relative;
  background: var(--pub-black);
  min-height: calc(100vh - var(--nav-h));
  overflow: hidden;
}

.pub-fp-img {
  position: relative;
  display: none;
  width: 100%;
  height: calc(100vh - var(--nav-h));
  align-items: center;
  justify-content: center;
}

.pub-fp-img.is-active {
  display: flex;
}

.pub-fp-img img,
.pub-fp-img video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.pub-fp-prev,
.pub-fp-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur) var(--ease);
  z-index: 10;
}

.pub-fp-prev:hover,
.pub-fp-next:hover { background: rgba(255,255,255,.18); }

.pub-fp-prev { left: 20px; }
.pub-fp-next { right: 20px; }

.pub-fp-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: .06em;
  color: rgba(255,255,255,.4);
  pointer-events: none;
  white-space: nowrap;
}

/* ─── Navigation projet ──────────────────────────────────────────────────────*/
.pub-project-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 48px 40px;
  border-top: 1px solid var(--pub-border);
  margin-top: 2px;
}

.pub-project-nav-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pub-project-nav-label {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--pub-muted);
}

.pub-project-nav-title {
  font-family: var(--pub-display);
  font-size: 18px;
  color: var(--pub-ink);
  transition: opacity var(--dur) var(--ease);
}

.pub-project-nav-link:hover .pub-project-nav-title { opacity: .5; }

/* ─── Lightbox ───────────────────────────────────────────────────────────────*/
.lightbox {
  position: fixed;
  inset: 0;
  background: var(--pub-overlay);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-img-wrap {
  position: relative;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img,
.lightbox-video {
  max-width: 92vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border: none;
  transition: opacity var(--dur) var(--ease);
}

.lightbox-video {
  display: none;
  background: #000;
}

.lightbox-close {
  position: fixed;
  top: 24px;
  right: 28px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur) var(--ease);
}
.lightbox-close:hover { background: rgba(255,255,255,.2); }

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur) var(--ease);
}
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255,255,255,.18); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-caption {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: .06em;
  color: rgba(255,255,255,.45);
  white-space: nowrap;
}

.lightbox-counter {
  position: fixed;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: .06em;
  color: rgba(255,255,255,.4);
}

/* ─── Footer ─────────────────────────────────────────────────────────────────*/
.pub-footer {
  padding: 32px 40px;
  border-top: 1px solid var(--pub-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pub-footer-brand {
  font-family: var(--pub-display);
  font-size: 15px;
  color: var(--pub-ink);
}

.pub-footer-copy {
  font-size: 12px;
  color: var(--pub-muted);
}

/* ─── États de chargement ────────────────────────────────────────────────────*/
.pub-gallery-item img[data-src] {
  opacity: 0;
}
.pub-gallery-item img.is-loaded {
  opacity: 1;
  transition: opacity 400ms var(--ease);
}

/* ─── Responsive ─────────────────────────────────────────────────────────────*/
@media (max-width: 768px) {
  .pub-nav { padding: 0 20px; }
  .pub-nav-links { gap: 20px; }

  .pub-hero-caption { bottom: 32px; left: 24px; right: 24px; }
  .pub-hero-scroll  { display: none; }

  .pub-section { padding: 48px 20px; }

  .pub-projects-grid { grid-template-columns: 1fr; gap: 1px; }

  .pub-project-header { padding: calc(var(--nav-h) + 32px) 20px 32px; }

  .pub-project-meta-row { flex-wrap: wrap; gap: 20px; }

  .pub-project-nav { padding: 32px 20px; flex-direction: column; gap: 24px; }

  .pub-cat-filter { padding: 0 20px 24px; }

  .pub-fp-prev { left: 8px; }
  .pub-fp-next { right: 8px; }

  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }

  .pub-footer { flex-direction: column; gap: 12px; text-align: center; padding: 24px 20px; }
}



/* ── Masonry ── */
.pub-gallery--masonry {
  column-gap: 4px;
  padding: 0 40px;
}

.pub-gallery--masonry .pub-gallery-item {
  break-inside: avoid;
  margin-bottom: 4px;
  display: block;
  cursor: zoom-in;
}

.pub-gallery--masonry .pub-gallery-item img,
.pub-gallery--masonry .pub-gallery-item video {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Pleine page ── */
.pub-gallery--fullpage {
  position: relative;
  height: calc(100vh - 60px);
  background: #000;
  overflow: hidden;
}

.pub-fp-img {
  position: relative;
  display: none;
  width: 100%;
  height: 100%;
}

.pub-fp-img.is-active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pub-fp-img img,
.pub-fp-img video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

@media (max-width: 1024px) {
  .pub-category-separator {
    margin: 32px 20px 20px;
  }

  .pub-category-title {
    display: block;
    padding: 0 20px 20px;
    font-family: var(--pub-display);
    font-size: clamp(18px, 4vw, 24px);
    font-weight: 400;
    line-height: 1.2;
    color: var(--pub-muted);
  }

  .pub-gallery--masonry {
    column-count: 2 !important;
    column-width: auto !important;
    padding: 0 20px;
  }
}

@media (max-width: 480px) {
  .pub-gallery--masonry {
    padding: 0 12px;
  }

  .pub-category-separator {
    margin-right: 12px;
    margin-left: 12px;
  }

  .pub-category-title {
    padding-right: 12px;
    padding-left: 12px;
  }
}
