/* Work group: our-work, skill development, skill centre, disaster, education, environment, livelihood.
   Composes tokens/components from ../sewainternational.css. Mobile first; tokens only. */

/* ---------- Shared: intro split (text + figure) ---------- */
.work-intro { align-items: start; }

@media (min-width: 900px) {
    .work-intro { align-items: center; }
}

.work-intro__text > h2 { margin-bottom: var(--space-5); }
.work-intro__text > p { max-width: var(--measure); }

.work-intro__figure { margin: 0; }

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

/* The 3Rs as type: three hairline-topped columns under the intro. */
.three-rs {
    display: grid;
    gap: 0 var(--space-6);
    margin-top: var(--space-8);
    counter-reset: none;
}

@media (min-width: 760px) {
    .three-rs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.three-rs__item {
    padding-block: var(--space-5);
    border-top: 1px solid var(--line);
}

.three-rs__item h3 { margin: 0 0 var(--space-2); }
.three-rs__item p { margin: 0; color: var(--ink-muted); max-width: 40ch; }

/* Short fact list under intro copy (training offered, areas of work) */
.work-facts__title {
    margin: var(--space-6) 0 var(--space-3);
    font-size: var(--text-h4);
}

/* Plain text, static facts, not controls: a two-column list on phones, one middot-separated line from 640px. */
.work-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-1) var(--space-4);
    color: var(--ink-muted);
}

.work-facts li::before {
    content: "\00B7";
    margin-right: var(--space-2);
    color: var(--ink-subtle);
    font-weight: 700;
}

@media (min-width: 640px) {
    .work-facts { display: flex; flex-wrap: wrap; gap: var(--space-1) 0; }
    .work-facts li:first-child::before { content: none; }
    .work-facts li + li::before { margin-inline: var(--space-2); }
}

/* ---------- Shared: story split (text + poster) ---------- */
.work-story { align-items: start; }

@media (min-width: 900px) {
    .work-story { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; }
}

.work-story__text > h2 { margin-bottom: var(--space-5); }
.work-story__text > p { max-width: var(--measure); margin-bottom: var(--space-5); }
.work-story__text--solo { max-width: var(--measure); }

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

.work-story__poster {
    margin: 0;
    justify-self: center;
    width: 100%;
    max-width: 340px;
}

@media (min-width: 900px) {
    .work-story__poster { max-width: 420px; }
}

.work-story__poster img {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--line);
}

.nowrap { white-space: nowrap; }

/* Education_11zon.jpeg has a lavender cast in its right edge; crop from the left so the frame drops it. */
img.work-img--edu { object-position: 0% 50%; }
.programme__figure.programme__figure--edu img { aspect-ratio: 4 / 3; }

/* ---------- Our Work: programme cards ---------- */
.programme-cards .media-card { height: 100%; }
.programme-cards .media-card__text { -webkit-line-clamp: 4; }

.programme-cards__more {
    margin-top: var(--space-7);
    padding-top: var(--space-5);
    border-top: 1px solid var(--line);
    color: var(--ink-muted);
}

/* ---------- Our Work: Jajarkot + latest news ---------- */
.work-news {
    display: grid;
    gap: var(--space-7);
}

@media (min-width: 900px) {
    .work-news { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-8); align-items: start; }
}

.work-news__lead > h2 { margin-bottom: var(--space-5); }
.work-news__lead > p { max-width: var(--measure); margin-bottom: var(--space-5); }

.work-news__title {
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--line);
    font-size: var(--text-h4);
}

.news-list { margin-bottom: var(--space-4); }
.news-list li + li { border-top: 1px solid var(--line); }

.news-list__item {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: var(--space-4);
    align-items: center;
    padding-block: var(--space-4);
    color: inherit;
}

.news-list__thumb {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: var(--navy-100);
}

.news-list__thumb img { width: 100%; height: 100%; object-fit: cover; }

.news-list__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.news-list__heading {
    font-weight: 600;
    line-height: 1.35;
    color: var(--navy-800);
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 3px;
    transition: text-decoration-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.news-list__item:hover .news-list__heading { color: var(--navy-700); text-decoration-color: currentColor; }
.news-list__body time { font-size: var(--text-small); color: var(--ink-muted); }

/* ---------- Our Work: upcoming events ---------- */
.event-list {
    border-top: 1px solid var(--line);
}

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

.event-list__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: var(--space-5);
    align-items: center;
    min-height: 72px;
    padding-block: var(--space-4);
    color: inherit;
}

.event-list__date { display: flex; flex-direction: column; min-width: 64px; line-height: 1.1; }
.event-list__day { font-family: var(--font-display); font-size: 2rem; font-weight: 600; color: var(--navy-800); }
.event-list__month { font-size: var(--text-small); color: var(--ink-muted); }
.event-list__name { font-weight: 600; font-size: 1.125rem; color: var(--navy-800); }
.event-list__arrow { color: var(--ink-subtle); transition: color var(--dur) var(--ease); }
.event-list__item:hover .event-list__name { color: var(--navy-700); text-decoration: underline; text-underline-offset: 3px; }
.event-list__item:hover .event-list__arrow { color: var(--navy-800); }

.section--alt .empty-state { background: var(--surface); border: 1px solid var(--line); }

/* ---------- Disaster: areas of response ---------- */
.response-list { border-top: 1px solid var(--line); }
.response-list > li { border-bottom: 1px solid var(--line); }

.response {
    display: grid;
    padding-block: var(--space-6);
}

.response h3 { margin: 0; }

.response__when {
    margin: var(--space-1) 0 var(--space-3);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ink-muted);
}

.response__text { max-width: var(--measure); margin: 0; }

/* Desktop: the date becomes a left-hand timeline column beside the heading and text. */
@media (min-width: 900px) {
    .response {
        grid-template-columns: 220px minmax(0, 1fr);
        column-gap: var(--space-8);
        padding-block: var(--space-7);
    }
    .response h3 { grid-column: 2; grid-row: 1; margin-bottom: var(--space-3); }
    .response__when { grid-column: 1; grid-row: 1 / span 2; margin: 0; padding-top: 4px; }
    .response__text { grid-column: 2; grid-row: 2; }
}

/* ---------- Skill development: centres ---------- */
.centre-grid {
    display: grid;
    gap: var(--space-5);
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 640px) {
    .centre-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

.centre {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: var(--space-4);
    align-items: start;
    height: 100%;
}

@media (min-width: 640px) {
    .centre { grid-template-columns: minmax(0, 1fr); gap: 0; align-content: start; }
}

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

@media (min-width: 640px) {
    .centre__media { border-radius: var(--radius); }
}

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

.centre__body { display: flex; flex-direction: column; gap: var(--space-1); }

@media (min-width: 640px) {
    .centre__body { padding-top: var(--space-4); }
}

.centre__title { margin: 0 0 var(--space-1); font-size: 1.0625rem; line-height: 1.35; }
.centre__place, .centre__note { margin: 0; font-size: 0.9375rem; line-height: 1.45; color: var(--ink-muted); }
.centre__place { display: flex; gap: 6px; }
.centre__place i { flex: none; margin-top: 0.3em; color: var(--ink-subtle); font-size: 0.85em; }

/* Additional (database) centres: compact text rows; a photo only when the centre has one. */
.centre-more {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 640px) {
    .centre-more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.centre-more__item {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: inherit;
    transition: border-color var(--dur) var(--ease);
}

.centre-more__item:hover { border-color: var(--line-input); }

.centre-more__media { display: block; aspect-ratio: 4 / 3; background: var(--navy-100); }
.centre-more__media img { width: 100%; height: 100%; object-fit: cover; }

.centre-more__body { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-5); }
.centre-more__name { margin: 0; font-size: 1.0625rem; line-height: 1.35; color: var(--navy-800); }
.centre-more__place { font-size: 0.9375rem; color: var(--ink-muted); }

.centre-more__link {
    margin-top: var(--space-3);
    font-weight: 600;
    color: var(--navy-800);
    text-underline-offset: 3px;
}

.centre-more__link i { font-size: 0.8em; margin-left: 4px; }
.centre-more__item:hover .centre-more__link { color: var(--navy-700); text-decoration: underline; }

/* ---------- Programme pages: rich-text body + aside ---------- */
.programme {
    display: grid;
    gap: var(--space-8);
}

@media (min-width: 1000px) {
    .programme { grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-9); align-items: start; }
}

.programme__figure { margin: 0 0 var(--space-7); max-width: var(--measure); }

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

/* A single short paragraph (e.g. a centre summary) reads as a lede. */
.programme-prose > p:only-child { font-size: var(--text-lede); line-height: 1.55; }

.programme__back { margin-top: var(--space-7); }

/* CKEditor content often carries pasted inline fonts, colours and centring; let the page type win. */
.programme-prose span[style] {
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    color: inherit !important;
    background: none !important;
}

.programme-prose :is(p, h2, h3, h4, h5)[style*="text-align"] { text-align: left !important; }

/* Headings stored as h1 inside page content are demoted to h2 by the template and read as section headings. */
.programme-prose h2 {
    margin-top: 2em;
    font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
    line-height: 1.2;
}

.programme-prose h2::first-letter { text-transform: uppercase; }
.programme-prose h2 + * { margin-top: 0.6em; }

.programme-prose p:empty { display: none; }

.programme__aside { display: grid; gap: var(--space-6); align-content: start; }

@media (min-width: 1000px) {
    .programme__aside { position: sticky; top: calc(var(--header-h) + var(--space-5)); }
}

.programme-nav__title,
.programme-support__title {
    margin-bottom: var(--space-3);
    font-family: var(--font-text);
    font-size: var(--text-h4);
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.3;
}

.programme-nav__list { border-top: 1px solid var(--line); margin-bottom: var(--space-4); }
.programme-nav__list li { border-bottom: 1px solid var(--line); }

.programme-nav__list a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding-block: var(--space-2);
    color: var(--ink);
}

.programme-nav__list a:hover { color: var(--navy-700); text-decoration: underline; text-underline-offset: 3px; }

.programme-nav__list a[aria-current="page"] {
    color: var(--navy-800);
    font-weight: 600;
}

.programme-nav__list a[aria-current="page"]::after {
    content: "";
    width: 6px;
    height: 6px;
    margin-left: var(--space-2);
    border-radius: 50%;
    background: var(--saffron-500);
}

.programme-support p { color: var(--ink-muted); margin-bottom: var(--space-4); }


/* A centre with no photo and a short summary: one reading column, the aside follows underneath. */
@media (min-width: 1000px) {
    .programme.programme--stacked { grid-template-columns: minmax(0, 1fr); max-width: calc(760px + 2 * var(--gutter)); }
    .programme--stacked .programme__aside { position: static; }
}

@media (min-width: 640px) {
    .programme--stacked .programme__aside { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-7); padding-top: var(--space-7); border-top: 1px solid var(--line); }
}

/* Programme cross-links as a row on the full-width programme pages (disaster, skill development). */
.programme-links { border-top: 1px solid var(--line); }
/* After a white section the shared-gap rule zeroes this section's top padding; keep room under the hairline. */
.programme-links > .container { padding-top: var(--space-7); }
.section--alt + .programme-links { border-top: 0; }
.section--alt + .programme-links > .container { padding-top: 0; }

@media (min-width: 760px) {
    .programme-nav--row .programme-nav__list {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        column-gap: var(--space-5);
        border-top: 0;
    }
    .programme-nav--row .programme-nav__list li { border-top: 1px solid var(--line); }
}

/* Livelihood.jpg is an upscale: keep the lead at card size so it stays crisp. */
.programme__figure--soft { max-width: 420px; }
.programme__figure--soft img { aspect-ratio: 4 / 3; }
