/* =========================================
   Anthony-pictures — Thème Galerie Photo
   Esthétique: sombre, éditoriale, minimaliste
   ========================================= */

:root {
  --bg:         #0e0e0e;
  --bg2:        #161616;
  --bg3:        #1f1f1f;
  --surface:    #252525;
  --border:     #2e2e2e;
  --border2:    #3a3a3a;
  --text:       #e8e4dc;
  --text2:      #9a9590;
  --text3:      #5a5650;
  --accent:     #c8a96e;
  --accent2:    #8a6e3e;
  --white:      #f5f1ea;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Instrument Sans', system-ui, sans-serif;

  --header-h: 64px;
  --gap:      clamp(12px, 2vw, 20px);
  --radius:   4px;
  --trans:    0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

/* ---- Header ---- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(14,14,14,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}
.site-logo {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  flex-shrink: 0;
}
.logo-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--white);
}
.logo-sub {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text3);
}
.site-nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
}
.nav-link {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text2);
  transition: color var(--trans);
  position: relative;
  padding-bottom: 2px;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width var(--trans);
}
.nav-link:hover, .nav-link.active { color: var(--white); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-toggle { display: none; }

/* ---- Main ---- */
.site-main {
  flex: 1;
  margin-top: var(--header-h);
}

/* ---- Hero ---- */
.hero {
  padding: clamp(60px, 10vw, 120px) clamp(20px, 4vw, 48px) clamp(40px, 6vw, 72px);
  max-width: 1400px;
  margin: 0 auto;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(52px, 8vw, 96px);
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--white);
  line-height: 0.95;
}
.hero-subtitle {
  margin-top: 16px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero-line {
  margin-top: 40px;
  height: 1px;
  background: linear-gradient(90deg, var(--border2) 0%, transparent 70%);
}

/* ---- Galleries index grid ---- */
.galleries-index {
  padding: 0 clamp(20px, 4vw, 48px) 80px;
  max-width: 1400px;
  margin: 0 auto;
}
.galleries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--gap);
}
.gallery-card { position: relative; }
.card-link { display: block; }
.card-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3/2;
  background: var(--bg3);
}
.card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4,0,0.2,1);
}
.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.1) 50%, transparent 100%);
  transition: opacity var(--trans);
}
.card-link:hover .card-img { transform: scale(1.04); }
.card-link:hover .card-overlay { opacity: 0.7; }
.card-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.placeholder-icon { font-size: 32px; color: var(--border2); }
.card-info {
  padding: 14px 4px 4px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--white);
  flex: 1;
}
.card-date {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text3);
  text-transform: uppercase;
}
.card-count {
  font-size: 11px;
  color: var(--accent2);
  letter-spacing: 0.06em;
}

/* ---- Gallery header ---- */
.gallery-header {
  padding: clamp(48px, 8vw, 96px) clamp(20px, 4vw, 48px) clamp(32px, 5vw, 56px);
  max-width: 900px;
  margin: 0 auto;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text3);
  transition: color var(--trans);
  margin-bottom: 28px;
}
.back-link:hover { color: var(--accent); }
.gallery-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 300;
  color: var(--white);
  line-height: 1;
}
.gallery-date {
  display: block;
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.gallery-summary {
  margin-top: 20px;
  font-size: 16px;
  color: var(--text2);
  max-width: 600px;
  line-height: 1.7;
}

/* ---- Masonry photo grid ---- */
.photo-gallery {
  padding: 0 clamp(12px, 2vw, 24px) 60px;
  max-width: 1600px;
  margin: 0 auto;
}
.masonry-grid {
  columns: 3;
  column-gap: var(--gap);
}
@media (max-width: 1100px) { .masonry-grid { columns: 2; } }
@media (max-width: 600px)  { .masonry-grid { columns: 1; } }

.masonry-item {
  break-inside: avoid;
  margin-bottom: var(--gap);
}
.photo-link {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--bg3);
  cursor: pointer;
}
.photo-thumb {
  width: 100%;
  display: block;
  transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
}
.photo-hover {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 14px;
  gap: 6px;
  transition: background var(--trans);
}
.photo-hover-icon {
  font-size: 20px;
  color: var(--white);
  opacity: 0;
  transform: translate(4px, -4px);
  transition: opacity var(--trans), transform var(--trans);
}
.photo-exif {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--trans), transform var(--trans);
}
.photo-exif span {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(232,228,220,0.75);
  background: rgba(0,0,0,0.5);
  padding: 2px 6px;
  border-radius: 2px;
}
.photo-link:hover .photo-hover { background: rgba(0,0,0,0.35); }
.photo-link:hover .photo-thumb { transform: scale(1.03); }
.photo-link:hover .photo-hover-icon {
  opacity: 1;
  transform: translate(0,0);
}
.photo-link:hover .photo-exif {
  opacity: 1;
  transform: translateY(0);
}

.gallery-total {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text3);
  margin-top: 8px;
}

/* ---- Article body ---- */
.article-body {
  max-width: 720px;
  margin: 0 auto 60px;
  padding: 0 clamp(20px, 4vw, 48px);
}
.article-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text2);
}
.article-content h2, .article-content h3 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--white);
  margin: 2em 0 0.6em;
}
.article-content p { margin-bottom: 1.2em; }
.article-content a { color: var(--accent); border-bottom: 1px solid var(--accent2); }

/* ---- Gallery nav ---- */
.gallery-nav {
  max-width: 1200px;
  margin: 0 auto 60px;
  padding: 32px clamp(20px, 4vw, 48px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.gnav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 300px;
}
.gnav-next { text-align: right; margin-left: auto; }
.gnav-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text3);
}
.gnav-title {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text);
  transition: color var(--trans);
}
.gnav-link:hover .gnav-title { color: var(--accent); }

/* ---- Pages (about, etc.) ---- */
.page-section {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) clamp(20px, 4vw, 48px) 80px;
}
.page-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 300;
  color: var(--white);
  margin-bottom: 36px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.page-content { font-size: 16px; line-height: 1.8; color: var(--text2); }
.page-content h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--white);
  margin: 2em 0 0.5em;
}
.page-content p { margin-bottom: 1.2em; }
.page-content a { color: var(--accent); }

.cat-list, .archives-list { list-style: none; }
.cat-list li, .archives-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text2);
}
.cat-list a, .archives-list a {
  color: var(--text);
  transition: color var(--trans);
}
.cat-list a:hover, .archives-list a:hover { color: var(--accent); }
.cat-list span { color: var(--text3); }
.archives-list time { margin-right: 16px; color: var(--text3); font-size: 12px; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px clamp(20px, 4vw, 48px);
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text3);
}
.footer-tech a { color: var(--text3); transition: color var(--trans); }
.footer-tech a:hover { color: var(--accent); }

/* ---- Mobile nav ---- */
@media (max-width: 700px) {
  .site-nav {
    display: none;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    z-index: 99;
  }
  .site-nav.open { display: flex; }
  .nav-link { font-size: 16px; letter-spacing: 0.1em; }
  .nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-left: auto;
  }
  .nav-toggle span {
    display: block;
    width: 22px; height: 1px;
    background: var(--text2);
    transition: var(--trans);
  }
  .galleries-grid { grid-template-columns: 1fr; }
}

/* ---- Page load animation ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-title   { animation: fadeUp 0.7s ease both; }
.hero-subtitle{ animation: fadeUp 0.7s ease 0.1s both; }
.hero-line    { animation: fadeUp 0.7s ease 0.2s both; }
.gallery-card { animation: fadeUp 0.6s ease both; }
{% for i in range(1, 13) %}
.gallery-card:nth-child({{ i }}) { animation-delay: {{ (i - 1) * 0.07 }}s; }
{% endfor %}
