/* McNally's Funeral Directors - one stylesheet for every page.
   Colours come from the logo (aubergine and gold) and the stone building. */

@font-face {
  font-family: "Lora"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/fonts/lora-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2");
}

:root {
  --bg: #f7f3ec;
  --surface: #ffffff;
  --text: #2e2a33;
  --muted: #6b6470;
  --brand: #46305a;
  --brand-dark: #33223f;
  --gold: #b08d3c;
  --gold-soft: #efe5cf;
  --line: #e4dccf;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.7 var(--sans);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; color: var(--brand-dark); margin: 0 0 0.5em; }
h1 { font-size: clamp(34px, 5.5vw, 54px); }
h2 { font-size: clamp(27px, 3.6vw, 36px); }
h3 { font-size: 22px; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* Header */
.topbar { background: var(--brand-dark); color: #f1eaf6; font-size: 14px; }
.topbar .wrap { display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: space-between; padding-top: 7px; padding-bottom: 7px; }
.topbar a { color: #fff; font-weight: 600; text-decoration: none; }
header.site { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
header.site .wrap { display: flex; align-items: center; gap: 16px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--brand-dark); margin-right: auto; }
.brand img { width: 46px; height: 46px; }
.brand span { font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.1; }
.brand small { display: block; font-family: var(--sans); font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
nav.main { display: flex; gap: 4px; }
nav.main a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--text); font-weight: 500; font-size: 16px; }
nav.main a:hover { background: var(--bg); }
nav.main a[aria-current="page"] { color: var(--brand); box-shadow: inset 0 -2px 0 var(--gold); border-radius: 0; }
.menu-toggle { display: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 24px; border-radius: 999px;
  background: var(--brand); color: #fff; font-weight: 600; text-decoration: none;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--brand-dark); }
.btn.light { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); }
.btn.light:hover { background: var(--brand); color: #fff; }
.btn svg { width: 20px; height: 20px; }

/* Page sections */
.hero { position: relative; color: #fff; background: var(--brand-dark); }
.hero img { width: 100%; height: clamp(360px, 62vh, 560px); object-fit: cover; opacity: 0.42; }
.hero .text { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; }
.hero h1 { color: #fff; max-width: 16em; }
.hero .kicker { color: var(--gold-soft); text-transform: uppercase; letter-spacing: 0.14em; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.hero p { font-size: 19px; max-width: 34em; margin: 0 auto 24px; color: #f3eef7; }
.hero .btn { background: var(--gold); }
.hero .btn:hover { background: #9a7a31; }
.page-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 56px 0 44px; text-align: center; }
.page-head p { color: var(--muted); font-size: 19px; max-width: 36em; margin: 0 auto; }
section { padding: 64px 0; }
section.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: 0.14em; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.center { text-align: center; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.split img { border-radius: 14px; box-shadow: 0 10px 30px rgba(46, 42, 51, 0.12); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; margin-top: 28px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 26px; }
.card h3 { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }
.ticks { list-style: none; padding: 0; margin: 0 0 1em; }
.ticks li { position: relative; padding-left: 28px; margin: 6px 0; }
.ticks li::before { content: ""; position: absolute; left: 4px; top: 0.62em; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.ticks.cols { columns: 2; column-gap: 28px; }
.places { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; list-style: none; padding: 0; margin: 22px 0; }
.places li { background: var(--gold-soft); color: var(--brand-dark); border-radius: 999px; padding: 6px 16px; font-weight: 500; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; margin-top: 28px; }
.gallery figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.gallery img { margin: 0 auto 8px; aspect-ratio: 4 / 3; object-fit: contain; }
.gallery figcaption { font-weight: 600; font-size: 15px; color: var(--brand-dark); }
.photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 28px; }
.photos img { border-radius: 12px; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; }
.contact-grid .card { text-align: center; }
.contact-grid .big { font-family: var(--serif); font-size: 26px; color: var(--brand); text-decoration: none; font-weight: 600; }
.map { width: 100%; height: 380px; border: 0; border-radius: 14px; margin-top: 28px; }
.cta { background: var(--brand); color: #fff; text-align: center; }
.cta h2 { color: #fff; }
.cta p { color: #efe6f5; }
.cta .btn { background: var(--gold); }
.cta .btn:hover { background: #9a7a31; }

/* Footer */
footer.site { background: var(--brand-dark); color: #d9cfe2; font-size: 15px; padding: 44px 0 28px; }
footer.site .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 26px; }
footer.site h3 { color: #fff; font-size: 18px; }
footer.site a { color: #fff; }
footer.site .legal { border-top: 1px solid rgba(255, 255, 255, 0.15); margin-top: 28px; padding-top: 18px; font-size: 13px; color: #b9aec4; }

/* Phones */
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; gap: 28px; }
  .ticks.cols { columns: 1; }
  section { padding: 48px 0; }
  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text);
  }
  nav.main { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 20px 16px; }
  nav.main.open { display: flex; }
  nav.main a[aria-current="page"] { box-shadow: none; background: var(--bg); border-radius: 8px; }
  header.site .wrap { position: relative; }
  .brand span { font-size: 19px; }
  .menu-toggle { font-size: 22px; }
  nav.main a { padding: 11px 12px; }
  /* Two coffins per row, so tapping one shows a genuinely bigger photo. */
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .gallery figure { padding: 8px; }
  .gallery figcaption { font-size: 14px; line-height: 1.3; }
  dialog.viewer button { min-height: 44px; }
  dialog.viewer figure { padding: 12px 10px 10px; }
  .topbar { font-size: 13px; }
  .topbar .wrap { justify-content: center; text-align: center; gap: 0 14px; padding-top: 5px; padding-bottom: 5px; }
}
.contact-grid .big { display: inline-block; padding: 6px 0; min-height: 44px; }

/* Coffin photo pop-up (coffins page) */
.gallery figure { cursor: zoom-in; transition: box-shadow 0.15s ease, transform 0.15s ease; }
.gallery figure:hover { box-shadow: 0 8px 22px rgba(46, 42, 51, 0.14); transform: translateY(-2px); }
dialog.viewer { border: 0; padding: 0; background: transparent; max-width: min(1100px, 94vw); width: 100%; }
dialog.viewer::backdrop { background: rgba(28, 20, 35, 0.86); }
dialog.viewer figure { margin: 0; background: #fff; border-radius: 16px; padding: 18px 18px 14px; text-align: center; }
dialog.viewer img { width: 100%; max-height: 74vh; object-fit: contain; margin: 0 auto; }
dialog.viewer figcaption { font-family: var(--serif); font-size: 24px; color: var(--brand-dark); margin-top: 8px; }
dialog.viewer .controls { display: flex; justify-content: center; gap: 12px; margin-top: 14px; }
dialog.viewer button {
  border: 0; border-radius: 999px; padding: 10px 20px; font: 600 16px var(--sans); cursor: pointer;
  background: var(--gold-soft); color: var(--brand-dark);
}
dialog.viewer button:hover { background: var(--gold); color: #fff; }
