/* The Gathering ATX — theme styles.
   Colors and fonts come from theme.json presets (--wp--preset--*), so changing
   them in Styles updates the whole site. */

:root {
  --g-bg: var(--wp--preset--color--background);
  --g-fg: var(--wp--preset--color--foreground);
  --g-surface: var(--wp--preset--color--surface);
  --g-muted: var(--wp--preset--color--muted);
  --g-line: var(--wp--preset--color--line);
  --g-sun: var(--wp--preset--color--primary);
  --g-sun-bright: var(--wp--preset--color--secondary);
  --g-sky-deep: var(--wp--preset--color--sky-deep);
  --g-sky: var(--wp--preset--color--sky);
  --g-on-sky: var(--wp--preset--color--on-sky);
  --g-on-sky-muted: var(--wp--preset--color--on-sky-muted);
  --g-error: #a3261b;
  --g-ok: #1d5f3f;
  --g-radius: 6px;
}

[hidden] { display: none !important; }
h1, h2, h3 { text-wrap: balance; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--g-sun-bright);
  outline-offset: 3px;
  border-radius: 2px;
}
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.gathering-eyebrow {
  font-size: 0.92rem !important; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--g-sun);
}
.is-style-gathering-sky .gathering-eyebrow { color: var(--g-sun-bright); }

/* ---------- Header ---------- */
.wp-site-blocks > header.wp-block-template-part:has(.gathering-header),
.wp-site-blocks > .wp-block-template-part:has(> .gathering-header) { position: sticky; top: 0; z-index: 50; }
.admin-bar .wp-site-blocks > .wp-block-template-part:has(.gathering-header) { top: var(--wp-admin--admin-bar--height, 32px); }
.gathering-header {
  background: color-mix(in srgb, var(--g-sky-deep) 94%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--g-on-sky);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.gathering-header a { color: var(--g-on-sky); text-decoration: none; }
.gathering-brand { gap: 0.75rem !important; }
.gathering-brand .wp-block-image { margin: 0; }
.gathering-brand img { width: 46px; height: 46px; display: block; }
.gathering-brand .wp-block-site-title { font-size: 0.95rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; margin: 0; }
.gathering-header .wp-block-navigation { font-size: 0.98rem; }
.gathering-header .wp-block-navigation-item__content { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.6rem !important; border-radius: var(--g-radius); }
.gathering-header .wp-block-navigation-item__content:hover { background: rgba(255, 255, 255, 0.08); }
.gathering-header .current-menu-item > .wp-block-navigation-item__content { box-shadow: inset 0 -2px 0 var(--g-sun-bright); }
.gathering-header .gathering-nav-cta > .wp-block-navigation-item__content { background: var(--g-sun-bright); color: var(--g-sky-deep) !important; font-weight: 700; }
.gathering-header .wp-block-navigation__responsive-container-open,
.gathering-header .wp-block-navigation__responsive-container-close { min-width: 44px; min-height: 44px; justify-content: center; color: var(--g-on-sky); }
.gathering-header .wp-block-navigation__responsive-container.is-menu-open { background: var(--g-sky-deep) !important; color: var(--g-on-sky) !important; }
@media (max-width: 380px) { .gathering-brand .wp-block-site-title { display: none; } }

/* ---------- Sky sections (Cover block, style "Night sky with clouds") ---------- */
.wp-block-cover.is-style-gathering-sky {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 0; color: var(--g-on-sky);
  padding-top: clamp(3.5rem, 9vw, 7.5rem); padding-bottom: clamp(3.5rem, 8vw, 6rem);
  background: var(--gathering-poster, none) center 40% / cover no-repeat, radial-gradient(140% 70% at 50% 115%, #5a3d1a 0%, var(--g-sky) 45%, var(--g-sky-deep) 85%);
}
.wp-block-cover.is-style-gathering-sky > .wp-block-cover__background { opacity: 0 !important; }
.wp-block-cover.is-style-gathering-sky > .gathering-clouds { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; object-fit: cover; object-position: center 40%; pointer-events: none; }
.wp-block-cover.is-style-gathering-sky::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 6, 10, 0.55) 0%, rgba(5, 6, 10, 0.72) 100%);
}
.wp-block-cover.is-style-gathering-sky > .wp-block-cover__inner-container { position: relative; z-index: 2; color: var(--g-on-sky); }
.is-style-gathering-sky h1 { text-transform: uppercase; letter-spacing: 0.01em; max-width: 13ch; }
.is-style-gathering-sky h1 em { font-style: italic; color: var(--g-sun-bright); }
.is-style-gathering-sky p { color: var(--g-on-sky); }
.is-style-gathering-sky .gathering-muted { color: var(--g-on-sky-muted); }
.gathering-hero-logo { justify-self: end; margin-left: auto !important; }
.gathering-hero-logo img { width: min(100%, 22rem) !important; height: auto; opacity: 0.94; }
@media (max-width: 781px) {
  .gathering-hero .wp-block-columns { flex-direction: column-reverse; }
  .gathering-hero-logo { margin-left: 0 !important; }
  .gathering-hero-logo img { width: 7.5rem !important; }
}

.motion-toggle {
  position: absolute; z-index: 3;
  right: max(16px, env(safe-area-inset-right, 0px)); bottom: 16px;
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 0.9rem;
  background: rgba(5, 6, 10, 0.6); color: var(--g-on-sky); border: 1px solid rgba(244, 243, 239, 0.35);
  border-radius: 999px; font: inherit; font-size: 0.85rem; cursor: pointer;
}
.motion-toggle:hover { background: rgba(5, 6, 10, 0.85); }
.motion-toggle svg { width: 14px; height: 14px; fill: currentColor; }

/* Verse on the sky */
.wp-block-quote.is-style-gathering-verse { margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--g-sun-bright) !important; max-width: 52ch; }
.wp-block-quote.is-style-gathering-verse p { font-size: inherit; line-height: 1.55; }
.wp-block-quote.is-style-gathering-verse cite,
.wp-block-quote.is-style-gathering-closing cite { font-style: normal; font-size: 0.92rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--g-sun-bright); }

/* Closing verse */
.wp-block-quote.is-style-gathering-closing { margin: 0 auto; border: 0; text-align: center; max-width: 26ch; }
.wp-block-quote.is-style-gathering-closing p { font-family: var(--wp--preset--font-family--display); font-size: var(--wp--preset--font-size--x-large); line-height: 1.25; }

/* Buttons */
.wp-block-button.is-style-gathering-sun .wp-block-button__link { background: var(--g-sun-bright); color: var(--g-sky-deep); }
.wp-block-button.is-style-gathering-sun .wp-block-button__link:hover { background: #f6cf7a; }
.wp-block-button.is-style-gathering-ghost .wp-block-button__link { background: transparent; color: var(--g-on-sky); box-shadow: inset 0 0 0 2px rgba(244, 243, 239, 0.55); }
.wp-block-button.is-style-gathering-ghost .wp-block-button__link:hover { background: rgba(255, 255, 255, 0.08); }
.wp-block-button.is-style-gathering-outline .wp-block-button__link { background: transparent; color: var(--g-fg); box-shadow: inset 0 0 0 2px var(--g-line); }
.wp-block-button.is-style-gathering-outline .wp-block-button__link:hover { box-shadow: inset 0 0 0 2px var(--g-fg); }
.wp-block-button__link { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Event cards ---------- */
.wp-block-group.is-style-gathering-card,
.wp-block-group.is-style-gathering-dashed {
  padding: 1.5rem; border-radius: var(--g-radius); height: 100%;
  background: var(--g-bg); border: 1px solid var(--g-line);
}
.wp-block-group.is-style-gathering-dashed { background: transparent; border-style: dashed; }
.is-style-gathering-card h3, .is-style-gathering-dashed h3 { margin-top: 0.25rem; }
.is-style-gathering-card p, .is-style-gathering-dashed p { color: var(--g-muted); }
.is-style-gathering-card .gathering-eyebrow, .is-style-gathering-dashed .gathering-eyebrow { color: var(--g-sun); }
.gathering-details { margin-top: 1.25rem !important; padding-top: 1rem; border-top: 1px solid var(--g-line); }
.gathering-details p { font-size: 0.95rem; color: var(--g-muted); margin: 0.4rem 0 0; }
.gathering-details strong { color: var(--g-fg); display: block; }

/* ---------- Believe ---------- */
@media (min-width: 782px) {
  .gathering-believe-intro { position: sticky; top: 6.5rem; align-self: flex-start; }
}
.gathering-believe-intro img { width: 5.5rem; height: auto; }
.gathering-story h3 { margin-top: 2rem; }
.wp-block-quote.is-style-gathering-scripture {
  margin: 0.75rem 0 0; padding: 0.9rem 1.1rem; border: 0; border-radius: var(--g-radius);
  background: var(--g-surface);
}
.wp-block-quote.is-style-gathering-scripture p { font-family: var(--wp--preset--font-family--display); font-size: 1.05rem; line-height: 1.55; }
.wp-block-quote.is-style-gathering-scripture cite { display: block; margin-top: 0.4rem; font-style: normal; font-size: 0.92rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--g-sun); }
.gathering-declare { font-family: var(--wp--preset--font-family--display); font-size: var(--wp--preset--font-size--large) !important; line-height: 1.3; }

/* ---------- Footer ---------- */
.gathering-footer { background: var(--g-sky-deep); color: var(--g-on-sky-muted); font-size: 0.95rem; }
.gathering-footer a { color: var(--g-on-sky); }
.gathering-footer img { width: 88px; height: auto; }
.gathering-footer .wp-block-navigation-item__content { min-height: 44px; display: inline-flex; align-items: center; }
.gathering-footer .wp-block-social-links .wp-social-link { color: var(--g-on-sky); }
.gathering-footer .wp-block-social-links a { padding: 0.6rem; }

/* ---------- Contact form ---------- */
.gathering-contact { display: grid; gap: 1.25rem; }
.gathering-contact .form { display: grid; gap: 1.35rem; container-type: inline-size; }
.gathering-contact .field { display: grid; gap: 0.4rem; min-width: 0; }
.gathering-contact .field label, .gathering-contact .field legend { font-weight: 700; font-size: 1rem; }
.gathering-contact .req, .gathering-contact .hint, .gathering-contact .small { color: var(--g-muted); font-weight: 400; font-size: 0.92rem; margin: 0; }
.gathering-contact input[type="text"], .gathering-contact input[type="email"], .gathering-contact input[type="tel"], .gathering-contact textarea {
  width: 100%; min-height: 48px; padding: 0.7rem 0.85rem; box-sizing: border-box;
  font: inherit; font-size: 1rem; color: var(--g-fg); background: #fff;
  border: 2px solid var(--g-line); border-radius: var(--g-radius);
}
.gathering-contact textarea { min-height: 9rem; resize: vertical; }
.gathering-contact input:hover, .gathering-contact textarea:hover { border-color: var(--g-muted); }
.gathering-contact input:focus-visible, .gathering-contact textarea:focus-visible { outline-offset: 1px; border-color: var(--g-fg); }
.gathering-contact [aria-invalid="true"] { border-color: var(--g-error) !important; }
.gathering-contact .error { color: var(--g-error); font-size: 0.92rem; font-weight: 700; margin: 0; }
.gathering-contact .error:empty { display: none; }
.three-up { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.35rem; align-items: start; }
.three-up input { height: 48px; }
@container (max-width: 560px) { .three-up { grid-template-columns: minmax(0, 1fr); } }
.gathering-contact fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.25rem; }
.choice { position: relative; display: inline-flex; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; border: 2px solid var(--g-line); border-radius: 999px; font-size: 0.98rem; background: #fff; font-weight: 400; }
.choice input:checked + span { border-color: var(--g-fg); background: var(--g-surface); font-weight: 700; }
.choice input:checked + span::before { content: "✓"; margin-right: 0.4rem; }
.choice input:focus-visible + span { outline: 3px solid var(--g-sun-bright); outline-offset: 2px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.form-footer .small { max-width: 38ch; }
.gathering-contact button[type="submit"] { min-height: 48px; cursor: pointer; border: 0; }
.gathering-contact button[aria-disabled="true"] { opacity: 0.7; cursor: progress; }
.error-summary { padding: 1rem 1.1rem; border: 2px solid var(--g-error); border-radius: var(--g-radius); background: #fbeceb; }
.error-summary h2 { font-family: var(--wp--preset--font-family--body); font-weight: 700; font-size: 1.05rem; margin: 0 0 0.4rem; }
.error-summary ul { margin: 0; padding-left: 1.2rem; }
.error-summary a { color: var(--g-error); font-weight: 700; }
.confirmation { display: grid; gap: 0.9rem; padding: clamp(1.5rem, 4vw, 2.25rem); border: 2px solid var(--g-ok); border-radius: var(--g-radius); background: #edf6f0; }
.confirmation h2 { margin: 0; }
.confirmation p { margin: 0; }
.confirmation button.wp-block-button__link { border: 0; cursor: pointer; font: inherit; font-weight: 700; }

/* Gentle entrance — content is visible at rest; this only adds a small lift */
@media (prefers-reduced-motion: no-preference) {
  .is-style-gathering-sky .wp-block-cover__inner-container > * { animation: gathering-rise .7s cubic-bezier(.2,.7,.2,1) both; }
  @keyframes gathering-rise { from { transform: translateY(12px); } to { transform: none; } }
}

@media (forced-colors: active) {
  .wp-block-cover.is-style-gathering-sky::after { display: none; }
  .choice span, .motion-toggle, .wp-block-button__link { border: 2px solid ButtonText; }
}

/* Tighter spacing for scripture under its paragraph (overrides the parent theme's quote margins) */
.gathering-story .wp-block-quote.is-style-gathering-scripture { margin-top: 0.9rem !important; margin-bottom: 0 !important; }

/* Who we are: four pillars */
.gathering-pillars.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 1.75rem 2rem !important; }
@media (max-width: 640px) { .gathering-pillars.is-layout-grid { grid-template-columns: minmax(0, 1fr) !important; } }
.gathering-pillar { padding-top: 1rem; border-top: 2px solid var(--g-sun-bright); }
.gathering-pillar h3 { margin: 0 0 0.4rem; }
.gathering-pillar p { margin: 0; color: var(--g-muted); }
#about .wp-block-quote.is-style-gathering-scripture { margin-top: 2rem !important; background: var(--g-bg); border-left: 3px solid var(--g-sun-bright); }
