:root {
  --white: #ffffff;
  --cream: #e0e0db;
  --cream-deep: #d4d4c8;
  --navy: #253351;
  --navy-deep: #1a2439;
  --ink: #2a2829;
  --gold: #fbb204;
  --gold-dark: #c78a03;
  --purple: #3027a3;
  --mist: #f4faf4;
  --muted: #5c5e66;
  --card: #ffffff;
  --line: rgba(37, 51, 81, 0.12);
  --shadow: 0 10px 28px rgba(26, 36, 57, 0.1);
  --radius: 16px;
  --header-h: 88px;
  --max: 1120px;
  --page-hero: var(--navy);
  --page-hero-text: var(--mist);
  --page-accent: var(--gold);
  --page-surface: #f6f6f1;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  background: var(--gold);
  color: var(--navy-deep);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
}
.skip-link:focus {
  top: 12px;
  color: var(--navy-deep);
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

body {
  margin: 0;
  font-family: "Poppins", system-ui, sans-serif;
  color: var(--ink);
  background: var(--page-surface);
  line-height: 1.6;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--gold-dark); }

.wrap {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

/* Page themes; match each original section palette */
.theme-home { --page-hero: #253351; --page-surface: #f3f3ec; --page-accent: #fbb204; }
.theme-web { --page-hero: #1f3a5f; --page-surface: #eef2f6; --page-accent: #fbb204; }
.theme-video { --page-hero: #17141f; --page-surface: #efeae3; --page-accent: #fbb204; }
.theme-voice { --page-hero: #2a2829; --page-surface: #f4efe6; --page-accent: #fbb204; }
.theme-social { --page-hero: #3027a3; --page-surface: #f3f1fb; --page-accent: #fbb204; }
.theme-about { --page-hero: #253351; --page-surface: #f1f0ea; --page-accent: #fbb204; }
.theme-blog { --page-hero: #253351; --page-surface: #f7f4ee; --page-accent: #fbb204; }
.theme-contact { --page-hero: #1a2439; --page-surface: #f4f1ea; --page-accent: #fbb204; }
.theme-links { --page-hero: #253351; --page-surface: #eef1f5; --page-accent: #fbb204; }
.theme-quote { --page-hero: #c78a03; --page-hero-text: #1a2439; --page-surface: #fff8e8; --page-accent: #253351; }
.theme-funeral { --page-hero: #2a2829; --page-surface: #f3efe8; --page-accent: #fbb204; }
.theme-podcast { --page-hero: #17141f; --page-surface: #f4f0e8; --page-accent: #fbb204; }
.theme-privacy { --page-hero: #253351; --page-surface: #f5f5f0; --page-accent: #fbb204; }
.theme-testimonials { --page-hero: #3027a3; --page-surface: #f6f4ff; --page-accent: #fbb204; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: calc(var(--header-h) + 3px);
  background: var(--navy-deep);
  color: var(--mist);
  border-bottom: 3px solid var(--gold);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--mist);
  flex-shrink: 0;
}
.brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}
.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-name strong {
  font-size: 1.12rem;
  letter-spacing: 0.02em;
}
.brand-name span {
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 500;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a,
.nav-drop > button {
  color: var(--mist);
  background: none;
  border: 0;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 12px 14px;
  cursor: pointer;
  border-radius: 8px;
}
.nav a:hover,
.nav-drop > button:hover,
.nav a.is-active {
  color: var(--gold);
}

.nav-drop { position: relative; }
.nav-drop-menu {
  display: none;
  position: absolute;
  top: calc(100% - 4px);
  left: 0;
  min-width: 220px;
  background: var(--white);
  color: var(--navy);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px;
  border: 1px solid var(--line);
}
.nav-drop:hover .nav-drop-menu,
.nav-drop:focus-within .nav-drop-menu { display: grid; }
.nav-drop-menu a {
  color: var(--navy);
  padding: 10px 12px;
}
.nav-drop-menu a:hover { background: var(--cream); color: var(--purple); }

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(251, 178, 4, 0.4);
  background: transparent;
  color: var(--gold);
  border-radius: 8px;
  font-size: 1.3rem;
  cursor: pointer;
}

/* Hero */
.hero {
  background: linear-gradient(160deg, var(--page-hero) 0%, var(--navy-deep) 100%);
  color: var(--page-hero-text);
  padding: 56px 0 48px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 8px;
  background: var(--gold);
}
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.15;
  max-width: 18ch;
}
.hero p {
  margin: 0;
  max-width: 58ch;
  color: rgba(244, 250, 244, 0.88);
  font-size: 1.05rem;
}
.theme-quote .hero p { color: var(--navy-deep); }
.hero-kicker {
  display: inline-block;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
  margin-bottom: 10px;
}

.section {
  padding: 48px 0;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 22px;
}
.section-head h2 {
  margin: 0;
  font-size: 1.55rem;
  color: var(--navy);
}
.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
  max-width: 60ch;
}

.alt {
  background: var(--cream);
}
.navy-band {
  background: var(--navy);
  color: var(--mist);
}
.navy-band h2,
.navy-band p { color: inherit; }
.navy-band .card { color: var(--ink); }

/* Cards */
.grid {
  display: grid;
  gap: 18px;
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stack-feature {
  display: grid;
  gap: 18px;
  justify-items: center;
}
.stack-feature > .card {
  width: min(640px, 100%);
}
.stack-feature .pair {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.stack-feature .pair .card {
  width: auto;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.card-accent { border-top: 4px solid var(--page-accent); }
.card-media {
  height: 160px;
  overflow: hidden;
  background: var(--navy);
  flex-shrink: 0;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-media.focus-upper img {
  object-position: center 18%;
}
.card-media.focus-top img {
  object-position: center top;
}
.card-media.show-full {
  height: auto;
  aspect-ratio: 1200 / 685;
  background: #1a2439;
}
.card-media.show-full img {
  object-fit: contain;
  object-position: center;
}
.card-media.portrait-fit {
  height: 160px;
  background: #f4efe6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-media.portrait-fit img {
  width: auto !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}
.voice-pics .card-media,
.voice-pics .card-media.portrait-fit {
  height: 240px;
}
.card-media.logo-fit {
  background: #f6f3ee;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-media.logo-fit img {
  width: auto;
  height: 78%;
  max-width: 72%;
  object-fit: contain;
}
.card-media.obits-lockup {
  height: auto;
  min-height: 0;
  max-height: none;
  padding: 18px 20px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: flex-start;
}
.card-media.obits-lockup img {
  width: 72px;
  height: 72px;
  max-width: 72px;
  object-fit: contain;
  flex-shrink: 0;
}
.obits-lockup .obits-name {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.4rem, 3.2vw, 1.95rem);
  letter-spacing: 0.04em;
  color: #1b365d;
  font-weight: 700;
  line-height: 1.1;
}
.obits-lockup .obits-tag {
  margin: 6px 0 0;
  font-size: clamp(0.92rem, 1.8vw, 1.08rem);
  color: #4a5568;
  font-weight: 500;
  line-height: 1.3;
}
.card-body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.card-body h3 {
  margin: 0;
  font-size: 1.12rem;
  color: var(--navy);
  line-height: 1.3;
}
.card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.card-meta {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold-dark);
}
.price {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy);
  margin-top: auto;
}
.price small {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

.quote-card {
  padding: 22px;
}
.quote-card blockquote {
  margin: 0 0 12px;
  font-size: 0.98rem;
  color: var(--navy);
}
.quote-card cite {
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold-dark);
}

.faq-card details {
  padding: 4px 2px;
}
.faq-card summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--navy);
}
.faq-card details p {
  margin: 8px 0 0;
}

/* Media constraints; never full-bleed giant images */
.media-box {
  max-width: 640px;
  margin: 0 auto;
}
.media-box img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 12px;
}
.embed {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.logo-lockup {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

/* Buttons */
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 2px solid transparent;
}
.btn-gold {
  background: var(--gold);
  color: var(--navy-deep);
}
.btn-gold:hover { background: #ffc533; color: var(--navy-deep); }
.btn-ghost {
  border-color: var(--gold);
  color: var(--gold);
}
.btn-ghost:hover { background: rgba(251, 178, 4, 0.12); color: var(--gold); }
.btn-navy {
  background: var(--navy);
  color: var(--mist);
}
.btn-navy:hover { background: var(--purple); color: #fff; }
.card .btn { margin-top: auto; align-self: flex-start; }

/* Forms */
form {
  display: grid;
  gap: 12px;
}
label {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
}
input, textarea, select {
  font: inherit;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}
textarea { min-height: 120px; resize: vertical; }
.form-note {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

/* Footer */
.site-footer {
  background: var(--navy-deep);
  color: var(--mist);
  padding: 40px 0 24px;
  margin-top: 20px;
  border-top: 4px solid var(--gold);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 24px;
}
.site-footer h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: var(--gold);
}
.site-footer a { color: var(--mist); }
.site-footer a:hover { color: var(--gold); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.legal {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 0.8rem;
  color: rgba(244,250,244,0.7);
}

.pill {
  display: inline-block;
  background: rgba(251, 178, 4, 0.18);
  color: var(--gold-dark);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.list-plain {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}
.list-plain li { margin: 4px 0; }

.prose {
  max-width: 70ch;
}
.prose p { color: var(--muted); }
.prose h2 { color: var(--navy); }

.article-card .card-media { height: 140px; }

.notice {
  background: #fff8e1;
  border: 1px solid rgba(251, 178, 4, 0.45);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.92rem;
}

@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav {
    display: none;
    position: absolute;
    inset: var(--header-h) 12px auto;
    background: var(--navy);
    border: 1px solid rgba(251, 178, 4, 0.35);
    border-radius: 12px;
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
  }
  .nav.open { display: flex; }
  .nav-drop-menu {
    position: static;
    display: grid;
    background: transparent;
    box-shadow: none;
    border: 0;
    padding: 0 0 0 10px;
  }
  .nav-drop-menu a { color: var(--mist); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stack-feature .pair { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: start; }
  .hero { padding: 36px 0 32px; }
  .card-media { height: 150px; }
}

@media (max-width: 520px) {
  .wrap { width: min(var(--max), calc(100% - 24px)); }
  .brand-name strong { font-size: 0.95rem; }
  .brand-name span { font-size: 0.7rem; }
  .footer-grid { grid-template-columns: 1fr; }
}
