/* ==========================================================================
   STYLESHEET
   --------------------------------------------------------------------------
   1. Design tokens (colours, fonts, spacing) – change the look here
   2. Base & typography
   3. Layout helpers & buttons
   4. Header & navigation
   5. Sections (hero → footer, in page order)
   6. Dialogs & lightbox
   7. Reduced motion
   ========================================================================== */


/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */
:root {
    /* Colours */
    --cream: #faf6ef;
    --cream-deep: #f3ecdf;
    --sand: #e8dcc6;
    --sand-dark: #d6c5a6;
    --forest: #2f4a3a;
    --forest-dark: #223629;
    --forest-light: #3f6150;
    --sage: #8fa68e;
    --sage-light: #dfe7dc;
    --gold: #c49a4a;
    --gold-light: #e9d8b4;
    --gold-text: #8a6420;       /* darker gold for text – better contrast */
    --charcoal: #2b2a27;
    --text: #3a3833;
    --text-muted: #625e55;
    --white: #ffffff;
    --error: #a33a2c;
    --border: #e3d9c8;

    /* Fonts – if you self-host other fonts, change the names here */
    --font-serif: "Lora", Georgia, "Times New Roman", serif;
    --font-sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;

    /* Sizes */
    --container: 1160px;
    --container-narrow: 820px;
    --gutter: clamp(1rem, 4vw, 2rem);
    --section-space: clamp(4rem, 9vw, 7rem);
    --header-height: 72px;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;

    --shadow-sm: 0 1px 2px rgba(43, 42, 39, 0.06), 0 2px 8px rgba(43, 42, 39, 0.04);
    --shadow: 0 2px 6px rgba(43, 42, 39, 0.05), 0 12px 32px rgba(43, 42, 39, 0.08);

    --transition: 200ms ease;
}


/* ==========================================================================
   2. BASE & TYPOGRAPHY
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-padding-top: calc(var(--header-height) + 12px);
    -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    margin: 0;
    background: var(--cream);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.65;
    overflow-wrap: break-word;
    hyphens: auto;             /* helps long German words wrap nicely */
}

body.has-dialog {
    overflow: hidden;
}

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

img.is-broken {
    visibility: hidden;        /* failed image: show only the soft background */
}

h1, h2, h3, h4 {
    margin: 0 0 0.5em;
    color: var(--charcoal);
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.25;
    hyphens: manual;
}

p {
    margin: 0 0 1em;
}

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

a:hover {
    color: var(--forest-light);
}

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

::selection {
    background: var(--gold-light);
    color: var(--charcoal);
}

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

.skip-link {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 200;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--forest);
    color: var(--white);
    font-weight: 600;
    transform: translateY(-160%);
    transition: transform var(--transition);
}

.skip-link:focus {
    transform: translateY(0);
    color: var(--white);
}


/* ==========================================================================
   3. LAYOUT HELPERS & BUTTONS
   ========================================================================== */
.container {
    width: 100%;
    max-width: calc(var(--container) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.container-narrow {
    max-width: calc(var(--container-narrow) + 2 * var(--gutter));
}

.section {
    padding-block: var(--section-space);
}

.section-tinted {
    background: var(--cream-deep);
}

.section-header {
    max-width: 44rem;
    margin: 0 auto clamp(2rem, 5vw, 3.25rem);
    text-align: center;
}

.section-header p:last-child {
    margin-bottom: 0;
    color: var(--text-muted);
}

.section-title {
    font-size: clamp(1.85rem, 3.6vw, 2.6rem);
}

.subsection-title {
    margin-top: clamp(3rem, 6vw, 4.5rem);
    margin-bottom: 1.75rem;
    font-size: clamp(1.35rem, 2.4vw, 1.7rem);
    text-align: center;
}

.eyebrow {
    margin-bottom: 0.6rem;
    color: var(--gold-text);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.eyebrow-light {
    color: var(--gold-light);
}

.lead {
    color: var(--charcoal);
    font-family: var(--font-serif);
    font-size: clamp(1.15rem, 2vw, 1.3rem);
    line-height: 1.6;
}

.section-footnote {
    max-width: 42rem;
    margin: 2.5rem auto 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: center;
}

.placeholder-note {
    padding: 0.85rem 1.1rem;
    border: 1px dashed var(--sand-dark);
    border-radius: var(--radius-sm);
    background: #fffaf0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0.7rem 1.5rem;
    border: 1.5px solid transparent;
    border-radius: 999px;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--transition), color var(--transition),
        border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--forest);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--forest-dark);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-gold {
    background: var(--gold-light);
    color: var(--forest-dark);
}

.btn-gold:hover {
    background: #f2e4c6;
    color: var(--forest-dark);
}

.btn-outline {
    border-color: var(--forest);
    background: transparent;
    color: var(--forest);
}

.btn-outline:hover {
    background: var(--forest);
    color: var(--white);
}

.btn-ghost-light {
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.06);
    color: var(--white);
}

.btn-ghost-light:hover {
    border-color: var(--white);
    background: rgba(255, 255, 255, 0.16);
    color: var(--white);
}

.link-button,
.text-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--forest);
    font: inherit;
    cursor: pointer;
}

.link-button {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

.text-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
}

.text-button svg {
    width: 1.1em;
    height: 1.1em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform var(--transition);
}

.text-button:hover svg {
    transform: translateX(3px);
}

.badge {
    display: inline-block;
    margin-bottom: 0.6rem;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background: var(--sage-light);
    color: var(--forest-dark);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-prayer     { background: #e7e3f0; color: #3f3760; }
.badge-fellowship { background: #f5e6d3; color: #6b4520; }
.badge-worship    { background: #e1ebee; color: #264b57; }
.badge-special    { background: var(--gold-light); color: #5c4212; }
.badge-christmas  { background: #f3dcd6; color: #7a2e22; }

.meta-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.25rem;
    margin: 0 0 0.9rem;
    padding: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    list-style: none;
}

.meta-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
}

.meta-list svg,
.passage svg,
.prayer-note svg {
    flex-shrink: 0;
    width: 1.1em;
    height: 1.1em;
    margin-top: 0.22em;
    fill: none;
    stroke: var(--forest-light);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ==========================================================================
   4. HEADER & NAVIGATION
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 246, 239, 0.94);
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition), box-shadow var(--transition);
}

@supports (backdrop-filter: blur(8px)) {
    .site-header {
        background: rgba(250, 246, 239, 0.85);
        backdrop-filter: blur(10px);
    }
}

.site-header.is-scrolled,
.site-header.menu-open {
    border-bottom-color: var(--border);
    box-shadow: 0 4px 18px rgba(43, 42, 39, 0.05);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: var(--header-height);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    margin-right: auto;
    color: var(--charcoal);
    text-decoration: none;
}

.brand:hover {
    color: var(--forest);
}

.brand-mark {
    flex-shrink: 0;
    line-height: 0;
}

/* Logo (images/logo.png – black on a transparent background) */
.brand-mark img {
    width: 44px;
    height: 44px;
}

.brand-name {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.2;
}

.nav-list {
    display: flex;
    gap: 0.15rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-list a {
    display: block;
    padding: 0.5rem 0.7rem;
    border-radius: 999px;
    color: var(--text);
    font-size: 0.975rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--transition), color var(--transition);
}

.nav-list a:hover {
    background: var(--sage-light);
    color: var(--forest-dark);
}

.nav-list a.is-active {
    color: var(--forest);
    box-shadow: inset 0 -2px 0 var(--gold);
    border-radius: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.lang-switch {
    display: flex;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--white);
}

.lang-switch button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 34px;
    padding: 0 0.55rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    transition: background-color var(--transition);
}

.lang-switch button[hidden],
[data-needs-responsible][hidden] {
    display: none;
}

.lang-switch .flag {
    display: block;
    width: 24px;
    height: 16px;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
    opacity: 0.6;
    transition: opacity var(--transition);
}

.lang-switch button:hover .flag,
.lang-switch button[aria-pressed="true"] .flag {
    opacity: 1;
}

.lang-switch button[aria-pressed="true"] {
    background: var(--forest);
}

.menu-toggle {
    display: none;
    position: relative;
    width: 46px;
    height: 46px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--white);
    color: var(--charcoal);
    cursor: pointer;
}

.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
    position: absolute;
    left: 50%;
    width: 18px;
    height: 2px;
    margin-left: -9px;
    border-radius: 2px;
    background: currentColor;
    transition: transform var(--transition), opacity var(--transition);
}

.menu-toggle-bars {
    top: 50%;
    margin-top: -1px;
}

.menu-toggle-bars::before,
.menu-toggle-bars::after {
    content: "";
    left: 0;
    margin-left: 0;
}

.menu-toggle-bars::before { top: -6px; }
.menu-toggle-bars::after  { top: 6px; }

.menu-toggle[aria-expanded="true"] .menu-toggle-bars {
    background: transparent;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bars::before {
    transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bars::after {
    transform: translateY(-6px) rotate(-45deg);
}

/* Mobile & tablet navigation */
@media (max-width: 1079px) {
    .menu-toggle {
        display: block;
    }

    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
        border-bottom: 1px solid var(--border);
        background: var(--cream);
        box-shadow: 0 14px 28px rgba(43, 42, 39, 0.08);
    }

    .menu-open .main-nav {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        gap: 0;
        max-width: calc(var(--container) + 2 * var(--gutter));
        margin-inline: auto;
        padding: 0.5rem var(--gutter) 1.25rem;
    }

    .nav-list a {
        padding: 0.85rem 0.25rem;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
        font-size: 1.05rem;
        white-space: normal;
    }

    .nav-list li:last-child a {
        border-bottom: 0;
    }

    .nav-list a:hover {
        background: transparent;
    }

    .nav-list a.is-active {
        box-shadow: inset 3px 0 0 var(--gold);
        padding-left: 0.85rem;
    }
}

@media (max-width: 420px) {
    :root {
        --header-height: 64px;
    }

    .brand-mark img {
        width: 36px;
        height: 36px;
    }

    .brand-name {
        font-size: 0.92rem;
    }

    .lang-switch button {
        min-width: 34px;
        padding: 0 0.4rem;
    }

    .menu-toggle {
        width: 42px;
        height: 42px;
    }
}


/* ==========================================================================
   5. SECTIONS
   ========================================================================== */

/* ---------- Hero ---------- */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: min(88vh, 760px);
    padding-block: clamp(5rem, 12vw, 8rem) clamp(7rem, 14vw, 10rem);
    overflow: hidden;
    background: var(--forest-dark);
    color: var(--white);
    isolation: isolate;
}

.hero-bg,
.invite-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(100deg, rgba(28, 44, 34, 0.9) 0%, rgba(28, 44, 34, 0.7) 45%, rgba(28, 44, 34, 0.35) 100%);
}

.hero-inner {
    max-width: calc(var(--container) + 2 * var(--gutter));
}

.hero-title {
    max-width: 16ch;
    color: var(--white);
    font-size: clamp(2.3rem, 5.6vw, 3.9rem);
    line-height: 1.12;
}

.hero-text {
    max-width: 36rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(1.08rem, 1.8vw, 1.22rem);
}

/* ---------- Next gathering ---------- */
.next-gathering {
    position: relative;
    z-index: 2;
    margin-top: clamp(-5.5rem, -9vw, -4rem);
}

.next-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.5rem 2.5rem;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border: 1px solid var(--border);
    border-left: 5px solid var(--gold);
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow);
}

.next-label {
    margin-bottom: 0.9rem;
    color: var(--gold-text);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.next-title {
    font-size: clamp(1.4rem, 2.6vw, 1.85rem);
}

.next-description,
.next-empty {
    max-width: 40rem;
    margin-bottom: 0;
}

.next-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* e.g. "Get Directions" is hidden when the next gathering has no public location */
.btn[hidden] {
    display: none;
}

@media (max-width: 760px) {
    .next-card {
        grid-template-columns: 1fr;
    }

    .next-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .next-actions .btn {
        flex: 1 1 12rem;
    }
}

/* ---------- About ---------- */
.about-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(2rem, 6vw, 5rem);
}

.about-image {
    margin: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--sand);
    aspect-ratio: 4 / 3;
    box-shadow: var(--shadow);
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.feature {
    padding: 1.75rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    transition: transform var(--transition), box-shadow var(--transition);
}

.feature:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.feature h4 {
    font-size: 1.2rem;
}

.feature p {
    margin: 0;
    color: var(--text-muted);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    border-radius: 50%;
    background: var(--sage-light);
}

.feature-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: var(--forest);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.welcome-note {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem 2rem;
    margin-top: clamp(2.5rem, 5vw, 3.5rem);
    padding: clamp(1.5rem, 4vw, 2.25rem);
    border-radius: var(--radius-lg);
    background: var(--sage-light);
}

.welcome-note h3 {
    grid-column: 1;
    font-size: clamp(1.3rem, 2.4vw, 1.6rem);
}

.welcome-note p {
    grid-column: 1;
    margin: 0;
}

.welcome-note .btn {
    grid-column: 2;
    grid-row: 1 / span 2;
}

@media (max-width: 860px) {
    .about-intro {
        grid-template-columns: 1fr;
    }

    .about-image {
        order: -1;
        aspect-ratio: 16 / 10;
    }

    .welcome-note {
        grid-template-columns: 1fr;
    }

    .welcome-note .btn {
        grid-column: 1;
        grid-row: auto;
        justify-self: start;
        margin-top: 1rem;
    }
}

/* ---------- Activities (timeline) ---------- */
.event-list {
    position: relative;
    display: grid;
    gap: 1.25rem;
    max-width: 58rem;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

/* Vertical carousel: shows 5 activities, the arrows scroll one at a time.
   The list height is set in app.js (initEventCarousel). */
.event-carousel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 58rem;
    margin: 0 auto;
}

.event-carousel .event-list {
    width: 100%;
    /* hidden: only the arrows scroll the list, so swiping or the mouse wheel
       always scroll the page instead of getting stuck in the list */
    overflow-y: hidden;
    /* room for the card hover lift, which overflow would clip */
    padding-top: 3px;
}

/* More specific than .carousel-nav (defined further down for Reflections),
   so these arrows stay in the flow above and below the list. */
.event-carousel .event-carousel-nav {
    position: static;
    flex-shrink: 0;
}

.event-card {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    transition: box-shadow var(--transition), transform var(--transition);
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: start;
    padding: 0.75rem 0.4rem;
    border-radius: var(--radius-sm);
    background: var(--forest);
    color: var(--white);
    line-height: 1.1;
    text-align: center;
}

.event-weekday,
.event-month {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.85;
}

.event-day {
    margin-block: 0.15rem;
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 600;
}

.event-title {
    font-size: 1.3rem;
}

.event-body p:last-child,
.event-body .meta-list:last-child {
    margin-bottom: 0;
}

.empty-state {
    padding: 2rem;
    border: 1px dashed var(--sand-dark);
    border-radius: var(--radius);
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 560px) {
    .event-card {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1.25rem;
    }

    .event-date {
        flex-direction: row;
        gap: 0.5rem;
        align-items: baseline;
        justify-self: start;
        padding: 0.45rem 0.9rem;
    }

    .event-day {
        margin: 0;
        font-size: 1.3rem;
    }
}

/* ---------- Reflections (cards in a horizontal carousel) ---------- */
.carousel {
    --carousel-gap: 1.75rem;
    --carousel-per-view: 3;
    position: relative;
}

.carousel-track {
    display: flex;
    gap: var(--carousel-gap);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    /* room for the card hover lift and shadow, which overflow would clip */
    margin-block: -0.75rem -2rem;
    padding-block: 0.75rem 2rem;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-track > .card {
    flex: 0 0 calc((100% - (var(--carousel-per-view) - 1) * var(--carousel-gap)) / var(--carousel-per-view));
    scroll-snap-align: start;
}

.carousel-nav {
    position: absolute;
    z-index: 2;
    /* centred on the card images */
    top: 6.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 2px solid var(--white);
    border-radius: 50%;
    background: var(--forest);
    box-shadow: var(--shadow);
    color: var(--white);
    cursor: pointer;
    transition: background-color var(--transition), opacity var(--transition);
}

.carousel-prev {
    left: 0;
    transform: translateX(-50%);
}

.carousel-next {
    right: 0;
    transform: translateX(50%);
}

.carousel-nav:hover {
    background: var(--forest-dark);
}

.carousel-nav:disabled {
    opacity: 0.35;
    cursor: default;
}

.carousel-nav:disabled:hover {
    background: var(--forest);
}

.carousel-nav[hidden] {
    display: none;
}

.carousel-nav svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 1079px) {
    .carousel {
        --carousel-per-view: 2;
    }
}

@media (max-width: 640px) {
    .carousel {
        --carousel-gap: 1rem;
    }

    /* one card plus a peek of the next, so it is clear the row scrolls */
    .carousel-track > .card {
        flex-basis: 85%;
    }

    .carousel-prev {
        transform: translateX(-25%);
    }

    .carousel-next {
        transform: translateX(25%);
    }
}

.card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.card-image {
    overflow: hidden;
    background: var(--sand);
    aspect-ratio: 3 / 2;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 400ms ease;
}

.card:hover .card-image img {
    transform: scale(1.03);
}

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

.card-kicker {
    margin-bottom: 0.4rem;
    color: var(--gold-text);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.card-title {
    font-size: 1.3rem;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.passage {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
    color: var(--forest);
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.975rem;
}

.card-excerpt {
    flex: 1;
    color: var(--text);
}

.card .text-button {
    align-self: flex-start;
    margin-top: 0.25rem;
}

/* ---------- Gallery ---------- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.chip {
    min-height: 40px;
    padding: 0.4rem 1rem;
    border: 1px solid var(--sand-dark);
    border-radius: 999px;
    background: var(--white);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

.chip:hover {
    border-color: var(--forest);
    color: var(--forest);
}

.chip[aria-pressed="true"] {
    border-color: var(--forest);
    background: var(--forest);
    color: var(--white);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gallery-item {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius);
    background: var(--sand);
    aspect-ratio: 4 / 3;
    cursor: zoom-in;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 400ms ease, filter var(--transition);
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
    transform: scale(1.04);
    filter: brightness(0.92);
}

.gallery-tag {
    position: absolute;
    left: 0.75rem;
    bottom: 0.75rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: rgba(250, 246, 239, 0.92);
    color: var(--forest-dark);
    font-size: 0.8rem;
    font-weight: 600;
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .gallery-tag {
        display: none;
    }
}

/* ---------- What we believe (accordion) ---------- */
.accordion {
    border-top: 1px solid var(--border);
}

.accordion-item {
    border-bottom: 1px solid var(--border);
}

.accordion-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem 0.25rem;
    cursor: pointer;
    list-style: none;
}

.accordion-item summary::-webkit-details-marker {
    display: none;
}

.accordion-title {
    color: var(--charcoal);
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 600;
}

.accordion-item summary:hover .accordion-title {
    color: var(--forest);
}

.accordion-icon {
    position: relative;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border: 1px solid var(--sand-dark);
    border-radius: 50%;
}

.accordion-icon::before,
.accordion-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 1.5px;
    margin: -0.75px 0 0 -6px;
    background: var(--forest);
    transition: transform var(--transition);
}

.accordion-icon::after {
    transform: rotate(90deg);
}

.accordion-item[open] .accordion-icon::after {
    transform: rotate(0deg);
}

.accordion-content {
    padding: 0 3rem 1.4rem 0.25rem;
}

.accordion-content p {
    margin: 0;
    color: var(--text);
}

.accordion-content p + p {
    margin-top: 0.9em;
}

/* ---------- Where we meet ---------- */
.location-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    gap: 1.75rem;
}

.location-card,
.contact-info {
    padding: clamp(1.5rem, 4vw, 2.25rem);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--white);
}

.location-name {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--charcoal);
}

.info-list {
    display: grid;
    gap: 1.1rem;
    margin: 0 0 1.75rem;
}

.info-list dt {
    margin-bottom: 0.15rem;
    color: var(--gold-text);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.info-list dd {
    margin: 0;
}

/* WhatsApp / Instagram / Facebook: brand icon beside the link text */
.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.social-icon {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
}

.social-whatsapp .social-icon { fill: #25d366; }
.social-instagram .social-icon { fill: #e4405f; }
.social-facebook .social-icon { fill: #0866ff; }

.map-box {
    position: relative;
    min-height: 340px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 30% 30%, rgba(143, 166, 142, 0.25), transparent 55%),
        repeating-linear-gradient(45deg, var(--sage-light) 0 2px, transparent 2px 22px),
        var(--cream);
}

.map-box iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 340px;
    padding: 2rem;
    text-align: center;
}

.map-placeholder-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 0.75rem;
    fill: none;
    stroke: var(--forest);
    stroke-width: 1.6;
}

.map-placeholder-title {
    margin-bottom: 0.4rem;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--charcoal);
}

.map-placeholder-text {
    max-width: 26rem;
    color: var(--text-muted);
    font-size: 0.925rem;
}

.map-placeholder .btn {
    background: var(--white);
}

.map-placeholder .btn:hover {
    background: var(--forest);
}

@media (max-width: 860px) {
    .location-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Contact ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    align-items: start;
    gap: clamp(1.75rem, 4vw, 3rem);
}

.contact-form {
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.form-row-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1.25rem;
}

.field {
    margin-bottom: 1.25rem;
}

.field label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--charcoal);
    font-weight: 600;
}

.req {
    color: var(--error);
}

.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
    width: 100%;
    min-height: 48px;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid var(--sand-dark);
    border-radius: var(--radius-sm);
    background: var(--cream);
    color: var(--charcoal);
    font: inherit;
    transition: border-color var(--transition), background-color var(--transition);
}

.field textarea {
    min-height: 150px;
    resize: vertical;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
    border-color: var(--sage);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--forest);
    background: var(--white);
    outline: none;
    box-shadow: 0 0 0 3px rgba(196, 154, 74, 0.35);
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
    border-color: var(--error);
}

.field-error {
    margin: 0.35rem 0 0;
    color: var(--error);
    font-size: 0.9rem;
    font-weight: 500;
}

.field-error:empty {
    display: none;
}

.field-check {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.25rem 0.7rem;
    align-items: start;
    margin-bottom: 0.5rem;
}

.field-check input {
    width: 20px;
    height: 20px;
    margin: 0.2rem 0 0;
    accent-color: var(--forest);
}

.field-check label {
    margin: 0;
    font-weight: 400;
    color: var(--text);
    font-size: 0.95rem;
}

.field-check .field-error {
    grid-column: 2;
}

.form-privacy-link {
    margin: 0 0 1.5rem 1.95rem;
    font-size: 0.95rem;
}

.form-error-summary {
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    border-left: 4px solid var(--error);
    border-radius: var(--radius-sm);
    background: #fbeeec;
    color: var(--error);
    font-weight: 600;
}

.prayer-hint {
    margin: -0.5rem 0 1.25rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--sage-light);
    color: var(--forest-dark);
    font-size: 0.95rem;
}

.form-status {
    margin-top: 1.5rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--gold);
    border-left-width: 5px;
    border-radius: var(--radius-sm);
    background: #fdf6e6;
}

.form-status:focus {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.form-status-title {
    margin-bottom: 0.3rem;
    color: var(--charcoal);
    font-weight: 700;
}

.form-status p:last-child {
    margin: 0;
}

.contact-info h3 {
    font-size: 1.3rem;
}

.prayer-note {
    display: flex;
    gap: 0.6rem;
    margin: 0;
    padding: 1rem;
    border-radius: var(--radius-sm);
    background: var(--sage-light);
    color: var(--forest-dark);
    font-size: 0.95rem;
}

@media (max-width: 860px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .form-row-2 {
        grid-template-columns: 1fr;
    }

    .btn-block-mobile {
        width: 100%;
    }
}

/* ---------- Final invitation ---------- */
.invite {
    position: relative;
    padding-block: clamp(5rem, 11vw, 8rem);
    overflow: hidden;
    background: var(--forest);
    color: var(--white);
    text-align: center;
    isolation: isolate;
}

.invite::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(28, 44, 34, 0.78);
}

.invite-inner {
    max-width: calc(44rem + 2 * var(--gutter));
}

.invite-title {
    color: var(--white);
    font-size: clamp(2rem, 4.5vw, 3rem);
}

.invite p {
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(1.08rem, 1.8vw, 1.25rem);
}

/* ---------- Footer ---------- */
.site-footer {
    padding-top: clamp(3.5rem, 7vw, 5rem);
    background: var(--forest-dark);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.975rem;
}

.site-footer a,
.site-footer .link-button {
    color: rgba(255, 255, 255, 0.88);
}

.site-footer a:hover,
.site-footer .link-button:hover {
    color: var(--gold-light);
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
    padding-bottom: 3rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
    color: var(--white);
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.25;
}

/* The black logo is shown in white on the dark footer */
.footer-logo {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    filter: invert(1);
    opacity: 0.92;
}

.footer-about p:last-child {
    max-width: 22rem;
}

.footer-title {
    margin-bottom: 0.9rem;
    color: var(--gold-light);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.footer-links {
    display: grid;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-links a,
.footer-legal a {
    text-decoration: none;
}

.footer-links a:hover,
.footer-legal a:hover {
    text-decoration: underline;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 2rem;
    padding-block: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 0.9rem;
}

.footer-bottom p {
    margin: 0;
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-legal .link-button {
    text-decoration: none;
}

.footer-legal .link-button:hover {
    text-decoration: underline;
}

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

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}


/* ==========================================================================
   6. DIALOGS & LIGHTBOX
   ========================================================================== */
dialog {
    padding: 0;
    border: 0;
}

.modal {
    width: min(100% - 2rem, 46rem);
    max-height: min(100% - 2rem, 900px);
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--cream);
    color: var(--text);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.modal::backdrop {
    background: rgba(28, 36, 30, 0.6);
}

.modal-inner {
    position: relative;
    max-height: min(100vh - 2rem, 900px);
    overflow-y: auto;
    padding: clamp(1.5rem, 5vw, 3rem);
}

.modal-close,
.lightbox-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--white);
    color: var(--charcoal);
    cursor: pointer;
    transition: background-color var(--transition);
}

.modal-close:hover {
    background: var(--sage-light);
}

.modal-close svg,
.lightbox-close svg,
.lightbox-nav svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.modal h2 {
    padding-right: 3rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
}

/* Sections of the privacy policy */
.modal h3 {
    margin: 1.75rem 0 0.5rem;
    font-size: 1.15rem;
}

.legal-updated {
    margin-top: 1.75rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.article-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 1.5rem;
    object-fit: cover;
    border-radius: var(--radius);
    background: var(--sand);
}

.modal .article-title {
    padding-right: 0;
}

.article-body {
    margin-top: 1.25rem;
    font-size: 1.075rem;
    line-height: 1.75;
}

/* Bible verses and song lines inside a reflection */
.article-quote {
    margin: 0 0 1em;
    padding: 0.2rem 0 0.2rem 1.1rem;
    border-left: 3px solid var(--gold);
    color: var(--text-muted);
    font-family: var(--font-serif);
    font-style: italic;
}

.article-quote p {
    margin: 0;
    white-space: pre-line;     /* keeps line breaks in song lines */
}

.lightbox {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    background: transparent;
    color: var(--white);
}

.lightbox[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox::backdrop {
    background: rgba(15, 20, 16, 0.92);
}

.lightbox-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: min(1200px, 100% - 8rem);
    margin: 0;
}

.lightbox-figure img {
    max-height: calc(100vh - 9rem);
    width: auto;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.lightbox figcaption {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 1rem;
    margin-top: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
}

.lightbox-counter {
    color: rgba(255, 255, 255, 0.6);
}

.lightbox-close {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.lightbox-close:hover,
.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.22);
}

.lightbox-nav {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin: 0 1rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    cursor: pointer;
    transition: background-color var(--transition);
}

.lightbox-nav[hidden] {
    visibility: hidden;
    display: flex;
}

.lightbox :focus-visible {
    outline-color: var(--gold-light);
}

@media (max-width: 700px) {
    .lightbox[open] {
        flex-wrap: wrap;
        align-content: center;
    }

    .lightbox-figure {
        order: -1;
        width: 100%;
        max-width: 100%;
        padding-inline: 0.5rem;
    }

    .lightbox-figure img {
        max-height: calc(100vh - 12rem);
    }

    .lightbox-nav {
        margin: 1rem 0.75rem 0;
    }
}


/* ==========================================================================
   7. REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }

    .btn:hover,
    .card:hover,
    .feature:hover,
    .event-card:hover {
        transform: none;
    }

    .card:hover .card-image img,
    .gallery-item:hover img {
        transform: none;
    }
}

/* Contact form: spam-bot trap, never visible */
.form-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-status.is-success {
    border-color: var(--forest-light);
    background: var(--sage-light);
}

.form-status.is-error {
    border-color: var(--error);
    background: #fbeeed;
}
