/* ==========================================================================
   Madadeni Undertaking Association — stylesheet
   Palette derived from the company mark: charcoal ink, warm gold, soft ivory
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500&family=Work+Sans:wght@300;400;500;600&display=swap');

:root {
  --ink: #26221f;
  --ink-soft: #4a4340;
  --gold: #b8935a;
  --gold-deep: #8f6d3c;
  --gold-light: #e3cfa0;
  --cream: #f7f2e8;
  --cream-deep: #efe6d3;
  --white: #fffdf9;
  --line: rgba(38, 34, 31, 0.12);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

html, body { max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 500; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 600;
  display: block;
  margin-bottom: 0.9em;
}

.lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 62ch;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.85em 1.7em;
  border-radius: 2px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-gold {
  background: var(--gold);
  color: var(--white);
}
.btn-gold:hover { background: var(--gold-deep); }
.btn-outline {
  border-color: rgba(255,255,255,0.55);
  color: var(--white);
}
.btn-outline:hover { background: rgba(255,255,255,0.12); }
.btn-outline-ink {
  border-color: var(--ink);
  color: var(--ink);
}
.btn-outline-ink:hover { background: var(--ink); color: var(--white); }

/* ---------- Dove signature mark ---------- */
.dove {
  display: inline-block;
  vertical-align: middle;
}
.dove path { fill: currentColor; stroke: none; }

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: var(--gold);
  margin: 0 auto;
  width: fit-content;
}
.divider .line { width: 64px; height: 1px; background: var(--line); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 242, 232, 0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.nav-toggle-input { display: none; }
.nav-toggle {
  display: none;
  width: 34px; height: 26px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span, .nav-toggle::before, .nav-toggle::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle::before { top: 4px; }
.nav-toggle span { top: 12px; }
.nav-toggle::after { top: 20px; }
.nav-toggle-input:checked ~ .nav-toggle::before { transform: translateY(8px) rotate(45deg); }
.nav-toggle-input:checked ~ .nav-toggle::after { transform: translateY(-8px) rotate(-45deg); }
.nav-toggle-input:checked ~ .nav-toggle span { opacity: 0; }
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark { color: var(--gold); width: 40px; height: 40px; }
.brand-text {
  font-family: var(--font-display);
  line-height: 1.05;
}
.brand-text .name { font-size: 1.28rem; font-weight: 600; display: block; }
.brand-text .sub {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-family: var(--font-body);
  font-weight: 600;
}

nav.main-nav { display: flex; align-items: center; gap: 34px; }
nav.main-nav a {
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--ink-soft);
  font-weight: 500;
  position: relative;
  padding-bottom: 4px;
}
nav.main-nav a.active,
nav.main-nav a:hover { color: var(--ink); }
nav.main-nav a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--gold);
}
.nav-cta {
  padding: 0.6em 1.3em;
  background: var(--ink);
  color: var(--white) !important;
  border-radius: 2px;
  font-size: 0.85rem !important;
}

.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  color: var(--white);
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center 30%;
}
.hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(28,24,20,0.55) 0%, rgba(28,24,20,0.35) 35%, rgba(23,19,16,0.92) 100%);
}
.hero-content {
  position: relative;
  padding: 80px 0 70px;
  width: 100%;
}
.hero .eyebrow { color: var(--gold-light); }
.hero h1 { color: var(--white); max-width: 15ch; }
.hero .lede { color: rgba(255,255,255,0.86); }
.hero-actions { display: flex; gap: 16px; margin-top: 30px; flex-wrap: wrap; }

.page-hero {
  position: relative;
  padding: 150px 0 70px;
  color: var(--white);
  background: linear-gradient(155deg, #2c2620, #1b1712 70%);
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  right: -8%;
  top: -20%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(184,147,90,0.28), transparent 70%);
}
.page-hero .wrap { position: relative; }
.page-hero .eyebrow { color: var(--gold-light); }
.page-hero h1 { color: var(--white); }

/* ---------- Sections ---------- */
section { padding: 96px 0; }
.section-tight { padding: 64px 0; }
.bg-white { background: var(--white); }
.bg-cream { background: var(--cream); }
.bg-ink { background: var(--ink); color: var(--white); }
.bg-ink h2, .bg-ink h3 { color: var(--white); }
.bg-ink .lede { color: rgba(255,255,255,0.78); }

.section-head { max-width: 640px; margin: 0 0 52px; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

/* ---------- Legacy / story strip ---------- */
.story-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 64px;
  align-items: center;
}
.story-grid img { border-radius: 3px; width: 100%; height: 460px; object-fit: cover; }
.story-figures {
  display: flex;
  gap: 40px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.story-figures .fig-num {
  font-family: var(--font-display);
  font-size: 2.1rem;
  color: var(--gold-deep);
  display: block;
  font-weight: 500;
}
.story-figures .fig-label {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* ---------- Service cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.service-card {
  background: var(--white);
  padding: 40px 32px;
  border-radius: 3px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
}
.service-card .num {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}
.service-card h3 { margin-top: 14px; }
.service-card p { color: var(--ink-soft); font-size: 0.97rem; margin-bottom: 0; }
.service-card ul {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.service-card li { margin-bottom: 6px; }

/* ---------- Team ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
}
.team-card { text-align: left; }
.team-photo {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 3px;
  background: var(--cream-deep);
  margin-bottom: 18px;
}
.team-photo img { width: 100%; height: 100%; object-fit: cover; }
.team-photo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-deep);
}
.team-name { font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 2px; }
.team-role { font-size: 0.85rem; color: var(--gold-deep); letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600; }

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 220px);
  gap: 14px;
}
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }
.gallery-grid .g1 { grid-column: span 2; grid-row: span 2; }
.gallery-grid .g2 { grid-column: span 2; }
.gallery-grid .g3 { grid-column: span 1; }
.gallery-grid .g4 { grid-column: span 1; }

/* ---------- CTA strip ---------- */
.cta-strip {
  background: var(--ink);
  color: var(--white);
  padding: 64px 0;
  text-align: center;
}
.cta-strip h2 { color: var(--white); }
.cta-strip .lede { color: rgba(255,255,255,0.75); margin: 0 auto 30px; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}
.contact-block { margin-bottom: 30px; }
.contact-block .label {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}
.contact-block a { text-decoration: none; }
.contact-block a:hover { color: var(--gold-deep); }
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { margin-bottom: 6px; }
.map-frame {
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  height: 100%;
  min-height: 340px;
}
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- Form ---------- */
.form-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 40px;
}
.form-row { margin-bottom: 20px; }
.form-row-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-row label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  margin-bottom: 7px;
}
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 0.75em 0.9em;
  font-family: var(--font-body);
  font-size: 0.96rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: border-color 0.15s ease;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--gold);
}
.form-row textarea { resize: vertical; min-height: 120px; }
.form-honeypot { position: absolute; left: -9999px; top: -9999px; }
.form-submit {
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}
.form-note {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-top: 14px;
}
.form-banner {
  padding: 16px 20px;
  border-radius: 3px;
  margin-bottom: 28px;
  font-size: 0.94rem;
}
.form-banner.success {
  background: #eef4e8;
  border: 1px solid #a9c98a;
  color: #3d5c26;
}
.form-banner.error {
  background: #f7e9e4;
  border: 1px solid #d9a58c;
  color: #7a3b21;
}

/* ---------- Disclosure / compliance page ---------- */
.disc-block {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 30px 34px;
  margin-bottom: 22px;
}
.disc-block h3 { font-size: 1.02rem; margin-bottom: 10px; }
.disc-block p { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 8px; }
.disc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.disc-note {
  border-left: 3px solid var(--gold);
  padding: 18px 24px;
  background: var(--cream-deep);
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-bottom: 40px;
}

/* ---------- Footer ---------- */
footer {
  background: var(--ink);
  color: rgba(255,255,255,0.78);
  padding: 64px 0 30px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.footer-brand .brand-mark { color: var(--gold-light); }
.footer-brand .name { font-family: var(--font-display); color: var(--white); font-size: 1.15rem; }
.footer-col h4 {
  color: var(--white);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
  font-family: var(--font-body);
  font-weight: 600;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 10px; font-size: 0.93rem; }
.footer-col a { text-decoration: none; color: rgba(255,255,255,0.78); }
.footer-col a:hover { color: var(--gold-light); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 26px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .story-grid, .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .card-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, 160px); }
  .gallery-grid .g1 { grid-column: span 2; grid-row: span 1; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }

  .nav-toggle { display: block; }
  nav.main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    padding: 10px 28px 24px;
  }
  nav.main-nav a { width: 100%; padding: 10px 0; }
  nav.main-nav a.nav-cta { width: auto; margin-top: 10px; text-align: center; padding: 0.6em 1.3em; }
  .nav-toggle-input:checked ~ nav.main-nav { display: flex; }
}

@media (max-width: 600px) {
  section { padding: 64px 0; }
  .hero { min-height: 82vh; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .story-figures { flex-wrap: wrap; gap: 24px; }
  .disc-grid { grid-template-columns: 1fr; }
}
