/* ==========================================================================
   Charte « photographe professionnel » — galerie photo animalière JC Ricois
   Conventions des portfolios photo pros (Format Magazine, sept. 2026) :
   - fond neutre sombre (charbon) : la photo parle, l'UI se tait
   - une serif d'exception pour les titres (Cormorant Garamond, auto-hébergée)
   - une seule sans-serif pour le corps (Jost, auto-hébergée)
   - micro-libellés en capitales espacées, palette limitée, beaucoup d'air
   - accent or vieilli, utilisé au compte-gouttes (liserés, survols)
   ========================================================================== */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("/static/fonts/cormorant-garamond.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("/static/fonts/cormorant-garamond-italic.woff2") format("woff2");
  font-weight: 400 600;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("/static/fonts/jost.woff2") format("woff2");
  font-weight: 200 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --encre: #141311;        /* charbon profond — fond général */
  --encre-2: #1c1a17;      /* panneaux */
  --ivoire: #ece7dc;       /* texte principal */
  --muted: #9d9484;        /* texte secondaire */
  --or: #c9a86a;           /* or vieilli — accent rare */
  --or-doux: rgba(201, 168, 106, .55);
  --ligne: #2c2925;        /* filets */
  --warn: #c96a5a;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 300;
  background: var(--encre);
  color: var(--ivoire);
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { max-width: 1280px; width: 100%; margin: 0 auto; padding: 28px 26px; flex: 1; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; }
h2 { font-size: 30px; margin: 0 0 6px; color: var(--ivoire); line-height: 1.1; }
h3 { font-size: 21px; margin: 0 0 10px; }
.sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; line-height: 1.6; letter-spacing: .3px; }
.help { color: var(--muted); font-size: 13px; line-height: 1.6; }

/* micro-libellés en capitales espacées — signature de la charte */
.eyebrow {
  font-family: var(--sans); font-size: 11px; font-weight: 400;
  letter-spacing: 3.5px; text-transform: uppercase; color: var(--or);
}

/* ---- bandeau ---- */
header.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(20, 19, 17, .92);
  backdrop-filter: blur(8px);
  color: var(--ivoire);
  padding: 14px 26px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  border-bottom: 1px solid var(--ligne);
}
header.topbar .brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ivoire); }
.logo-paw { height: 30px; width: 30px; fill: var(--or); flex: none; }
.logo-paw.big { height: 54px; width: 54px; display: block; margin: 0 auto 14px; }
header.topbar .branding { display: flex; flex-direction: column; line-height: 1.25; }
header.topbar .branding b {
  font-family: var(--sans); font-weight: 400; font-size: 14px;
  letter-spacing: 4px; text-transform: uppercase;
}
header.topbar .branding span {
  font-size: 9.5px; letter-spacing: 2.5px; color: var(--muted);
  text-transform: uppercase; font-weight: 300;
}
header.topbar h1 {
  font-family: var(--serif); font-size: 22px; margin: 0; font-weight: 500;
  color: var(--muted);
}
.topbar-right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.topbar-link {
  color: var(--ivoire); text-decoration: none; padding: 7px 13px; font-size: 11px;
  font-weight: 400; letter-spacing: 2.5px; text-transform: uppercase;
  border: 1px solid transparent; border-radius: 2px; opacity: .85;
}
.topbar-link:hover { color: var(--or); border-color: var(--ligne); opacity: 1; }
.topbar-link.discreet { opacity: .45; font-weight: 300; }
.topbar-link.discreet:hover { opacity: .8; }

/* ---- panneaux, boutons, formulaires ---- */
.card {
  background: var(--encre-2); border: 1px solid var(--ligne); border-radius: 4px;
  padding: 26px; margin-bottom: 26px;
}
.card > h2 { padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--ligne); }

button, .btn {
  background: transparent; color: var(--ivoire); border: 1px solid var(--or-doux);
  border-radius: 2px; padding: 10px 22px; font-family: var(--sans);
  font-size: 11px; font-weight: 400; letter-spacing: 2.5px; text-transform: uppercase;
  cursor: pointer; text-decoration: none; display: inline-block;
  transition: color .2s, border-color .2s, background .2s;
}
button:hover, .btn:hover { color: var(--or); border-color: var(--or); }
button.secondary, .btn.secondary { border-color: var(--ligne); }
button.secondary:hover, .btn.secondary:hover { border-color: var(--muted); color: var(--ivoire); }
button.small, .btn.small { padding: 6px 12px; font-size: 10px; letter-spacing: 2px; }
.btn.danger { border-color: rgba(201, 106, 90, .6); color: var(--warn); }
.btn.danger:hover { border-color: var(--warn); }

label {
  display: block; font-family: var(--sans); font-size: 10px; color: var(--muted);
  margin-bottom: 6px; font-weight: 400; letter-spacing: 2.5px; text-transform: uppercase;
}
label.checkbox { text-transform: none; letter-spacing: .3px; font-size: 13px;
  color: var(--ivoire); font-weight: 300; display: flex; gap: 10px;
  align-items: flex-start; line-height: 1.55; }
input[type=text], input[type=password], input[type=url], input[type=email],
input[type=number], select, input[type=file], textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--ligne); border-radius: 2px;
  font-size: 14px; background: var(--encre); font-family: var(--sans); font-weight: 300;
  color: var(--ivoire);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--or-doux); }
input::placeholder, textarea::placeholder { color: #5c564b; }
input[type=file] { padding: 8px; color: var(--muted); }

.stack { display: flex; flex-direction: column; gap: 14px; max-width: 480px; }
.inline { display: flex; align-items: center; gap: 10px; }
.inline > input { flex: 1; }

.banner { padding: 11px 16px; border-radius: 2px; font-size: 13px; margin-bottom: 14px;
  display: none; letter-spacing: .3px; }
.banner.error { background: rgba(201, 106, 90, .12); color: var(--warn);
  display: block; border-left: 2px solid var(--warn); }
.banner.info { background: rgba(201, 168, 106, .1); color: var(--or);
  display: block; border-left: 2px solid var(--or); }

.back-home { margin-bottom: 18px; display: inline-block; }

footer {
  text-align: center; color: var(--muted); font-size: 10.5px; padding: 26px;
  border-top: 1px solid var(--ligne); letter-spacing: 2.5px; text-transform: uppercase;
}

/* ---- accueil : héros pleine page ---- */
.hero-full {
  position: relative; margin: -28px -26px 30px; height: 78vh; min-height: 460px;
  overflow: hidden;
}
.hero-full img.hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.hero-full .hero-veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,19,17,.5) 0%,
    rgba(20,19,17,.15) 40%, rgba(20,19,17,.85) 100%);
}
.hero-full .hero-text {
  position: absolute; left: 0; right: 0; bottom: 44px; text-align: center;
  padding: 0 20px;
}
.hero-full .hero-name {
  font-family: var(--serif); font-weight: 500; font-size: clamp(38px, 7vw, 72px);
  margin: 10px 0 6px; color: var(--ivoire); letter-spacing: 2px;
  text-shadow: 0 2px 30px rgba(0,0,0,.5);
}
.hero-full .hero-baseline {
  color: var(--ivoire); opacity: .9; font-size: 12px; letter-spacing: 4px;
  text-transform: uppercase; font-weight: 300;
}
.hero-full .hero-meta {
  color: var(--muted); font-size: 11px; letter-spacing: 2.5px;
  text-transform: uppercase; margin-top: 14px;
}
.hero-scroll {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  color: var(--muted); font-size: 10px; letter-spacing: 3px; text-transform: uppercase;
}
.hero-scroll::after { content: ""; display: block; width: 1px; height: 26px;
  background: var(--or-doux); margin: 6px auto 0; }

/* héros sans photo (aucune photo d'accueil choisie) */
.hero-simple { text-align: center; padding: 60px 20px 30px; }
.hero-simple .hero-name { margin: 12px 0 8px; }
.hero-simple .hero-baseline {
  color: var(--muted); font-size: 11.5px; letter-spacing: 3px;
  text-transform: uppercase; font-weight: 300;
}

/* sélecteur de photo d'accueil (admin) */
.hero-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 6px;
}
.hero-pick {
  padding: 0; border: 1px solid var(--ligne); border-radius: 2px;
  background: var(--encre); overflow: hidden; cursor: pointer; line-height: 0;
}
.hero-pick img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block;
  filter: saturate(.85); transition: filter .2s; }
.hero-pick:hover img { filter: saturate(1); }
.hero-pick.selected { border-color: var(--or); }
.hero-pick.selected::after {
  content: "accueil"; display: block; line-height: 1.4; font-size: 9px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--or);
  background: rgba(201, 168, 106, .08); text-align: center; padding: 3px 0;
}

/* ---- mosaïque ---- */
.spotlight {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 8px;
}
.spot-item { position: relative; overflow: hidden; display: block; border-radius: 2px; }
.spot-item img { width: 100%; height: 150px; object-fit: cover; display: block;
  transition: transform .5s ease, filter .5s ease; filter: saturate(.92); }
.spot-item:hover img { transform: scale(1.06); filter: saturate(1); }
@media (max-width: 900px) { .spotlight { grid-template-columns: repeat(3, 1fr); } }

/* ---- grille d'albums : cartes éditoriales ---- */
.album-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 26px; margin-top: 20px;
}
.album-card {
  position: relative; display: block; text-decoration: none; color: var(--ivoire);
  overflow: hidden; background: var(--encre-2);
}
.album-card img, .album-empty { width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  display: block; transition: transform .5s ease, filter .5s ease;
  filter: saturate(.92); }
.album-empty { display: flex; align-items: center; justify-content: center;
  font-size: 40px; background: var(--encre-2); filter: none; }
.album-card:hover img { transform: scale(1.04); filter: saturate(1); }
.album-meta { padding: 14px 4px 6px; border-top: 1px solid transparent; }
.album-card:hover .album-meta { border-top-color: var(--ligne); }
.album-meta b {
  font-family: var(--serif); font-weight: 500; font-size: 22px;
  display: block; line-height: 1.2;
}
.album-meta span {
  color: var(--muted); font-size: 10px; letter-spacing: 2.5px;
  text-transform: uppercase;
}
.album-meta p { margin: 8px 0 0; font-size: 13px; color: var(--muted);
  font-weight: 300; line-height: 1.5; }

/* ---- galerie d'un album ---- */
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px; margin-top: 18px;
}
.gallery-thumb {
  position: relative; margin: 0; overflow: hidden; cursor: zoom-in;
  background: var(--encre-2); border-radius: 2px;
}
.gallery-thumb img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block;
  transition: transform .5s ease, filter .5s ease; filter: saturate(.92);
}
.gallery-thumb:hover img { transform: scale(1.05); filter: saturate(1); }
.gallery-thumb figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(20, 19, 17, .9));
  color: var(--ivoire); font-size: 11px; padding: 22px 10px 8px; display: none;
  letter-spacing: 1px; font-weight: 300;
}
.gallery-thumb figcaption:not(:empty) { display: block; }

/* ---- filigrane affiché (en plus du filigrane incrusté dans les pixels) ---- */
.wm-badge {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(15, 14, 12, .5); color: rgba(236, 231, 220, .92);
  font-family: var(--sans); font-size: 9px; letter-spacing: 1.5px;
  text-transform: uppercase; padding: 3px 8px; border-radius: 1px;
  pointer-events: none; z-index: 2; backdrop-filter: blur(2px);
}

/* ---- plein écran ---- */
.lightbox {
  position: fixed; inset: 0; background: #0a0908; z-index: 100;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.lightbox.hidden { display: none; }
.lightbox-stage { position: relative; max-width: 92vw; max-height: 86vh; }
.lightbox img {
  max-width: 92vw; max-height: 86vh; display: block;
  user-select: none; box-shadow: 0 0 80px rgba(0, 0, 0, .8);
}
.lightbox-caption {
  color: var(--muted); font-size: 11px; padding: 14px 10px 0; text-align: center;
  letter-spacing: 2px; text-transform: uppercase;
}
.lightbox-caption em { font-family: var(--serif); font-style: italic;
  text-transform: none; letter-spacing: .5px; font-size: 15px; color: var(--ivoire); }
.lightbox-close, .lightbox-nav {
  position: absolute; background: transparent; color: var(--muted);
  border: 1px solid var(--ligne); border-radius: 50%; width: 46px; height: 46px;
  font-size: 20px; cursor: pointer; z-index: 101; padding: 0;
  text-transform: none; letter-spacing: 0;
}
.lightbox-close:hover, .lightbox-nav:hover { color: var(--or); border-color: var(--or-doux); }
.lightbox-close { top: 16px; right: 18px; }
.lightbox-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* ---- protections anti-copie (voir protect.js) ---- */
.protect-img-wrap { user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; -webkit-user-drag: none; }
img { -webkit-user-drag: none; }
body.screen-blur main, body.screen-blur .hero-full,
body.screen-blur .gallery-grid, body.screen-blur .spotlight,
body.screen-blur .lightbox, body.screen-blur .album-grid {
  filter: blur(26px); opacity: .2; transition: filter .1s;
}

/* ---- page login ---- */
.login-body { background: var(--encre); }
.login-wrap { max-width: 400px; margin: 10vh auto; padding: 0 20px; width: 100%; }
.login-wrap h2 { text-align: center; letter-spacing: 1px; }
.login-wrap form { margin: 0 auto; }
.login-wrap .card { text-align: left; }

/* ---- admin : lignes d'albums ---- */
.admin-album {
  border: 1px solid var(--ligne); border-radius: 2px; padding: 14px;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
.admin-album .album-mini {
  width: 84px; height: 63px; object-fit: cover; flex: none;
  background: var(--encre); border-radius: 2px;
}
.admin-album .album-mini-empty {
  width: 84px; height: 63px; flex: none; background: var(--encre);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  border-radius: 2px;
}
.admin-album .aa-main { flex: 1; min-width: 230px; }
.admin-album .aa-main b { font-family: var(--serif); font-size: 19px; font-weight: 500; }
.admin-album .aa-main .sub { margin: 3px 0 0; }
.badge {
  font-family: var(--sans); font-size: 9px; font-weight: 400; letter-spacing: 2px;
  padding: 3px 9px; border-radius: 1px; text-transform: uppercase;
  border: 1px solid var(--ligne); color: var(--or);
}
.badge.off { color: var(--muted); }
.admin-album .aa-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-album .aa-edit { width: 100%; display: none; flex-direction: column; gap: 10px; }
.admin-album.open .aa-edit { display: flex; }
details { margin-top: 12px; }
details summary { cursor: pointer; color: var(--muted); font-size: 11px;
  letter-spacing: 2px; text-transform: uppercase; }
details summary:hover { color: var(--or); }
table.mini { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 10px;
  font-weight: 300; }
table.mini th, table.mini td { text-align: left; padding: 7px 9px;
  border-bottom: 1px solid var(--ligne); }
table.mini th { color: var(--muted); font-size: 9.5px; text-transform: uppercase;
  letter-spacing: 2px; font-weight: 400; }

/* ---- mobile ---- */
@media (max-width: 700px) {
  header.topbar { padding: 10px 14px; gap: 10px; }
  header.topbar .branding span { display: none; }
  header.topbar h1 { font-size: 17px; }
  .topbar-right { margin-left: 0; width: 100%; justify-content: flex-end; }
  main { padding: 16px 14px; }
  .hero-full { margin: -16px -14px 24px; height: 68vh; }
  .spot-item img { height: 100px; }
  .album-meta b { font-size: 19px; }
  .card { padding: 18px; }
}
