:root {
  color-scheme: light;
  --ink: #25211d;
  --muted: #716a61;
  --paper: #fbfaf6;
  --linen: #eee7dc;
  --river: #46665f;
  --moss: #62734d;
  --clay: #b97658;
  --white: #ffffff;
  --shadow: 0 20px 70px rgba(37, 33, 29, 0.18);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.password-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(37, 33, 29, 0.28), rgba(37, 33, 29, 0.38)),
    url("web/Ceremony/Z63_8728.jpg") center / cover;
}

.password-panel {
  width: min(100%, 430px);
  padding: 34px;
  background: rgba(251, 250, 246, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--river);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 8vw, 5.8rem);
  font-weight: 400;
  line-height: 0.95;
}

.date {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.password-form {
  display: grid;
  gap: 10px;
  margin-top: 30px;
}

.password-form label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.password-row input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #cfc5b8;
  border-radius: 6px;
  outline: none;
}

.password-row input:focus {
  border-color: var(--river);
  box-shadow: 0 0 0 3px rgba(70, 102, 95, 0.2);
}

.password-row button,
.quiet-button {
  min-height: 44px;
  padding: 0 18px;
  color: var(--white);
  background: var(--river);
  border: 0;
  border-radius: 6px;
  font-weight: 750;
}

.password-error {
  min-height: 20px;
  margin: 0;
  color: #a23f31;
  font-size: 0.9rem;
}

.gallery-view {
  min-height: 100vh;
}

.site-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 34px clamp(18px, 5vw, 58px) 26px;
  background: var(--linen);
  border-bottom: 1px solid #d8cebf;
}

.site-header h1 {
  font-size: clamp(3.5rem, 9vw, 7rem);
}

.quiet-button {
  background: var(--ink);
}

.category-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px clamp(18px, 5vw, 58px);
  background: rgba(251, 250, 246, 0.92);
  border-bottom: 1px solid #e2d9cd;
  backdrop-filter: blur(12px);
}

.category-nav button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  color: var(--ink);
  background: transparent;
  border: 1px solid #cfc5b8;
  border-radius: 999px;
  font-weight: 700;
}

.category-nav button[aria-pressed="true"] {
  color: var(--white);
  background: var(--moss);
  border-color: var(--moss);
}

.gallery-grid {
  columns: 4 230px;
  column-gap: 14px;
  padding: 18px clamp(12px, 4vw, 42px) 42px;
}

.load-sentinel {
  height: 1px;
}

.photo-button {
  display: block;
  width: 100%;
  margin: 0 0 14px;
  padding: 0;
  overflow: hidden;
  background: #ded5c8;
  border: 0;
  border-radius: 6px;
  break-inside: avoid;
}

.photo-button img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 240ms ease, filter 240ms ease;
}

.photo-button:hover img,
.photo-button:focus-visible img {
  filter: saturate(1.08) contrast(1.03);
  transform: scale(1.025);
}

.photo-button:focus-visible,
.icon-button:focus-visible,
.category-nav button:focus-visible,
.quiet-button:focus-visible {
  outline: 3px solid rgba(185, 118, 88, 0.45);
  outline-offset: 3px;
}

.lightbox {
  width: min(94vw, 1180px);
  max-width: none;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
}

.lightbox::backdrop {
  background: rgba(20, 18, 16, 0.86);
}

.lightbox figure {
  margin: 0;
}

.lightbox img {
  display: block;
  width: 100%;
  max-height: 84vh;
  object-fit: contain;
  background: #171513;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.lightbox figcaption {
  min-height: 28px;
  padding-top: 10px;
  color: var(--paper);
  text-align: center;
}

.icon-button {
  position: absolute;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  border-radius: 999px;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}

.close-button {
  top: -54px;
  right: 0;
  font-size: 1.1rem;
}

.nav-button {
  top: 50%;
  transform: translateY(-50%);
}

.prev-button {
  left: -58px;
}

.next-button {
  right: -58px;
}

@media (max-width: 720px) {
  .password-panel {
    padding: 26px;
  }

  .password-row {
    grid-template-columns: 1fr;
  }

  .site-header {
    display: grid;
    align-items: start;
  }

  .quiet-button {
    width: fit-content;
  }

  .gallery-grid {
    columns: 2 150px;
  }

  .nav-button {
    top: auto;
    bottom: -58px;
    transform: none;
  }

  .prev-button {
    left: 0;
  }

  .next-button {
    right: 0;
  }
}
