.gallery-page > main {
  max-width: 1180px;
}

.gallery-page > main h2 {
  color: var(--gallery-gold-deep) !important;
  font-family: Georgia, "Songti SC", serif;
  letter-spacing: .08em !important;
}

.gallery-page > main h2 > span {
  width: 3px !important;
  height: 18px !important;
  border-radius: 0 !important;
  background: var(--gallery-gold) !important;
}

.gallery-page .card {
  position: relative;
  border: 1px solid var(--gallery-line) !important;
  border-radius: 10px !important;
  background: var(--gallery-paper) !important;
  box-shadow: 0 7px 16px rgba(77, 57, 34, .1) !important;
}

.gallery-page .card::before,
.gallery-page .card::after {
  position: absolute;
  z-index: 2;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(185, 139, 75, .42);
  content: "";
  pointer-events: none;
}

.gallery-page .card::before {
  top: 6px;
  left: 6px;
  border-right: 0;
  border-bottom: 0;
}

.gallery-page .card::after {
  right: 6px;
  bottom: 6px;
  border-top: 0;
  border-left: 0;
}

.gallery-page .card:hover {
  border-color: var(--gallery-gold) !important;
  box-shadow: 0 12px 22px rgba(77, 57, 34, .15) !important;
}

.gallery-page .card-img {
  background: rgba(238, 227, 207, .42) !important;
}

.gallery-page .card > div:last-child {
  border-top: 1px solid rgba(216, 203, 179, .72);
}

.gallery-page .card > div:last-child > div > span:first-child {
  color: var(--gallery-ink) !important;
  font-family: Georgia, "Times New Roman", serif;
}

.gallery-page .card > div:last-child > div > span:nth-child(2),
.gallery-page .card > div:last-child p {
  color: var(--gallery-muted) !important;
}

.gallery-page .card > span {
  border-radius: 4px !important;
}

.gallery-page #modal {
  background: rgba(45, 42, 67, .58) !important;
}

.gallery-page #modal-content {
  border: 1px solid var(--gallery-line);
  background: var(--gallery-paper) !important;
  box-shadow: 0 24px 70px rgba(45, 42, 67, .28);
}

.gallery-page #modal-content > div:first-child,
.gallery-page #modal-content > div:last-child {
  border-color: var(--gallery-line) !important;
  background: var(--gallery-paper) !important;
}

.gallery-page #modal-content button:hover {
  background: var(--gallery-paper-deep) !important;
}

.gallery-page #modal-share {
  color: #fffaf0 !important;
  background: var(--gallery-blue) !important;
}

.gallery-page #modal-copy {
  color: var(--gallery-ink) !important;
  background: var(--gallery-paper-deep) !important;
}

.gallery-page #modal-body .text-slate-500,
.gallery-page #modal-body .text-slate-400,
.gallery-page #modal-body .text-slate-600,
.gallery-page #modal-body .text-slate-700 {
  color: var(--gallery-muted) !important;
}

.gallery-page #modal-body .bg-slate-50,
.gallery-page #modal-body .bg-slate-100 {
  background: var(--gallery-paper-deep) !important;
}

.gallery-page #toast {
  color: #fffaf0 !important;
  background: var(--gallery-ink) !important;
}

html.dark .gallery-page {
  --gallery-canvas: #20201e;
  --gallery-paper: #2b2a27;
  --gallery-paper-deep: #36342f;
  --gallery-ink: #f5eee2;
  --gallery-body: #e3dacc;
  --gallery-muted: #b9ad9d;
  --gallery-line: #625846;
  --gallery-gold: #d2ad6c;
  --gallery-gold-deep: #e0bc7a;
  --gallery-blue: #8eadd2;
  --gallery-blue-soft: #344254;
  --gallery-shadow: rgba(0, 0, 0, .28);
}

html.dark .gallery-page {
  background-image:
    radial-gradient(circle at 12% 12%, rgba(210, 173, 108, .08) 0 1px, transparent 1.5px),
    radial-gradient(circle at 84% 72%, rgba(142, 173, 210, .06) 0 1px, transparent 1.5px),
    linear-gradient(90deg, rgba(255, 255, 255, .025), transparent 14%, transparent 86%, rgba(0, 0, 0, .08));
}

html.dark .gallery-page > header {
  background: rgba(43, 42, 39, .92) !important;
}

html.dark .gallery-page .quiz-option,
html.dark .gallery-page > header a[href="index.html"],
html.dark .gallery-page #quiz-prev {
  background: rgba(54, 52, 47, .88) !important;
}

html.dark .gallery-page .quiz-option:has(input:checked) {
  background: #4a3e2d !important;
}

html.dark .gallery-page #quiz-next,
html.dark .gallery-page #modal-share {
  color: #211f1b !important;
}

@media (max-width: 640px) {
  .gallery-page > header a[href="index.html"] {
    min-height: 44px !important;
  }

  .gallery-page > section:first-of-type .text-center {
    padding-right: 0;
    padding-left: 0;
  }

  .gallery-page > section:first-of-type .text-center::before,
  .gallery-page > section:first-of-type .text-center::after {
    width: 19%;
  }

  .gallery-page > section:first-of-type .inline-flex {
    padding-right: 8px;
    padding-left: 8px;
  }

  .gallery-page .quiz-question {
    padding: 25px 17px 23px;
  }

  .gallery-page .quiz-question h3 {
    font-size: 1.45rem !important;
  }

  .gallery-page .quiz-option {
    min-height: 55px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .gallery-page #quiz-result > div {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-page .quiz-option,
  .gallery-page #quiz-prev,
  .gallery-page #quiz-next,
  .gallery-page .card {
    transition: none;
  }
}
