/* ============================================================
   Barat Gallery — style harmonisé avec brehec.fr
   ============================================================ */

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

:root {
  --navy:      #1a2a3a;
  --navy-mid:  #243447;
  --gold:      #b8960c;
  --gold-lt:   #d4ab20;
  --sepia:     #f5f0e8;
  --sepia-dk:  #e8e0ce;
  --text:      #2c2c2c;
  --text-lt:   #555;
  --white:     #fff;
  --radius:    4px;
  --shadow:    0 2px 8px rgba(0,0,0,.18);
  --trans:     .2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: Georgia, 'Times New Roman', serif;
  background: var(--sepia);
  color: var(--text);
  min-height: 100vh;
}

/* ── Header ── */
header {
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-title {
  font-size: .78rem;
  letter-spacing: .08em;
  color: var(--gold-lt);
  text-transform: uppercase;
  text-decoration: none;
  display: block;
  margin-bottom: 3px;
}
.site-title:hover { color: var(--white); }
.page-title {
  font-size: 1.1rem;
  font-weight: normal;
  color: var(--white);
  letter-spacing: .04em;
}
.breadcrumb {
  font-size: .76rem;
  color: #aabbc8;
  font-family: Arial, Helvetica, sans-serif;
}
.breadcrumb a { color: var(--gold-lt); text-decoration: none; }
.breadcrumb a:hover { color: var(--white); }

/* ── Folder tab nav ── */
.folder-nav {
  background: var(--navy-mid);
  border-bottom: 2px solid var(--gold);
}
.folder-nav ul {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.folder-nav li a {
  display: block;
  padding: 9px 16px;
  color: #c8d8e8;
  text-decoration: none;
  font-size: .8rem;
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: .03em;
  border-bottom: 3px solid transparent;
  transition: var(--trans);
}
.folder-nav li a:hover,
.folder-nav li a.active {
  color: var(--white);
  border-bottom-color: var(--gold-lt);
  background: rgba(255,255,255,.05);
}

/* ── Main ── */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

/* ── Index folder cards ── */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.folder-card {
  background: var(--white);
  border: 1px solid var(--sepia-dk);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 28px 20px 22px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: var(--trans);
}
.folder-card:hover {
  border-top-color: var(--navy);
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.folder-card .fc-icon { font-size: 2.6rem; display: block; margin-bottom: 12px; }
.folder-card .fc-name {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  font-size: .9rem;
  color: var(--navy);
}
.folder-card .fc-range {
  font-size: .76rem;
  color: var(--text-lt);
  margin-top: 4px;
  font-family: Arial, Helvetica, sans-serif;
}
.txt-card {
  border-top-color: var(--sepia-dk);
  background: var(--sepia);
}
.txt-card:hover {
  border-top-color: var(--gold) !important;
}

/* ── Gallery header ── */
.gallery-info {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--sepia-dk);
}
.gallery-info h1 {
  font-size: 1.25rem;
  font-weight: normal;
  color: var(--navy);
}
#photo-count {
  font-size: .8rem;
  color: var(--text-lt);
  font-family: Arial, Helvetica, sans-serif;
}

/* ── Status / error message ── */
#status-msg {
  font-family: Arial, Helvetica, sans-serif;
  font-size: .86rem;
  color: var(--text-lt);
  margin-bottom: 16px;
  min-height: 1.4em;
}
#status-msg.error { color: #a04020; }

/* ── Thumbnail grid ── */
#gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.thumb-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--sepia-dk);
  aspect-ratio: 3/2;
  box-shadow: var(--shadow);
  cursor: pointer;
  border: 1px solid #d0c8b8;
}
.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease, filter .25s ease;
}
.thumb-item:hover img { transform: scale(1.06); filter: brightness(1.08); }
.thumb-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(10,20,35,.72));
  color: #fff;
  font-size: .66rem;
  font-family: Arial, Helvetica, sans-serif;
  padding: 14px 6px 5px;
  opacity: 0;
  transition: opacity var(--trans);
}
.thumb-item:hover .thumb-label { opacity: 1; }

/* ── Lightbox ── */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5,10,18,.93);
  z-index: 999;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
#lightbox.open { display: flex; }
#lb-img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 2px;
  box-shadow: 0 8px 40px rgba(0,0,0,.7);
}
#lb-caption {
  color: #bbb;
  font-family: Arial, Helvetica, sans-serif;
  font-size: .8rem;
  margin-top: 10px;
  letter-spacing: .04em;
}
.lb-close {
  position: fixed;
  top: 14px; right: 20px;
  color: #ccc;
  font-size: 2rem;
  cursor: pointer;
  background: none; border: none;
  transition: color var(--trans);
  line-height: 1;
}
.lb-close:hover { color: var(--white); }
.lb-nav {
  position: fixed;
  top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.1);
  border: none;
  color: var(--white);
  font-size: 2rem;
  cursor: pointer;
  padding: 12px 16px;
  border-radius: var(--radius);
  transition: background var(--trans);
}
.lb-nav:hover { background: rgba(255,255,255,.22); }
#lb-prev { left: 10px; }
#lb-next { right: 10px; }

/* ── Prev/next folder nav ── */
.folder-pager {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--sepia-dk);
  font-family: Arial, Helvetica, sans-serif;
  font-size: .82rem;
}
.folder-pager a { color: var(--gold); text-decoration: none; }
.folder-pager a:hover { color: var(--navy); }

/* ── Footer ── */
footer {
  background: var(--navy);
  color: #8899aa;
  text-align: center;
  font-size: .74rem;
  font-family: Arial, Helvetica, sans-serif;
  padding: 16px;
  margin-top: 40px;
}
footer a { color: var(--gold-lt); text-decoration: none; }

/* ── Responsive ── */
@media (max-width: 600px) {
  #gallery { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 7px; }
  .header-inner { padding: 10px 14px; }
  .lb-nav { font-size: 1.4rem; padding: 8px 12px; }
}
