:root {
  --cream: #f8f2e8;
  --beige: #efe3d3;
  --forest: #274235;
  --gold: #b8914c;
  --ink: #1f1f1f;
  --card: #fffdf9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Source Sans 3", sans-serif;
  background: radial-gradient(circle at top, #fff, var(--cream));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3 {
  font-family: "Playfair Display", serif;
  margin-top: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid rgba(39, 66, 53, 0.12);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(4px);
}

.brand {
  color: var(--forest);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
}

.host {
  color: rgba(31, 31, 31, 0.7);
  font-size: 0.82rem;
}

.toolbar {
  display: flex;
  gap: 0.4rem;
}

.container {
  width: min(960px, 92vw);
  margin: 1.5rem auto 3rem;
  flex: 1;
}

.hero-banner {
  min-height: 72vh;
  border-radius: 24px;
  margin-bottom: 1.2rem;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: flex-end;
  background-image:
    linear-gradient(to top, rgba(20, 30, 22, 0.72), rgba(20, 30, 22, 0.2)),
    var(--hero-image);
  background-size: cover;
  background-position: center 28%;
  box-shadow: 0 14px 38px rgba(39, 66, 53, 0.18);
}

.hero-overlay {
  width: 100%;
  padding: 1.1rem;
  color: #fff;
}

.hero-kicker {
  margin: 0 0 0.25rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.78rem;
  opacity: 0.9;
}

.hero-cta {
  margin-top: 0.6rem;
}

.card {
  background: var(--card);
  border: 1px solid rgba(39, 66, 53, 0.1);
  border-radius: 18px;
  box-shadow: 0 10px 32px rgba(39, 66, 53, 0.08);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.hero {
  background: linear-gradient(145deg, #fff, var(--beige));
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
}

.link-card {
  color: var(--forest);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.link-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(39, 66, 53, 0.16);
}

.form-card {
  max-width: 560px;
}

.login-layout {
  display: grid;
  gap: 1rem;
}

.form-grid {
  display: grid;
  gap: 0.8rem;
}

input[type="text"],
input[type="password"],
input[type="file"] {
  width: 100%;
  margin-top: 0.25rem;
  border: 1px solid #d9ceb9;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: #fff;
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.upload-hint {
  margin: -0.2rem 0 0.1rem;
  color: rgba(31, 31, 31, 0.72);
  font-size: 0.92rem;
}

#extra-file-inputs {
  display: grid;
  gap: 0.65rem;
}

.extra-file-input {
  display: grid;
}

.upload-count {
  margin: 0.2rem 0 0;
  font-weight: 600;
}

.upload-file-list {
  margin: 0;
  padding-left: 1.1rem;
  color: rgba(31, 31, 31, 0.82);
  max-height: 9rem;
  overflow: auto;
}

.btn {
  display: inline-block;
  border: 0;
  border-radius: 12px;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  color: #fff;
  background: var(--forest);
  text-decoration: none;
  transition: filter 0.2s ease;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn-ghost {
  color: var(--forest);
  background: transparent;
  border: 1px solid rgba(39, 66, 53, 0.2);
}

.flash {
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  background: #f2f7f3;
  border: 1px solid rgba(39, 66, 53, 0.2);
}

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

.gallery-item {
  margin: 0;
}

.gallery-card {
  background: #fff;
  border: 1px solid rgba(39, 66, 53, 0.12);
  border-radius: 14px;
  padding: 0.6rem;
  box-shadow: 0 6px 20px rgba(39, 66, 53, 0.08);
}

.gallery-media {
  position: relative;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.gallery-item figcaption {
  margin-top: 0.55rem;
  margin-bottom: 0.55rem;
}

.gallery-delete-form {
  margin: 0;
}

.btn-danger {
  background: #8a2f2f;
}

.gallery-delete-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(138, 47, 47, 0.92);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.gallery-delete-btn svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.gallery-delete-btn:hover {
  background: #7b2727;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, 0.88);
  padding: 1rem;
}

.lightbox.is-open {
  display: grid;
}

.lightbox-image {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 1200px);
  max-height: 86vh;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  touch-action: pan-y;
}

.lightbox-close,
.lightbox-download,
.lightbox-nav {
  position: absolute;
  z-index: 3;
  border: 0;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.6);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox-close,
.lightbox-download {
  top: 1rem;
  width: 2.4rem;
  height: 2.4rem;
}

.lightbox-close {
  right: 1rem;
  font-size: 1.7rem;
  line-height: 1;
}

.lightbox-counter {
  position: absolute;
  z-index: 3;
  top: 1rem;
  left: 1rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.6);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
}

.lightbox-download {
  right: 4rem;
}

.lightbox-download svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 2.8rem;
  height: 2.8rem;
  font-size: 2rem;
  line-height: 1;
  opacity: 1;
  transition: opacity 420ms ease, background-color 220ms ease;
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

.lightbox-controls-hidden .lightbox-nav {
  opacity: 0;
  pointer-events: none;
  transition-delay: 120ms;
}

.lightbox-close:hover,
.lightbox-download:hover,
.lightbox-nav:hover {
  background: rgba(20, 20, 20, 0.82);
}

.lightbox-image.is-fading {
  animation: lightbox-fade 220ms ease;
}

@keyframes lightbox-fade {
  from {
    opacity: 0.6;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.no-scroll {
  overflow: hidden;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.stat-card h2 {
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

.stat-card p {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--forest);
}

.table-wrap {
  overflow-x: auto;
}

.guest-table {
  width: 100%;
  border-collapse: collapse;
}

.guest-table th,
.guest-table td {
  text-align: left;
  padding: 0.65rem 0.55rem;
  border-bottom: 1px solid rgba(39, 66, 53, 0.12);
}

.guest-table th {
  font-weight: 600;
}

.map-wrap iframe {
  width: 100%;
  min-height: 320px;
  border: 0;
  border-radius: 12px;
  margin: 0.8rem 0;
}

.site-footer {
  border-top: 1px solid rgba(39, 66, 53, 0.12);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(4px);
  padding: 0.9rem 1rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.site-footer a {
  color: var(--forest);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover {
  text-decoration: underline;
}

.legal-card h2 {
  margin-top: 1.2rem;
}

@media (min-width: 768px) {
  .hero-overlay {
    max-width: 54ch;
    padding: 2rem;
  }

  .hero-banner {
    min-height: 78vh;
    background-position: center 24%;
  }
}

@media (min-width: 1024px) {
  .login-layout {
    grid-template-columns: minmax(0, 1.25fr) minmax(360px, 560px);
    align-items: start;
  }

  .login-layout .card {
    margin-bottom: 0;
  }

  .login-layout .hero {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .login-layout .form-card {
    max-width: none;
  }
}
