/* ==========================================================================
   Communities page. Builds on css/site.css (tokens, trunk, limb, blade, board).
   Page-local only: values as blades, gatherings as branches.
   ========================================================================== */

/* ---------- values: blades off the trunk, each with its line beside it ---------- */
.value {
    display: flex; align-items: center; gap: 0 clamp(18px, 2.4vw, 36px);
    margin-bottom: clamp(14px, 1.8vw, 24px);
}
.value .blade {
    flex: none; margin: 0;
    padding-top: .5em; padding-bottom: .5em;
    font-size: clamp(1.25rem, 2.5vw, 2.1rem); font-weight: 700; letter-spacing: -.015em;
}
.value p {
    max-width: 24em; margin-right: var(--edge);
    font-size: clamp(1rem, 1.35vw, 1.2rem); line-height: 1.4; color: var(--bark);
}
/* leaves on a frond are not all one length: let the blades run a little longer down the stem */
.value:nth-child(3n + 1) .blade { padding-right: 4.4em; }
.value:nth-child(3n) .blade { padding-right: 2.4em; }

/* ---------- gatherings: branches off the trunk ---------- */
.gath {
    position: relative;
    display: grid; grid-template-columns: minmax(0, 1fr);
    width: min(62%, 700px);
    margin-bottom: clamp(26px, 3.4vw, 46px);
    padding: .2em 0 0 calc(var(--pw) + var(--gap));
}
/* the twig that joins a gathering to the trunk */
.gath::before {
    content: ''; position: absolute; left: 0; top: .1em;
    width: calc(var(--gap) - 8px); height: clamp(16px, 2vw, 26px);
    border: solid var(--forest-light); border-width: 0 0 2.5px 2.5px; border-radius: 0 0 0 16px;
}
.gath--photo { grid-template-columns: minmax(0, 1fr) clamp(120px, 17vw, 220px); gap: 0 clamp(16px, 2.4vw, 34px); width: min(84%, 940px); }
.gath-main { min-width: 0; }
.gath-name {
    display: inline; margin-right: .5em;
    font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 700; line-height: 1.05; letter-spacing: -.02em;
    color: var(--forest); overflow-wrap: anywhere;
}
/* the pill itself is .tag in site.css */
.gath-tag { vertical-align: .35em; font-size: .8rem; }
.gath-rhythm { margin-top: .55em; font-size: clamp(1.02rem, 1.5vw, 1.25rem); font-weight: 600; color: var(--forest-light); overflow-wrap: anywhere; }
.gath-desc { max-width: 32em; margin-top: .6em; line-height: 1.55; overflow-wrap: anywhere; }
.gath-where { display: flex; align-items: flex-start; gap: .5em; margin-top: .9em; font-size: .95rem; color: var(--forest-light); overflow-wrap: anywhere; }
.gath-where svg { flex: none; margin-top: .28em; }
.gath-where span { min-width: 0; }
.gath-photo { align-self: start; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }

/* featured gatherings are full leaves: forest, wider, flush on the trunk */
.gath--featured {
    width: min(80%, 900px);
    margin-bottom: 14px;
    padding: clamp(22px, 3vw, 40px) clamp(40px, 7vw, 110px) clamp(22px, 3vw, 40px) calc(var(--pw) + var(--gap));
    border-radius: 0 clamp(40px, 7vw, 110px) 0 0;
    background: var(--forest); color: var(--ivory);
}
.gath--featured.gath--photo { width: min(92%, 1040px); }
.gath--featured::before { display: none; }
.gath--featured .gath-name { color: var(--ivory); }
.gath--featured .gath-rhythm { color: var(--gold); }
.gath--featured .gath-where { color: var(--sage-light); }
/* the last leaf before the smaller branches needs air below it */
.gath--featured + .gath:not(.gath--featured) { margin-top: clamp(34px, 4.4vw, 60px); }
.gatherings > :last-child { margin-bottom: 0; }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
    .value { display: block; margin-bottom: 22px; }
    .value .blade { max-width: calc(100% - 14px); }
    .value:nth-child(n) .blade { padding-right: 2.6em; }
    .value:nth-child(3n + 1) .blade { padding-right: 3.6em; }
    .value p { max-width: none; margin: 8px var(--edge) 0 calc(var(--pw) + var(--gap)); }

    .gath, .gath--photo { grid-template-columns: minmax(0, 1fr); width: auto; margin-right: var(--edge); }
    .gath--featured, .gath--featured.gath--photo { width: auto; margin-right: 14px; padding-right: 44px; }
    .gath-photo { margin-top: 16px; aspect-ratio: 16 / 9; }
}

/* ---------- open layout: no trunk, so no twigs; featured leaves get their own left padding ---------- */
.living--open .gath::before { display: none; }
.living--open .gath--featured {
    padding-left: clamp(24px, 3vw, 44px);
    border-radius: clamp(40px, 6vw, 90px) 0 clamp(40px, 6vw, 90px) 0;
}

/* ---------- communities as cards with a round photo (the original site's circles) ---------- */
.gath--icon {
    grid-template-columns: clamp(76px, 8vw, 116px) minmax(0, 1fr); gap: 0 clamp(18px, 2.4vw, 32px); align-items: start;
    width: min(100%, 760px);
    margin-bottom: clamp(16px, 2vw, 24px);
    padding: clamp(20px, 2.4vw, 30px) clamp(22px, 3vw, 40px);
    background: var(--ivory);
    border-radius: clamp(28px, 4vw, 56px) 0 clamp(28px, 4vw, 56px) 0;
    box-shadow: 0 14px 34px -22px rgba(15, 37, 30, .45);
}
.gath-icon {
    width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%;
    box-shadow: 0 0 0 4px var(--ivory), 0 0 0 6px var(--sage);
}
.gath--icon .gath-name { font-size: clamp(1.4rem, 2.4vw, 2rem); }
.gath--icon .gath-desc { margin-top: .45em; }
.living--open .gath--featured.gath--icon { background: var(--forest); padding-left: clamp(22px, 3vw, 40px); }
.gath--featured .gath-icon { box-shadow: 0 0 0 4px var(--forest), 0 0 0 6px var(--sage-light); }
.gath--featured + .gath--icon:not(.gath--featured) { margin-top: clamp(16px, 2vw, 24px); }
@media (max-width: 760px) {
    .gath--icon, .gath--featured.gath--icon { grid-template-columns: 64px minmax(0, 1fr); width: auto; margin-right: var(--edge); padding: 18px 20px; }
}

/* ---------- About: a short statement, set large, close under the hero ---------- */
.living--open .limb--about { padding-top: clamp(40px, 5vw, 80px); padding-bottom: 0; }
.about-lead {
    max-width: 30em; margin: 0;
    font-size: clamp(1.45rem, 2.6vw, 2.25rem); font-weight: 500; line-height: 1.3; letter-spacing: -.01em;
    color: var(--forest);
}
.about-lead + .about-lead { max-width: 36em; margin-top: .9em; font-size: clamp(1.2rem, 1.8vw, 1.6rem); line-height: 1.4; }
/* The Presbyterian line: ordinary body text under the larger statement */
.about-note { max-width: 38em; margin: clamp(20px, 2.4vw, 32px) 0 0; font-size: 1.05rem; line-height: 1.6; color: var(--muted); }
.about-lead a, .about-note a { color: var(--forest-light); text-decoration: underline; text-decoration-color: var(--sage); text-underline-offset: .18em; text-decoration-thickness: 2px; }
.about-lead a:hover, .about-note a:hover { text-decoration-color: var(--terracotta); }

/* ---------- the photo under the values sits centred in the column ---------- */
.living--open .limb > .slot--bleed {
    width: min(100% - 2 * var(--edge), 1000px); margin-left: auto; margin-right: auto;
    border-radius: clamp(60px, 8vw, 130px) 0 clamp(60px, 8vw, 130px) 0;
}

/* ---------- Find a Community: two photos stacked down the right ---------- */
.living--open .aside-stack {
    display: flex; flex-direction: column; gap: clamp(20px, 2.4vw, 32px);
    max-height: none; overflow: visible; background: none; box-shadow: none; border-radius: 0;
}
.aside-stack figure {
    flex: 1 1 0; min-height: 0; max-height: 680px; margin: 0; overflow: hidden;
    border-radius: clamp(70px, 9vw, 140px) 0 clamp(70px, 9vw, 140px) 0;
    box-shadow: 0 30px 60px -30px rgba(15, 37, 30, .45); background: var(--sage-light);
}
.aside-stack img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) {
    .living--open .aside-stack { height: auto; }
    .aside-stack figure { height: 260px; flex: none; border-radius: 60px 0 60px 0; }
    .aside-stack-extra { display: none; }
}
/* mobile: the round photo sits beside the name only, so the description gets the card's full width */
@media (max-width: 760px) {
    .gath--icon, .gath--featured.gath--icon { grid-template-columns: 56px minmax(0, 1fr); gap: 0 14px; margin-right: 0; padding: 18px; }
    .gath--icon .gath-main { display: contents; }
    .gath--icon .gath-icon { grid-row: 1; grid-column: 1; }
    .gath--icon .gath-main > * { grid-column: 1 / -1; }
    .gath--icon .gath-main > :first-child { grid-row: 1; grid-column: 2; align-self: center; margin: 0; }
    .gath--icon .gath-main > :nth-child(2) { margin-top: 12px; }
    .gath--icon .gath-name { font-size: 1.35rem; }
}

/* ---------- more link (Thin Place) and the "taking a break" card ---------- */
.gath-more {
    display: inline-block; margin-top: 1em;
    font-weight: 600; color: var(--forest);
    text-decoration: underline; text-decoration-color: var(--terracotta); text-decoration-thickness: 2px; text-underline-offset: .2em;
}
.gath-more::after { content: ' →'; }
.gath-more:hover { text-decoration-color: currentColor; }
.gath--featured .gath-more { color: var(--ivory); text-decoration-color: var(--gold); }
.gath--paused .gath-tag { border-color: var(--terracotta); color: var(--forest-dark); }
.gath--paused .gath-icon { filter: grayscale(.7); }
.gath-rhythm + .gath-rhythm { margin-top: .15em; }
