:root {
  --gallery-black: #1c1c1c;
  --gallery-gold: #d4af37;
  --gallery-gold-soft: #edd489;
  --gallery-beige: #f7f1e7;
  --gallery-cream: #fcfaf6;
  --gallery-brown: #5d4633;
  --gallery-brown-soft: #8a6a4a;
  --gallery-border: rgba(93, 70, 51, 0.12);
  --gallery-shadow: 0 22px 60px rgba(28, 28, 28, 0.09);
  --gallery-shadow-strong: 0 26px 70px rgba(28, 28, 28, 0.14);
}

.gallery-page-shell {
  padding: 5rem 0;
  background: linear-gradient(180deg, #fcf8f2 0%, #f7f1e7 100%);
}

.gallery-page-intro {
  margin: 0 auto 3rem;
  max-width: 780px;
  text-align: center;
}

.gallery-page-intro__eyebrow {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.12);
  color: var(--gallery-brown);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gallery-page-intro h2,
.collection-hero__content h1 {
  font-family: "Abril Fatface", serif;
  font-weight: 400;
  line-height: 1.12;
  color: var(--gallery-black);
}

.gallery-page-intro p,
.collection-hero__content p {
  color: rgba(28, 28, 28, 0.72);
  line-height: 1.8;
}

.gallery-page-intro__meta {
  margin-top: 1rem;
  color: var(--gallery-brown-soft);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gallery-status {
  margin: 0 auto 2rem;
  max-width: 760px;
  padding: 18px 20px;
  border-radius: 18px;
  text-align: center;
  font-size: 0.98rem;
}

.gallery-status--loading {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gallery-brown);
}

.gallery-status--empty {
  background: rgba(93, 70, 51, 0.08);
  color: var(--gallery-brown);
}

.gallery-status--error {
  background: rgba(180, 74, 54, 0.12);
  color: #8d3f30;
}

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

.collection-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--gallery-border);
  box-shadow: var(--gallery-shadow);
  text-decoration: none;
  transition: transform 0.32s ease, box-shadow 0.32s ease;
}

.collection-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--gallery-shadow-strong);
}

.collection-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.16) 0%, rgba(93, 70, 51, 0.2) 100%);
}

.collection-card__media-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  transition: opacity 0.24s ease;
}

.collection-card__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: transform 0.45s ease, opacity 0.24s ease;
}

.collection-card__media.is-loaded .collection-card__image {
  opacity: 1;
}

.collection-card__media.is-loaded .collection-card__media-fallback {
  opacity: 0;
}

.collection-card:hover .collection-card__media.is-loaded .collection-card__image {
  transform: scale(1.04);
}

.collection-card__media--placeholder {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.22) 0%, rgba(93, 70, 51, 0.28) 100%);
}

.collection-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
}

.collection-card__eyebrow {
  margin-bottom: 0;
  color: var(--gallery-brown-soft);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.collection-card__body h3 {
  margin-bottom: 0;
  color: var(--gallery-black);
  font-size: 1.2rem;
  line-height: 1.35;
}

.collection-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  color: rgba(28, 28, 28, 0.66);
  font-size: 0.9rem;
}

.collection-card__cta {
  color: var(--gallery-brown);
  font-weight: 600;
}

.collection-hero {
  position: relative;
  padding: 5rem 0 3rem;
  background:
    linear-gradient(135deg, rgba(20, 15, 11, 0.72) 0%, rgba(28, 28, 28, 0.78) 100%),
    var(--collection-hero-image, linear-gradient(135deg, #2a2018 0%, #4b3828 100%));
  background-size: cover;
  background-position: center;
}

.collection-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.22) 100%);
}

.collection-hero .container {
  position: relative;
  z-index: 1;
}

.collection-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-decoration: none;
}

body.site-shell .collection-hero__content {
  max-width: 760px;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.collection-hero__eyebrow {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--gallery-gold-soft);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.collection-hero__content h1,
.collection-hero__content p {
  color: #ffffff;
}

.gallery-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.gallery-image-card {
  overflow: hidden;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--gallery-border);
  box-shadow: var(--gallery-shadow);
  transition: transform 0.32s ease, box-shadow 0.32s ease;
}

.gallery-image-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--gallery-shadow-strong);
}

.gallery-image-card__media {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: zoom-in;
}

.gallery-image-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.gallery-image-card:hover .gallery-image-card__media img {
  transform: scale(1.03);
}

.gallery-image-card__body {
  padding: 18px 18px 20px;
}

.gallery-image-card__body h3 {
  margin-bottom: 6px;
  color: var(--gallery-black);
  font-size: 1rem;
  line-height: 1.4;
}

.gallery-image-card__body p {
  margin-bottom: 0;
  color: rgba(28, 28, 28, 0.58);
  font-size: 0.88rem;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 4vw, 48px);
  background: rgba(14, 11, 8, 0.9);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.gallery-lightbox.is-open {
  opacity: 1;
}

.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox-open {
  overflow: hidden;
}

.gallery-lightbox__figure {
  position: relative;
  max-width: min(1080px, 100%);
  max-height: 100%;
  margin: 0;
}

.gallery-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 130px);
  margin: 0 auto;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.gallery-lightbox__caption {
  margin-top: 14px;
  color: #ffffff;
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
}

.gallery-lightbox__close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.gallery-lightbox__close:hover,
.gallery-lightbox__close:focus {
  background: rgba(255, 255, 255, 0.22);
}

.gallery-load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  margin-top: 2rem;
  padding: 14px 24px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gallery-gold) 0%, var(--gallery-gold-soft) 100%);
  color: var(--gallery-black);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 14px 34px rgba(212, 175, 55, 0.22);
}

.gallery-load-more[hidden] {
  display: none;
}

[hidden],
.admin-login[hidden],
.admin-app[hidden],
.admin-notice[hidden],
.admin-inline-message[hidden],
.admin-progress[hidden],
.admin-debug[hidden],
#collectionDetail[hidden],
#collectionEmpty[hidden] {
  display: none !important;
}

.gallery-load-more:disabled {
  opacity: 0.7;
}

.admin-body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(180deg, #faf6ef 0%, #f3ebde 100%);
  color: var(--gallery-black);
  font-family: "Roboto", sans-serif;
}

.admin-shell {
  min-height: 100vh;
  padding: 24px;
}

.admin-login,
.admin-app {
  max-width: 1280px;
  margin: 0 auto;
}

.admin-login {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 48px);
}

.admin-card,
.admin-auth-card {
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--gallery-border);
  box-shadow: var(--gallery-shadow);
}

.admin-auth-card {
  width: min(480px, 100%);
  padding: 34px 30px;
}

.admin-auth-card h1,
.admin-topbar h1 {
  margin-bottom: 10px;
  font-family: "Abril Fatface", serif;
  font-weight: 400;
  line-height: 1.12;
}

.admin-auth-card p,
.admin-topbar p,
.admin-subtitle {
  color: rgba(28, 28, 28, 0.72);
}

.admin-overline {
  margin-bottom: 10px;
  color: var(--gallery-brown-soft);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.admin-field input,
.admin-field textarea,
.admin-upload-item input {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid var(--gallery-border);
  border-radius: 18px;
  background: rgba(252, 250, 246, 0.92);
  color: var(--gallery-black);
  box-sizing: border-box;
}

.admin-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gallery-gold) 0%, var(--gallery-gold-soft) 100%);
  color: var(--gallery-black);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 14px 34px rgba(212, 175, 55, 0.22);
  cursor: pointer;
}

.admin-button--secondary,
.admin-button--ghost {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(93, 70, 51, 0.14);
  box-shadow: none;
}

.admin-button--danger {
  background: rgba(181, 80, 59, 0.14);
  color: #8d3f30;
  box-shadow: none;
}

.admin-button--small {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.72rem;
}

.admin-inline-message,
.admin-notice {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
}

.admin-inline-message--success {
  background: rgba(71, 145, 98, 0.12);
  color: #29663d;
}

.admin-inline-message--warning {
  background: rgba(176, 120, 0, 0.14);
  color: #815900;
}

.admin-inline-message--error,
.admin-notice--error {
  background: rgba(181, 80, 59, 0.14);
  color: #8d3f30;
}

.admin-debug {
  margin-bottom: 18px;
  border-radius: 18px;
  border: 1px solid rgba(93, 70, 51, 0.12);
  background: rgba(250, 246, 239, 0.9);
  overflow: hidden;
}

.admin-debug summary {
  padding: 14px 16px;
  cursor: pointer;
  color: var(--gallery-brown);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-debug__content {
  padding: 0 16px 16px;
}

.admin-debug__grid {
  display: grid;
  grid-template-columns: minmax(0, 140px) minmax(0, 1fr);
  gap: 10px 14px;
  margin-bottom: 16px;
}

.admin-debug__label {
  color: rgba(28, 28, 28, 0.62);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-debug__value {
  color: var(--gallery-black);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.admin-debug__steps {
  margin: 0;
  padding-left: 18px;
  color: rgba(28, 28, 28, 0.8);
}

.admin-debug__steps li + li {
  margin-top: 8px;
}

.admin-debug__checks {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.admin-debug__check {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.admin-debug__check strong {
  color: var(--gallery-black);
}

.admin-debug__check span {
  font-size: 0.76rem;
  font-weight: 800;
}

.admin-debug__check p {
  grid-column: 1 / -1;
  margin: 0;
  color: rgba(28, 28, 28, 0.74);
  overflow-wrap: anywhere;
}

.admin-debug__check--pass span {
  color: #29663d;
}

.admin-debug__check--fail span {
  color: #8d3f30;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.admin-topbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  color: rgba(28, 28, 28, 0.64);
}

.admin-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 22px;
}

.admin-sidebar,
.admin-main {
  padding: 24px;
}

.admin-section-head,
.admin-gallery-header,
.admin-upload__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.admin-collection-list {
  margin-top: 20px;
  display: grid;
  gap: 12px;
}

.admin-collection-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 20px;
  background: rgba(250, 246, 239, 0.86);
  text-align: left;
}

.admin-collection-item.is-active {
  border-color: rgba(212, 175, 55, 0.26);
  background: rgba(212, 175, 55, 0.1);
}

.admin-collection-item__thumb {
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(93, 70, 51, 0.24) 100%);
}

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

.admin-collection-item__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.admin-collection-item__body strong {
  display: block;
  margin-bottom: 4px;
  color: var(--gallery-black);
}

.admin-collection-item__body span {
  color: rgba(28, 28, 28, 0.58);
  font-size: 0.86rem;
}

.admin-subcard {
  margin: 22px 0 24px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(250, 246, 239, 0.88);
  border: 1px solid var(--gallery-border);
}

.admin-upload__header {
  margin-bottom: 18px;
}

.admin-upload-list {
  display: grid;
  gap: 12px;
}

.admin-upload-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.admin-upload-item__thumb {
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
}

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

.admin-upload-item__body p {
  margin: 8px 0 0;
  color: rgba(28, 28, 28, 0.56);
  font-size: 0.84rem;
}

.admin-progress {
  margin-top: 16px;
}

.admin-progress__track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(28, 28, 28, 0.08);
}

.admin-progress__bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gallery-gold) 0%, var(--gallery-gold-soft) 100%);
  transition: width 0.2s ease;
}

.admin-progress p {
  margin: 10px 0 0;
  color: rgba(28, 28, 28, 0.64);
  font-size: 0.88rem;
}

.admin-upload__actions {
  margin-top: 18px;
}

.admin-gallery-header {
  margin-bottom: 16px;
}

.admin-gallery-header span {
  color: var(--gallery-brown-soft);
  font-size: 0.9rem;
}

.admin-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.admin-image-card {
  overflow: hidden;
  border-radius: 22px;
  background: rgba(250, 246, 239, 0.88);
  border: 1px solid var(--gallery-border);
}

.admin-image-card__media {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

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

.admin-image-card__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
}

.admin-image-card__body h3 {
  margin-bottom: 4px;
  color: var(--gallery-black);
  font-size: 0.95rem;
  line-height: 1.4;
}

.admin-image-card__body p {
  margin-bottom: 0;
  color: rgba(28, 28, 28, 0.56);
  font-size: 0.82rem;
}

.admin-empty {
  padding: 26px 20px;
  border: 1px dashed rgba(93, 70, 51, 0.18);
  border-radius: 22px;
  text-align: center;
  color: rgba(28, 28, 28, 0.58);
}

.admin-empty--small {
  padding: 18px 16px;
  font-size: 0.9rem;
}

@media (max-width: 991.98px) {
  .gallery-page-shell {
    padding: 4rem 0;
  }

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

@media (max-width: 767.98px) {
  .gallery-page-shell {
    padding: 3.25rem 0;
  }

  .collection-grid,
  .gallery-image-grid,
  .admin-image-grid {
    grid-template-columns: 1fr;
  }

  .gallery-page-intro {
    margin-bottom: 2rem;
  }

  .collection-card,
  .gallery-image-card {
    border-radius: 22px;
  }

  .collection-hero {
    padding-top: 4rem;
  }

  .admin-shell {
    padding: 14px;
  }

  .admin-auth-card,
  .admin-sidebar,
  .admin-main {
    padding: 20px;
    border-radius: 24px;
  }

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

  .admin-topbar,
  .admin-section-head,
  .admin-gallery-header,
  .admin-upload__header {
    flex-direction: column;
  }

  .admin-collection-item,
  .admin-upload-item,
  .admin-image-card__body {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .admin-image-card__body {
    align-items: flex-start;
  }
}
