/* ===========================
   NIKOL DZIUB — PORTFOLIO
   =========================== */

/* --- Variables --- */
:root {
  --black:   #0a0a0a;
  --white:   #fafaf8;
  --warm:    #f5f3ef;
  --muted:   #888580;
  --border:  #e0ddd8;
  --serif:   'Cormorant Garamond', Georgia, serif;
  --sans:    'Montserrat', 'Helvetica Neue', sans-serif;
  --nav-h:   72px;
  --ease:    cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--sans); background: var(--white); color: var(--black); overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--sans); }

/* ===========================
   NAVIGATION
   =========================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px;
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.nav--dark { background: rgba(10,10,10,0.0); color: #fff; }
.nav--dark.scrolled { background: rgba(10,10,10,0.92); backdrop-filter: blur(12px); }
.nav--light { background: var(--white); color: var(--black); box-shadow: 0 1px 0 var(--border); }

.nav__brand {
  font-family: var(--serif); font-size: 26px; font-style: italic;
  font-weight: 600; letter-spacing: 0.03em;
}
.nav__links { display: flex; gap: 36px; list-style: none; }
.nav__links a {
  font-size: 10px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  position: relative; padding-bottom: 3px; transition: opacity 0.2s;
}
.nav__links a::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 0; height: 1px; background: currentColor;
  transition: width 0.3s var(--ease);
}
.nav__links a:hover::after, .nav__links a.active::after { width: 100%; }

/* Hamburger */
.nav__toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; padding: 4px;
}
.nav__toggle span { display: block; width: 22px; height: 1.5px; background: currentColor; transition: 0.3s; }
.nav__toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__toggle.open span:nth-child(2) { opacity: 0; }
.nav__toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile nav drawer */
.nav__drawer {
  display: none; position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  background: var(--black); color: #fff; z-index: 199;
  padding: 32px 48px 48px;
}
.nav__drawer.open { display: block; }
.nav__drawer ul { list-style: none; display: flex; flex-direction: column; gap: 28px; }
.nav__drawer a { font-size: 28px; font-family: var(--serif); font-style: italic; }

/* ===========================
   HERO SLIDESHOW
   =========================== */
.hero {
  position: relative; width: 100%; height: 100vh;
  overflow: hidden; background: var(--black);
}
.hero__slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 1.6s var(--ease);
}
.hero__slide.active { opacity: 1; }
.hero__slide img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transform: scale(1.03); transition: transform 8s var(--ease);
}
.hero__slide.active img { transform: scale(1); }
.hero__vignette {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0) 35%, rgba(0,0,0,0.55) 100%);
}
.hero__caption {
  position: absolute; bottom: 64px; left: 48px; right: 48px;
  color: rgba(255,255,255,0.75);
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.8s 0.8s, transform 0.8s 0.8s;
}
.hero__slide.active .hero__caption { opacity: 1; transform: translateY(0); }
.hero__dots {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px;
}
.hero__dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255,255,255,0.35); border: none;
  cursor: pointer; transition: background 0.3s, transform 0.3s;
}
.hero__dot.active { background: rgba(255,255,255,0.9); transform: scale(1.4); }

.hero__scroll {
  position: absolute; right: 48px; bottom: 36px;
  color: rgba(255,255,255,0.5); font-size: 10px;
  letter-spacing: 0.22em; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
  animation: pulse 2.5s ease infinite;
}
.hero__scroll::before {
  content: ''; display: block; width: 32px; height: 1px;
  background: rgba(255,255,255,0.4);
}
@keyframes pulse { 0%,100%{opacity:.5} 50%{opacity:1} }

/* ===========================
   BIO / HOME TEXT
   =========================== */
.bio {
  max-width: 860px; margin: 0 auto;
  padding: 100px 48px 120px;
}
.bio__title {
  font-family: var(--serif); font-size: clamp(36px, 5vw, 60px);
  font-weight: 300; font-style: italic; line-height: 1.15;
  margin-bottom: 52px; color: var(--black);
}
.bio__text p {
  font-family: var(--serif); font-size: clamp(16px, 1.7vw, 18.5px);
  line-height: 1.9; color: #3d3b38; margin-bottom: 1.6em;
}
.bio__text p:last-child { margin-bottom: 0; }
.bio__contact {
  margin-top: 52px; padding-top: 32px; border-top: 1px solid var(--border);
}
.bio__contact a {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); transition: color 0.2s;
}
.bio__contact a:hover { color: var(--black); }

/* ===========================
   SECTION HEADERS
   =========================== */
.page-header {
  padding: 100px 48px 48px;
  max-width: 1400px; margin: 0 auto;
}
.page-header__title {
  font-family: var(--serif); font-size: clamp(40px, 6vw, 80px);
  font-weight: 300; font-style: italic; line-height: 1.1; color: var(--black);
}
.page-header__sub {
  margin-top: 14px; font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--muted);
}

/* ===========================
   PROJECTS GRID
   =========================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 3px; padding: 3px;
  max-width: 1400px; margin: 0 auto;
  padding-bottom: 100px;
}
.project-card {
  position: relative; overflow: hidden;
  aspect-ratio: 4/3; background: var(--black); cursor: pointer;
  display: block;
}
.project-card__img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transition: transform 0.8s var(--ease), filter 0.5s, opacity 0.5s;
  filter: brightness(0.82);
  opacity: 0;
}
.project-card__img.img-loaded { opacity: 1; }
.project-card:hover .project-card__img {
  transform: scale(1.06); filter: brightness(0.55);
}
.project-card__info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 48px 24px 24px;
  background: linear-gradient(to top, rgba(0,0,0,0.82), transparent);
  color: #fff;
  transform: translateY(6px); transition: transform 0.4s var(--ease);
}
.project-card:hover .project-card__info { transform: translateY(0); }
.project-card__title {
  font-family: var(--serif); font-size: 21px;
  font-style: italic; font-weight: 400; line-height: 1.3;
}
.project-card__cta {
  margin-top: 8px; font-size: 9px; letter-spacing: 0.2em;
  text-transform: uppercase; opacity: 0;
  transition: opacity 0.3s 0.1s;
}
.project-card:hover .project-card__cta { opacity: 0.65; }

/* ===========================
   PROJECT GALLERY PAGE
   =========================== */
.project-hero {
  height: 75vh; position: relative; overflow: hidden; background: var(--black);
}
.project-hero img {
  width: 100%; height: 100%;
  object-fit: cover; filter: brightness(0.72);
}
.project-hero__content {
  position: absolute; bottom: 56px; left: 48px; right: 48px; color: #fff;
}
.project-hero__title {
  font-family: var(--serif); font-size: clamp(30px, 5vw, 64px);
  font-weight: 300; font-style: italic; line-height: 1.15;
}
.project-hero__sub {
  margin-top: 10px; font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; opacity: 0.65;
}
.project-back {
  display: inline-flex; align-items: center; gap: 8px;
  position: absolute; top: calc(var(--nav-h) + 20px); left: 48px;
  color: rgba(255,255,255,0.7); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
  transition: color 0.2s; z-index: 2;
}
.project-back::before { content: '←'; font-size: 14px; }
.project-back:hover { color: #fff; }

.masonry {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: start;
  max-width: 1400px; margin: 12px auto; padding: 0 16px 120px;
  opacity: 0; transition: opacity 0.6s;
}
.masonry.visible { opacity: 1; }
.masonry-loader {
  text-align: center; padding: 80px 0;
  font-family: var(--serif); font-style: italic;
  font-size: 18px; color: var(--muted);
  animation: pulse 2s ease infinite;
  grid-column: 1 / -1;
}
.masonry__item {
  position: relative; overflow: hidden;
  background: var(--warm);
}
.masonry__item img {
  width: 100%; display: block;
  transition: transform 0.55s var(--ease);
  pointer-events: none;
}
/* Overlay transparent — intercepte le clic et bloque le clic-droit */
.photo-overlay {
  position: absolute;
  inset: 0;
  cursor: pointer;
  z-index: 2;
  background: transparent;
}
/* Légende en overlay avec fondu noir au survol */
.masonry__caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 72px 16px 16px;
  background: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0.95) 35%, rgba(0,0,0,0.7) 65%, transparent 100%);
  font-family: var(--serif);
  font-style: italic;
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(255,255,255,0.92);
  text-align: center;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  z-index: 3;
  pointer-events: none;
}
.masonry__item:hover .masonry__caption { opacity: 1; }
/* Hover sur l'item */
.masonry__item:hover img { transform: scale(1.03); }

/* ===========================
   LIGHTBOX avec caption
   =========================== */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(10,10,10,0.97);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.lightbox.open { opacity: 1; pointer-events: all; }


/* Conteneur image */
.lightbox__stage {
  flex: 1; display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 0;
  overflow: hidden;
  touch-action: none;
}
.lightbox__img {
  max-width: min(88vw, 1200px);
  max-height: calc(100vh - 120px);
  object-fit: contain;
  transition: opacity 0.22s;
  pointer-events: none;
  -webkit-user-drag: none;
  transform-origin: center center;
  will-change: transform;
}

/* Boutons navigation */
.lightbox__close {
  position: absolute; top: 18px; right: 22px;
  background: none; border: none; color: rgba(255,255,255,0.65);
  font-size: 34px; line-height: 1; cursor: pointer;
  transition: color 0.2s; z-index: 2;
}
.lightbox__close:hover { color: #fff; }
.lightbox__prev, .lightbox__next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: rgba(255,255,255,0.5);
  font-size: 48px; padding: 20px; cursor: pointer;
  transition: color 0.2s; z-index: 2;
}
.lightbox__prev { left: 0; }
.lightbox__next { right: 0; }
.lightbox__prev:hover, .lightbox__next:hover { color: #fff; }

/* Barre caption + compteur — superposée sur l'image */
.lightbox__bottom {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: 140px 72px 20px;
  gap: 6px;
  background: transparent;
  pointer-events: none;
  z-index: 2;
}
.lightbox__caption {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(13px, 1.6vw, 17px);
  color: rgba(255,255,255,0.85);
  line-height: 1.5;
  max-width: 72%;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  pointer-events: auto;
}
.lightbox__counter {
  font-size: 11px; letter-spacing: 0.15em;
  color: rgba(255,255,255,0.4); white-space: nowrap;
}
@media (max-width: 768px) {
  .lightbox__bottom { padding: 60px 20px 16px; }
  .lightbox__caption {
    font-size: 13px;
    max-width: 100%;
    -webkit-line-clamp: 2;
  }
}

/* ===========================
   PUBLICATIONS
   =========================== */
.publications {
  max-width: 880px; margin: 0 auto; padding: 24px 48px 120px;
}
.publications__intro {
  font-family: var(--serif); font-size: 17px; font-style: italic;
  color: var(--muted); line-height: 1.75; margin-bottom: 64px;
}
.pub-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 64px;
}
.pub-gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; cursor: pointer; }
.pub-list { list-style: none; }
.pub-item {
  display: flex; gap: 28px; align-items: flex-start;
  padding: 28px 0; border-bottom: 1px solid var(--border);
}
.pub-item:first-child { border-top: 1px solid var(--border); }
.pub-year {
  min-width: 48px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; color: var(--muted); padding-top: 3px;
}
.entry-desc {
  flex: 1; font-family: var(--serif); font-size: 16px;
  line-height: 1.75; color: #3d3b38;
}
.entry-desc a {
  color: var(--muted); font-size: 12px; text-decoration: underline;
  text-underline-offset: 3px; transition: color 0.2s;
}
.entry-desc a:hover { color: var(--black); }

/* ===========================
   ABOUT
   =========================== */
.about-grid {
  display: grid; grid-template-columns: 360px 1fr;
  gap: 80px; align-items: start;
  max-width: 1100px; margin: 0 auto; padding: 24px 48px 120px;
}
.about-photo { position: sticky; top: calc(var(--nav-h) + 24px); }
.about-photo img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.about-bio__text {
  font-family: var(--serif); font-size: 18px;
  line-height: 1.9; color: #3d3b38; margin-bottom: 52px;
}
.cv-section-title {
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin-bottom: 28px;
}
.cv-list { list-style: none; }
.cv-item {
  display: flex; gap: 24px;
  padding: 18px 0; border-bottom: 1px solid var(--border);
}
.cv-period {
  min-width: 110px; font-size: 11px; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 600; padding-top: 2px;
}
.cv-desc { font-family: var(--serif); font-size: 15.5px; line-height: 1.65; color: #3d3b38; }
.about-contact {
  margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border);
}
.about-contact a {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); transition: color 0.2s;
}
.about-contact a:hover { color: var(--black); }

/* ===========================
   BOOKS PAGE
   =========================== */
.books-header {
  text-align: center; padding: 120px 48px 56px;
}
.books-header__title {
  font-family: var(--serif); font-size: clamp(44px, 7vw, 88px);
  font-weight: 300; font-style: italic; margin-bottom: 16px;
}
.books-header__sub {
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted);
}
.books-controls {
  display: flex; justify-content: center; gap: 16px; margin-bottom: 64px;
}
.btn {
  padding: 12px 32px; font-family: var(--sans);
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  border: 1px solid var(--border); background: none; cursor: pointer;
  transition: all 0.25s; color: var(--muted);
}
.btn:hover { border-color: var(--black); color: var(--black); }
.btn--primary { background: var(--black); border-color: var(--black); color: var(--white); }
.btn--primary:hover { opacity: 0.8; }

/* Admin area */
.books-add { display: none; max-width: 580px; margin: 0 auto 64px; padding: 0 48px; }
.books-add.visible { display: block; }
.books-add__zone {
  border: 2px dashed var(--border); padding: 48px; text-align: center;
  cursor: pointer; transition: border-color 0.2s;
}
.books-add__zone:hover { border-color: var(--black); }
.books-add__zone p { font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); }

.books-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 56px 40px; max-width: 1200px; margin: 0 auto; padding: 0 48px 120px;
}
.book-entry { display: flex; flex-direction: column; gap: 18px; position: relative; }
.book-entry__img { width: 100%; object-fit: contain; max-height: 480px; background: var(--warm); }
.book-entry__text {
  font-family: var(--serif); font-size: 15.5px; line-height: 1.8; color: #3d3b38;
  white-space: pre-wrap;
}
.book-entry__del {
  position: absolute; top: 10px; right: 10px;
  background: rgba(10,10,10,0.75); color: #fff;
  border: none; width: 32px; height: 32px; border-radius: 50%;
  font-size: 18px; display: none; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.admin-mode .book-entry__del { display: flex; }
.book-entry__del:hover { background: #c00; }

.books-empty {
  text-align: center; padding: 80px 48px;
  font-family: var(--serif); font-size: 18px;
  font-style: italic; color: var(--muted);
}

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(10,10,10,0.65); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white); width: 90%; max-width: 520px;
  padding: 52px 48px; max-height: 90vh; overflow-y: auto;
}
.modal__title {
  font-family: var(--serif); font-size: 28px; font-style: italic; margin-bottom: 36px;
}
.form-group { margin-bottom: 28px; }
.form-group label {
  display: block; font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 12px;
}
.form-group input[type="file"] { width: 100%; font-size: 13px; color: var(--muted); }
.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea {
  width: 100%; font-family: var(--serif); font-size: 16px;
  padding: 10px 0; border: none; border-bottom: 1px solid var(--border);
  background: transparent; outline: none; color: var(--black);
  transition: border-color 0.2s; resize: vertical;
}
.form-group textarea { min-height: 120px; }
.form-group input:focus, .form-group textarea:focus { border-bottom-color: var(--black); }
.form-group__preview { width: 100%; max-height: 220px; object-fit: contain; margin-top: 16px; display: none; }
.modal__actions { display: flex; gap: 16px; justify-content: flex-end; margin-top: 36px; }

/* ===========================
   FOOTER
   =========================== */
footer {
  background: var(--black); color: rgba(255,255,255,0.55);
  padding: 64px 48px;
}
.footer__inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 32px;
}
.footer__brand {
  font-family: var(--serif); font-size: 28px;
  font-style: italic; color: #fff;
}
.footer__nav { list-style: none; display: flex; gap: 28px; }
.footer__nav a {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  transition: color 0.2s;
}
.footer__nav a:hover { color: #fff; }
.footer__copy {
  width: 100%; text-align: center; font-size: 11px;
  padding-top: 40px; border-top: 1px solid rgba(255,255,255,0.1); margin-top: 12px;
}

/* ===========================
   PHOTO PROTECTION
   =========================== */
img {
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}
/* Wrapper pour la protection par overlay */
.img-protected {
  position: relative;
  display: block;
  overflow: hidden;
}
.img-protected img { pointer-events: none; }
.img-protected::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: default;
  background: transparent;
}
/* Exception : les cartes projet et masonry ont besoin de pointer */
.project-card .img-protected::after,
.masonry__item .img-protected::after { cursor: pointer; }

/* ===========================
   BOOKS (nouvelle version PHP)
   =========================== */
.books-header {
  text-align: center;
  padding: 120px 48px 48px;
}
.books-header__title {
  font-family: var(--serif); font-size: clamp(44px, 7vw, 88px);
  font-weight: 300; font-style: italic; margin-bottom: 14px;
}
.books-header__sub {
  font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--muted);
}

/* Barre admin */
.admin-bar {
  display: none;
  align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  max-width: 1200px; margin: 0 auto 48px;
  padding: 0 48px;
}

/* Projets */
.bp-project {
  max-width: 1200px; margin: 0 auto 80px;
  padding: 0 48px;
}
.bp-project__header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.bp-project__title {
  font-family: var(--serif); font-size: clamp(24px, 3vw, 36px);
  font-weight: 300; font-style: italic; color: var(--black);
}
.bp-admin-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Grille de photos */
.bp-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 40px 32px;
}
.bp-photo { display: flex; flex-direction: column; gap: 14px; }

/* Image protégée dans Books */
.bp-photo__wrap {
  position: relative;
  overflow: hidden;
  background: var(--warm);
  line-height: 0;
}
.bp-photo__img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
}
.bp-photo__overlay {
  position: absolute; inset: 0; z-index: 2;
  background: transparent;
  cursor: default;
}
.bp-photo__caption {
  font-family: var(--serif); font-size: 15px;
  line-height: 1.75; color: #3d3b38;
  white-space: pre-wrap;
}
.bp-photo__admin {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.bp-hint {
  grid-column: 1 / -1;
  font-family: var(--serif); font-style: italic;
  color: var(--muted); font-size: 15px; padding: 20px 0;
}

/* Loader */
.books-loading {
  text-align: center; padding: 80px 48px;
  font-family: var(--serif); font-size: 18px;
  font-style: italic; color: var(--muted);
}
.books-empty {
  text-align: center; padding: 80px 48px;
  font-family: var(--serif); font-size: 20px;
  font-style: italic; color: var(--muted);
}

/* Boutons tailles */
.btn {
  padding: 10px 24px; font-family: var(--sans);
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  border: 1px solid var(--border); background: none; cursor: pointer;
  transition: all 0.22s; color: var(--muted); white-space: nowrap;
}
.btn:hover { border-color: var(--black); color: var(--black); }
.btn--primary { background: var(--black); border-color: var(--black); color: var(--white); }
.btn--primary:hover { opacity: .82; }
.btn--danger { border-color: #c0392b; color: #c0392b; }
.btn--danger:hover { background: #c0392b; color: #fff; }
.btn--sm { padding: 8px 18px; font-size: 9.5px; }
.btn--xs { padding: 6px 14px; font-size: 9px; }

/* Modal générique */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(10,10,10,0.65); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.28s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white); width: 90%; max-width: 500px;
  padding: 48px 44px; max-height: 90vh; overflow-y: auto;
}
.modal__title {
  font-family: var(--serif); font-size: 26px;
  font-style: italic; margin-bottom: 32px;
}
.form-group { margin-bottom: 24px; }
.form-group label {
  display: block; font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 10px;
}
.form-group input[type="file"] { font-size: 13px; color: var(--muted); }
.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea {
  width: 100%; font-family: var(--serif); font-size: 16px;
  padding: 10px 0; border: none; border-bottom: 1px solid var(--border);
  background: transparent; outline: none; color: var(--black);
  transition: border-color 0.2s; resize: vertical;
}
.form-group textarea { min-height: 110px; }
.form-group input:focus, .form-group textarea:focus { border-bottom-color: var(--black); }
.form-group__preview { width: 100%; max-height: 200px; object-fit: contain; margin-top: 14px; display: none; }
.modal__actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 32px; }

/* Page connexion */
.cx-page {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--black); color: var(--white);
}

/* ===========================
   UTILITIES
   =========================== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.fade-in { animation: fadeIn 0.55s var(--ease) both; }
@keyframes fadeIn { from { opacity:0; transform: translateY(14px); } to { opacity:1; transform: none; } }

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 1024px) {
  .about-grid { grid-template-columns: 280px 1fr; gap: 48px; }
  .masonry { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  :root { --nav-h: 60px; }

  /* Nav mobile — fond toujours sombre, burger toujours blanc */
  .nav {
    padding: 0 20px;
    background: var(--black) !important;
    color: #fff !important;
  }
  .nav__brand { color: #fff !important; }
  .nav__links { display: none; }
  .nav__toggle { display: flex; color: #fff; }
  .nav__toggle span { background: #fff; }

  .hero__caption, .hero__scroll { display: none; }
  .hero__dots { bottom: 20px; }

  .bio { padding: 60px 20px 80px; }
  .page-header { padding: 80px 20px 36px; }
  .publications { padding: 20px 20px 80px; }
  .books-header { padding: 80px 20px 40px; }
  .bp-project { padding: 0 20px; margin-bottom: 60px; }
  .admin-bar { padding: 0 20px; }
  .bp-photos { grid-template-columns: 1fr; }
  .modal { padding: 36px 22px; }
  footer { padding: 48px 20px; }
  .footer__inner { flex-direction: column; text-align: center; }
  .footer__nav { justify-content: center; }

  .about-grid { grid-template-columns: 1fr; gap: 40px; padding: 20px 20px 80px; }
  .about-photo { position: static; }

  .projects-grid { grid-template-columns: 1fr; }
  .masonry { grid-template-columns: 1fr; padding: 0 12px 100px; gap: 10px; }

  .project-hero__content { left: 20px; right: 20px; bottom: 40px; }
  .project-back { left: 20px; }
}
@media (max-width: 480px) {
  .pub-item { flex-direction: column; gap: 6px; }
  .pub-year { min-width: auto; }
  .bp-admin-actions { gap: 8px; }
}
