/* ==========================================================================
   W. Smith & Sons — site stylesheet
   Fonts and colours carried over from the previous (WordPress/Avada) site.
   ========================================================================== */

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: "Questrial";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/questrial-400.woff2") format("woff2");
}
@font-face {
  font-family: "Oxygen";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/oxygen-400.woff2") format("woff2");
}
@font-face {
  font-family: "Oxygen";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/oxygen-700.woff2") format("woff2");
}
@font-face {
  font-family: "Maven Pro";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/maven-pro.woff2") format("woff2");
}

/* ---------- Design tokens ---------- */
:root {
  --red: #9b0a1b;            /* brand red: headings, bars, buttons */
  --red-dark: #7d0816;
  --red-tint-10: rgba(155, 10, 27, 0.1);
  --red-tint-15: rgba(155, 10, 27, 0.15);
  --white: #ffffff;
  --grey-light: #dad9d7;     /* page grey / separators */
  --grey-mid: #9490a0;
  --gold: #b68b52;           /* link hover */
  --navy: #03264e;
  --ink: #333333;            /* body text */
  --ink-soft: #4a4e57;
  --black: #000000;

  --font-heading: "Questrial", Arial, Helvetica, sans-serif;
  --font-body: "Oxygen", Arial, Helvetica, sans-serif;
  --font-card: "Maven Pro", Arial, Helvetica, sans-serif;

  --site-width: 1200px;
  --gutter: 30px;
  --shadow-card: 0 10px 20px 0 rgba(15, 15, 15, 0.15);
  --shadow-menu: 3px 3px 28px 4px rgba(0, 0, 0, 0.1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 1px;
}

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

a { color: var(--ink); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold); }
.prose a { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  color: var(--red);
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -1px;
}
h1 { font-size: clamp(44px, 5.6vw, 80px); }
h2 { font-size: clamp(34px, 3.8vw, 54px); }
h3 { font-size: clamp(27px, 2.6vw, 36px); }
h4 { font-size: 24px; }
h5 { font-size: 20px; }
h6 { font-size: 16px; }

p { margin: 0 0 20px; }
ul, ol { margin: 0 0 20px; padding-left: 40px; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--white); color: var(--red); padding: 10px 16px;
}
.skip-link:focus { left: 10px; top: 10px; }

.container {
  width: 100%;
  max-width: calc(var(--site-width) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { padding: 3% 0; }
.section--top { padding-top: 6%; }
.section > .container > :last-child,
.prose > :last-child { margin-bottom: 0; }

.prose h2, .prose h3 { margin-bottom: 20px; }
.prose h2 { margin-bottom: 30px; }
.prose p + h2, .prose p + h3, .prose ul + h3 { margin-top: 10px; }

/* Layout grids */
.grid { display: grid; gap: 40px 4%; }
.grid--1-2 { grid-template-columns: 1fr 2fr; }
.grid--2-1 { grid-template-columns: 2fr 1fr; }
.grid--halves { grid-template-columns: 1fr 1fr; }

/* Visibility helpers (mirror the old site's device-specific blocks) */
.only-small { display: none; }
.not-large { display: none; }

/* ---------- Buttons ---------- */
.button {
  display: inline-block;
  padding: 13px 29px;
  border: 0;
  border-radius: 4px;
  background: var(--red);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  line-height: 17px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: background 0.2s;
}
.button:hover { background: var(--red-dark); color: var(--white); }
.button--block { display: block; width: 100%; padding: 17px 29px; font-size: 16px; letter-spacing: 1px; }

/* ==========================================================================
   Header
   ========================================================================== */
.topbar { background: var(--red); }
.topbar ul {
  display: flex; justify-content: flex-end; flex-wrap: wrap;
  margin: 0; padding: 0; list-style: none;
}
.topbar a {
  display: block; padding: 20px 12px; color: var(--white);
}
.topbar li:last-child a { padding-right: 0; }
.topbar a:hover { color: var(--grey-light); }

.masthead { position: relative; padding: 10px 0; background: var(--white); }
.masthead__inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.logo img { width: 300px; height: 200px; object-fit: contain; }
.notice {
  margin: 0; padding: 6px 0;
  color: var(--red);
  font-family: var(--font-heading);
  font-size: 20px; line-height: 1.1; letter-spacing: -1px;
}

.notice a { color: inherit; }
.notice a:hover { color: var(--red-dark); text-decoration: underline; }

/* Main navigation: a visible row on desktop, a toggled list on tablet and mobile */
.nav-toggle { display: none; }
.site-nav { margin-top: 10px; border-top: 1px solid var(--grey-light); }
.site-nav ul {
  display: flex; flex-wrap: wrap; justify-content: center;
  margin: 0; padding: 0; list-style: none;
}
.site-nav a {
  display: block; padding: 16px 13px 10px;
  color: var(--red);
  font-family: var(--font-heading); font-size: 19px; line-height: 1.1; letter-spacing: -0.5px;
  border-bottom: 3px solid transparent;
}
.site-nav a:hover { color: var(--red-dark); border-bottom-color: var(--grey-light); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--red); }

/* ==========================================================================
   Home
   ========================================================================== */
.hero {
  padding: 7vw 0;
  background:
    linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
    url("../images/hero.jpg") center / cover no-repeat;
  color: var(--white);
}
.hero__intro { text-align: center; margin-bottom: 30px; }
.hero__intro h1, .hero__intro .hero__lead { color: var(--white); }
.hero__lead {
  margin: 0;
  font-family: var(--font-heading); font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.1; letter-spacing: -1px;
}
.hero__intro h1 { margin-bottom: 0.2em; }
.hero__intro p:last-child { margin: 0 0 20px; }
.hero__cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 60px; }
.hero__card {
  padding: 40px; border-radius: 12px;
  background: var(--white); color: var(--ink);
}
.hero__card h2 { font-size: clamp(27px, 2.6vw, 36px); margin-bottom: 20px; }
.hero__card p:last-child { margin-bottom: 0; }

.story h2 { padding-top: 3%; margin-bottom: 30px; }
.story p { color: var(--navy); }

.cards { padding: 3% 0 1%; }
.cards__row { display: flex; flex-wrap: wrap; justify-content: center; }
.card {
  display: block; width: 33.333%; padding: 20px 24px;
  color: var(--ink); text-align: center;
}
.card:hover { color: var(--ink); }
.card__image {
  width: 100%; aspect-ratio: 368 / 221; object-fit: cover; border-radius: 8px;
  transition: filter 0.3s;
}
.card:hover .card__image { filter: brightness(0.9); }
.card__body {
  position: relative; margin: -80px 25px 0; padding: 25px 35px;
  background: var(--white); box-shadow: var(--shadow-card);
  transition: transform 0.3s;
}
.card:hover .card__body { transform: translateY(-4px); }
.card__title {
  margin-bottom: 20px;
  font-family: var(--font-card); font-size: 28px; font-weight: 700; line-height: 1.2;
  letter-spacing: -0.035em; text-transform: capitalize; color: var(--red);
}
.card__body p { margin: 0; }
.card__body hr {
  margin: 20px 0; border: 0; border-top: 1px dotted var(--grey-light);
}
.card__more { font-size: 13px; }

/* ==========================================================================
   Inner pages
   ========================================================================== */
.side-image {
  min-height: 320px; border-radius: 0;
  background-position: center; background-size: cover; background-repeat: no-repeat;
}

/* Funeral choices */
.dropcap {
  float: left; margin: 0.05em 0.1em 0 0;
  color: var(--red); font-size: 3.4em; line-height: 0.85; letter-spacing: 0;
}
.split { display: grid; grid-template-columns: 1fr 1fr; }
.split > div { padding: 0 2% 0 0; }
.split > div + div { padding: 0 0 0 4%; border-left: 1px solid var(--red); }
.split h3 { margin-bottom: 24px; }

.accordions { display: grid; grid-template-columns: 1fr 1fr; gap: 0 4%; align-items: start; }
.accordion details { margin: 0; }
.accordion summary {
  display: flex; align-items: center; gap: 18px;
  padding: 19px 0 19px 15px;
  list-style: none; cursor: pointer;
  color: var(--red);
  font-family: var(--font-heading); font-size: 26px; line-height: 1.1; letter-spacing: -1px;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::before {
  content: "+"; flex: none;
  width: 22px; height: 22px; border-radius: 2px;
  background: var(--ink); color: var(--white);
  font-family: Arial, sans-serif; font-size: 18px; font-weight: 700; line-height: 21px;
  letter-spacing: 0; text-align: center;
}
.accordion details[open] > summary::before { content: "\2212"; background: var(--red); }
.accordion summary:hover { color: var(--red-dark); }
.accordion__body { padding: 10px 0 20px 55px; }

/* Donations */
.columns-2 { columns: 2; column-gap: 4%; }
.columns-2 p { break-inside: avoid-column; }
.center { text-align: center; }
.columns-2 + .center { margin-top: 30px; }
.info-boxes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px 4%; margin-top: 40px; padding: 0 20px; }
.info-boxes h3 { font-size: 20px; margin-bottom: 16px; }
.info-boxes p { margin: 0; }

/* Our services */
.pills { display: flex; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.pill-wrap { width: 33.333%; padding: 10px 20px; }
.pill {
  display: flex; align-items: center; gap: 8px;
  min-height: 56px; padding: 8px 8px 8px 24px;
  border-radius: 36px; background: var(--red); color: var(--white);
  font-size: 14px; font-weight: 700; line-height: 1.35; text-align: center;
  transition: background 0.2s;
}
.pill:hover { background: var(--red-dark); color: var(--white); }
.pill span { flex: 1; }
.pill::after {
  content: ""; flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239b0a1b' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / 18px no-repeat;
}

/* Contact */
.banner { padding: 60px 0 35px; background: var(--red); color: var(--white); }
.banner h1, .banner h2 { color: var(--white); }
.banner__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px 4%; align-items: center; }
.banner h2 { font-size: clamp(27px, 2.6vw, 36px); margin-bottom: 10px; }
.banner a { color: var(--white); }
.banner a:hover { color: var(--grey-light); }
.banner p { margin-bottom: 16px; }

.enquiry { padding: 5vw 0; background: var(--grey-light); }
.enquiry__card { display: grid; grid-template-columns: 45fr 55fr; border-radius: 9px; overflow: hidden; }
.enquiry__image { min-height: 300px; background: url("../images/church_sunrise.jpg") center / cover no-repeat; }
.enquiry__form { padding: 3vw 6vw 4vw; background: var(--white); }
.enquiry__form h2 { text-align: center; margin-bottom: 24px; }
.enquiry__form > p { text-align: center; margin-bottom: 30px; }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form__field { display: flex; flex-direction: column; }
.form__field--full { grid-column: 1 / -1; }
.form label { margin-bottom: 6px; }
.form input[type="text"], .form input[type="email"], .form input[type="tel"], .form textarea {
  width: 100%; padding: 14px 15px;
  border: 1px solid var(--grey-mid); border-radius: 6px;
  background: var(--white); color: var(--ink);
  font-family: var(--font-body); font-size: 14px; letter-spacing: 1px;
}
.form textarea { min-height: 130px; resize: vertical; }
.form input:focus, .form textarea:focus { border-color: var(--red); outline: 0; box-shadow: 0 0 0 2px var(--red-tint-15); }
.form__phone { position: relative; }
.form__phone svg { position: absolute; left: 14px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%); color: var(--ink-soft); }
.form__phone input { padding-left: 40px !important; }
.form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.alert { grid-column: 1 / -1; margin: 0; padding: 16px 20px; border-radius: 6px; text-align: center; }
.alert[hidden] { display: none; }
.alert--success { background: #e6f4ea; border: 1px solid #12b878; color: #0b6b46; }
.alert--error { background: #fbe9eb; border: 1px solid var(--red); color: var(--red); }

/* 404 */
.notfound { padding: 8% 0; text-align: center; }
.notfound h1 { margin-bottom: 20px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { padding: 3% 0; background: var(--red); color: var(--white); text-align: center; }
.site-footer__name {
  margin: 0 0 20px; color: var(--white);
  font-family: var(--font-heading); font-size: clamp(36px, 4.2vw, 60px); line-height: 1.1; letter-spacing: -1px;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--white); }
.site-footer a:hover { color: var(--grey-light); }
.site-footer__links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 26px;
  margin: 26px 0 0; padding: 22px 0 0; list-style: none;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 14px;
}
.site-footer__links a { text-decoration: underline; }

/* Call bar: phones only */
.callbar { display: none; }

.to-top {
  position: fixed; right: 30px; bottom: 0; z-index: 50;
  display: grid; place-items: center; width: 44px; height: 38px;
  border: 0; border-radius: 4px 4px 0 0; background: var(--ink); cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity 0.3s, background 0.2s;
}
.to-top.is-visible { opacity: 1; pointer-events: auto; }
.to-top:hover { background: var(--red); }
.to-top svg { width: 14px; height: 14px; }

/* ==========================================================================
   Responsive  (large > 1024px, medium 641–1024px, small <= 640px)
   ========================================================================== */
@media (max-width: 1024px) {
  .not-large { display: block; }

  .topbar ul { justify-content: center; }
  .topbar a { padding: 10px 10px; font-size: 14px; }

  /* Header: logo left, menu button right, notice beneath */
  .masthead__inner {
    display: grid; grid-template-columns: 1fr auto; align-items: center; text-align: left;
  }
  .logo img { width: 180px; height: 120px; }
  .notice { grid-column: 1 / -1; order: 3; text-align: center; font-size: 16px; }
  .nav-toggle { margin: 0; padding: 12px; }
  .nav-toggle__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
    display: block; width: 26px; height: 3px; background: var(--ink-soft); border-radius: 2px;
    transition: transform 0.2s, background 0.2s;
  }
  .nav-toggle__bars { position: relative; }
  .nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle__bars::before { top: -8px; }
  .nav-toggle__bars::after { top: 8px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(8px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-8px) rotate(-45deg); }

  /* Menu becomes a stacked list behind the menu button */
  .nav-toggle {
    display: inline-flex; align-items: center;
    border: 0; background: transparent; cursor: pointer;
  }
  .js .site-nav:not(.is-open) { display: none; }
  .site-nav { margin-top: 10px; }
  .site-nav .container { padding: 0; }
  .site-nav ul { display: block; }
  .site-nav li { border-bottom: 1px solid var(--grey-light); }
  .site-nav a {
    padding: 14px var(--gutter); border-bottom: 0;
    font-family: var(--font-body); font-size: 16px; line-height: 1.5; letter-spacing: 1px; color: var(--ink-soft);
  }
  .site-nav a[aria-current="page"] { color: var(--red); font-weight: 700; }

  .hero__cards { grid-template-columns: 1fr; gap: 30px; }
  .card { width: 50%; }
  .grid--1-2, .grid--2-1, .grid--halves { grid-template-columns: 1fr; }
  .accordions { grid-template-columns: 1fr; }
  .info-boxes { grid-template-columns: 1fr 1fr; }
  .pill-wrap { width: 50%; }
  .banner { padding: 48px 0; }
  .banner__grid { grid-template-columns: 1fr; }
  .enquiry { padding: 0; }
  .enquiry .container { padding: 0; }
  .enquiry__card { border-radius: 0; }
  .side-image { min-height: 420px; }
}

@media (max-width: 640px) {
  .only-small { display: block; }

  .topbar a { padding: 6px 8px; font-size: 13px; }
  .logo img { width: 150px; height: 100px; }

  .section { padding: 30px 0; }
  .section--top { padding-top: 40px; }
  .card { width: 100%; padding: 20px 0; }
  .split { grid-template-columns: 1fr; }
  .split > div, .split > div + div { padding: 0; border: 0; }
  .split > div + div { margin-top: 20px; }
  .columns-2 { columns: 1; }
  .info-boxes { grid-template-columns: 1fr; padding: 0; }
  .pill-wrap { width: 100%; padding: 10px 0; }
  .accordion summary { font-size: 22px; padding-left: 0; }
  .accordion__body { padding-left: 0; }
  .banner { padding: 60px 0; }
  .enquiry__card { grid-template-columns: 1fr; }
  .enquiry__image { min-height: 20vh; }
  .enquiry__form { padding: 40px var(--gutter); }
  .form { grid-template-columns: 1fr; }
  .site-footer { padding: 40px 0; }

  body { padding-bottom: 92px; }
  .callbar {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 6px 8px 8px; background: var(--red); color: var(--white);
    box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.25); text-align: center;
  }
  .callbar__label { margin: 0 0 5px; font-size: 12px; line-height: 1.3; }
  .callbar__links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .callbar a {
    display: block; padding: 7px 4px; border-radius: 4px;
    background: var(--white); color: var(--red);
    font-size: 15px; font-weight: 700; line-height: 1.25; letter-spacing: 0;
  }
  .callbar a span { display: block; font-size: 11px; font-weight: 400; letter-spacing: 0.5px; color: var(--ink); }
  .to-top { bottom: 92px; right: 12px; border-radius: 4px; }
}
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

@media print {
  .topbar, .nav-toggle, .site-nav, .to-top, .callbar, .map { display: none !important; }
}

/* Heading size utilities: keep the old visual size while using the right heading level */
h1.h2 { font-size: clamp(34px, 3.8vw, 54px); margin-bottom: 30px; }
h1.h3 { font-size: clamp(27px, 2.6vw, 36px); margin-bottom: 20px; }
h2.h3 { font-size: clamp(27px, 2.6vw, 36px); margin-bottom: 20px; }
h3.h4 { font-size: 24px; margin-bottom: 12px; }

/* Price list */
.price-table { width: 100%; margin: 0 0 24px; border-collapse: collapse; }
.price-table th, .price-table td {
  padding: 14px 0; border-bottom: 1px solid var(--grey-light);
  text-align: left; vertical-align: top;
}
.price-table thead th { color: var(--red); font-weight: 700; border-bottom: 2px solid var(--red); }
.price-table th:last-child, .price-table td:last-child {
  width: 190px; padding-left: 30px; text-align: right; white-space: nowrap;
}
.price-table tfoot th, .price-table tfoot td {
  border-bottom: 0; border-top: 2px solid var(--red);
  color: var(--red); font-size: 18px; font-weight: 700;
}
.price-table sup a, .prose sup a { text-decoration: none; color: var(--red); }
.small { font-size: 14px; }

/* Contact: find us */
.map {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  min-height: 340px; padding: 30px; border-radius: 9px;
  background: var(--grey-light); text-align: center;
}
.map p { max-width: 360px; }
.map p:last-of-type { margin-bottom: 0; }
.map.is-loaded { padding: 0; overflow: hidden; }
.map iframe { display: block; width: 100%; height: 100%; min-height: 340px; border: 0; }
.form__note { grid-column: 1 / -1; margin: 0; font-size: 13px; text-align: center; }
.form__note a { text-decoration: underline; }

@media (max-width: 640px) {
  .price-table, .price-table tbody, .price-table tfoot, .price-table tr, .price-table td, .price-table th { display: block; }
  .price-table thead { display: none; }
  .price-table tr { padding: 14px 0; border-bottom: 1px solid var(--grey-light); }
  .price-table td, .price-table tfoot th, .price-table tfoot td,
  .price-table td:last-child, .price-table th:last-child {
    width: auto; padding: 0; border: 0; text-align: left; white-space: normal;
  }
  .price-table td:last-child { margin-top: 6px; font-weight: 700; color: var(--red); }
  .price-table tfoot tr { border-bottom: 0; border-top: 2px solid var(--red); }
  .map { min-height: 240px; }
  /* The call bar carries the phone numbers on phones */
  .topbar li:nth-child(n+3) { display: none; }
}
