/* ---------------------------------------------------------------------------
   Every colour, font and measurement below is a custom property set at runtime
   from config/theme.json. Nothing here should be a literal brand value — if
   you find yourself typing a hex code, add a theme key instead.
   --------------------------------------------------------------------------- */

:root {
  --color-background: #faf7f2;
  --color-surface: #ffffff;
  --color-text: #2e2a26;
  --color-muted: #8a8078;
  --color-accent: #9c6b4f;
  --color-accent-text: #ffffff;
  --color-border: #e6ded4;
  --color-danger: #b3453a;

  --font-heading: Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading-weight: 500;
  --font-heading-spacing: 0.01em;
  --font-size-base: 17px;

  --radius: 10px;
  --max-width: 1080px;
  --space: 1rem;
  --hero-overlay: 0.35;
  --hero-text-color: #ffffff;
}

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

html {
  font-size: var(--font-size-base);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  opacity: 0;
  transition: opacity 0.25s ease;
}

body.ready {
  opacity: 1;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  letter-spacing: var(--font-heading-spacing);
  line-height: 1.15;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2.4rem, 8vw, 4.2rem);
}
h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}
h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--color-accent);
}

img {
  max-width: 100%;
  display: block;
}

/* --- layout ---------------------------------------------------------------- */

.page {
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 calc(var(--space) * 1.25);
}

section.block {
  padding: calc(var(--space) * 3) 0;
}

section.block + section.block {
  border-top: 1px solid var(--color-border);
}

.section-title {
  text-align: center;
  margin-bottom: calc(var(--space) * 2);
}

.site-nav {
  display: flex;
  gap: calc(var(--space) * 1.5);
  justify-content: center;
  padding: var(--space) 0;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-nav a {
  color: var(--color-muted);
  text-decoration: none;
}

.site-nav a.active,
.site-nav a:hover {
  color: var(--color-text);
}

/* --- hero ------------------------------------------------------------------ */

.hero {
  position: relative;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--hero-text-color);
  padding: calc(var(--space) * 5) var(--space);
  overflow: hidden;
}

.hero.style-full {
  min-height: 82vh;
}
.hero.style-banner {
  min-height: 42vh;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #000;
  opacity: var(--hero-overlay);
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero.no-image {
  color: var(--color-text);
  background: var(--color-surface);
}

.hero-tagline {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.8rem;
  margin-bottom: 1.4em;
  opacity: 0.9;
}

.hero-date {
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  margin-top: 0.6em;
}

/* --- buttons --------------------------------------------------------------- */

.button {
  display: inline-block;
  border: 1px solid var(--color-accent);
  background: var(--color-accent);
  color: var(--color-accent-text);
  border-radius: var(--radius);
  padding: 0.7em 1.6em;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s ease;
}

.button:hover:not(:disabled) {
  filter: brightness(0.92);
}

.button:disabled {
  opacity: 0.55;
  cursor: default;
}

.button.ghost {
  background: transparent;
  color: var(--color-accent);
}

.button.danger {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: #fff;
}

/* --- countdown ------------------------------------------------------------- */

.countdown {
  display: flex;
  justify-content: center;
  gap: calc(var(--space) * 1.5);
  flex-wrap: wrap;
}

.countdown-unit {
  min-width: 4.5rem;
  text-align: center;
}

.countdown-value {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1;
}

.countdown-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-muted);
}

/* --- cards & grids --------------------------------------------------------- */

.card-grid {
  display: grid;
  gap: calc(var(--space) * 1.5);
  grid-template-columns: 1fr;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-body {
  padding: calc(var(--space) * 1.25);
}

.card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.card-role {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--color-muted);
}

.card-address {
  color: var(--color-muted);
  font-size: 0.95rem;
}

/* --- timeline -------------------------------------------------------------- */

.timeline {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 620px;
}

.timeline li {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: var(--space);
  padding: calc(var(--space) * 1.1) 0;
  border-bottom: 1px solid var(--color-border);
}

.timeline li:last-child {
  border-bottom: none;
}

.timeline-time {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--color-accent);
}

.timeline-title {
  font-weight: 600;
}

.timeline-icon {
  margin-right: 0.45em;
}

.timeline-desc {
  color: var(--color-muted);
  font-size: 0.95rem;
}

/* --- info sections & faq ---------------------------------------------------- */

.info-blocks {
  display: grid;
  gap: calc(var(--space) * 1.5);
  grid-template-columns: 1fr;
}

.info-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: calc(var(--space) * 1.5);
}

.info-block p:last-child {
  margin-bottom: 0;
}

.info-block.layout-image {
  padding: 0;
  overflow: hidden;
}

.info-block.layout-image .info-body {
  padding: calc(var(--space) * 1.5);
}

.faq-list {
  max-width: 720px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
  padding: calc(var(--space) * 0.9) 0;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--color-accent);
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item p {
  margin: 0.6em 0 0;
  color: var(--color-muted);
}

.contact-list {
  display: grid;
  gap: var(--space);
  grid-template-columns: 1fr;
  max-width: 720px;
  margin: 0 auto;
  list-style: none;
  padding: 0;
}

.contact-list li {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space);
}

.contact-label {
  color: var(--color-muted);
  font-size: 0.85rem;
}

/* --- gallery cta ------------------------------------------------------------ */

.gallery-cta {
  text-align: center;
}

.gallery-cta p {
  color: var(--color-muted);
  max-width: 40ch;
  margin: 0 auto 1.5em;
}

/* --- footer ----------------------------------------------------------------- */

.site-footer {
  text-align: center;
  padding: calc(var(--space) * 3) var(--space);
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.site-footer .names {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--color-text);
  margin-bottom: 0.3em;
}

/* --- uploader --------------------------------------------------------------- */

.uploader {
  max-width: 620px;
  margin: 0 auto calc(var(--space) * 2);
}

.dropzone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: calc(var(--space) * 2.5) var(--space);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--color-accent);
}

.dropzone-title {
  font-size: 1.05rem;
  margin-bottom: 0.3em;
}

.dropzone-hint {
  color: var(--color-muted);
  font-size: 0.88rem;
}

.name-field {
  display: block;
  margin-top: var(--space);
}

.name-field span {
  display: block;
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 0.3em;
}

.name-field input {
  width: 100%;
  font: inherit;
  padding: 0.65em 0.8em;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: inherit;
}

.name-field input:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.queue {
  list-style: none;
  margin: var(--space) 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.queue-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}

.queue-item img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: calc(var(--radius) / 2);
}

.queue-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-status {
  color: var(--color-muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.queue-item.error .queue-status {
  color: var(--color-danger);
}

.progress {
  grid-column: 1 / -1;
  height: 3px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--color-accent);
  transition: width 0.2s ease;
}

/* --- photo wall -------------------------------------------------------------- */

.wall-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space);
  margin-bottom: var(--space);
  flex-wrap: wrap;
}

.wall-count {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-muted);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-muted);
}

.live-badge.online .live-dot {
  background: var(--color-accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

.wall {
  column-count: var(--wall-columns, 2);
  column-gap: 0.6rem;
}

.wall-item {
  break-inside: avoid;
  margin-bottom: 0.6rem;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  cursor: zoom-in;
  animation: fade-in 0.4s ease both;
}

.wall-item img {
  width: 100%;
  height: auto;
}

.wall-item .uploader-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.6em 0.6em 0.5em;
  font-size: 0.78rem;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
  pointer-events: none;
}

.wall-item .admin-delete {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  border: none;
  border-radius: calc(var(--radius) / 2);
  background: var(--color-danger);
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  padding: 0.25em 0.7em;
  cursor: pointer;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.empty-state,
.list-end {
  text-align: center;
  color: var(--color-muted);
  padding: calc(var(--space) * 2) 0;
}

/* --- lightbox ---------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  /* Fully opaque: a translucent overlay lets the sticky nav and the tiles
     underneath bleed through, which reads as a rendering glitch. */
  background: #0b0b0b;
  display: grid;
  grid-template-rows: auto 1fr auto;
  z-index: 100;
  overscroll-behavior: contain;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  color: #fff;
  font-size: 0.9rem;
  padding-top: max(0.75rem, env(safe-area-inset-top));
}

.lightbox-bar button,
.lightbox-bar a {
  background: none;
  border: none;
  color: #fff;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  opacity: 0.85;
}

/* The photo is positioned absolutely inside this box rather than laid out in
   flow. A percentage height on a grid item doesn't resolve when the row is
   `1fr` — the browser treats that height as indefinite and falls back to the
   image's intrinsic size, which overflowed and cropped the photo. An
   absolutely positioned child measures against this padding box, which is
   definite, so object-fit can letterbox correctly. */
.lightbox-stage {
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.lightbox-stage img {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  width: calc(100% - 1rem);
  height: calc(100% - 1rem);
  object-fit: contain;
}

.lightbox-nav {
  display: flex;
  justify-content: space-between;
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.lightbox-nav button {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font: inherit;
  border-radius: var(--radius);
  padding: 0.6em 1.4em;
  cursor: pointer;
}

/* --- admin -------------------------------------------------------------------- */

.login-box {
  max-width: 340px;
  margin: 18vh auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: calc(var(--space) * 1.75);
}

.form-error {
  color: var(--color-danger);
  font-size: 0.88rem;
  min-height: 1.3em;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background: var(--color-text);
  color: var(--color-background);
  padding: 0.6em 1.2em;
  border-radius: var(--radius);
  font-size: 0.9rem;
  z-index: 200;
}

/* --- responsive ---------------------------------------------------------------- */

@media (min-width: 768px) {
  .card-grid,
  .info-blocks {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .wall {
    column-count: var(--wall-columns-desktop, 4);
  }

  .queue-item {
    grid-template-columns: 44px 1fr auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
