/* Eturnal Rest -- cemetery detail page (overhaul: real-photo hero + premium
   listing layout). Loaded after base.css. Real brand: slate-blue, Merriweather
   + Lato. The hero uses the cemetery's REAL photo (c.logo) with a blue gradient
   overlay; if the photo is null/fails, a calm brand-blue gradient hero is used. */

/* ============================================================
   HERO  -- full-width, real cemetery photo as the background
   ============================================================ */
.cem-hero {
  position: relative;
  min-height: 460px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: linear-gradient(
    150deg,
    var(--blue-600),
    var(--blue-800) 60%,
    var(--blue-900)
  );
  isolation: isolate;
}
@media (min-width: 720px) {
  .cem-hero {
    min-height: 540px;
  }
}

/* the real photo lives in its own layer so we can parallax/zoom it without
   moving the text. Starts slightly zoomed + dimmed, settles on reveal. */
.cem-hero__media {
  position: absolute;
  inset: -4% -2%; /* bleed so the zoom never shows an edge */
  z-index: -2;
  background-size: cover;
  background-position: center;
  transform: scale(1.12);
  opacity: 0;
  transition:
    transform 1.6s var(--ease-out),
    opacity 0.9s var(--ease-out);
  will-change: transform, opacity;
}
.cem-hero.is-ready .cem-hero__media {
  transform: scale(1.02);
  opacity: 1;
}

/* dark blue gradient overlay so white text is always legible on any photo */
.cem-hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(
      to top,
      rgba(15, 28, 36, 0.92) 0%,
      rgba(20, 38, 48, 0.6) 38%,
      rgba(29, 55, 68, 0.28) 70%,
      rgba(29, 55, 68, 0.32) 100%
    ),
    linear-gradient(105deg, rgba(20, 38, 48, 0.55), rgba(20, 38, 48, 0) 55%);
}
/* when there is no real photo, lean on the brand gradient + a soft texture */
.cem-hero--brand .cem-hero__scrim {
  background:
    radial-gradient(
      120% 90% at 15% 0%,
      rgba(255, 255, 255, 0.1),
      transparent 55%
    ),
    linear-gradient(to top, rgba(15, 28, 36, 0.55), rgba(29, 55, 68, 0) 70%);
}

.cem-hero__inner {
  position: relative;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--space-8) 24px var(--space-7);
  color: #fff;
}

.cem-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.86);
  margin-bottom: var(--space-5);
}
.cem-hero__back:hover {
  color: #fff;
  text-decoration: none;
}

.cem-hero__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-4);
}
/* badges sit on a dark photo -- give them a frosted backing */
.cem-hero__badges .badge {
  backdrop-filter: blur(4px);
}
.cem-hero__badges .badge--verified {
  background: rgba(47, 125, 91, 0.92);
  color: #fff;
}
.cem-hero__badges .chip--avail {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  backdrop-filter: blur(4px);
}

.cem-hero h1 {
  color: #fff;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  margin: 0 0 0.25em;
  max-width: 18ch;
  text-shadow: 0 2px 20px rgba(13, 24, 31, 0.45);
}
.cem-hero__loc {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 var(--space-5);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.cem-hero__loc .dot {
  opacity: 0.5;
}
.cem-hero__type {
  color: rgba(255, 255, 255, 0.78);
}

/* key facts strip overlaid on the hero (plots available, price range) */
.cem-hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.cem-hero__fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cem-hero__fact b {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  line-height: 1;
  color: #fff;
}
.cem-hero__fact span {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.74);
}

/* ============================================================
   BODY  -- premium two-column under the hero
   ============================================================ */
.cem-body {
  padding: var(--space-8) 0 var(--space-9);
}
.cem-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: var(--space-7);
  align-items: start;
}

/* writeup / description */
.cem-about {
  margin-bottom: var(--space-7);
}
.cem-about h2 {
  font-size: 1.6rem;
}
.cem-about p {
  color: var(--ink-2);
  max-width: 66ch;
}
.cem-about--generic .cem-about__note {
  font-size: 0.85rem;
  color: var(--ink-3);
}

/* map */
.cem-map-wrap {
  margin-bottom: var(--space-7);
}
.cem-map-wrap h2 {
  font-size: 1.6rem;
}
.cem-map {
  height: 340px;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line-cool);
  box-shadow: var(--shadow-sm);
  z-index: 0;
}
.cem-map__cap {
  font-size: 0.82rem;
  color: var(--ink-3);
  margin-top: 8px;
}
.leaflet-container {
  font-family: var(--font-sans);
  background: var(--blue-50);
}

/* ---- summary "At a glance" card (sticky on desktop) ---- */
.cem-summary {
  position: sticky;
  top: 90px;
  background: var(--white);
  border: 1px solid var(--line-cool);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-6);
}
.cem-summary h2 {
  font-size: 1.3rem;
  margin-bottom: var(--space-4);
}
.cem-summary__rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.cem-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px dashed var(--line);
}
.cem-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.cem-row__label {
  color: var(--ink-2);
  font-size: 0.95rem;
}
.cem-row__val {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--blue-700);
  font-size: 1.12rem;
  text-align: right;
}
.cem-history-note {
  margin-top: var(--space-4);
  font-size: 0.9rem;
  color: var(--blue-800);
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.cem-summary__cta {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
.cem-summary__cta .btn {
  width: 100%;
  justify-content: center;
}
.cem-website {
  margin-top: var(--space-4);
  font-size: 0.92rem;
  text-align: center;
}
.cem-price-note {
  font-size: 0.84rem;
  color: var(--ink-3);
  margin: 12px 0 0;
}

/* ============================================================
   LISTINGS  -- plots for sale (real data, no seller email)
   ============================================================ */
.cem-listings {
  margin-top: var(--space-7);
}
.cem-listings h2 {
  font-size: 1.7rem;
}
.cem-listings__intro {
  color: var(--ink-2);
  max-width: 66ch;
  margin-bottom: var(--space-5);
}
.listing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
.listing {
  background: var(--white);
  border: 1px solid var(--line-cool);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition:
    box-shadow var(--dur-2) var(--ease-out),
    transform var(--dur-2) var(--ease-out);
}
.listing:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}
.listing__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.listing__type {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-700);
}
.listing__title {
  font-family: var(--font-serif);
  font-size: 1.02rem;
  color: var(--blue-900);
  line-height: 1.34;
  margin: 0;
  flex: 1;
}
.listing__price {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.32rem;
  color: var(--blue-700);
}
.listing__price--ask {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-3);
}
.listing__cta {
  margin-top: auto;
}
.listing-disclaimer {
  font-size: 0.82rem;
  color: var(--ink-3);
  margin-top: var(--space-4);
}

/* ============================================================
   INQUIRY  -- native form (replaces mailto)
   ============================================================ */
.cem-inquiry {
  margin-top: var(--space-8);
}
.cem-inquiry__grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: var(--space-7);
  align-items: start;
}
.cem-inquiry__copy h2 {
  font-size: 1.7rem;
}
.cem-inquiry__copy p {
  color: var(--ink-2);
  max-width: 50ch;
}
.cem-inquiry__points {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
}
.cem-inquiry__points li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
  color: var(--ink-2);
  font-size: 0.96rem;
}
.cem-inquiry__points li::before {
  content: "\2713";
  color: var(--blue-600);
  font-weight: 700;
  flex: 0 0 auto;
}
/* honeypot: visually + accessibly hidden but present in the DOM */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- error / not found ---- */
.cem-notfound {
  text-align: center;
  padding: var(--space-9) 0;
}
.cem-notfound .cem-cta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  margin-top: var(--space-5);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .cem-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  .cem-summary {
    position: static;
  }
  .cem-inquiry__grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
  .listing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .cem-hero {
    min-height: 420px;
  }
  .cem-hero__inner {
    padding: var(--space-7) 20px var(--space-6);
  }
  .cem-hero__facts {
    gap: var(--space-5);
  }
  .listing-grid {
    grid-template-columns: 1fr;
  }
  .cem-map {
    height: 280px;
  }
}

/* Listing photo (original plot photo from the old site, or pool placeholder)
   + the every-card image disclaimer (client review 2026-06-10). */
.listing__photo {
  aspect-ratio: 16 / 9;
  margin: calc(var(--space-5) * -1) calc(var(--space-5) * -1) 0;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--blue-50);
}
.listing__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.listing__img-note {
  font-size: 0.74rem;
  color: var(--ink-3);
  margin: 0;
  line-height: 1.35;
}

/* Seller's own plot description (from the original listing). Clamped so long
   write-ups don't blow up the card; the inquiry carries the full context. */
.listing__desc {
  font-size: 0.88rem;
  color: var(--ink-2, var(--ink-3));
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
