/* --- RESET & TYPOGRAPHIE --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  color: #111;
  background-color: #fff;
  -webkit-font-smoothing: antialiased;
}

button {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 0;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --- NAVBAR FIXE --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 320px 1fr auto;
  align-items: start;
  z-index: 300; /* Toujours visible au-dessus du flou */
  pointer-events: none;
}

.navbar * {
  pointer-events: auto;
}

.nav-left {
  justify-self: start;
  display: flex;
  flex-direction: column;
}

.nav-title {
  justify-self: center;
  font-weight: 500;
}

.nav-right-group {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 24px;
}

#btn-about.is-active {
  opacity: 0.45;
}

/* --- MENU GAUCHE INTERACTIF (FEED) --- */
#label-counter {
  transition: opacity 0.2s ease;
}

.projects-sidebar {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.projects-sidebar.hidden {
  display: none;
}

.sidebar-item {
  display: flex;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.35;
  transition: opacity 0.15s ease;
}

.sidebar-title {
  font-weight: 500;
}

.sidebar-client {
  opacity: 0.45;
}

.sidebar-item:hover .sidebar-title {
  text-decoration: underline;
}

.sidebar-item.is-active {
  opacity: 1;
}

/* --- VUES (GESTION DATA-STATUS) --- */
.main-content {
  padding-top: 90px;
}

body[data-status="feed"] #feed-view {
  display: block;
}
body[data-status="feed"] #index-view {
  display: none;
}

body[data-status="index"] #feed-view {
  display: none;
}
body[data-status="index"] #index-view {
  display: block;
}
body[data-status="index"] #projects-sidebar {
  display: none !important;
}
body[data-status="index"] #label-counter {
  display: block !important;
  opacity: 1 !important;
}

/* --- MODE FEED (IMAGES CENTRÉES) --- */
.project-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 140px;
}

.project-gallery {
  display: flex;
  flex-direction: column;
  gap: 80px;
  align-items: center;
}

.project-figure {
  margin: 0;
  display: flex;
  justify-content: center;
}

.project-figure img {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: pointer;
}

/* --- MODE INDEX (GRILLE DE VIGNETTES NATURELLES) --- */
.index-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 12px;
  padding: 0 20px 80px 20px;
  align-items: end;
}

.index-item {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.index-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background-color: transparent;
  display: block;
  transition: opacity 0.2s ease;
}

.index-item:hover img {
  opacity: 0.7;
}

/* --- FOOTER MENTIONS LÉGALES --- */
.site-footer {
  border-top: 1px solid #eee;
  margin-top: 60px;
  padding: 40px 20px 60px 20px;
  font-size: 11px;
  line-height: 1.6;
  color: #777;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-legal strong {
  color: #444;
}

.footer-copy {
  opacity: 0.8;
}

/* --- LIGHTBOX --- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.98);
  z-index: 400;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.lightbox.hidden {
  display: none;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}

.lightbox-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 88vh;
}

#lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
}

.lightbox-caption {
  margin-top: 14px;
  font-size: 13px;
  opacity: 0.6;
}

/* --- PANNEAU À PROPOS (FROSTED GLASS) --- */
.about-modal {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(17px);
  -webkit-backdrop-filter: blur(17px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: pointer;
}

.about-modal.hidden {
  display: none;
}

.about-content {
  max-width: 440px;
  font-size: 14px;
  line-height: 1.6;
  cursor: default;
}

.about-bio {
  margin-bottom: 24px;
}

.about-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.about-links a:hover {
  text-decoration: underline;
}

.about-cgv-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  opacity: 0.7;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 1024px) {
  .index-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .navbar {
    grid-template-columns: 1fr auto auto;
    padding: 14px 16px;
  }

  .projects-sidebar {
    display: none !important;
  }

  #label-counter {
    display: block !important;
    opacity: 1 !important;
  }

  .project-section {
    margin-bottom: 70px;
  }

  .project-figure img {
    max-height: 72vh;
  }

  .index-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0 16px 60px 16px;
  }

  .site-footer {
    padding: 30px 16px 40px 16px;
  }
}