/* ================================
   global.css v3.4 — added tombstone styling card
   ================================ */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;600&family=Work+Sans:wght@400;500;700&display=swap');

/* ============ Design tokens ============ */
:root{
  /* colors */
  --bg:        #f9f7f3;
  --ink:       #000000;
  --muted:     #6b6b6b;
  --line:      rgba(0,0,0,.12);
  --soft:      #f5f1df;     /* tinted surfaces (cards) */
  --card:      #ffffff;
  --accent:    #A1A37A;

  /* spacing (8pt-ish) */
  --s-1: 4px;  --s0: 8px;  --s1: 12px; --s2: 16px; --s3: 20px;
  --s4: 24px;  --s5: 32px; --s6: 40px; --s7: 56px;

  /* radii / shadow */
  --r-sm: 3px; --r-md: 5px; --r-lg: 8px; --r-xl: 12px;
  --shadow-1: 0 1px 0 rgba(0,0,0,.06);

  /* type */
  --fs-title: clamp(28px, 3vw, 42px);
  --fs-body:  16px;
  --fs-small: 14px;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* layout */
  --maxw: 800px;
}

/* ============ Base / reset-ish ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow-x: hidden; }
html, body {
  font-family: 'Work Sans', sans-serif;
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: #333;
  background: var(--bg);
}

/* Headings */
h1, h2, h3 { font-family: 'Lexend', sans-serif; font-weight: 600; }
h1{ font-size: var(--fs-title); letter-spacing: .01em; margin: var(--s6) 0 var(--s4); }
h2{ font-size: 22px; margin: var(--s5) 0 var(--s2); }

/* Typography utils */
p.muted{ color: var(--muted); }
.mono{ font-family: var(--font-mono); }

/* Links */
a{ color: inherit; text-underline-offset: 3px; }
a:hover{ text-decoration: none; }

/* Layout wrapper */
.page { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }

/* Site logo + title */
.site-logo-wrap { text-align: center; margin: 1.5rem auto; }
.site-logo { display: block; max-width: 250px; height: auto; margin: 0 auto; }
.site-title {
  font-family: 'Lexend', sans-serif; font-size: 2rem; font-weight: 700;
  margin-top: 0.5rem; color: #000; letter-spacing: 0.05em;
}
/* Center the main site title everywhere */
.site-title, h1.site-title {
  text-align: center; display: block; margin-left: auto; margin-right: auto;
}
@media (max-width: 600px){
  .site-logo { max-width: 140px; }
  .site-title { font-size: 1.5rem; }
}

/* Header / nav */
nav.top-menu {
  position: relative;
  left: 0;
  transform: none;
  width: 100%;
  background: #fff;
  padding: 0.5rem 0;
  margin-bottom: 1.5rem;
  box-sizing: border-box;
  z-index: 10;
}
nav.top-menu ul {
  list-style: none; display: flex; justify-content: center; align-items: center; gap: var(--s3);
}
nav.top-menu li { display: flex; align-items: center; }
nav.top-menu a {
  color: var(--ink); text-decoration: none; font-size: 15px; display: flex; align-items: center;
  line-height: 1; padding: 2px 0; font-weight: 300;
}
nav.top-menu a:hover { text-decoration: underline; }
nav.top-menu .nav-icon { width: 25px; height: 25px; display:block; margin-right: 8px; object-fit: contain; }

/* Utilities */
.icon-img{ width: 25px; height: 25px; object-fit: contain; display:inline-block; }
.stack > * + *{ margin-top: var(--s2); }
.center{ text-align: center; }
img { max-width: 100%; height: auto; }

/* Divider */
hr {
  border: none; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  margin: var(--s4) 0;
}

/* Inputs */
.hidden-file { position: fixed; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Generic card */
.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s4);
  box-shadow: var(--shadow-1);
}
.card.soft{ background: var(--soft); }

/* Buttons */
.button, .btn{
  display:inline-flex; align-items:center; justify-content:center;
  height: 42px; padding: 0 var(--s3);
  border-radius: 4px; border: 0;
  background: transparent; color: var(--ink);
  font-weight: 500; cursor:pointer;
}
.button:hover, .btn:hover{ background: rgba(0,0,0,.04); }
.btn.primary{ background: var(--ink); color:#fff; }
.btn.primary:hover{ filter: brightness(.96); }

/* Footer */
footer {
  margin-top: var(--s5);
  padding: var(--s3) 0 var(--s4);
  border-top: 1px solid var(--line);
  color: var(--muted);
}
footer p { font-size: var(--fs-small); text-align:center; }
footer .legal { font-size: 0.8em; opacity: 0.7; margin-top: 0.5em; }

/* reCAPTCHA badge (legal notice is in footer) */
.grecaptcha-badge { visibility: hidden; }

/* Floating-label container style (shared aesthetic) */
.labeled-container {
  position: relative;
  border: 1px solid #999;
  border-radius: 10px;
  padding: 1.5rem;
  margin: 2rem 0;
  background: transparent;
}
.labeled-container .label {
  position: absolute; top: -0.7em; left: 1rem;
  background: var(--bg);
  padding: 0 0.5rem;
  font-size: 0.85rem; font-weight: 400; color: #999;
}

/* Hero stats */
.dg-hero-stat {
  display: flex; gap: .75rem; align-items: baseline; justify-content: center; flex-wrap: wrap;
  margin: 1rem auto 1.5rem;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
}
.dg-hero-stat .tagline { opacity: .85; }
.dg-hero-stat .counts { font-weight: 700; letter-spacing: .01em; }
.dg-hero-stat .sep { opacity: .4; margin: 0 .5rem; }
#dg-buried-count, #dg-cremated-count { font-variant-numeric: tabular-nums; }

/* ===== Burial Record card (fieldset + legend) ===== */
.dg-list { display: grid; gap: 14px; }

.dg-record{
  /* fieldset shell */
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--card);             /* filled card */
  padding: 18px;
  margin: 10px 0 18px;
  min-width: 0;
}

/* Legend: full card fill, border ONLY on the top half */
.dg-record > legend.dg-record__legend{
  position: relative;
  display: inline-block;
  padding: 0 8px;
  margin-left: 12px;
  background: var(--card);      /* same fill as the container */
  color: var(--muted);
  font-style: italic;
  font-size: 0.95rem;
  border: 0;
  line-height: 1.1;
}
.dg-record > legend.dg-record__legend::after{
  content: "";
  position: absolute;
  left: -6px;                   /* align to fieldset border */
  right: -6px;
  top: -6px;                    /* sit on the fieldset border */
  height: 58%;                  /* height of the outlined portion */
  border: 1px solid var(--line);
  border-bottom: 0;             /* no bottom border */
  border-radius: 4px 4px 0 0;
  pointer-events: none;
  background: transparent;
}

/* Grid layout: name+actions, epitaph, premium+meta */
.dg-record__layout{
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "name actions"
    "eulogy actions"
    "premium meta";
  gap: 12px 22px;
}
.dg-record__head{ grid-area: name; }
.dg-record__name{ margin: 6px 0 4px; font-weight: 700; }
.dg-record__epitaph{ grid-area: eulogy; margin: 0; font-style: italic; color: var(--muted); }
.dg-record__premium{ grid-area: premium; display: flex; gap: 12px; align-items: center; }
.dg-record__meta{ grid-area: meta; color: var(--muted); text-align: right; }

/* Actions: right-aligned, wrap left when crowded */
.dg-actions{
  grid-area: actions;
  display: flex; gap: 10px; align-items: center;
  justify-content: flex-end; justify-self: end;
  flex-wrap: wrap; row-gap: 8px;
}

/* Icon buttons */
.dg-btn{
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 999px; background: transparent;
  cursor: pointer;
}
.dg-btn img{ width: 22px; height: 22px; }
.dg-btn:focus{ outline: 2px solid #0aa; outline-offset: 2px; }
.dg-btn.is-playing{ background: rgba(0,0,0,.04); }
.dg-premium-icon{ width: 34px; height: 34px; object-fit: contain; }

/* Responsive */
@media (max-width: 640px){
  .dg-record__layout{
    grid-template-columns: 1fr;
    grid-template-areas:
      "name"
      "actions"
      "eulogy"
      "premium"
      "meta";
  }
  .dg-record__meta{ text-align: left; }
  .dg-actions{ width: 100%; }
}

/* Pagination (top & bottom) */
#paginationControls,
#paginationControlsBottom{
  display:flex; justify-content:center; align-items:center; gap:8px; flex-wrap:wrap; margin:14px 0;
}
.page-btn{
  min-width:42px; height:42px; border-radius:4px;
  border:1px solid var(--line); background:#fff;
  display:inline-grid; place-items:center; font-weight:600;
  margin: 0 4px; cursor:pointer;
}
.page-btn.active{ background: var(--soft); border-color: #000; }

/* Tap highlight removal for icon buttons */
.play-icon, .icon-img { outline: none; -webkit-tap-highlight-color: transparent; }

/* ===== Tombstone card ===== */
.ts-card{
  background: var(--soft);
  border: 1.5px solid rgba(0,0,0,.35);
  border-radius: 36px 36px 10px 10px;    /* mega round top corners, small bottom */
  padding: clamp(16px, 4vw, 48px);
  text-align: center;
  box-shadow: 0 1px 0 rgba(0,0,0,.06) inset;
  max-width: 900px;
  margin: 0 auto;
  /* gentle “stone” shade on top */
  background-image: linear-gradient(180deg, rgba(0,0,0,.035), rgba(0,0,0,0) 40%);
  background-blend-mode: multiply;
}
.ts-title{ font-size: clamp(18px, 2.3vw, 28px); color: var(--muted); margin-bottom: .6em; }
.ts-name{ font-weight: 700; font-size: clamp(26px, 4vw, 42px); letter-spacing: .01em; }
.ts-epitaph{ font-style: italic; color: var(--muted); margin-top: .9em; }
.ts-dates{
  margin-top: .6em;
  font-size: clamp(16px, 2vw, 22px);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.ts-dates .sep{ opacity: .6; margin: 0 .35em; }

/* Actions under the stone */
.ts-actions{ text-align: center; margin: 1.25rem 0 0; }
.ts-actions .btn{ border: 1px solid var(--ink); padding: 0 .9rem; height: 38px; }
.ts-actions .btn.primary{ background: var(--ink); color:#fff; }

/* optional link under actions */
.ts-link-under{
  display:block; text-align:center; margin-top: .9rem;
  text-decoration: underline; text-underline-offset: 3px;
}

/* Small helper: hide remains button for burials via data-attr (defense in depth) */
.ts-card[data-method="bury"] .js-remains { display: none !important; }

/* Restore list spacing inside labeled containers */
.labeled-container ul,
.labeled-container ol {
  margin-left: 1.1rem;   /* shift list body right */
  padding-left: 1.1rem;  /* space for bullets/numbers */
  list-style-position: outside;
}

.labeled-container li + li {
  margin-top: .35rem;    /* nice vertical rhythm */
}

