:root {
  color-scheme: light;
  --bg: #f3efe5;
  --panel: #fffaf1;
  --ink: #1e1b18;
  --muted: #63594c;
  --line: #d9cfbe;
  --accent: #2e6f5e;
  --accent-strong: #1f4f43;
  --error: #8f2f2f;
  --shadow: 0 18px 40px rgba(39, 29, 17, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background: linear-gradient(180deg, #f6f1e6 0%, var(--bg) 100%);
  color: var(--ink);
}

body.viewer-open {
  overflow: hidden;
}

html.viewer-open {
  overflow: hidden;
}

a {
  color: inherit;
}

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

code {
  font-family: "SFMono-Regular", Consolas, monospace;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.shell--narrow {
  width: min(680px, calc(100% - 32px));
}

.hero,
.panel {
  background: rgba(255, 250, 241, 0.88);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 48px;
  margin-bottom: 24px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 28px;
  padding: 0 4px 18px;
  border-bottom: 1px solid rgba(99, 89, 76, 0.18);
}

.topbar__title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 0.95;
}

.topbar__main {
  min-width: 0;
}

.topbar__main--event {
  display: flex;
  flex: 1 1 100%;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.topbar__heading-row {
  display: flex;
  width: 100%;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.topbar__heading-row .eyebrow {
  margin-bottom: 0;
}

.topbar__title--event {
  font-size: clamp(1.9rem, 3.6vw, 3rem);
}

.topbar__title-row {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
}

.topbar__title-row .topbar__title {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  height: 100%;
  min-width: 0;
}

.topbar__event-action {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}

.topbar__event-action .button {
  margin-left: auto;
}

.topbar__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
  flex: 0 1 auto;
  min-width: fit-content;
  margin-left: auto;
}

.topbar--event {
  align-items: flex-start;
}

.topbar__count {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar__copy {
  margin: 0;
  color: var(--muted);
}

.hero--compact {
  padding: 32px 40px;
}

.panel {
  padding: 32px;
}

.panel--nested {
  margin-top: 24px;
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: none;
}

.panel--pending {
  background: linear-gradient(180deg, rgba(255, 243, 217, 0.96) 0%, rgba(255, 250, 241, 0.96) 100%);
  border-color: #d8b26f;
  box-shadow: 0 20px 44px rgba(124, 84, 18, 0.14);
}

.panel--pending .eyebrow {
  color: #8a5a12;
}

.pending-copy {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.65;
  color: var(--ink);
  max-width: 38rem;
}

.pending-note {
  margin: 14px 0 0;
  max-width: 34rem;
  color: #6d5430;
  font-style: italic;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  color: var(--accent-strong);
}

.lede {
  color: var(--muted);
  font-size: 1.05rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.card,
.photo-card {
  display: block;
  text-decoration: none;
  background: rgba(255, 250, 241, 0.92);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.photo-card {
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.card h2,
.hero h1,
.panel h1,
.panel h2 {
  margin-top: 0;
}

.pill {
  display: inline-flex;
  margin-top: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(46, 111, 94, 0.12);
  color: var(--accent-strong);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.card-meta .pill,
.card-meta .status-badge {
  margin-top: 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
}

.status-badge--pending {
  background: linear-gradient(180deg, rgba(255, 243, 217, 0.96) 0%, rgba(255, 250, 241, 0.96) 100%);
  border-color: #d8b26f;
  color: #8a5a12;
}

.status-badge--in-progress {
  background: rgba(69, 88, 102, 0.12);
  border-color: rgba(69, 88, 102, 0.22);
  color: #445562;
}

.status-badge--complete {
  background: rgba(42, 163, 102, 0.18);
  border-color: rgba(42, 163, 102, 0.36);
  color: #177245;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fffaf5;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  touch-action: manipulation;
}

.button--ghost {
  background: transparent;
  color: var(--accent-strong);
  border: 1px solid var(--line);
}

.button--danger {
  background: #8f2f2f;
  color: #fffaf5;
}

.button--viewer-close {
  background: rgba(191, 95, 71, 0.2);
  color: #ffd8c9;
  border: 1px solid rgba(255, 183, 160, 0.35);
}

.button--small {
  min-height: 36px;
  padding: 0 14px;
}

.back-link {
  display: inline-block;
  margin: 0 0 16px;
}

.list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.row {
  display: flex;
  align-items: center;
}

.row--spread {
  justify-content: space-between;
  gap: 16px;
}

.stack > * + * {
  margin-top: 16px;
}

.field {
  display: block;
}

.field span {
  display: block;
  margin-bottom: 8px;
}

.field input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf8;
  font: inherit;
}

.field select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf8;
  font: inherit;
}

.upload-dropzone {
  display: block;
  width: 100%;
  padding: 28px 24px;
  border: 2px dashed var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.92);
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease, transform 120ms ease;
}

.upload-dropzone--active {
  border-color: var(--accent);
  background: rgba(46, 111, 94, 0.08);
  transform: translateY(-1px);
}

.upload-dropzone__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.upload-dropzone__title,
.upload-dropzone__copy {
  display: block;
}

.upload-dropzone__title {
  font-size: 1.08rem;
  color: var(--ink);
}

.upload-dropzone__copy {
  margin-top: 6px;
  color: var(--muted);
}

.upload-preview {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.92);
}

.upload-preview__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.upload-preview__header .eyebrow {
  margin-bottom: 0;
}

.upload-preview__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.upload-preview__card {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 250, 241, 0.92);
}

.upload-preview__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
}

.upload-preview__caption {
  margin: 10px 0 12px;
  color: var(--muted);
  word-break: break-word;
}

.notice {
  padding: 12px 14px;
  border-radius: 14px;
}

.notice--error {
  background: rgba(143, 47, 47, 0.1);
  color: var(--error);
}

.notice--success {
  background: rgba(46, 111, 94, 0.12);
  color: var(--accent-strong);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.viewer {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-radius: 28px;
  background: #16120f;
  color: #f6efe3;
  box-shadow: 0 24px 60px rgba(22, 18, 15, 0.28);
  max-width: 100%;
  height: min(88vh, 920px);
}

.viewer-modal[hidden] {
  display: none;
}

.viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
  overscroll-behavior: contain;
}

.viewer-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 12, 10, 0.76);
  backdrop-filter: blur(10px);
}

.viewer-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(1200px, 100%);
  max-width: 100%;
  max-height: 100%;
}

.viewer__frame {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 18px;
  border-radius: 20px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 35%),
    #0f0c0a;
}

.viewer__image {
  width: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 18px;
  object-fit: contain;
}

.viewer__meta {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 20px 8px 6px;
  text-align: center;
}

.viewer .eyebrow,
.viewer .lede {
  color: #d8cdbf;
}

.viewer .viewer__meta .inline-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(420px, 100%);
  max-width: 100%;
  gap: 10px;
}

.viewer .viewer__meta .inline-actions .button {
  width: 100%;
  min-width: 0;
}

.viewer .viewer__meta .inline-actions .button:last-child {
  grid-column: 1 / -1;
}

.admin-photo-grid {
  margin-top: 8px;
}

.photo-card--admin {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 250, 241, 0.92);
  box-shadow: var(--shadow);
}

.photo-card--admin figcaption {
  margin: 12px 0;
  color: var(--muted);
}

.photo-card--admin img {
  border-radius: 14px;
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.meta {
  margin: 6px 0 0;
  color: var(--muted);
}

.photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 18px;
}

.photo-link {
  color: inherit;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  touch-action: manipulation;
}

.photo-link--active {
  outline: 3px solid rgba(46, 111, 94, 0.5);
  outline-offset: 2px;
}

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

@media (max-width: 700px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 16px;
  }

  .topbar__heading-row {
    flex-wrap: wrap;
  }

  .topbar__meta {
    align-items: flex-start;
    max-width: none;
    text-align: left;
    margin-left: 0;
    min-width: 0;
  }

  .topbar__main--event,
  .topbar__meta--event {
    width: 100%;
  }

  .topbar__title-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar__event-action {
    width: 100%;
  }

  .topbar__event-action .button {
    margin-left: 0;
  }

  .topbar--event {
    align-items: flex-start;
  }

  .hero,
  .panel,
  .card,
  .photo-card {
    padding: 22px;
    border-radius: 18px;
  }

  .row,
  .list-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .viewer {
    padding: 12px;
    border-radius: 22px;
    height: calc(100vh - 16px);
  }

  .viewer-modal {
    padding: 8px;
  }

  .viewer__frame {
    padding: 10px;
  }

  .viewer__meta {
    align-items: center;
    gap: 12px;
    padding: 16px 4px 2px;
  }

  .viewer .viewer__meta .inline-actions {
    width: 100%;
    gap: 8px;
  }

  .viewer__image {
    max-height: 100%;
  }
}
