/* Home page (sewainternational.html).
   Composes tokens and components from ../sewainternational.css; mobile first. */

/* ---------- Hero: full-bleed photograph, headline over a bottom scrim ---------- */
.home-hero {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: flex-end;
    min-height: 540px; /* fallback where svh is unsupported */
    min-height: clamp(540px, calc(100svh - var(--header-h)), 700px);
    padding-block: var(--space-9) var(--space-7);
    overflow: hidden;
}

.home-hero__media {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 30%;
}

/* Scrim: darkest where the type sits (bottom), clear over the faces. */
.home-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--scrim); /* fallback where color-mix() is unsupported */
    background: linear-gradient(
        to top,
        color-mix(in srgb, var(--navy-900) 92%, transparent) 0%,
        color-mix(in srgb, var(--navy-900) 70%, transparent) 38%,
        color-mix(in srgb, var(--navy-900) 0%, transparent) 72%
    );
}

.home-hero__inner { width: 100%; }

/* Deliberate display-size exception: the homepage h1 tops out at 4rem (other pages 3.75rem). */
.home-hero h1 {
    max-width: 15ch;
    margin-bottom: var(--space-4);
    font-size: clamp(2.25rem, 1.6rem + 2.8vw, 4rem);
    line-height: 1.08;
}

.home-hero__lede {
    max-width: 46ch;
    margin-bottom: var(--space-6);
    font-size: var(--text-lede);
    line-height: 1.55;
    color: var(--on-navy);
}

/* A light button reads on the photograph; saffron stays reserved for Donate. */
.home-hero .home-hero__cta { background: var(--surface); color: var(--navy-800); }
.home-hero .home-hero__cta:hover { background: var(--navy-50); color: var(--navy-800); }

@media (min-width: 900px) {
    .home-hero { padding-block: var(--space-10) var(--space-9); }

    /* Add a left-hand fall-off so the headline column stays legible on wide screens. */
    .home-hero::before {
        background: var(--scrim);
        background:
            linear-gradient(
                to right,
                color-mix(in srgb, var(--navy-900) 78%, transparent) 0%,
                color-mix(in srgb, var(--navy-900) 35%, transparent) 45%,
                color-mix(in srgb, var(--navy-900) 0%, transparent) 70%
            ),
            linear-gradient(
                to top,
                color-mix(in srgb, var(--navy-900) 70%, transparent) 0%,
                color-mix(in srgb, var(--navy-900) 0%, transparent) 55%
            );
    }
}

/* ---------- About ---------- */
.home-about { align-items: start; }
.home-about__text .lede { margin-bottom: var(--space-6); }

.home-about__figure {
    margin: 0;
    width: 100%;
}

.home-about__figure img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius);
}

.home-about__figure figcaption {
    margin-top: var(--space-3);
    font-size: var(--text-small);
    color: var(--ink-muted);
}

@media (min-width: 900px) {
    .home-about { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ---------- How we serve: 2 x 2 on phones instead of four tall cards ---------- */
.home-serve { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5) var(--space-4); }
.home-serve .media-card__title { font-size: 1.0625rem; }

@media (min-width: 640px) {
    .home-serve .media-card__title { font-size: 1.1875rem; }
}

@media (min-width: 1000px) {
    .home-serve { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-5); }
}

/* Education_11zon.jpeg has a lavender cast on its right edge; crop from the left. */
.home-serve__img--edu { object-position: 0% 50%; }

/* Environment has no photograph of its own, so it is a text line under the grid rather than a fifth card. */
.home-serve__more {
    margin-top: var(--space-7);
    padding-top: var(--space-5);
    border-top: 1px solid var(--line);
    color: var(--ink-muted);
}

/* ---------- Top news: featured story across the top, the rest in a row below ---------- */
.home-news { display: grid; gap: var(--space-7); }

.home-news__featured-title {
    margin: 0;
    font-size: clamp(1.375rem, 1.1rem + 1.1vw, 2rem);
    line-height: 1.3;
}

.home-news__excerpt {
    margin: 0;
    max-width: var(--measure);
    color: var(--ink-muted);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Featured image: uploads can be small, so keep its box modest at every width
   (never much beyond 2x a ~230px-wide source). */
.home-news__featured .media-card__media { max-height: 260px; }

@media (min-width: 640px) {
    .home-news__featured {
        display: grid;
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
        gap: var(--space-6);
        align-items: center;
    }

    .home-news__featured .media-card__media { max-width: 480px; max-height: none; }
    .home-news__featured .media-card__body { padding-top: 0; gap: var(--space-3); }
}

@media (min-width: 1100px) {
    .home-news__featured { grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: var(--space-8); }
}

.home-news__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    column-gap: var(--space-7);
}

.home-news__list > li { border-top: 1px solid var(--line); }

.home-news__item {
    position: relative;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: var(--space-4);
    align-items: start;
    padding-block: var(--space-5);
}

.home-news__thumb {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: var(--navy-100);
}

.home-news__thumb img { width: 100%; height: 100%; object-fit: cover; }

.home-news__item-title {
    margin: 0 0 var(--space-1);
    font-size: 1.125rem;
    line-height: 1.4;
}

.home-news__item-title a {
    color: var(--navy-800);
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

/* The whole row is the link's hit area. */
.home-news__item-title a::after { content: ""; position: absolute; inset: 0; }
/* Draw the ring on the stretched hit area so it wraps the whole row (no :has() needed). */
.home-news__item-title a:focus-visible { outline: none; }
.home-news__item-title a:focus-visible::after { outline: 2px solid var(--navy-800); outline-offset: 4px; border-radius: var(--radius-sm); }
.home-news__item:hover .home-news__item-title a { color: var(--navy-700); text-decoration-color: currentColor; }

.home-news__date { margin: 0; font-size: var(--text-small); color: var(--ink-muted); }

@media (min-width: 640px) {
    .home-news__item { grid-template-columns: 128px minmax(0, 1fr); }
}

/* ---------- Projects: editorial two-column list, image beside text ---------- */
.home-projects { display: grid; }

.home-project {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-areas:
        "media title"
        "text  text";
    column-gap: var(--space-4);
    row-gap: var(--space-4);
    align-items: center;
    padding-block: var(--space-6);
    border-top: 1px solid var(--line);
}

.home-project__media {
    grid-area: media;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--navy-100);
}

.home-project__title { grid-area: title; margin: 0; }
.home-project__text { grid-area: text; margin: 0; color: var(--ink-muted); }

@media (min-width: 560px) {
    .home-project {
        grid-template-columns: 200px minmax(0, 1fr);
        grid-template-areas:
            "media title"
            "media text";
        grid-template-rows: auto 1fr;
        row-gap: var(--space-2);
        column-gap: var(--space-5);
        align-items: start;
    }

    .home-project__media { border-radius: var(--radius); }
}

@media (min-width: 960px) {
    .home-projects {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--space-8);
    }
}

/* ---------- Notices and upcoming events ---------- */
.home-updates {
    display: grid;
    gap: var(--space-8);
}

@media (min-width: 960px) {
    .home-updates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.home-updates__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2) var(--space-5);
    margin-bottom: var(--space-5);
}

.home-updates__head h2 {
    margin: 0;
    font-size: clamp(1.625rem, 1.35rem + 1vw, 2.125rem);
}

.home-list { border-top: 1px solid var(--line); }
.home-list > li { border-bottom: 1px solid var(--line); }

.home-list__row {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    min-height: 72px;
    padding-block: var(--space-4);
    color: inherit;
}

.home-list__row:focus-visible { border-radius: var(--radius-sm); }

.home-list__main {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}

.home-list__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) var(--space-3);
    font-size: var(--text-small);
    color: var(--ink-muted);
}

.home-list__pdf { display: inline-flex; align-items: center; gap: var(--space-1); }

.home-list__title {
    font-weight: 600;
    line-height: 1.4;
    color: var(--navy-800);
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    transition: color var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease);
}

.home-list__arrow {
    flex: none;
    font-size: 0.875rem;
    color: var(--ink-subtle);
    transition: color var(--dur) var(--ease);
}

.home-list__row:hover .home-list__title { color: var(--navy-700); text-decoration-color: currentColor; }
.home-list__row:hover .home-list__arrow { color: var(--navy-800); }

.home-date {
    flex: none;
    display: grid;
    place-content: center;
    width: 56px;
    height: 60px;
    border-radius: var(--radius-sm);
    background: var(--navy-50);
    text-align: center;
    line-height: 1.1;
}

.home-date__day {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--navy-800);
}

.home-date__month { font-size: var(--text-small); color: var(--ink-muted); }

.home-updates__empty {
    margin: 0;
    padding-block: var(--space-5);
    border-top: 1px solid var(--line);
    color: var(--ink-muted);
}
