:root {
  --paper: #fffdf8;
  --panel: #ffffff;
  --ink: #241f1c;
  --muted: #766b62;
  --line: #e8d9c6;
  --accent: #c65245;
  --accent-dark: #81382f;
  --sun: #f2b84b;
  --leaf: #5f7b54;
  --shadow: 0 18px 50px rgba(79, 54, 35, .14);
}

@font-face {
  font-family: "Great Vibes";
  src: url("/fonts/great-vibes/great-vibes.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(242, 184, 75, .25), transparent 36rem),
    linear-gradient(180deg, #fff8ea 0, #fffdf8 32rem);
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 74px;
  padding: .9rem clamp(1rem, 4vw, 3rem);
  background: rgba(255, 253, 248, .9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: grid;
  gap: .1rem;
  text-decoration: none;
}

.brand span {
  color: var(--accent-dark);
  font-family: "Great Vibes", "Segoe Script", cursive;
  font-size: 2rem;
  font-weight: 400;
  line-height: .9;
}

.brand small {
  color: var(--muted);
  font-size: .82rem;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .45rem .8rem;
  font-size: .95rem;
  font-weight: 650;
}

.site-nav a,
.secondary-action,
.primary-action,
.danger-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: .55rem .9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  cursor: pointer;
}

.site-nav a,
.secondary-action {
  background: rgba(255, 255, 255, .75);
}

.primary-action {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.primary-action.small {
  min-height: 36px;
  padding: .48rem .85rem;
}

.danger-action {
  border-color: #b32318;
  background: #b32318;
  color: white;
  font-weight: 800;
}

.guest-name {
  color: var(--muted);
  font-size: .9rem;
}

.site-main {
  width: min(100%, 1540px);
  min-height: calc(100vh - 146px);
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 3rem);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem clamp(1rem, 4vw, 3rem);
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: .92rem;
}

.site-footer nav {
  display: flex;
  gap: 1rem;
}

.access-page {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: center;
  min-height: calc(100vh - 190px);
}

.access-hero h1 {
  margin: .2rem 0 .65rem;
  color: var(--accent-dark);
  font-family: "Great Vibes", "Segoe Script", cursive;
  font-size: clamp(5rem, 12vw, 10rem);
  font-weight: 400;
  line-height: .9;
  letter-spacing: 0;
}

.access-subtitle {
  margin: 0 0 1.1rem;
  color: var(--ink);
  font-size: clamp(1.35rem, 2.4vw, 2.1rem);
  font-weight: 800;
}

.page-head h1 {
  margin: 0 0 .65rem;
  color: var(--accent-dark);
  font-family: "Great Vibes", "Segoe Script", cursive;
  font-size: clamp(3.7rem, 8vw, 6.8rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: 0;
}

.lead {
  max-width: 50rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.2rem, 2.3vw, 1.75rem);
}

.eyebrow {
  margin: 0;
  color: var(--accent-dark);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.access-card,
.panel {
  background: rgba(255, 255, 255, .86);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.access-card {
  display: grid;
  gap: .85rem;
  padding: clamp(1rem, 3vw, 2rem);
}

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

label {
  color: #40372f;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: .7rem .8rem;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}

input[type="checkbox"] {
  width: auto;
  min-height: auto;
  accent-color: var(--accent);
}

input[type="radio"] {
  width: auto;
  min-height: auto;
  accent-color: var(--accent);
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}

.checkbox-row.compact {
  font-size: .92rem;
  font-weight: 650;
}

.validation {
  color: #b32318;
  font-size: .92rem;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
  padding-top: .45rem;
}

.page-head .eyebrow {
  margin-bottom: 1rem;
}

.panel {
  padding: clamp(1rem, 2.2vw, 1.5rem);
  margin-bottom: 1rem;
}

.panel h2 {
  margin: 0 0 .35rem;
}

.panel p {
  color: var(--muted);
}

.filter-panel {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.filter-label {
  color: #40372f;
  font-weight: 900;
  white-space: nowrap;
}

.radio-group,
.radio-fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.radio-fieldset {
  padding: 0;
  border: 0;
  margin: 0;
}

.radio-fieldset legend {
  width: 100%;
  margin: 0 0 .1rem;
  color: #40372f;
  font-weight: 900;
}

.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 42px;
  padding: .55rem .75rem;
  background: rgba(255, 255, 255, .78);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.radio-pill span {
  white-space: nowrap;
}

.gallery-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .65rem;
  margin: 0 0 1rem;
}

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

.media-card {
  min-width: 0;
}

.media-preview {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #f4eadb;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.lightbox-trigger {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.lightbox-trigger img,
.lightbox-trigger video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.video-tile {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: white;
  font-size: 1.1rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--leaf), var(--accent-dark));
}

.card-select {
  position: absolute;
  top: .45rem;
  left: .45rem;
  z-index: 2;
}

.card-download {
  position: absolute;
  top: .4rem;
  right: .4rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--ink);
  background: rgba(255, 255, 255, .82);
  border-radius: 999px;
}

.card-download svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.card-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  gap: .1rem;
  padding: .55rem .65rem;
  color: white;
  font-size: .78rem;
  line-height: 1.25;
  background: linear-gradient(0deg, rgba(0, 0, 0, .68), transparent);
  opacity: 0;
  transition: opacity .15s ease;
}

.media-preview:hover .card-meta,
.media-preview:focus-within .card-meta {
  opacity: 1;
}

.card-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-panel form {
  display: grid;
  gap: .8rem;
}

.upload-progress {
  position: relative;
  min-height: 36px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff6e3;
}

.upload-progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: rgba(95, 123, 84, .45);
  transition: width .15s linear;
}

.upload-progress span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 36px;
  font-size: .9rem;
  font-weight: 800;
}

.admin-list {
  display: grid;
  gap: .8rem;
}

.admin-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
}

.admin-thumb {
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 1;
  color: white;
  font-weight: 900;
  background: var(--leaf);
  border-radius: 8px;
}

.admin-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-detail h2 {
  margin: 0 0 .25rem;
  font-size: 1.05rem;
}

.admin-detail p {
  margin: 0 0 .6rem;
  color: var(--muted);
}

.inline-form,
.admin-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}

.inline-form select {
  min-width: 260px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(24, 20, 17, .92);
}

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

.lightbox-stage {
  display: grid;
  place-items: center;
  width: min(94vw, 1500px);
  height: 88vh;
}

.lightbox-stage img,
.lightbox-stage video {
  max-width: 100%;
  max-height: calc(88vh - 3rem);
}

.lightbox-stage p,
.lightbox-meta {
  color: white;
  margin: .65rem 0 0;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
}

.lightbox-close,
.lightbox-nav {
  position: fixed;
  z-index: 101;
  color: white;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  cursor: pointer;
}

.lightbox-close {
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  font-size: 2rem;
}

.lightbox-nav {
  top: 50%;
  width: 48px;
  height: 48px;
  font-size: 2.4rem;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

.prose {
  max-width: 72ch;
}

@media (max-width: 760px) {
  .site-header,
  .site-footer,
  .page-head,
  .filter-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .access-page {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .access-hero h1 {
    font-size: clamp(4.4rem, 22vw, 6.4rem);
  }

  .page-head h1 {
    font-size: clamp(3.4rem, 17vw, 4.8rem);
  }

  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .admin-item {
    grid-template-columns: 88px minmax(0, 1fr);
  }

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