/* ===========================================================
   Samten Norbù — Photographe à Strasbourg
   Feuille de style principale
   =========================================================== */

:root {
  --bg: #0e0e10;
  --bg-soft: #16161a;
  --text: #e8e6e1;
  --text-dim: #9a978f;
  --accent: #c9a227;
  --line: #2a2a30;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

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

/* ---------- En-tête ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 14, 16, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: var(--serif);
  font-size: 1.45rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.brand small {
  display: block;
  font-family: var(--sans);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--text-dim);
}

.main-nav ul {
  display: flex;
  gap: 1.8rem;
  list-style: none;
}

.main-nav a {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  transition: color 0.2s;
  padding: 0.4rem 0;
}

.main-nav a:hover,
.main-nav a.active { color: var(--text); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .main-nav.open { display: block; }
  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
  }
  .main-nav a {
    display: block;
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
  }
}

/* ---------- Mise en page générale ---------- */

.wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.wrap-narrow { max-width: 820px; }

.page-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 0.4rem;
}

.page-sub {
  color: var(--text-dim);
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
}

/* ---------- Accueil : catégories et albums ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.intro {
  max-width: 720px;
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 2.8rem;
}

.intro a { color: var(--accent); }

.category { margin-bottom: 3.5rem; }

.category-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.6rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
}

@media (max-width: 500px) {
  .album-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
}

.album-card {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-soft);
}

.album-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, opacity 0.4s;
  opacity: 0.92;
}

.album-card:hover img { transform: scale(1.04); opacity: 1; }

.album-card .label {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.6rem 0.9rem 0.7rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

.album-card .label .count {
  color: var(--text-dim);
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

/* ---------- Galerie d'un album ---------- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.8rem;
}

@media (max-width: 500px) {
  .photo-grid { grid-template-columns: 1fr 1fr; gap: 0.4rem; }
}

.photo-grid a {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-soft);
}

.photo-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s, transform 0.5s;
  opacity: 0.94;
}

.photo-grid a:hover img { opacity: 1; transform: scale(1.03); }

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.back-link:hover { color: var(--text); }

/* ---------- Visionneuse (lightbox) ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 8, 9, 0.97);
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 94vw;
  max-height: 88vh;
  object-fit: contain;
  user-select: none;
  cursor: pointer; /* clic sur la photo = suivante */
}

.lightbox .lb-btn {
  position: absolute;
  z-index: 2; /* toujours au-dessus de la photo */
  background: rgba(8, 8, 9, 0.45);
  border: none;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 1.9rem;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  line-height: 1;
}

.lightbox .lb-btn:hover { color: var(--text); background: rgba(8, 8, 9, 0.75); }

.lb-close { top: 0.8rem; right: 0.8rem; }
.lb-prev { left: 0.6rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 0.6rem; top: 50%; transform: translateY(-50%); }

.lb-counter {
  position: absolute;
  z-index: 2;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-dim);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

@media (max-width: 760px) {
  /* sur mobile : flèches plus discrètes, le balayage et le tap restent les
     gestes principaux */
  .lb-prev, .lb-next { width: 2.4rem; height: 2.4rem; font-size: 1.5rem; }
}

/* ---------- Pages texte ---------- */

.prose h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.5rem;
  margin: 2.2rem 0 0.8rem;
}

.prose p { margin-bottom: 1rem; color: #cfcdc6; }

.prose ul { margin: 0 0 1rem 1.2rem; color: #cfcdc6; }

.prose li { margin-bottom: 0.4rem; }

.prose a { color: var(--accent); }

.prose hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

/* ---------- Formulaire de contact ---------- */

.contact-form { max-width: 560px; }

.contact-form label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin: 1.2rem 0 0.4rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.7rem 0.9rem;
  font: inherit;
  border-radius: 2px;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-form textarea { min-height: 180px; resize: vertical; }

.contact-form button {
  margin-top: 1.5rem;
  background: var(--accent);
  color: #181818;
  border: none;
  padding: 0.8rem 2.2rem;
  font: inherit;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  border-radius: 2px;
}

.contact-form button:hover { filter: brightness(1.1); }

.form-msg { margin-top: 1rem; font-size: 0.9rem; }
.form-msg.ok { color: #8fc97f; }
.form-msg.err { color: #e07a6a; }

.hp-field { position: absolute; left: -9999px; } /* piège anti-spam */

/* ---------- Bandeau de consentement (mesure d'audience) ---------- */

.consent-banner {
  position: fixed;
  z-index: 200;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5);
}

.consent-banner p {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.8rem;
}

.consent-actions { display: flex; gap: 0.7rem; }

.consent-actions button {
  font: inherit;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 1.3rem;
  border-radius: 2px;
  cursor: pointer;
  border: none;
  background: var(--accent);
  color: #181818;
}

.consent-actions button.secondary {
  background: none;
  border: 1px solid var(--line);
  color: var(--text-dim);
}

.consent-actions button.secondary:hover { color: var(--text); }

/* ---------- Pied de page ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.6rem 1.5rem 2.2rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.site-footer a { color: var(--text-dim); text-decoration: underline; }
.site-footer a:hover { color: var(--text); }

.site-footer .sep { margin: 0 0.5rem; opacity: 0.5; }
