/* ============================================================
   Sacred Way Farms — Pilgrim visual system
   ============================================================ */

:root {
  /* Palette */
  --bg: #FBF6EC;
  --ink: #1F2A3D;
  --ink-muted: #46506A;
  --gold: #B08D2E;
  --gold-text: #7A601F; /* darkened for WCAG AA contrast on all site backgrounds */
  --burgundy: #6B2737;
  --rule: #C9B98A;
  --surface: #FFFFFF;
  --surface-alt: #F3EBD6;

  /* Typography */
  --font-display: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Scale */
  --step-xs: 0.75rem;
  --step-sm: 0.875rem;
  --step-md: 1rem;
  --step-lg: 1.125rem;
  --step-xl: 1.25rem;
  --step-2xl: 1.5rem;
  --step-3xl: 2rem;
  --step-4xl: 2.75rem;
  --step-5xl: 3.5rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  /* Layout */
  --container: 1200px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-display);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, iframe { max-width: 100%; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--burgundy);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--ink);
  color: var(--bg);
  padding: var(--space-2) var(--space-4);
  z-index: 100;
  font-family: var(--font-ui);
  font-size: var(--step-sm);
}
.skip-link:focus { top: 0; }

/* Container */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-6); }

/* Typography */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; line-height: 1.1; color: var(--ink); margin: 0; }
h1 { font-size: var(--step-5xl); }
h2 { font-size: var(--step-4xl); }
h3 { font-size: var(--step-2xl); }
h4 { font-size: var(--step-xl); }
em { color: var(--burgundy); font-weight: 400; }
p { margin: 0 0 var(--space-4); }
.lede { font-size: var(--step-xl); color: var(--ink-muted); max-width: 60ch; }
.eyebrow { font-family: var(--font-ui); font-size: var(--step-xs); letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-text); font-weight: 500; }

@media (max-width: 768px) {
  h1 { font-size: var(--step-4xl); }
  h2 { font-size: var(--step-3xl); }
  h3 { font-size: var(--step-xl); }
}

/* Header */
.site-header {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}
.site-header .inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); }
.brand { font-family: var(--font-display); font-size: var(--step-xl); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; color: var(--ink); text-decoration: none; }
.primary-nav { display: flex; align-items: center; gap: var(--space-6); }
.primary-nav a { font-family: var(--font-ui); font-size: var(--step-sm); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); text-decoration: none; font-weight: 500; }
.primary-nav a:hover, .primary-nav a[aria-current="page"] { color: var(--ink); }

/* Header status pill */
.header-pill {
  font-family: var(--font-ui);
  font-size: var(--step-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  background: var(--burgundy);
  color: var(--bg);
  border-radius: var(--radius-pill);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.header-pill .pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
@media (max-width: 900px) {
  .header-pill { display: none; }
}

/* Mobile nav */
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: var(--space-2); }
.nav-toggle svg { width: 28px; height: 28px; stroke: var(--ink); }
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .primary-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--rule); flex-direction: column; padding: var(--space-6); align-items: flex-start; display: none; }
  .primary-nav.open { display: flex; }
}

/* Footer */
.site-footer {
  background: var(--ink);
  color: var(--bg);
  padding: var(--space-16) 0 var(--space-8);
  margin-top: var(--space-24);
  font-family: var(--font-ui);
  font-size: var(--step-sm);
}
.site-footer .inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--space-12); }
.site-footer h4 { color: var(--bg); font-family: var(--font-display); margin-bottom: var(--space-3); }
.site-footer a { color: var(--bg); text-decoration: none; opacity: 0.85; }
.site-footer a:hover { opacity: 1; text-decoration: underline; }
.site-footer .credits { margin-top: var(--space-12); padding-top: var(--space-6); border-top: 1px solid rgba(251,246,236,0.2); display: flex; justify-content: space-between; opacity: 0.7; font-size: var(--step-xs); }
@media (max-width: 768px) {
  .site-footer .inner { grid-template-columns: 1fr; gap: var(--space-6); }
  .site-footer .credits { flex-direction: column; gap: var(--space-2); }
}

/* Hero */
.hero {
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  padding: 0;
}
.hero-body { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 520px; }
.hero-text { padding: var(--space-16) var(--space-12); display: flex; flex-direction: column; justify-content: center; }
.hero-image { background: var(--surface-alt); background-size: cover; background-position: center; position: relative; }
.hero-image::before { content: ''; position: absolute; inset: var(--space-4); border: 1px solid rgba(251,246,236,0.4); pointer-events: none; }
@media (max-width: 900px) {
  .hero-body { grid-template-columns: 1fr; }
  .hero-image { min-height: 280px; }
  .hero-text { padding: var(--space-12) var(--space-6); }
}

/* Status badge (hero) */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  align-self: flex-start;
  padding: var(--space-2) var(--space-4);
  background: var(--burgundy);
  color: var(--bg);
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  font-size: var(--step-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: var(--space-6);
  text-decoration: none;
}
.status-badge .pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--gold); position: relative;
  animation: pulse 2s ease-in-out infinite;
}
.status-badge .pulse::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%; background: var(--gold);
  opacity: 0.4; animation: ring 2s ease-in-out infinite;
}
.status-badge .sep { opacity: 0.5; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
@keyframes ring { 0% { transform: scale(0.8); opacity: 0.5; } 100% { transform: scale(1.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .status-badge .pulse, .status-badge .pulse::after { animation: none; }
}

/* Buttons */
.btn {
  display: inline-block;
  padding: var(--space-3) var(--space-6);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-ui);
  font-size: var(--step-sm);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s var(--ease);
}
.btn:hover { background: var(--burgundy); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
.btn-link { background: none; color: var(--ink); text-decoration: underline; text-underline-offset: 5px; padding: var(--space-3) 0; letter-spacing: 0.06em; text-transform: none; font-size: var(--step-sm); font-weight: 500; }
.btn-link:hover { color: var(--burgundy); background: none; }

/* Section scaffolding */
.section { padding: var(--space-16) 0; }
.section-tight { padding: var(--space-12) 0; }
.section-alt { background: var(--surface-alt); }
.ornament { width: 60px; height: 1px; background: var(--gold); margin: 0 0 var(--space-6); position: relative; }
.ornament::after { content: '✠'; position: absolute; left: 70px; top: -14px; color: var(--gold-text); font-size: var(--step-lg); }

/* Cards / tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.tile { background: var(--surface); border: 1px solid var(--rule); padding: var(--space-6); border-radius: var(--radius-md); }
.tile .label { font-family: var(--font-ui); font-size: var(--step-xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-text); margin-bottom: var(--space-2); }
.tile .value { font-family: var(--font-display); font-size: var(--step-xl); color: var(--ink); }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .tiles { grid-template-columns: 1fr; } }

/* Resource grid */
.resource-group { margin-bottom: var(--space-12); }
.resource-group h3 { margin-bottom: var(--space-4); }
.resource-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); list-style: none; padding: 0; margin: 0; }
.resource-list li { background: var(--surface); border: 1px solid var(--rule); padding: var(--space-4) var(--space-6); border-radius: var(--radius-md); }
.resource-list a { font-family: var(--font-display); font-size: var(--step-lg); color: var(--ink); text-decoration: none; font-weight: 500; display: block; margin-bottom: var(--space-2); }
.resource-list a:hover { color: var(--burgundy); }
.resource-list .desc { font-family: var(--font-display); color: var(--ink-muted); font-size: var(--step-md); }
@media (max-width: 768px) { .resource-list { grid-template-columns: 1fr; } }

/* Schedule */
.schedule { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.day { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-md); padding: var(--space-6); }
.day h3 { margin-bottom: var(--space-4); padding-bottom: var(--space-3); border-bottom: 1px solid var(--rule); }
.day ul { list-style: none; padding: 0; margin: 0; }
.day li { display: flex; gap: var(--space-4); padding: var(--space-2) 0; font-family: var(--font-display); font-size: var(--step-md); color: var(--ink-muted); }
.day li .time { font-family: var(--font-ui); font-size: var(--step-xs); letter-spacing: 0.08em; color: var(--gold-text); font-weight: 600; min-width: 4.5rem; padding-top: 0.2em; }
@media (max-width: 900px) { .schedule { grid-template-columns: 1fr; } }

/* Forms */
.form-section { background: var(--surface); padding: var(--space-12) var(--space-12); border-radius: var(--radius-lg); box-shadow: 0 6px 20px rgba(31,42,61,0.08); max-width: 760px; margin: 0 auto; }
@media (max-width: 640px) { .form-section { padding: var(--space-8) var(--space-4); } }
.form-demo-tag { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-3); background: rgba(176,141,46,0.15); color: var(--gold-text); border-radius: var(--radius-pill); font-family: var(--font-ui); font-size: var(--step-xs); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: var(--space-6); }
.form-demo-tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6) var(--space-4); }
.field-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; }
.field label { font-family: var(--font-ui); font-size: var(--step-xs); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: var(--space-2); }
.field label .req { color: var(--burgundy); margin-left: 3px; }
.field input, .field select, .field textarea {
  font-family: var(--font-display);
  font-size: var(--step-lg);
  padding: var(--space-3) var(--space-4);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--burgundy);
  box-shadow: 0 0 0 3px rgba(107,39,55,0.12);
}
.field textarea { min-height: 96px; resize: vertical; }
.field .help { font-family: var(--font-display); font-size: var(--step-sm); font-style: italic; color: var(--ink-muted); margin-top: var(--space-2); }
.field .error { color: var(--burgundy); font-family: var(--font-ui); font-size: var(--step-sm); margin-top: var(--space-2); min-height: 1.2em; }
@media (max-width: 640px) { .field-grid { grid-template-columns: 1fr; } }

/* Honeypot — visually hidden but technically visible to bots */
.honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Radio pill group */
.radio-row { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.radio-pill { padding: var(--space-3) var(--space-5); border: 1px solid var(--rule); border-radius: var(--radius-pill); cursor: pointer; font-family: var(--font-display); font-size: var(--step-md); background: var(--bg); transition: all 0.15s; user-select: none; }
.radio-pill input { position: absolute; opacity: 0; }
.radio-pill:has(input:checked), .radio-pill.selected { border-color: var(--burgundy); background: var(--burgundy); color: var(--bg); }
.radio-pill:hover:not(:has(input:checked)) { border-color: var(--burgundy); color: var(--burgundy); }

/* Form divider */
.form-divider { height: 1px; background: var(--rule); margin: var(--space-8) 0; position: relative; }
.form-divider::after { content: '✠'; position: absolute; left: 50%; top: -10px; transform: translateX(-50%); background: var(--surface); padding: 0 var(--space-3); color: var(--gold-text); font-size: var(--step-md); }

/* Payment note */
.payment-note { background: rgba(176,141,46,0.08); border-left: 3px solid var(--gold); padding: var(--space-4) var(--space-6); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-family: var(--font-display); font-size: var(--step-md); color: var(--ink-muted); }
.payment-note strong { color: var(--ink); font-weight: 600; }
.payment-note code { font-family: var(--font-ui); font-size: var(--step-sm); background: var(--surface); padding: 2px 6px; border-radius: 3px; border: 1px solid var(--rule); }

/* Submit row */
.submit-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); flex-wrap: wrap; margin-top: var(--space-6); }
.submit-btn { padding: var(--space-4) var(--space-8); background: var(--ink); color: var(--bg); font-family: var(--font-ui); font-weight: 500; font-size: var(--step-sm); letter-spacing: 0.12em; text-transform: uppercase; border: none; border-radius: var(--radius-sm); cursor: pointer; transition: background 0.15s; }
.submit-btn:hover:not(:disabled) { background: var(--burgundy); }
.submit-btn:disabled { opacity: 0.6; cursor: wait; }
.submit-foot { font-family: var(--font-display); font-size: var(--step-sm); font-style: italic; color: var(--ink-muted); }

/* Form state cards */
.form-success, .form-error { padding: var(--space-8); text-align: center; border-radius: var(--radius-md); }
.form-success { background: rgba(176,141,46,0.08); border: 1px solid var(--gold); }
.form-error { background: rgba(107,39,55,0.08); border: 1px solid var(--burgundy); }
.form-success h3, .form-error h3 { margin-bottom: var(--space-3); }

/* Utilities */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.stack > * + * { margin-top: var(--space-6); }
.stack-sm > * + * { margin-top: var(--space-3); }
.stack-lg > * + * { margin-top: var(--space-8); }
.center { text-align: center; }

/* ============================================================
   Mobile polish — overrides for phone-size viewports
   ============================================================ */
@media (max-width: 768px) {
  /* Section padding tighter on phones */
  .section { padding: var(--space-12) 0; }
  .section-tight { padding: var(--space-8) 0; }
  .site-footer { padding: var(--space-12) 0 var(--space-6); margin-top: var(--space-16); }

  /* Container gutter */
  .container { padding: 0 var(--space-4); }

  /* Any inline 2-column grid container collapses to single column */
  main .container[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: var(--space-8) !important;
  }

  /* Contact quick-pick tiles (3-col → 1-col) */
  main .tiles[style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr !important;
  }

  /* Hero */
  .hero h1 { font-size: var(--step-3xl); line-height: 1.08; }
  .hero .lede { font-size: var(--step-lg); }
  .hero-text { padding: var(--space-8) var(--space-4); }
  .hero-image { min-height: 220px; }

  /* Status badge wraps cleanly */
  .status-badge {
    flex-wrap: wrap;
    line-height: 1.4;
    padding: var(--space-2) var(--space-4);
    font-size: 10px;
    gap: var(--space-2);
  }
  .status-badge .sep { display: none; }

  /* Primary CTAs go full-width in the hero on mobile */
  .hero-text > div[style*="display: flex"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: var(--space-3) !important;
  }
  .hero-text .btn {
    width: 100%;
    text-align: center;
    padding: var(--space-4);
    font-size: var(--step-xs);
  }
  .hero-text .btn-link {
    text-align: center;
    padding: var(--space-2) 0;
  }

  /* Tiles: tighter padding, slightly smaller values */
  .tile { padding: var(--space-4); }
  .tile .value { font-size: var(--step-lg); }

  /* Schedule time column narrower + values wrap */
  .day li .time { min-width: 3.5rem; font-size: 10px; }

  /* Radio pill group stacks vertically */
  .radio-row { flex-direction: column; align-items: stretch; }
  .radio-pill { text-align: center; font-size: var(--step-md); padding: var(--space-3) var(--space-4); }

  /* Form section tighter */
  .form-section { padding: var(--space-8) var(--space-4); }
  .form-section h2 { font-size: var(--step-2xl); }
  .submit-row { flex-direction: column; align-items: stretch; gap: var(--space-3); }
  .submit-btn { width: 100%; }
  .submit-foot { text-align: center; font-size: var(--step-xs); }

  /* Resource cards: tighter padding */
  .resource-list li { padding: var(--space-3) var(--space-4); }
  .resource-list a { font-size: var(--step-md); }
  .resource-list .desc { font-size: var(--step-sm); }

  /* Stack-lg on about page tighter */
  .stack-lg > * + * { margin-top: var(--space-6); }

  /* Ornament recenter when inline style used */
  .ornament { margin-bottom: var(--space-4); }

  /* Footer nav / primary nav shows via hamburger — already handled by existing rule */
  .site-footer .inner { gap: var(--space-8); }
}

/* ============================================================
   Narrower phones (iPhone SE and similar, ~375px)
   ============================================================ */
@media (max-width: 420px) {
  .hero h1 { font-size: var(--step-2xl); }
  h2 { font-size: var(--step-2xl); }
  .tiles { grid-template-columns: 1fr; gap: var(--space-3); }
  .day { padding: var(--space-4); }
  .day li { padding: var(--space-2) 0; font-size: var(--step-sm); }
}
