:root {
  --bg: #f5f7f4;
  --panel: #ffffff;
  --ink: #17211d;
  --muted: #65706a;
  --line: #dce3dd;
  --accent: #126b5f;
  --accent-2: #b9432f;
  --gold: #d79f2f;
  --soft: #e7f1ee;
  --danger: #a83232;
  --shadow: 0 18px 50px rgba(23, 33, 29, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(220, 227, 221, 0.86);
  background: rgba(245, 247, 244, 0.9);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.topnav {
  display: flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.topnav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
}

.topnav a.active {
  background: var(--ink);
  color: #fff;
}

.view {
  padding: clamp(18px, 4vw, 48px);
}

.hero {
  display: grid;
  min-height: calc(100vh - 126px);
  align-items: center;
  gap: 32px;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
}

.hero-copy h1 {
  max-width: 820px;
  margin: 0 0 16px;
  font-size: clamp(42px, 7vw, 92px);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 640px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.55;
}

.entry-panel,
.admin-login,
.panel,
.modal-content {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.entry-panel {
  padding: 22px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field span,
.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

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

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  border-color: #aebbb3;
}

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

.button.danger {
  border-color: rgba(168, 50, 50, 0.26);
  color: var(--danger);
}

.icon-button {
  width: 42px;
  padding: 0;
}

.icon,
.sprite {
  width: 20px;
  height: 20px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.privacy-box {
  margin-top: 18px;
  padding: 14px;
  border-radius: 8px;
  background: var(--soft);
  color: #30514b;
  font-size: 14px;
  line-height: 1.45;
}

.hero-visual {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 20%, rgba(215, 159, 47, 0.42), transparent 24%),
    linear-gradient(135deg, #10241f 0%, #245a51 48%, #f1e4c8 100%);
  box-shadow: var(--shadow);
}

.hero-visual::before,
.hero-visual::after {
  content: "";
  position: absolute;
  inset: 12%;
  border: 14px solid #fff;
  border-bottom-width: 48px;
  border-radius: 4px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.12)),
    linear-gradient(135deg, #c84f3b, #e9b84b 48%, #246b60);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  transform: rotate(-7deg);
}

.hero-visual::after {
  inset: 27% 10% 11% 37%;
  background:
    linear-gradient(rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.08)),
    linear-gradient(135deg, #18342e, #ffffff 44%, #b9432f);
  transform: rotate(8deg);
}

.admin-login {
  max-width: 460px;
  margin: 10vh auto;
  padding: 24px;
}

.admin-layout {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  align-items: start;
}

.panel {
  padding: 20px;
  box-shadow: none;
}

.panel h2,
.panel h3 {
  margin: 0 0 16px;
}

.stack {
  display: grid;
  gap: 14px;
}

.event-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.event-card.active {
  border-color: var(--accent);
  background: var(--soft);
}

.event-card header,
.gallery-head,
.admin-head,
.photo-card footer,
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.event-card h3,
.gallery-head h1,
.admin-head h1 {
  margin: 0;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.code-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  border-radius: 999px;
  padding: 8px 10px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  letter-spacing: 1px;
}

.split {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 160px;
  border: 1px dashed #9aa9a0;
  border-radius: 8px;
  background: #fbfcfb;
  text-align: center;
  cursor: pointer;
}

.dropzone input {
  display: none;
}

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

.photo-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #dce3dd;
}

.photo-card footer {
  min-height: 58px;
  padding: 10px;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 260px;
  margin-top: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.notice {
  border-left: 4px solid var(--gold);
  padding: 12px 14px;
  background: #fff8e7;
  color: #6a4d14;
  line-height: 1.45;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(23, 33, 29, 0.62);
}

.modal.open {
  display: grid;
}

.modal-content {
  max-width: 540px;
  width: min(540px, 100%);
  padding: 22px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  max-width: 360px;
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

.site-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 0 clamp(18px, 4vw, 48px) clamp(22px, 4vw, 42px);
  border-top: 1px solid var(--line);
  padding: 28px 0 0;
  color: var(--muted);
}

.site-footer strong {
  color: var(--ink);
}

.site-footer p {
  max-width: 520px;
  margin: 8px 0 0;
  line-height: 1.55;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.site-footer a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  font-size: 14px;
}

.site-footer .admin-footer-link {
  color: var(--accent);
  font-weight: 800;
}

@media (max-width: 920px) {
  .hero,
  .admin-layout,
  .split {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-visual {
    min-height: 320px;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topnav {
    width: 100%;
  }

  .topnav a {
    flex: 1;
    text-align: center;
  }

  .gallery-head,
  .admin-head,
  .event-card header {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions {
    width: 100%;
  }

  .button {
    flex: 1;
  }

  .site-footer {
    flex-direction: column;
    margin-inline: 18px;
  }

  .site-footer nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    justify-content: stretch;
  }

  .site-footer a {
    text-align: center;
  }
}
