:root {
  --ink: #1d2620;
  --muted: #5c6a60;
  --paper: #f3f6f2;
  --panel: rgba(255, 255, 255, 0.72);
  --line: rgba(29, 38, 32, 0.12);
  --accent: #6f8f74;
  --accent-deep: #3f5a45;
  --danger: #9b3b32;
  --shadow: 0 18px 50px rgba(35, 48, 40, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Figtree", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.45;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 700px at 10% -10%, rgba(143, 176, 150, 0.35), transparent 55%),
    radial-gradient(900px 600px at 100% 0%, rgba(214, 198, 168, 0.28), transparent 50%),
    linear-gradient(165deg, #eef3ec 0%, #f7f4ee 45%, #e7eee8 100%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.55;
  pointer-events: none;
}

.shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 18px 40px;
}

.hero {
  width: min(100%, 460px);
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 24px 28px;
  animation: rise 0.7s ease both;
}

.hero.narrow {
  text-align: center;
}

.hero.admin {
  width: min(100%, 980px);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-deep);
  font-weight: 650;
}

h1 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.lede {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.upload-form {
  margin-top: 26px;
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 550;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px;
  font: inherit;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
}

.field input:focus {
  outline: 2px solid rgba(111, 143, 116, 0.45);
  border-color: transparent;
}

.dropzone {
  position: relative;
  display: grid;
  gap: 6px;
  place-items: center;
  text-align: center;
  min-height: 160px;
  padding: 22px 16px;
  border-radius: 18px;
  border: 1.5px dashed rgba(63, 90, 69, 0.35);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(236, 243, 237, 0.7));
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.dropzone:hover,
.dropzone:focus-within {
  transform: translateY(-1px);
  border-color: var(--accent-deep);
  background: rgba(255, 255, 255, 0.8);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 500;
}

.dropzone-sub,
.file-count,
.hint {
  color: var(--muted);
  font-size: 0.92rem;
}

.file-count {
  margin-top: 4px;
  font-weight: 650;
  color: var(--accent-deep);
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.btn.primary {
  background: var(--ink);
  color: #f7faf6;
}

.btn.primary:hover {
  background: var(--accent-deep);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.error,
.errors {
  color: var(--danger);
  font-size: 0.95rem;
}

.errors {
  text-align: left;
  margin: 18px 0 0;
  padding-left: 18px;
}

.admin-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-end;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.file-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: min(55vh, 520px);
  overflow: auto;
}

.file-list li {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.fname {
  font-weight: 650;
  word-break: break-all;
}

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

.admin-filters {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.9fr auto;
  gap: 12px;
  align-items: end;
}

.admin-filters .field {
  margin: 0;
}

.admin-filters .field.grow {
  min-width: 0;
}

.admin-filters select,
.admin-filters input[type="search"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
}

.filter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.guest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.chip {
  text-decoration: none;
  color: var(--accent-deep);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.9rem;
  font-weight: 550;
}

.chip.active {
  background: var(--ink);
  color: #f7faf6;
  border-color: transparent;
}

.gallery {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.78);
  display: grid;
  grid-template-rows: 140px auto;
}

.thumb-btn {
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  background: #dfe7e1;
  height: 140px;
  overflow: hidden;
}

.thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.thumb-btn:hover img {
  transform: scale(1.04);
}

.thumb-fallback {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.thumb-fallback.video {
  background: linear-gradient(160deg, #3f5a45, #1d2620);
  color: #f3f6f2;
}

.card-meta {
  display: grid;
  gap: 2px;
  padding: 10px 12px 12px;
  font-size: 0.86rem;
}

.card-meta strong {
  font-size: 0.95rem;
}

.card-meta span {
  color: var(--muted);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
}

.card-actions a,
.card-actions .link-danger {
  color: var(--accent-deep);
  font-weight: 650;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.card-actions .link-danger {
  color: var(--danger);
}

.inline-form {
  display: inline;
  margin: 0;
}

.lightbox {
  border: 0;
  border-radius: 18px;
  padding: 0;
  width: min(960px, 96vw);
  max-height: 92vh;
  background: #111814;
  color: #f3f6f2;
  box-shadow: var(--shadow);
}

.lightbox::backdrop {
  background: rgba(12, 18, 14, 0.72);
}

.lightbox-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lightbox-bar .btn.ghost {
  color: #f3f6f2;
  border-color: rgba(255, 255, 255, 0.2);
}

.lightbox-body {
  padding: 12px;
  display: grid;
  place-items: center;
  min-height: 240px;
}

.lightbox-body img,
.lightbox-body video {
  max-width: 100%;
  max-height: 75vh;
  border-radius: 10px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 800px) {
  .admin-filters {
    grid-template-columns: 1fr 1fr;
  }

  .filter-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {
  .hero {
    padding: 28px 18px 24px;
  }

  .admin-filters {
    grid-template-columns: 1fr;
  }
}
