/*
Theme Name: Memoir
Theme URI: https://example.com/memoir
Author: Custom
Author URI: https://example.com
Description: A professional theme for collecting and sharing personal memories and stories.
Version: 4.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: memoir
Tags: stories, memories, personal, green, professional
*/

/* ── Variables ── */
:root {
  /* Greens — deep forest to sage, matching Online-Tribute "grass" */
  --green-900:   #1B2E1C;
  --green-800:   #243D25;
  --green-700:   #2F5231;
  --green-600:   #3A6B3D;
  --green-500:   #4A8550;
  --green-400:   #6BA872;
  --green-300:   #96C79C;
  --green-200:   #C1DEC4;
  --green-100:   #E0EFE1;
  --green-50:    #F2F8F2;

  /* Warm cream background tones (the signature grass-theme warmth) */
  --cream:       #F7F4EE;
  --cream-dark:  #EDE9E0;
  --cream-border:#D9D3C5;

  --white:       #FFFFFF;
  --grey-50:     #F9F7F4;
  --grey-100:    #EDE9E1;
  --grey-200:    #D5CFC4;
  --grey-400:    #9A9186;
  --grey-600:    #5C5549;
  --grey-900:    #1E1B17;

  --text-primary:   #1E1B17;
  --text-secondary: #3D382F;
  --text-muted:     #6B6357;
  --text-on-dark:   #FFFFFF;

  --border:         #B5AD9E;
  --border-light:   #CEC8BB;
  --border-faint:   #E0DBD0;

  --accent:         #3A6B3D;
  --accent-hover:   #2F5231;
  --accent-light:   #EDF5EE;

  /* Online-Tribute uses Playfair Display for headings, Lora for body, DM Sans for UI */
  --font-serif:  'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:   'Lora', Georgia, serif;
  --font-ui:     'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  --font:        'DM Sans', 'Helvetica Neue', Arial, sans-serif; /* legacy alias */

  --max-width:   740px;
  --wide-width:  1140px;
  --radius-sm:   3px;
  --radius:      6px;
  --radius-lg:   10px;
  --transition:  0.2s ease;
}

/* ── Placeholder contrast — WCAG 1.4.3 ── */
::placeholder { color: #767676; opacity: 1; }  /* 4.54:1 on white ✓ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  background: var(--white);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* ── Skip link ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  background: var(--accent);
  color: var(--white);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.6rem 1.2rem;
  border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ── Focus indicators — WCAG 2.4.7, 2.4.11, 2.4.12, 2.5.8 ── */
/* Remove browser default only for mouse users; keyboard always gets a clear ring */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid #005fcc;   /* #005fcc on white = 8.6:1 ✓; on green-800 = 4.8:1 ✓ */
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
/* Form fields get an inset focus ring so it sits inside the border */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #005fcc;
  outline-offset: 0;
  box-shadow: 0 0 0 3px rgba(0, 95, 204, 0.25);
  border-color: #005fcc !important;
}
/* File upload widget: show focus ring on the visual wrapper */
.file-upload-wrap:focus-within .file-upload-ui {
  outline: 3px solid #005fcc;
  outline-offset: 0;
  border-color: #005fcc !important;
}
a:target, [tabindex], input, textarea, select, button {
  scroll-margin-top: 80px;
}

/* ── Typography — Playfair Display headings, Lora body, DM Sans UI ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.9rem, 4.5vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }
h4 { font-size: 1rem; font-weight: 700; }

p { margin-bottom: 1.4em; }
p:last-child { margin-bottom: 0; }

blockquote {
  border-left: 3px solid var(--green-400);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--grey-50);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary);
  font-style: italic;
  font-family: var(--font-body);
}

/* ── Layout ── */
.container  { width: 100%; max-width: var(--wide-width); margin: 0 auto; padding: 0 2rem; }
.content-wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 2rem; }

/* ── Header ── */
.site-header {
  background: var(--green-800);
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--green-700);
}
.header-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.site-branding a {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--white);
  letter-spacing: 0em;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.site-branding a:hover { color: var(--green-200); }
.site-branding .tagline {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  font-weight: 400;
  color: var(--green-300);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ── Navigation ── */
.main-nav ul { list-style: none; display: flex; gap: 0.25rem; align-items: center; }
.main-nav a {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--green-200);
  padding: 0.75rem 1rem;   /* min 24px tap target height — WCAG 2.5.8 ✓ */
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: inline-block;
}
.main-nav a:hover { color: var(--white); background: rgba(255,255,255,0.1); }
.main-nav .current-menu-item a { color: var(--white); font-weight: 700; }

.nav-cta a {
  background: var(--white) !important;
  color: var(--green-800) !important;
  padding: 0.45rem 1.1rem !important;
  border-radius: var(--radius) !important;
  font-weight: 700 !important;
  font-family: var(--font-ui) !important;
  transition: background var(--transition) !important;
}
.nav-cta a:hover { background: var(--green-200) !important; color: var(--green-800) !important; }

.hamburger {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0.4rem 0.5rem;
  flex-direction: column;
  gap: 4px;
}
.hamburger span { display: block; width: 20px; height: 2px; background: var(--white); border-radius: 2px; }

/* ── Hero ── */
.site-hero {
  background: #243D25;
  padding: 5.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.site-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 60%, rgba(74,133,80,0.2) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(74,133,80,0.15) 0%, transparent 50%);
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--green-300);
  border: 1px solid var(--green-600);
  background: rgba(74,133,80,0.15);
  padding: 0.35rem 1rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}
.site-hero h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: #FFFFFF;
  max-width: 640px;
  margin: 0 auto 1.25rem;
  letter-spacing: -0.015em;
  position: relative;
  z-index: 1;
}
.site-hero .hero-lead {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 400;
  font-style: italic;
  color: #C1DEC4;
  max-width: 520px;
  margin: 0 auto 2.5rem;
  line-height: 1.75;
  position: relative;
  z-index: 1;
}
.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary { background: var(--white); color: var(--green-800); }
.btn-primary:hover { background: var(--green-100); color: var(--green-800); transform: translateY(-1px); }

.btn-secondary { background: rgba(255,255,255,0.12); color: var(--white); border: 1px solid rgba(255,255,255,0.3); }
.btn-secondary:hover { background: rgba(255,255,255,0.2); color: var(--white); border-color: rgba(255,255,255,0.5); }

.btn-green { background: var(--accent); color: var(--white); }
.btn-green:hover { background: var(--accent-hover); color: var(--white); transform: translateY(-1px); }

.btn-outline { background: transparent; color: var(--accent); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); background: var(--accent-light); }

/* ── Stats bar ── */
.stats-bar { background: var(--grey-50); border-bottom: 1px solid var(--cream-border); padding: 1.25rem 2rem; }
.stats-inner { max-width: var(--wide-width); margin: 0 auto; display: flex; gap: 3rem; align-items: center; justify-content: center; }
.stat-item { text-align: center; }
.stat-number { font-family: var(--font-ui); font-size: 1.5rem; font-weight: 900; color: var(--green-700); letter-spacing: -0.02em; line-height: 1; }
.stat-label  { font-family: var(--font-ui); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-top: 3px; }

/* ── Section headers ── */
.section-header { margin-bottom: 2.5rem; }
.section-header.centered { text-align: center; }
.overline { font-family: var(--font-ui); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 0.5rem; }
.section-header h2 { margin-bottom: 0.5rem; }
.section-header p { font-family: var(--font-body); color: var(--text-muted); font-size: 0.95rem; max-width: 520px; margin: 0; }
.section-header.centered p { margin: 0 auto; }

/* ── Features strip ── */
.features-strip { background: var(--grey-50); border-top: 1px solid var(--cream-border); border-bottom: 1px solid var(--cream-border); padding: 3rem 2rem; }
.features-inner { max-width: var(--wide-width); margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
.feature-item { display: flex; flex-direction: column; gap: 0.4rem; }
.feature-icon { width: 40px; height: 40px; background: var(--green-200); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; margin-bottom: 0.25rem; }
.feature-item h4 { font-family: var(--font-ui); font-size: 0.9rem; font-weight: 700; color: var(--text-primary); }
.feature-item p  { font-family: var(--font-ui); font-size: 0.825rem; font-weight: 400; color: var(--text-muted); margin: 0; line-height: 1.6; }

/* ── Stories section ── */
.stories-section { padding: 5rem 2rem; background: var(--white); }
.stories-section-inner { max-width: var(--wide-width); margin: 0 auto; }
.stories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }

/* ── Story cards ── */
.story-card {
  background: var(--white);
  border: 1px solid var(--cream-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
}
.story-card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(36,61,37,0.12); border-color: var(--border); }

.story-card-thumb { aspect-ratio: 16/9; background: var(--grey-50); overflow: hidden; }
.story-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.story-card:hover .story-card-thumb img { transform: scale(1.03); }
.story-card-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ui); font-size: 2.5rem; font-weight: 900;
  color: var(--green-400); background: var(--green-50);
}

.story-card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }

.story-meta {
  font-family: var(--font-ui); font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 0.6rem;
  display: flex; gap: 0.6rem; align-items: center;
}
.story-meta .dot { color: var(--border-light); }

.story-card-title { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.6rem; line-height: 1.35; }
.story-card-title a { color: inherit; }
.story-card-title a:hover { color: var(--accent); }

.story-card-excerpt { font-family: var(--font-body); font-size: 0.875rem; font-weight: 400; color: var(--text-muted); line-height: 1.65; flex: 1; margin-bottom: 1.25rem; }

.story-read-link {
  font-family: var(--font-ui); font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--accent); display: inline-flex; align-items: center;
  gap: 0.3rem; margin-top: auto; transition: gap var(--transition), color var(--transition);
}
.story-read-link::after { content: '→'; font-weight: 400; }
.story-read-link:hover { gap: 0.55rem; color: var(--accent-hover); }

/* ── Single story ── */
.single-story { padding: 1.5rem 2rem 6rem; background: var(--white); }
.story-header { max-width: var(--wide-width); margin: 0 auto 2rem; padding: 0 1rem; }
.story-header .story-meta { margin-bottom: 0.75rem; }
.story-header h1 { font-family: var(--font-serif); font-weight: 400; margin-bottom: 1rem; font-size: clamp(1.75rem, 4vw, 2.75rem); letter-spacing: -0.025em; }
.story-byline { font-family: var(--font-ui); font-size: 0.875rem; font-weight: 400; color: var(--text-muted); padding-top: 1rem; margin-top: 1rem; border-top: 1px solid var(--border-faint); }

.story-divider { display: none; }

.story-content { max-width: 100%; margin: 0; font-family: var(--font-body); font-size: 1.05rem; font-weight: 400; line-height: 1.85; color: var(--text-primary); }
.story-content p { margin-bottom: 1.6em; }
.story-content h2, .story-content h3 { font-family: var(--font-serif); margin: 2em 0 0.75em; }

/* ── About strip ── */
.about-strip { background: var(--green-800); padding: 5rem 2rem; }
.about-strip-inner { max-width: var(--wide-width); margin: 0 auto; display: grid; grid-template-columns: 1fr auto; gap: 3rem; align-items: center; }
.about-strip h2 { font-family: var(--font-serif); font-weight: 400; color: var(--white); margin-bottom: 0.75rem; }
.about-strip p  { font-family: var(--font-body); font-size: 0.95rem; font-weight: 400; font-style: italic; color: var(--green-100); max-width: 520px; }
.about-strip-actions { flex-shrink: 0; display: flex; flex-direction: column; gap: 0.75rem; }

/* ── Submit page ── */
.submit-section { padding: 4rem 2rem 6rem; background: var(--white); }
.submit-intro { max-width: 580px; margin: 0 auto 3rem; }
.submit-intro p { font-family: var(--font-ui); color: var(--text-muted); font-size: 0.95rem; }

.story-form-wrap {
  max-width: 640px; margin: 0 auto;
  background: var(--white); border: 1px solid var(--cream-border);
  border-radius: var(--radius-lg); padding: 2.5rem;
  box-shadow: 0 1px 4px rgba(26,61,28,0.06);
}

.form-group { margin-bottom: 1.4rem; }
.form-group label { display: block; font-family: var(--font-ui); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; color: var(--text-secondary); margin-bottom: 0.45rem; }

.form-group input:not(.file-input),
.form-group textarea,
.form-group select {
  width: 100%; padding: 0.7rem 0.9rem;
  background: var(--white); border: 1.5px solid var(--cream-border);
  border-radius: var(--radius);
  font-family: var(--font-ui); font-size: 0.9rem; font-weight: 400;
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none; -webkit-appearance: none;
}
.form-group input:not(.file-input):focus,
.form-group textarea:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(58,128,64,0.15);
  background: var(--white);
}
.form-group textarea { min-height: 260px; resize: vertical; line-height: 1.7; }

.form-note { font-family: var(--font-ui); font-size: 0.74rem; font-weight: 400; color: var(--text-muted); margin-top: 0.3rem; display: block; }
.field-error { font-family: var(--font-ui); font-size: 0.78rem; color: #B91C1C; margin-top: 0.3rem; display: block; min-height: 1.2em; }
.field-invalid { border-color: #DC2626 !important; box-shadow: 0 0 0 3px rgba(220,38,38,0.12) !important; }
.required-mark { color: var(--accent); }
.required-note { font-family: var(--font-ui); font-size: 0.75rem; font-weight: 400; color: var(--text-muted); margin-top: -0.5rem; margin-bottom: 1rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-submit { margin-top: 1.75rem; }
.form-submit .btn { width: 100%; padding: 0.85rem; font-size: 0.9rem; }

/* ── Footer ── */
/* ── Footer — mirrors header layout ── */
.site-footer {
  background: var(--green-800);
  padding: 0 2rem;
  border-top: 1px solid var(--green-700);
}
.footer-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.footer-branding a {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--white);
  letter-spacing: 0em;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-decoration: none;
  transition: color var(--transition);
}
.footer-branding a:hover { color: var(--green-200); }
.footer-branding .tagline {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  font-weight: 400;
  color: var(--green-300);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2px;
}

.footer-nav-list { list-style: none; display: flex; gap: 0.25rem; align-items: center; margin: 0; padding: 0; }
.footer-nav-list a {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--green-200);
  padding: 0.75rem 1rem;   /* min 24px tap target — WCAG 2.5.8 ✓ */
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition);
  display: inline-block;
}
.footer-nav-list a:hover { color: var(--white); background: rgba(255,255,255,0.1); }

.footer-support {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--green-300);
  text-align: center;
  padding: 0.5rem 2rem 0.75rem;
  margin: 0;
}

/* ── Pagination ── */
.pagination { display: flex; justify-content: center; align-items: center; gap: 0.4rem; padding: 3rem 0 1rem; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 0.5rem;
  border-radius: var(--radius); border: 1px solid var(--border-faint);
  font-family: var(--font-ui); font-size: 0.875rem; font-weight: 500;
  color: var(--text-secondary); transition: all var(--transition);
}
.pagination a:hover { background: var(--green-50); border-color: var(--border); color: var(--accent); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: var(--white); }

/* ── Notices ── */
.notice { padding: 0.9rem 1.1rem; border-radius: var(--radius); font-family: var(--font-ui); font-size: 0.875rem; font-weight: 400; margin-bottom: 1.5rem; display: flex; align-items: flex-start; gap: 0.6rem; }
.notice-success { background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-200); }
.notice-error   { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }

/* ── No posts ── */
.no-stories { text-align: center; padding: 5rem 2rem; font-family: var(--font-ui); color: var(--text-muted); font-size: 0.95rem; }

/* ── Breadcrumb ── */
.breadcrumb { background: var(--grey-50); border-bottom: 1px solid var(--cream-border); padding: 0.65rem 2rem; font-family: var(--font-ui); font-size: 0.75rem; color: var(--text-muted); }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 0.4rem; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .about-strip-inner { grid-template-columns: 1fr; }
  .features-inner { grid-template-columns: 1fr 1fr; }
  .footer-inner { height: auto; padding: 1.25rem 0; flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .footer-nav-list { flex-wrap: wrap; }
}

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .main-nav {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    background: var(--green-800); padding: 1rem;
    border-top: 1px solid var(--green-700); border-bottom: 1px solid var(--green-700);
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0.25rem; }
  .main-nav a { display: block; padding: 0.65rem 0.75rem; font-size: 0.9rem; }
  .site-hero { padding: 3.5rem 1.5rem; }
  .stories-section { padding: 3rem 1.5rem; }
  .stories-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .story-form-wrap { padding: 1.5rem; }
  .features-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .stats-inner { gap: 1.5rem; }
}

/* ── Home inline form section ── */
.home-form-section {
  background: var(--green-50);
  border-top: 1px solid var(--border-faint);
  padding: 4rem 2rem 5rem;
}
.home-form-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
}
.home-form-inner .submit-section {
  padding: 0;
}
.home-form-inner .submit-intro {
  margin-left: 0;
  text-align: left;
}

/* Single stat — centre it nicely */
.stats-bar .stats-inner { justify-content: center; }

/* ── Funeral details section ── */
.funeral-details {
  background: var(--white);
  border-top: 1px solid var(--border-faint);
  border-bottom: 1px solid var(--border-faint);
  padding: 2.5rem 2rem;
  text-align: center;
}
.funeral-details-inner {
  max-width: 640px;
  margin: 0 auto;
}
.funeral-details-heading {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}
.funeral-detail-row {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-faint);
}
.funeral-detail-row:first-of-type {
  border-top: 1px solid var(--border-faint);
}
.funeral-detail-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 0.2rem;
}
.funeral-detail-value {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  line-height: 1.3;
}
.funeral-detail-address {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-muted);
  display: block;
  margin-top: 0.15rem;
  line-height: 1.5;
}
.funeral-detail-link {
  text-decoration: none;
  color: inherit;
}
.funeral-detail-map {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 0.4rem;
  transition: color var(--transition);
}
.funeral-detail-link:hover .funeral-detail-map {
  color: var(--accent-hover);
}
.funeral-detail-welcome {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-muted);
  padding-top: 1rem;
  line-height: 1.5;
}

/* ── Compact hero ── */
.site-hero--compact {
  padding: 2.5rem 2rem;
}
.site-hero--compact .hero-eyebrow { margin-bottom: 0.75rem; }
.site-hero--compact h1 { font-size: clamp(1.6rem, 3.5vw, 2.25rem); margin-bottom: 0.4rem; }
.site-hero--compact .hero-dates {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--green-200); /* #C1DEC4 on #243D25 bg = ~7.4:1 contrast — WCAG AA & AAA ✓ */
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}
.site-hero--compact .hero-lead { font-size: 0.95rem; margin-bottom: 1.5rem; }

/* ── Two-column home layout ── */
.home-two-col-section {
  padding: 3.5rem 2rem 5rem;
  background: var(--white);
}
.home-two-col-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 4rem;
  align-items: start;
}

/* On desktop: stories+gallery on left, form on right */
.home-col--stories { order: 1; }
.home-col--form    { order: 2; }

.home-col--form .form-group input:not(.file-input),
.home-col--form .form-group textarea {
  background: var(--white);
}
  background: var(--grey-50);
}

.home-col--form .form-submit .btn { width: 100%; }

/* ── Stories list (compact, not cards) ── */
.home-stories-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.home-story-item {
  display: block;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-faint);
  text-decoration: none;
  transition: background var(--transition);
}
.home-story-item:first-child { border-top: 1px solid var(--border-faint); }
.home-story-item:hover { background: var(--green-50); padding-left: 0.5rem; }
.home-story-meta {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.home-story-title {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}
.home-story-item:hover .home-story-title { color: var(--accent); }
.home-story-excerpt {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.5;
}
.no-stories-inline {
  font-family: var(--font-ui);
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 2rem 0;
}

/* ── Mobile: form on top, stories below ── */
@media (max-width: 860px) {
  .home-two-col-inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .home-col--form    { order: 1; }
  .home-col--stories { order: 2; }
}

@media (max-width: 768px) {
  .home-two-col-section { padding: 2.5rem 1.5rem 4rem; }
  .site-hero--compact { padding: 2rem 1.5rem; }
}

/* ── File upload field ── */
.file-upload-wrap { position: relative; display: block; }

.file-input {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  cursor: pointer !important;
  z-index: 2 !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: none !important;
  -webkit-appearance: none !important;
}

.file-upload-ui {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  background: var(--grey-50);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.file-upload-wrap:hover .file-upload-ui,
.file-upload-wrap:focus-within .file-upload-ui {
  border-color: var(--green-500);
  background: var(--white);
}
.file-upload-icon { font-size: 1.1rem; flex-shrink: 0; }
.file-upload-label { font-family: var(--font-ui); font-size: 0.875rem; font-weight: 600; color: var(--accent); }
.file-upload-name  { font-family: var(--font-ui); font-size: 0.8rem; font-weight: 400; color: var(--text-muted); margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }

/* Image preview */
.image-preview-wrap { margin-top: 0.75rem; }
.image-preview-wrap img {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius);
  border: 1px solid var(--border-faint);
  object-fit: cover;
}

/* ── Story image on single page ── */
.story-image {
  max-width: var(--max-width);
  margin: 0 auto 2rem;
}
.story-image img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-faint);
}

/* ── Photo gallery mosaic (inside left column) ── */
.home-gallery-wrap {
  margin-top: 0;
}

/*
 * 2-column mosaic inside the left column — CSS columns give a natural
 * masonry layout where each image sits at its own aspect ratio.
 */
.photo-gallery-mosaic {
  columns: 2;
  column-gap: 0.6rem;
}

.gallery-tile {
  display: block;
  break-inside: avoid;
  margin-bottom: 0.6rem;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  text-decoration: none;
  background: var(--grey-50);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s ease, transform 0.45s ease,
              box-shadow var(--transition);
}
.gallery-tile.visible {
  opacity: 1;
  transform: none;
}
.gallery-tile:hover {
  box-shadow: 0 8px 28px rgba(36,61,37,0.18);
}

.gallery-tile img {
  width: 100%;
  height: auto;      /* natural aspect ratio — creates the varied-height mosaic look */
  display: block;
  transition: transform 0.5s ease;
}
.gallery-tile:hover img {
  transform: scale(1.04);
}

/* Caption — slides up on hover */
.gallery-tile-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.25rem 0.7rem 0.55rem;
  background: linear-gradient(to top, rgba(20,40,21,0.9) 0%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.gallery-tile:hover .gallery-tile-caption,
.gallery-tile:focus .gallery-tile-caption {
  opacity: 1;
  transform: none;
}
.gallery-tile-title {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--white);       /* white on dark overlay ~17:1 ✓ WCAG AAA */
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gallery-tile-date {
  font-family: var(--font-ui);
  font-size: 0.67rem;
  font-weight: 400;
  color: var(--green-200);   /* #C1DEC4 on dark overlay ~7:1 ✓ WCAG AA */
  letter-spacing: 0.04em;
}

.gallery-tile:focus-visible {
  outline: 3px solid #005fcc;
  outline-offset: 2px;
}

@media (max-width: 860px) {
  /* On mobile the two-col collapses to single col, so gallery can go 3-wide */
  .photo-gallery-mosaic { columns: 3; }
}
@media (max-width: 500px) {
  .photo-gallery-mosaic { columns: 2; column-gap: 0.4rem; }
  .gallery-tile { margin-bottom: 0.4rem; }
}

/* ── Photo upload panel ── */
.photo-upload-panel {
  margin-top: 1.25rem;
}

.photo-upload-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--grey-50);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);        /* #3A6B3D on cream-dark #EDE9E0 = ~5.4:1 ✓ WCAG AA */
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  text-align: left;
}
.photo-upload-toggle:hover,
.photo-upload-toggle:focus-visible {
  background: var(--white);
  border-color: var(--green-500);
}
.photo-upload-toggle:focus-visible {
  outline: 3px solid #005fcc;
  outline-offset: 2px;
}
.photo-upload-toggle-icon {
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 0.2s ease;
  display: inline-block;
}
.photo-upload-toggle[aria-expanded="true"] .photo-upload-toggle-icon {
  transform: rotate(45deg);
}

.photo-upload-form-wrap {
  margin-top: 1rem;
  padding: 1.25rem;
  background: var(--white);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius);
  /* Animated open/close handled by JS toggling hidden attribute */
}
.photo-upload-form-wrap[hidden] { display: none; }

/* ── Gallery page ── */
.gallery-page-section {
  background: var(--white);
  padding: 3rem 2rem 5rem;
}
.gallery-page-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
}
.photo-gallery-mosaic--full {
  columns: 4 200px;
  column-gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.photo-gallery-mosaic--full .gallery-tile {
  margin-bottom: 0.75rem;
}
@media (max-width: 900px) {
  .photo-gallery-mosaic--full { columns: 3 160px; }
}
@media (max-width: 600px) {
  .photo-gallery-mosaic--full { columns: 2; column-gap: 0.5rem; }
  .photo-gallery-mosaic--full .gallery-tile { margin-bottom: 0.5rem; }
}
#wpadminbar { display: none !important; }
html { margin-top: 0 !important; }

/* ── Single story layout ── */
.single-story-layout {
  background: var(--white);
  padding: 2.5rem 2rem 5rem;
}
.single-story-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
}
.story-hero-date {
  margin-bottom: 0.5rem;
  display: block;
}
.single-story-two-col {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 3rem;
  align-items: start;
}
.single-story-text {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-primary);
}
.single-story-text p { margin-bottom: 1.5em; }
.single-story-text--full {
  max-width: 740px;
}
.single-story-img img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-faint);
  display: block;
}
.single-story-actions {
  margin-top: 3rem;
  text-align: center;
  border-top: 1px solid var(--border-faint);
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.single-story-actions p {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}
.single-story-actions .btn { margin: 0 0.35rem; }

@media (max-width: 860px) {
  .single-story-two-col { grid-template-columns: 1fr; }
  .single-story-img { order: -1; }
  .single-story-img img { max-height: 280px; }
}
@media (max-width: 768px) {
  .single-story-layout { padding: 1.5rem 1rem 4rem; }
}

.story-header,
.story-body,
.story-footer-actions {
  max-width: var(--wide-width);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Remove WordPress block editor overrides */
.single-story .wp-block-group,
.single-story .wp-block-paragraph,
.single-story .entry-content,
.single-story .wp-block-post-content {
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Two-column body: text left, image right */
.story-body {
  margin-bottom: 2rem;
  padding-left: 1rem;
  padding-right: 1rem;
}
.story-body--with-image {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 3rem;
  align-items: start;
}
.story-body--with-image .story-content {
  max-width: 100%;
  margin: 0;
}
.story-body--with-image .story-image {
  max-width: 100%;
  margin: 0;
  position: sticky;
  top: 88px;
}
.story-body--with-image .story-image img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-faint);
  display: block;
}

/* Footer actions */
.story-footer-actions {
  margin-top: 3rem;
  text-align: center;
}
.story-footer-prompt {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}
.story-footer-actions .btn { margin: 0 0.4rem; }

/* Mobile: stack image above text, remove excess padding */
@media (max-width: 860px) {
  .story-body--with-image { grid-template-columns: 1fr; }
  .story-body--with-image .story-image { position: static; order: -1; }
  .story-body--with-image .story-image img { max-height: 280px; }
}
@media (max-width: 768px) {
  .single-story { padding: 1rem 0 4rem; }
  .story-header,
  .story-body,
  .story-footer-actions { padding-left: 1rem; padding-right: 1rem; }
}

/* ── Back to top ── */
.back-to-top {
  display: block;
  text-align: center;
  padding: 0.6rem 1rem;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--green-300);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color var(--transition);
  border-bottom: 1px solid var(--green-700);
}
.back-to-top:hover,
.back-to-top:focus-visible { color: var(--white); }

/* ── Form live status region — WCAG 4.1.3 ── */
.form-live-status:empty { display: none; }
.form-live-status { margin-bottom: 1rem; }

/* ── Funeral + Donations two-column section ── */
.funeral-donations-section {
  background: #fff;
  border-top: 1px solid #e8e3da;
  border-bottom: 1px solid #e8e3da;
  padding: 1.25rem 2rem;
}
.funeral-donations-inner {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.funeral-donations-col-left {
  padding-right: 2rem;
  border-right: 1px solid #e8e3da;
}
.funeral-donations-col-right {
  padding-left: 2rem;
  text-align: center;
}

@media (max-width: 680px) {
  .funeral-donations-section { padding: 1.25rem; }
  .funeral-donations-inner {
    grid-template-columns: 1fr;
  }
  .funeral-donations-col-left {
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid #e8e3da;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
  }
  .funeral-donations-col-right {
    padding-left: 0;
  }
}
