:root {
  --paper: #f7f3ec;
  --ink: #2c2620;
  --ink-soft: #6b6055;
  --terracotta: #83391a;
  --terracotta-dark: #642a12;
  --card: #ffffff;
  --border: #e6ddd0;
  --display-font: Georgia, 'Times New Roman', Cambria, serif;
  --body-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --logo-font: 'Arial Black', Arial, 'Helvetica Neue', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body-font);
  line-height: 1.5;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--terracotta-dark);
  font-weight: 600;
  margin: 0 0 0.4rem;
}

h1 {
  font-family: var(--display-font);
  font-weight: 400;
  font-size: 2rem;
  margin: 0;
  color: var(--ink);
}

/* --- Logo "Drunk in Love" (repris du gobelet du mariage) --- */

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-logo {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.cell-cream { fill: var(--card); }
.cell-terracotta { fill: var(--terracotta); }

.logo-frame {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
}

.logo-grid-line {
  stroke: var(--ink);
  stroke-width: 1;
}

.logo-word {
  font-family: var(--logo-font);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-anchor: middle;
  dominant-baseline: central;
}

.brand-text { line-height: 1.15; }

.brand-names {
  font-family: var(--display-font);
  font-style: italic;
  font-size: 1.5rem;
  margin: 0;
  color: var(--ink);
}

.brand-date {
  font-family: var(--display-font);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0.2rem 0 0;
}

.site-header .brand-logo { width: 76px; height: 76px; }
.site-header .brand-names { font-size: 1.9rem; }
.site-header .brand-date { font-size: 0.8rem; }

/* --- Login page --- */

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  position: relative;
  background: var(--card);
  border-radius: 4px;
  padding: 2.5rem 2.25rem;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 18px 40px rgba(44, 38, 32, 0.12);
  transform: rotate(-0.6deg);
}

.corner-tape {
  position: absolute;
  top: -14px;
  left: 32px;
  width: 64px;
  height: 24px;
  background: var(--terracotta);
  opacity: 0.85;
  transform: rotate(-4deg);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.login-copy {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0.9rem 0 1.5rem;
}

.login-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--ink-soft);
}

.login-form input {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  font-family: var(--body-font);
  background: var(--paper);
  color: var(--ink);
}

.login-form input:focus {
  outline: 2px solid var(--terracotta);
  outline-offset: 1px;
}

.login-form button {
  margin-top: 1.1rem;
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 4px;
  background: var(--terracotta);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.login-form button:hover { background: var(--terracotta-dark); }
.login-form button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.login-error {
  color: #a5443a;
  font-size: 0.85rem;
  margin-top: 1rem;
  text-align: center;
}

/* --- Gallery page --- */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 2.5rem 5vw 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.logout-link {
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.logout-link:hover { color: var(--ink); border-color: var(--ink-soft); }

.upload-zone {
  position: relative;
  margin: 0 5vw 2.5rem;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 2rem;
  text-align: center;
}

.upload-zone.drag-over { border-color: var(--terracotta); background: #fbfaf6; }

.upload-zone .corner-tape {
  left: 50%;
  margin-left: -32px;
}

.upload-title {
  font-family: var(--display-font);
  font-size: 1.3rem;
  margin: 0.5rem 0 0.2rem;
}

.upload-hint {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.upload-button {
  display: inline-block;
  background: var(--terracotta);
  color: #fff;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.upload-button:hover { background: var(--terracotta-dark); }

.upload-status {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  min-height: 1.2em;
}

.wall {
  column-count: 4;
  column-gap: 1.5rem;
  padding: 0 5vw 3rem;
}

@media (max-width: 1100px) { .wall { column-count: 3; } }
@media (max-width: 720px) { .wall { column-count: 2; } }
@media (max-width: 460px) { .wall { column-count: 1; } }

.photo-card {
  break-inside: avoid;
  background: #fff;
  padding: 0.6rem 0.6rem 1.2rem;
  margin-bottom: 1.5rem;
  border-radius: 2px;
  box-shadow: 0 10px 24px rgba(44, 38, 32, 0.14);
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photo-card:hover {
  transform: rotate(0deg) scale(1.02);
  box-shadow: 0 16px 32px rgba(44, 38, 32, 0.2);
  z-index: 2;
}

.photo-card img {
  width: 100%;
  display: block;
  border-radius: 1px;
}

.empty-state {
  text-align: center;
  color: var(--ink-soft);
  padding: 2rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 17, 14, 0.92);
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  z-index: 10;
}

.lightbox:not([hidden]) {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  border-radius: 2px;
}

.lightbox-close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-download {
  position: absolute;
  top: 1.2rem;
  left: 1.5rem;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lightbox-download:hover,
.lightbox-download:focus-visible { background: rgba(255, 255, 255, 0.24); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.lightbox-nav:hover,
.lightbox-nav:focus-visible { background: rgba(255, 255, 255, 0.24); }

.lightbox-nav[hidden] { display: none; }

.lightbox-prev { left: 0.75rem; }
.lightbox-next { right: 0.75rem; }

@media (max-width: 640px) {
  .lightbox-nav { width: 2.6rem; height: 2.6rem; font-size: 1.7rem; }
  .lightbox-prev { left: 0.3rem; }
  .lightbox-next { right: 0.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .photo-card, .upload-button, .login-form button { transition: none; }
}
