/* ============================================================================
   Soul Care Ministries LLC — styles.css
   Brand tokens as CSS custom properties (overridable from content.json at
   runtime by app.js) + responsive layout for 320px–1920px.
   ========================================================================== */

/* Fonts: warm humanist serif headings + clean sans body, with safe fallbacks. */
@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Inter:wght@400;500;600&display=swap");

:root {
  /* Brand colors — mirror content.json brand.colors; app.js overrides these. */
  --color-sage: #7C9A82;
  --color-sage-deep: #4F6B57;
  --color-sand: #F3ECE1;
  --color-cream: #FBF8F2;
  --color-terracotta: #C06B4A;
  --color-dusty-rose: #B87C82;
  --color-charcoal: #2C2A28;
  --color-charcoal-muted: #57534E;

  /* Type */
  --font-heading: "Fraunces", "Georgia", serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  /* Layout scale */
  --maxw: 1120px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 14px;
  --shadow: 0 6px 24px rgba(44, 42, 40, 0.10);
  --focus-ring: 3px solid var(--color-sage-deep);
}

/* ── Reset / base ───────────────────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;              /* ≥16px on mobile — Req 7.4 */
  line-height: 1.6;
  color: var(--color-charcoal);
  background: var(--color-cream);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;           /* guard against accidental horizontal scroll — Req 7.1 */
}

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

h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--color-charcoal);
  line-height: 1.15;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 6vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.4rem); }

p { margin: 0 0 1rem; }

a { color: var(--color-sage-deep); }

/* Visible keyboard focus on every interactive element — Req 8.7 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section { padding-block: clamp(2.5rem, 7vw, 5rem); }

/* ── Buttons / CTAs ─────────────────────────────────────────────────────── */
.btn,
.follow-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;             /* ≥44×44 tap target — Req 7.2 */
  min-width: 44px;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.12s ease, background-color 0.12s ease;
}

.btn--primary {
  background: var(--color-sage-deep);
  color: var(--color-cream);     /* cream on sageDeep ≈ 6.1:1 — AA ✓ */
}
.btn--primary:hover { transform: translateY(-1px); }

.btn--ghost {
  background: transparent;
  color: var(--color-sage-deep);
  border-color: var(--color-sage-deep);
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  /* Background image with brand-color fallback — Req 1.7 */
  background-color: var(--color-sage-deep);
  background-image: linear-gradient(180deg, rgba(44,42,40,0.35), rgba(44,42,40,0.55)), var(--hero-image, none);
  background-size: cover;
  background-position: center;
  color: var(--color-cream);
  text-align: center;
  min-height: min(88vh, 720px);
  display: grid;
  place-items: center;
}
.hero h1 { color: var(--color-cream); }
.hero .mission {
  max-width: 46ch;
  margin-inline: auto;
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  color: var(--color-cream);
}
.hero .follow-bar { margin-top: 1.75rem; }

/* ── Follow bar ─────────────────────────────────────────────────────────── */
.follow-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}
.follow-bar .follow-link {
  background: var(--color-cream);
  color: var(--color-charcoal);
}
.follow-link .icon { width: 22px; height: 22px; }

/* ── Generic section headers ────────────────────────────────────────────── */
.section-alt { background: var(--color-sand); }

/* ── Social highlights ──────────────────────────────────────────────────── */
.highlights-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
.embed-slot {
  background: var(--color-sand);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
/* Responsive 16:9 media so embeds fit the mobile viewport — Req 7.3 */
.embed-media {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
}
.embed-media iframe,
.embed-media img,
.embed-media .yt-facade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.yt-facade {
  cursor: pointer;
  display: grid;
  place-items: center;
  background-size: cover;
  background-position: center;
}
.yt-facade .play {
  width: 68px; height: 48px;
  background: rgba(44,42,40,0.75);
  border-radius: 12px;
  display: grid; place-items: center;
}
.yt-facade .play::before {
  content: "";
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent var(--color-cream);
}

.curated-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
.curated-card {
  background: var(--color-cream);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--color-charcoal);
  display: flex;
  flex-direction: column;
}
.curated-card .thumb {
  aspect-ratio: 1 / 1;
  background: var(--color-sage);   /* brand-color placeholder if image fails */
  width: 100%;
  object-fit: cover;
}
.curated-card .caption { padding: 0.75rem 1rem; font-weight: 500; }

/* Embed fallback (Follow link + message) */
.embed-fallback {
  padding: 1.5rem;
  text-align: center;
  background: var(--color-sand);
  border-radius: var(--radius);
}
.embed-fallback p { color: var(--color-charcoal-muted); }

/* ── About / themes / cross-link ────────────────────────────────────────── */
.about .person { color: var(--color-charcoal-muted); font-style: italic; }

.themes-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.themes-list li {
  background: var(--color-cream);
  border: 1px solid var(--color-sage);
  color: var(--color-charcoal);
  padding: 0.5rem 1rem;
  border-radius: 999px;
}

.cross-link { text-align: center; }

/* ── Contact ────────────────────────────────────────────────────────────── */
.contact-form {
  display: grid;
  gap: 1rem;
  max-width: 560px;
  margin-inline: auto;
}
.field { display: grid; gap: 0.35rem; }
.field label { font-weight: 600; }
.field input,
.field textarea {
  font: inherit;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--color-sage);
  border-radius: 10px;
  background: var(--color-cream);
  color: var(--color-charcoal);
  min-height: 44px;
}
.field textarea { min-height: 140px; resize: vertical; }
.field-error {
  color: #9B2C2C;               /* accessible red on cream */
  font-size: 0.9rem;
  min-height: 1.2em;
}
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: #9B2C2C; }

.form-status { text-align: center; font-weight: 600; min-height: 1.4em; }
.form-status.error { color: #9B2C2C; }
.form-status.success { color: var(--color-sage-deep); }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--color-charcoal);
  color: var(--color-cream);
  text-align: center;
  padding-block: 2.5rem;
}
.site-footer .follow-bar .follow-link {
  background: transparent;
  color: var(--color-cream);
  border-color: var(--color-cream);
}
.site-footer a { color: var(--color-cream); }

/* ── Responsive breakpoints ─────────────────────────────────────────────── */
@media (min-width: 640px) {
  .curated-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
  .highlights-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .highlights-grid { grid-template-columns: repeat(2, 1fr); }
}

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