:root {
  --merlot: #5c2a2a;
  --cream: #f5f1e8;
  --charcoal: #2c2118;
  --stone: #8b7f73;
  --white: #fffaf2;
  --shadow: 0 18px 40px rgba(44, 33, 24, 0.14);
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--charcoal);
  background: var(--cream);
  line-height: 1.6;
}

body,
input,
button {
  font-size: 16px;
}
a {
  color: var(--merlot);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.site-header {
  min-height: 78px;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(245, 241, 232, 0.96);
  border-bottom: 1px solid rgba(139, 127, 115, 0.25);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--charcoal);
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  background: var(--merlot);
  color: var(--cream);
  border-radius: 50%;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.brand small {
  display: block;
  color: var(--stone);
  font-size: 0.86rem;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  font-family: Arial, sans-serif;
}
.nav-link {
  color: var(--charcoal);
  font-size: 0.88rem;
  line-height: 1;
  padding: 9px 11px;
  border-radius: 999px;
  transition:
    background 0.18s ease,
    color 0.18s ease;
}
.nav-link:hover {
  background: rgba(92, 42, 42, 0.09);
  text-decoration: none;
}
.nav-link[aria-current='page'] {
  background: var(--merlot);
  color: var(--cream);
  font-weight: 700;
}
.nav-link-admin {
  margin-left: 4px;
  border: 1px solid rgba(92, 42, 42, 0.24);
  color: var(--merlot);
}

.hero {
  min-height: 620px;
  display: grid;
  place-items: center;
  padding: 70px 20px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(44, 33, 24, 0.78), rgba(92, 42, 42, 0.5), rgba(44, 33, 24, 0.2)),
    url('../images/hero-placeholder.svg') center/cover no-repeat;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 80%, rgba(245, 241, 232, 0.18), transparent 34%);
}
.hero-content {
  position: relative;
  width: min(820px, 100%);
  color: var(--cream);
  text-align: center;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--merlot);
  font-family: Arial, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
}
.hero .eyebrow {
  color: #ead8c9;
}
h1 {
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  line-height: 1.05;
  margin: 0 0 18px;
}
h2 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.1;
  margin: 0 0 14px;
}
h3 {
  margin: 0 0 8px;
}
.lead {
  font-size: 1.16rem;
  color: var(--stone);
}

.hero-search,
.inline-form {
  display: flex;
  gap: 10px;
  margin: 30px auto 0;
  max-width: 720px;
}
input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(139, 127, 115, 0.45);
  background: var(--white);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--charcoal);
}
button,
.button {
  border: 0;
  background: var(--merlot);
  color: var(--cream);
  padding: 14px 22px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
button:hover,
.button:hover {
  filter: brightness(1.05);
  text-decoration: none;
}
.secondary-button {
  background: #355c3a;
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: -58px;
  position: relative;
  z-index: 2;
}
.card,
.soft-panel,
.search-panel,
.result-card,
.login-card {
  background: var(--white);
  border: 1px solid rgba(139, 127, 115, 0.22);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 28px;
}
.card h2 {
  font-size: 1.55rem;
}
.card p {
  color: #5a4d43;
}
.text-link {
  font-weight: 700;
}
.candle-card {
  background:
    linear-gradient(rgba(255, 250, 242, 0.91), rgba(255, 250, 242, 0.91)),
    radial-gradient(circle at 78% 20%, rgba(92, 42, 42, 0.18), transparent 28%);
}

.split-section {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 42px;
  align-items: center;
  padding: 88px 0;
}
.soft-panel ul {
  margin: 0;
  padding-left: 20px;
}
.services-section {
  background: #ebe3d7;
  padding: 78px 0;
}
.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 28px;
}
.service-grid article {
  background: var(--cream);
  border-left: 4px solid var(--merlot);
  padding: 22px;
  border-radius: 12px;
}
.candle-panel {
  background:
    linear-gradient(rgba(255, 250, 242, 0.88), rgba(255, 250, 242, 0.88)),
    radial-gradient(circle at 20% 35%, rgba(92, 42, 42, 0.2), transparent 26%);
}

.site-footer {
  background: var(--charcoal);
  color: var(--cream);
  padding: 46px 0;
}
.site-footer a {
  color: var(--cream);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.page-content {
  padding: 58px 0 90px;
}
.search-panel {
  margin: 25px 0 42px;
}
.search-panel label,
.login-card label {
  display: block;
  font-weight: 700;
  margin: 12px 0 6px;
}
.result-list {
  display: grid;
  gap: 16px;
}
.result-card h3 {
  font-size: 1.4rem;
}
.muted {
  color: var(--stone);
}
.notice {
  background: #fff7e7;
  border: 1px solid rgba(139, 127, 115, 0.32);
  border-radius: 10px;
  padding: 16px;
}
.notice.error {
  background: #fae8e8;
  color: #5c2a2a;
}
.badge {
  display: inline-block;
  background: rgba(92, 42, 42, 0.11);
  color: var(--merlot);
  border-radius: 999px;
  padding: 5px 12px;
  font-family: Arial, sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
}

.history-page {
  display: grid;
  gap: 1.5rem;
}

.history-page .page-hero {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  background:
    linear-gradient(rgba(255, 250, 242, 0.92), rgba(255, 250, 242, 0.92)),
    url('../images/hero-placeholder.svg') center/cover no-repeat;
}

.history-page .page-hero h1 {
  max-width: none;
  font-size: clamp(2.2rem, 4.2vw, 3rem);
}

.history-page .page-hero .lead {
  max-width: 760px;
}

.history-article {
  max-width: 900px;
  margin: 0 auto;
}

.history-article p {
  color: #4f433a;
  font-size: 1.05rem;
}

.history-article h2 {
  margin-top: 2.2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(139, 127, 115, 0.24);
  font-size: clamp(1.55rem, 2.4vw, 2.25rem);
}

.contact-page {
  display: grid;
  gap: 1.5rem;
}

.contact-page > .page-hero,
.contact-layout,
.inquiry-grid {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.contact-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}

.contact-main,
.board-card,
.inquiry-card {
  height: 100%;
}

.contact-page .page-hero h1 {
  max-width: none;
  font-size: clamp(2.2rem, 4.2vw, 3rem);
}

.contact-main h2,
.board-card h2,
.inquiry-card h2 {
  font-size: 1.55rem;
}

.contact-list {
  display: grid;
  gap: 1rem;
}

.contact-list div,
.board-member {
  padding: 1rem 0;
  border-top: 1px solid rgba(139, 127, 115, 0.22);
}

.contact-list div:first-child,
.board-member:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.contact-list span,
.board-member span {
  display: block;
  color: var(--stone);
  font-family: Arial, sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
}

.contact-list strong,
.board-member strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.18rem;
}

.contact-list p {
  margin: 0.25rem 0 0;
}

.contact-email-button {
  display: inline-block;
  margin-top: 0.65rem;
  overflow-wrap: anywhere;
  white-space: normal;
}

.inquiry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.inquiry-card {
  display: grid;
  align-content: start;
  gap: 0.75rem;
}

.inquiry-card .button {
  justify-self: start;
  align-self: end;
  margin-top: 0.35rem;
}

.history-article h2:first-of-type {
  margin-top: 1.2rem;
}

.history-article h2 span {
  display: block;
  margin-top: 0.25rem;
  color: var(--stone);
  font-family: Arial, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
}

.admin-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(rgba(245, 241, 232, 0.9), rgba(245, 241, 232, 0.9)),
    url('../images/hero-placeholder.svg') center/cover no-repeat;
}
.login-card {
  width: min(460px, 100%);
}
.login-card form {
  display: grid;
  gap: 8px;
}
.login-card button {
  margin-top: 12px;
}
.auth-link {
  margin-top: 1rem;
  text-align: center;
}

.person-hero {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.person-portrait {
  width: 180px;
  aspect-ratio: 1;
  border: 4px solid rgba(255, 250, 242, 0.92);
  border-radius: 50%;
  box-shadow: 0 12px 28px rgba(44, 33, 24, 0.18);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(92, 42, 42, 0.16), rgba(139, 127, 115, 0.2));
  display: grid;
  place-items: center;
}

.person-portrait img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.person-portrait span {
  color: var(--merlot);
  font-family: Arial, sans-serif;
  font-size: 3rem;
  font-weight: 700;
}

.person-hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.8rem);
}

.person-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.person-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(18rem, 0.9fr);
  gap: 1.5rem;
  align-items: start;
}

.person-section {
  margin-top: 1.5rem;
}

.prose {
  color: #5a4d43;
}

.genealogy-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
}

.genealogy-list div {
  border-bottom: 1px solid rgba(139, 127, 115, 0.22);
  padding-bottom: 0.75rem;
}

.genealogy-list dt {
  color: var(--stone);
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.genealogy-list dd {
  margin: 0.2rem 0 0;
}

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

.photo-grid figure {
  margin: 0;
  border: 1px solid rgba(139, 127, 115, 0.22);
  border-radius: 8px;
  overflow: hidden;
  background: var(--cream);
}

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

.photo-grid figcaption {
  padding: 0.7rem 0.8rem;
  color: #5a4d43;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
}

.headstone-card {
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.headstone-card img {
  display: block;
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  border: 1px solid rgba(139, 127, 115, 0.22);
  border-radius: 8px;
  background: var(--cream);
}

.headstone-card figcaption {
  color: #5a4d43;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
}

.photo-gallery-grid,
.gallery-page-grid {
  display: grid;
  gap: 4px;
}

.photo-gallery-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery-page-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.photo-gallery-grid .gallery-tile,
.gallery-page-grid .gallery-tile,
.photo-gallery-grid a:not(.gallery-tile-link),
.gallery-page-grid a:not(.gallery-tile-link) {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--cream);
}

.gallery-tile {
  position: relative;
}

.gallery-tile-link {
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.gallery-tile-link:hover {
  text-decoration: none;
}

.photo-gallery-grid img,
.gallery-page-grid img,
.gallery-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.18s ease,
    filter 0.18s ease;
}

.gallery-tile-overlay {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem;
  background: linear-gradient(180deg, transparent, rgba(24, 18, 14, 0.78));
  color: #fffaf2;
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.gallery-tile-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
}

.gallery-tile-chip {
  flex: 0 0 auto;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.18);
  border: 1px solid rgba(255, 250, 242, 0.36);
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}

.photo-gallery-grid a:hover img,
.gallery-page-grid a:hover img,
.gallery-tile:hover img {
  transform: scale(1.035);
  filter: brightness(0.96);
}

.gallery-tile:hover .gallery-tile-overlay,
.gallery-tile:focus-within .gallery-tile-overlay {
  opacity: 1;
}

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

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(24, 18, 14, 0.9);
}

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

.gallery-lightbox-card {
  width: min(1040px, 100%);
  max-height: calc(100vh - 2.5rem);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #fffaf2;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.gallery-lightbox-media {
  display: grid;
  place-items: center;
  min-height: 260px;
  background: #18120e;
}

.gallery-lightbox img {
  display: block;
  width: 100%;
  max-height: min(76vh, 760px);
  object-fit: contain;
}

.gallery-lightbox-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: #fffaf2;
  color: var(--charcoal);
  font-family: Arial, sans-serif;
  font-size: 0.95rem;
}

.gallery-lightbox-caption {
  min-width: 0;
  overflow-wrap: anywhere;
}

.gallery-lightbox-count {
  flex: 0 0 auto;
  margin-top: 0.2rem;
  color: var(--stone);
  font-size: 0.85rem;
}

.gallery-lightbox-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.gallery-lightbox-button {
  width: auto;
  min-width: 2.55rem;
  height: 2.4rem;
  padding: 0 0.8rem;
  border-radius: 6px;
  font-family: Arial, sans-serif;
  font-size: 0.92rem;
}

.photo-viewer-card {
  overflow: hidden;
  border: 1px solid rgba(139, 127, 115, 0.22);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.photo-viewer-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  background: #18120e;
}

.photo-viewer-scroll:focus {
  outline: 3px solid rgba(214, 166, 63, 0.45);
  outline-offset: -3px;
}

.photo-viewer-slide {
  scroll-snap-align: center;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: min(82vh, 860px);
  background: #18120e;
}

.photo-viewer-media {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 1rem;
  background: #18120e;
}

.photo-viewer-media img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(72vh, 760px);
  object-fit: contain;
}

.photo-viewer-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: #fffaf2;
  color: var(--charcoal);
}

.photo-viewer-caption h2 {
  margin: 0;
  font-size: 1.25rem;
  overflow-wrap: anywhere;
}

.photo-viewer-caption p {
  margin: 0.2rem 0 0;
  flex: 0 0 auto;
}

.photo-viewer-progress {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.75rem 1rem 0;
}

.photo-viewer-progress span {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: rgba(139, 127, 115, 0.42);
}

.photo-viewer-progress span.active {
  background: var(--merlot);
}

.photo-viewer-hint {
  margin: 0.45rem 0 1rem;
  text-align: center;
  color: var(--stone);
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
}

.gallery-heading {
  margin-bottom: 1.5rem;
}

.document-links {
  display: grid;
  gap: 0.75rem;
}

.genealogy-documents {
  margin-top: 1rem;
}

.document-links a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(139, 127, 115, 0.25);
  border-radius: 8px;
  background: var(--cream);
}

.document-preview {
  display: grid;
  gap: 0.75rem;
}

.document-preview iframe {
  width: 100%;
  min-height: 480px;
  border: 1px solid rgba(139, 127, 115, 0.25);
  border-radius: 8px;
  background: var(--cream);
}

.document-links span {
  color: var(--stone);
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  flex: 0 0 auto;
}

.admin-dashboard h1 {
  margin-bottom: 28px;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.admin-stats-grid .card h2 {
  color: var(--merlot);
  font-family: Arial, sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
}

.admin-stats-grid .card p {
  margin-bottom: 0;
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .intro-grid,
  .service-grid,
  .split-section,
  .footer-grid,
  .admin-stats-grid,
  .admin-dashboard-grid,
  .person-hero,
  .person-layout,
  .contact-layout,
  .inquiry-grid {
    grid-template-columns: 1fr;
  }
  .person-portrait {
    width: 132px;
  }
  .person-facts {
    justify-content: flex-start;
  }
  .photo-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gallery-lightbox {
    padding: 0.75rem;
  }
  .gallery-lightbox-card {
    max-height: calc(100vh - 1.5rem);
  }
  .gallery-lightbox-foot {
    flex-direction: column;
    align-items: stretch;
  }
  .gallery-lightbox-actions {
    justify-content: flex-start;
  }
  .photo-viewer-slide {
    min-height: 70vh;
  }
  .photo-viewer-media {
    padding: 0.5rem;
  }
  .photo-viewer-media img {
    max-height: 62vh;
  }
  .photo-viewer-caption {
    flex-direction: column;
    align-items: flex-start;
  }
  .intro-grid {
    margin-top: 24px;
  }
  .hero-search,
  .inline-form {
    flex-direction: column;
  }
}

/* Cemetery map */
.page-hero.compact {
  padding: 2.25rem;
  margin-bottom: 1.5rem;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.cemetery-map {
  background: #f5f1e8;
  border: 1px solid rgba(139, 127, 115, 0.35);
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(44, 33, 24, 0.08);
  overflow: hidden;
}

.map-background {
  position: relative;
  min-height: 520px;
  background:
    radial-gradient(circle at 18% 22%, rgba(92, 42, 42, 0.08), transparent 18%),
    radial-gradient(circle at 80% 18%, rgba(139, 127, 115, 0.12), transparent 18%),
    linear-gradient(135deg, #f5f1e8, #ebe3d5);
}

.map-path {
  position: absolute;
  background: rgba(139, 127, 115, 0.22);
  border-radius: 999px;
}

.map-path.horizontal {
  left: 6%;
  right: 6%;
  top: 73%;
  height: 32px;
}

.map-path.vertical {
  top: 8%;
  bottom: 8%;
  left: 47%;
  width: 28px;
}

.map-section {
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  text-align: center;
  padding: 1rem;
  border: 2px solid var(--section-color, #5c2a2a);
  background: rgba(255, 255, 255, 0.68);
  color: #2c2118;
  border-radius: 16px;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(44, 33, 24, 0.08);
}

.map-section:hover {
  background: rgba(255, 255, 255, 0.88);
  transform: translateY(-1px);
}

.map-section strong {
  color: var(--section-color, #5c2a2a);
  font-size: 1.05rem;
}

.map-section span {
  font-size: 0.9rem;
}

.map-tree {
  position: absolute;
  color: rgba(44, 33, 24, 0.25);
  font-size: 2.25rem;
}

.tree-one {
  left: 6%;
  top: 9%;
}
.tree-two {
  right: 8%;
  top: 10%;
}
.tree-three {
  right: 11%;
  bottom: 12%;
}

.map-label.entrance {
  position: absolute;
  left: 40%;
  bottom: 5%;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: #2c2118;
  color: #f5f1e8;
  font-size: 0.9rem;
}

.map-key p {
  margin: 0.65rem 0;
}

.status-dot {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  margin-right: 0.5rem;
  vertical-align: middle;
  background: #8b7f73;
}

.status-dot.available,
.badge.available {
  background: #f5f1e8;
  color: #2c2118;
  border: 1px solid #8b7f73;
}
.status-dot.taken,
.badge.taken,
.status-dot.reserved,
.badge.reserved {
  background: var(--merlot);
  color: white;
}
.status-dot.occupied,
.badge.occupied,
.badge.paid {
  background: var(--merlot);
  color: white;
}
.status-dot.unavailable,
.badge.unavailable {
  background: #2c2118;
  color: white;
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.plot-map-card {
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.plot-directory-search {
  display: grid;
  gap: 0.55rem;
  margin: 0.85rem 0 1rem;
}

.plot-directory-search label {
  font-weight: 700;
}

.plot-directory-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.plot-section-list {
  display: grid;
  gap: 1.25rem;
  margin-top: 1rem;
}

.plot-section {
  position: relative;
  border: 1px solid rgba(139, 127, 115, 0.25);
  border-radius: 8px;
  padding: 1rem;
  background: rgba(255, 250, 242, 0.72);
}

.plot-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.plot-section-heading h3 {
  font-size: 1.15rem;
}

.plot-section-heading span {
  color: var(--stone);
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
}

.plot-grid-map {
  display: grid;
  grid-template-columns: max-content repeat(var(--plot-columns), minmax(30px, 1fr));
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.plot-row-label {
  display: grid;
  place-items: center;
  min-width: 42px;
  min-height: 30px;
  color: var(--stone);
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}

.plot-cell {
  display: grid;
  place-items: center;
  min-width: 58px;
  min-height: 30px;
  border: 1px solid rgba(139, 127, 115, 0.35);
  border-radius: 4px;
  background: #f5f1e8;
  color: #2c2118;
  font-family: Arial, sans-serif;
  font-size: 0.76rem;
  line-height: 1;
  text-decoration: none;
}

.plot-cell:hover {
  text-decoration: none;
  filter: brightness(0.98);
}

.plot-cell.plot-search-dim {
  opacity: 0.2;
}

.plot-cell.plot-search-match {
  opacity: 1;
  z-index: 12;
  border-color: #d6a63f;
  box-shadow: 0 0 0 2px rgba(214, 166, 63, 0.65), 0 0 14px rgba(214, 166, 63, 0.42);
}

.plot-cell.plot-focused {
  z-index: 14;
  outline: 3px solid #d6a63f;
  outline-offset: 2px;
}

.plot-cell.plot-selected {
  z-index: 15;
  outline: 3px solid #d6a63f;
  outline-offset: 2px;
}

.plot-cell.taken,
.plot-cell.reserved {
  background: var(--merlot);
  color: white;
}

.plot-cell.occupied,
.plot-cell.paid {
  background: var(--merlot);
  color: white;
}

.plot-cell.unavailable {
  background: #2c2118;
  color: white;
}

.plot-cell.empty {
  background: transparent;
  border-color: rgba(139, 127, 115, 0.12);
}

.plot-coordinate-map {
  position: relative;
  width: max(100%, 920px);
  aspect-ratio: 1 / 1;
  min-height: 90rem;
  border: 1px solid rgba(139, 127, 115, 0.25);
  border-radius: 8px;
  background:
    linear-gradient(rgba(139, 127, 115, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 127, 115, 0.08) 1px, transparent 1px), #fffaf2;
  background-size: 32px 32px;
  overflow: hidden;
}

.plot-layout-guide {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.plot-layout-guide.section-boundary {
  display: grid;
  place-items: center;
  z-index: 7;
  border: 2px dashed rgba(92, 42, 42, 0.38);
  background: rgba(92, 42, 42, 0.015);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 242, 0.72);
}

.plot-layout-guide span {
  position: absolute;
  left: 0.45rem;
  top: 0.35rem;
  padding: 0.16rem 0.4rem;
  border-radius: 4px;
  background: rgba(255, 250, 242, 0.86);
  color: #5c2a2a;
  font-family: Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  z-index: 8;
}

.plot-layout-guide.section-boundary span {
  position: static;
  max-width: 92%;
  padding: 0;
  background: transparent;
  color: rgba(92, 42, 42, 0.42);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.9rem, 5.5vw, 5.25rem);
  font-weight: 700;
  line-height: 0.95;
  text-align: center;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 rgba(255, 250, 242, 0.9),
    0 0 10px rgba(255, 250, 242, 0.95);
  pointer-events: none;
  user-select: none;
}

.plot-layout-guide.section-boundary.guide-cs span {
  font-size: clamp(0.95rem, 2.5vw, 1.6rem);
  line-height: 1;
}

.plot-layout-guide.road {
  border: 1px solid rgba(44, 33, 24, 0.2);
  background: rgba(139, 127, 115, 0.36);
}

.plot-layout-guide.road span {
  top: 50%;
  transform: translateY(-50%);
  background: rgba(44, 33, 24, 0.82);
  color: #fffaf2;
}

.plot-layout-guide.wishkah-road {
  z-index: 3;
  border-inline: 1px solid rgba(44, 33, 24, 0.18);
  background: rgba(139, 127, 115, 0.22);
}

.plot-layout-guide.wishkah-road-label {
  z-index: 4;
}

.plot-layout-guide.wishkah-road span,
.plot-layout-guide.wishkah-road-label span {
  left: 50%;
  top: 50%;
  width: max-content;
  transform: translate(-50%, -50%) rotate(90deg);
  transform-origin: center;
  background: rgba(44, 33, 24, 0.82);
  color: #fffaf2;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.plot-layout-guide.wishkah-road span {
  top: 17%;
}

.plot-layout-guide.main-gate {
  z-index: 6;
  overflow: visible;
}

.plot-layout-guide.main-gate span {
  left: 0;
  top: 50%;
  transform: translate(-50%, -50%) rotate(90deg);
  transform-origin: center;
  border: 1px solid rgba(214, 166, 63, 0.58);
  background: rgba(255, 250, 242, 0.94);
  color: #5c2a2a;
  font-size: 0.72rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.plot-cell.absolute {
  position: absolute;
  z-index: 5;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border-radius: 2px;
  overflow: hidden;
  transform: none;
  font-size: 0.54rem;
  line-height: 1;
  text-align: center;
  overflow-wrap: anywhere;
  white-space: nowrap;
}

.plot-cell.absolute.burial {
  aspect-ratio: 4 / 10;
}

.plot-cell.absolute.cremation {
  min-width: 0;
  min-height: 0;
  aspect-ratio: auto;
  font-size: 0.38rem;
  letter-spacing: 0;
}

.plot-touch-tooltip {
  position: absolute;
  z-index: 20;
  max-width: min(18rem, calc(100% - 1rem));
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(92, 42, 42, 0.24);
  border-radius: 8px;
  background: rgba(44, 33, 24, 0.96);
  color: #fffaf2;
  box-shadow: 0 10px 24px rgba(44, 33, 24, 0.22);
  font-family: Arial, sans-serif;
  font-size: 0.84rem;
  line-height: 1.35;
  pointer-events: none;
}

.section-list {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stats-row span,
.badge {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(139, 127, 115, 0.14);
  font-size: 0.88rem;
}

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

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

th,
td {
  text-align: left;
  padding: 0.8rem;
  border-bottom: 1px solid rgba(139, 127, 115, 0.25);
}

[data-plot-directory-row] {
  cursor: pointer;
}

[data-plot-directory-row]:hover,
[data-plot-directory-row]:focus,
.plot-directory-row-match {
  background: rgba(214, 166, 63, 0.12);
}

.admin-grid-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: end;
}

.admin-grid-form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

.admin-grid-form input {
  padding: 0.75rem;
  border: 1px solid rgba(139, 127, 115, 0.45);
  border-radius: 10px;
  background: #fffaf2;
}

.notice {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.notice.success {
  background: rgba(92, 42, 42, 0.08);
  color: #5c2a2a;
}
.notice.error {
  background: rgba(92, 42, 42, 0.16);
  color: #5c2a2a;
}

@media (max-width: 900px) {
  .map-layout,
  .section-card {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .plot-directory-search-row {
    grid-template-columns: 1fr;
  }

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

  .map-background {
    min-height: 420px;
  }
}
