/*
Theme Name: Moore Help 4 Grief
Theme URI: https://moorehelp4grief.com
Author: M-Powered Media
Author URI: https://m-poweredmedia.com
Description: Custom accessible theme for Moore Help 4 Grief. Built to WCAG 2.1 AA.
Version: 0.1.0
Requires at least: 6.4
Requires PHP: 8.1
License: Proprietary
Text Domain: moorehelp
*/

/* ==========================================================================
   DESIGN TOKENS
   Palette sampled directly from the client logo (moorehelp-logo.png).
   Every text pairing below is contrast-checked; ratios noted inline.
   ========================================================================== */

:root {
  /* Brand, sampled from logo */
  --navy:        #0F3867;  /* wordmark + hand */
  --gold:        #D6B96C;  /* heart + autumn leaf */
  --sage:        #98B49C;  /* living leaf */

  /* Text-safe derivatives. Raw gold is 1.9:1 on light and must never carry text. */
  --gold-deep:   #6B5518;  /* 6.92:1 on paper */
  --sage-deep:   #4A6B50;  /* 5.79:1 on paper */

  /* Surfaces */
  --paper:       #FDFBF7;
  --shell:       #F2EEE6;
  --ink:         #1B2A3A;  /* 14.12:1 on paper */

  /* Roles */
  --text:            var(--ink);
  --text-quiet:      #4A5866;   /* 7.4:1 on paper */
  --heading:         var(--navy);
  --link:            var(--navy);
  --link-hover:      var(--gold-deep);
  --surface:         var(--paper);
  --surface-alt:     var(--shell);
  --surface-invert:  var(--navy);
  --rule:            #DCD5C7;

  /* Type */
  --font-display: "Lora", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  /* Base is 19px on purpose. This audience is largely 50+, often reading on a
     phone, often late at night. Legibility outranks visual density here. */
  --step--1: clamp(0.94rem, 0.92rem + 0.1vw, 1rem);
  --step-0:  clamp(1.1875rem, 1.15rem + 0.19vw, 1.3125rem);
  --step-1:  clamp(1.42rem, 1.34rem + 0.4vw, 1.66rem);
  --step-2:  clamp(1.7rem, 1.55rem + 0.75vw, 2.1rem);
  --step-3:  clamp(2.04rem, 1.78rem + 1.3vw, 2.66rem);
  --step-4:  clamp(2.45rem, 2.0rem + 2.2vw, 3.4rem);

  /* Spacing */
  --space-2xs: 0.375rem;
  --space-xs:  0.75rem;
  --space-s:   1.125rem;
  --space-m:   1.75rem;
  --space-l:   2.75rem;
  --space-xl:  4.25rem;
  --space-2xl: 6.5rem;

  /* Measure */
  --measure: 62ch;
  --wide: 74rem;

  --radius: 3px;
  --transition: 180ms ease;
}

/* ==========================================================================
   RESET
   ========================================================================== */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--heading);
  font-weight: 600;
  line-height: 1.22;
  margin: 0 0 var(--space-s);
  text-wrap: balance;
}

h1 { font-size: var(--step-4); letter-spacing: -0.015em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
h4 { font-size: var(--step-0); font-weight: 700; }

p { margin: 0 0 var(--space-s); }
p:last-child { margin-bottom: 0; }

/* Eyebrow: labels a section by what it is. Never decorative. */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 var(--space-xs);
}

.lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--text-quiet);
}

a { color: var(--link); text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }

/* ==========================================================================
   FOCUS AND SKIP LINK
   ========================================================================== */

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

.on-invert :focus-visible,
.site-footer :focus-visible { outline-color: var(--gold); }

.skip-link {
  position: absolute;
  left: var(--space-s);
  top: -100px;
  z-index: 999;
  background: var(--navy);
  color: var(--paper);
  padding: var(--space-xs) var(--space-m);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--transition);
}
.skip-link:focus { top: var(--space-s); color: var(--paper); }

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.wrap { width: min(100% - 2.5rem, var(--wide)); margin-inline: auto; }
.prose { max-width: var(--measure); }
.prose-center { max-width: var(--measure); margin-inline: auto; }

.section { padding-block: var(--space-xl); }
.section--tight { padding-block: var(--space-l); }
.section--alt { background: var(--surface-alt); }
.section--invert { background: var(--surface-invert); color: var(--paper); }
.section--invert h2,
.section--invert h3 { color: var(--paper); }
.section--invert .eyebrow { color: var(--gold); }
.section--invert a { color: var(--gold); }
.section--invert a:hover { color: var(--paper); }

/* ==========================================================================
   SIGNATURE: the two-leaf rule
   Her mark carries two leaves, one sage and one gold: the life that continues
   and the loss that turned. This divider is that idea reduced to a hairline,
   and it is the only ornament in the theme.
   ========================================================================== */

.leaf-rule {
  width: 132px;
  height: 2px;
  border: 0;
  margin: var(--space-m) 0;
  background: linear-gradient(90deg, var(--sage) 0%, var(--sage) 34%, var(--gold) 66%, var(--gold) 100%);
}
.leaf-rule--center { margin-inline: auto; }

/* ==========================================================================
   BUTTONS
   44px minimum target, per WCAG 2.5.5.
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.7em 1.8em;
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.btn--primary { background: var(--navy); color: var(--paper); border-color: var(--navy); }
.btn--primary:hover { background: #0B2A4E; color: var(--paper); border-color: #0B2A4E; }

.btn--secondary { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn--secondary:hover { background: var(--navy); color: var(--paper); }

.section--invert .btn--primary { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.section--invert .btn--primary:hover { background: var(--paper); border-color: var(--paper); color: var(--navy); }
.section--invert .btn--secondary { color: var(--paper); border-color: var(--paper); }
.section--invert .btn--secondary:hover { background: var(--paper); color: var(--navy); }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-s); margin-top: var(--space-m); }

/* ==========================================================================
   HEADER
   ========================================================================== */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding-block: var(--space-s);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  flex-wrap: wrap;
}

.site-brand { display: inline-flex; align-items: center; text-decoration: none; }
.site-brand img { width: auto; height: 74px; }
.site-brand__text { font-family: var(--font-display); font-size: var(--step-1); color: var(--navy); font-weight: 600; }

.nav-toggle {
  display: none;
  min-height: 48px;
  align-items: center;
  gap: 0.5em;
  background: transparent;
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  color: var(--navy);
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 1em;
  cursor: pointer;
}

.site-nav ul { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-s); list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--navy);
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--gold); color: var(--navy); }
.site-nav .current-menu-item > a { border-bottom-color: var(--navy); }

@media (max-width: 60rem) {
  .nav-toggle { display: inline-flex; }
  .site-nav { flex-basis: 100%; display: none; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav li { border-top: 1px solid var(--rule); }
  .site-nav a { min-height: 52px; width: 100%; }
}

/* ==========================================================================
   HERO
   Type-led on purpose. There is no photograph of Ima yet, and a stock image of
   a stranger would undercut the one thing this page has to establish: that a
   real person is on the other side of it.
   ========================================================================== */

.hero { background: var(--shell); padding-block: var(--space-2xl) var(--space-xl); text-align: center; }
.hero__mark { margin: 0 auto var(--space-m); width: auto; height: 128px; }
.hero h1 { max-width: 20ch; margin-inline: auto; }
.hero .lede { max-width: 54ch; margin: var(--space-m) auto 0; }
.hero .btn-row { justify-content: center; }
.hero__note { margin-top: var(--space-s); font-size: var(--step--1); color: var(--text-quiet); }

/* ==========================================================================
   SUPPORT LIST
   Not numbered. These are three doors into the same room, not a sequence.
   ========================================================================== */

.support-grid {
  display: grid;
  gap: var(--space-m);
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  margin-top: var(--space-l);
  list-style: none;
  padding: 0;
}

.support-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--sage);
  border-radius: var(--radius);
  padding: var(--space-m);
}
.support-card:nth-child(2) { border-top-color: var(--gold); }
.support-card:nth-child(3) { border-top-color: var(--navy); }
.support-card h3 { margin-bottom: var(--space-2xs); }
.support-card p { color: var(--text-quiet); margin-bottom: 0; }

/* ==========================================================================
   STAGES
   Numbered, because these genuinely are a sequence and the order carries
   meaning the reader needs. Kessler's sixth stage is the point of the page.
   ========================================================================== */

.stage-list { list-style: none; margin: var(--space-l) 0 0; padding: 0; max-width: 46rem; }

.stage {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: var(--space-s);
  align-items: baseline;
  padding-block: var(--space-s);
  border-top: 1px solid var(--rule);
}
.stage:last-child { border-bottom: 1px solid var(--rule); }

.stage__num {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 600;
  color: var(--gold-deep);
  font-variant-numeric: tabular-nums;
}
.stage__name { font-family: var(--font-display); font-size: var(--step-1); color: var(--navy); margin: 0; }
.stage__note { margin: var(--space-2xs) 0 0; color: var(--text-quiet); font-size: var(--step--1); }

.stage--meaning .stage__num,
.stage--meaning .stage__name { color: var(--sage-deep); }

/* ==========================================================================
   STORY (About)
   ========================================================================== */

.story h2 { margin-top: var(--space-l); }
.story h2:first-child { margin-top: 0; }
.story > * { max-width: var(--measure); }

.pull {
  border-left: 3px solid var(--gold);
  padding: var(--space-xs) 0 var(--space-xs) var(--space-m);
  margin: var(--space-l) 0;
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--navy);
}

/* ==========================================================================
   CRISIS NOTICE
   Deliberately not styled as an alert or a warning box. Someone arriving here
   in distress does not need a red banner shouting at them. It needs to be
   unmissable and calm at the same time.
   ========================================================================== */

.crisis {
  background: var(--paper);
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  padding: var(--space-m);
  max-width: 46rem;
}
.crisis h2, .crisis h3 { font-size: var(--step-1); margin-bottom: var(--space-xs); }
.crisis p:last-child { margin-bottom: 0; }
.crisis strong { color: var(--navy); }
.crisis--footer { background: transparent; border-color: var(--gold); margin-inline: auto; }
.crisis--footer h2, .crisis--footer h3 { color: var(--paper); }

/* ==========================================================================
   BOOKING
   ========================================================================== */

.booking-embed { margin-top: var(--space-l); max-width: 52rem; }
.booking-alt {
  margin-top: var(--space-m);
  padding: var(--space-m);
  background: var(--shell);
  border-radius: var(--radius);
  max-width: 52rem;
}
.booking-alt h3 { font-size: var(--step-0); }

/* ==========================================================================
   EDITOR-ONLY CONTENT PLACEHOLDER
   Visible only to logged-in editors. Nothing unfinished can reach a visitor.
   ========================================================================== */

.needs-content {
  border: 2px dashed #B4462F;
  background: #FDF3F0;
  color: #7A2E1E;
  padding: var(--space-m);
  border-radius: var(--radius);
  margin-block: var(--space-m);
  font-family: var(--font-body);
  max-width: 52rem;
}
.needs-content__label {
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 var(--space-xs);
}
.needs-content ul { margin: 0; padding-left: 1.3em; }
.needs-content li { margin-bottom: var(--space-2xs); }

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer { background: var(--navy); color: var(--paper); padding-block: var(--space-xl) var(--space-l); }
.site-footer a { color: var(--gold); }
.site-footer a:hover { color: var(--paper); }
.site-footer h2, .site-footer h3 { color: var(--paper); }

.footer-grid {
  display: grid;
  gap: var(--space-l);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-top: var(--space-l);
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: var(--space-2xs); }
.footer-grid a { display: inline-flex; align-items: center; min-height: 40px; }

.footer-legal {
  margin-top: var(--space-l);
  padding-top: var(--space-m);
  border-top: 1px solid rgba(253, 251, 247, 0.22);
  font-size: var(--step--1);
  color: #C6D2E0;
}
.footer-legal p { margin-bottom: var(--space-2xs); }

/* ==========================================================================
   UTILITY
   ========================================================================== */

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.screen-reader-text:focus {
  position: static !important;
  width: auto; height: auto;
  clip: auto; clip-path: none;
  margin: 0; padding: var(--space-xs);
}

.text-center { text-align: center; }
.mt-l { margin-top: var(--space-l); }

/* ==========================================================================
   CLIENT-EDITED CONTENT
   Everything Ima writes in the WordPress editor lands inside .client-content.
   Styling is scoped here so her blocks inherit the theme without her needing
   to choose anything.
   ========================================================================== */

.client-content { margin-top: var(--space-l); }
.client-content > *:first-child { margin-top: 0; }

.client-content h2 { font-size: var(--step-2); margin-top: var(--space-l); }
.client-content h3 { font-size: var(--step-1); margin-top: var(--space-m); }
.client-content h2:first-child,
.client-content h3:first-child { margin-top: 0; }

.client-content ul,
.client-content ol { padding-left: 1.4em; margin-bottom: var(--space-s); }
.client-content li { margin-bottom: var(--space-2xs); }

.client-content blockquote {
  border-left: 3px solid var(--gold);
  padding: var(--space-xs) 0 var(--space-xs) var(--space-m);
  margin: var(--space-l) 0;
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--navy);
}
.client-content blockquote p:last-child { margin-bottom: 0; }

.client-content img { border-radius: var(--radius); margin-block: var(--space-m); }

.client-content hr {
  border: 0;
  height: 2px;
  width: 132px;
  background: linear-gradient(90deg, var(--sage) 0%, var(--sage) 34%, var(--gold) 66%, var(--gold) 100%);
  margin-block: var(--space-l);
}

/* Details/summary, offered to her for FAQ-style content. */
.client-content details {
  border-top: 1px solid var(--rule);
  padding-block: var(--space-s);
}
.client-content details:last-of-type { border-bottom: 1px solid var(--rule); }
.client-content summary {
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: var(--navy);
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* Button block, mapped onto the theme button. */
.client-content .wp-block-button__link {
  background: var(--navy);
  color: var(--paper);
  border-radius: var(--radius);
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  padding: 0.7em 1.8em;
  font-family: var(--font-body);
  font-weight: 600;
  text-decoration: none;
}
.client-content .wp-block-button__link:hover { background: #0B2A4E; color: var(--paper); }
