/* Igbo Union Northamptonshire - public website
   Standalone stylesheet. Not shared with the Vue member portal. */

/* ---------- Tokens ---------- */

:root {
    --red: #DA181F;
    --red-dark: #A80F15;
    --ivory: #FBF7EF;
    --cream: #F3EBDD;
    --gold: #B07A28;
    --horn: #79583B;
    --charcoal: #20211F;
    --muted: #66645F;

    --line: rgba(32, 33, 31, 0.12);
    --line-light: rgba(251, 247, 239, 0.22);

    --font-display: "Libre Baskerville", Georgia, "Times New Roman", serif;
    --font-body: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.75rem;
    --space-lg: 3rem;
    --space-xl: 5rem;

    --shell: 74rem;
    --radius: 10px;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--ivory);
    color: var(--charcoal);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    overflow-wrap: break-word;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    line-height: 1.2;
    margin: 0 0 var(--space-sm);
    font-weight: 700;
}

h1 {
    /* The floor is set by "Northamptonshire." - 17 characters that must fit a
       ~320px column without breaking mid-word. */
    font-size: clamp(1.55rem, 6.4vw, 3.6rem);
    letter-spacing: -0.015em;
    /* "Northamptonshire" is long enough to break mid-word at small sizes. */
    overflow-wrap: normal;
    hyphens: none;
}

h2 {
    font-size: clamp(1.6rem, 3.4vw, 2.5rem);
}

h3 {
    font-size: 1.2rem;
    font-family: var(--font-body);
    font-weight: 700;
}

p {
    margin: 0 0 var(--space-sm);
}

a {
    color: var(--red-dark);
}

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

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

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

.shell {
    width: 100%;
    max-width: var(--shell);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* Grid and flex children default to min-width:auto, so they refuse to shrink
   below their longest unbreakable word - the wordmark and the contact email
   both pushed the page sideways on a 320px screen. */
.split > *,
.lede > *,
.contact-grid > *,
.site-footer__inner > *,
.join-banner__inner > * {
    min-width: 0;
}

/* The contact address is one long token with no natural break point. */
.site-footer__contact a,
.contact-details a {
    overflow-wrap: anywhere;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    background: var(--red);
    color: #fff;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    left: 0;
}

/* ---------- Shared pieces ---------- */

.eyebrow {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 var(--space-sm);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold);
}

.eyebrow::before {
    content: "";
    width: 2.25rem;
    height: 2px;
    background: var(--gold);
    flex: none;
}

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

.eyebrow--light::before {
    background: var(--cream);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.7rem 1.5rem;
    border: 2px solid transparent;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.button--solid {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

.button--solid:hover {
    background: var(--red-dark);
    border-color: var(--red-dark);
}

.button--outline {
    background: transparent;
    border-color: var(--charcoal);
    color: var(--charcoal);
}

.button--outline:hover {
    background: var(--charcoal);
    color: var(--ivory);
}

.button--outline-light {
    background: transparent;
    border-color: var(--ivory);
    color: var(--ivory);
}

.button--outline-light:hover {
    background: var(--ivory);
    color: var(--charcoal);
}

.button--light {
    background: var(--ivory);
    border-color: var(--ivory);
    color: var(--red-dark);
}

.button--light:hover {
    background: #fff;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

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

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

.section--dark {
    background: var(--charcoal);
    color: var(--ivory);
}

.section--dark a {
    color: var(--cream);
}

.section__lead {
    font-size: 1.15rem;
    color: var(--muted);
    max-width: 44rem;
}

.section--dark .section__lead {
    color: rgba(251, 247, 239, 0.78);
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
    font-weight: 600;
    color: var(--red-dark);
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.text-link::after {
    content: "\2192";
}

.text-link:hover {
    border-bottom-color: var(--red-dark);
}

/* Igbo-inspired lattice used wherever approved photography is not yet available. */
.motif {
    background-color: var(--charcoal);
    background-image:
        repeating-linear-gradient(45deg, rgba(176, 122, 40, 0.14) 0 2px, transparent 2px 22px),
        repeating-linear-gradient(-45deg, rgba(176, 122, 40, 0.14) 0 2px, transparent 2px 22px),
        radial-gradient(circle at 18% 22%, rgba(218, 24, 31, 0.34), transparent 46%),
        radial-gradient(circle at 86% 78%, rgba(121, 88, 59, 0.42), transparent 52%);
}

.motif--light {
    background-color: var(--cream);
}

/* ---------- Header ---------- */

.site-header {
    background: var(--charcoal);
    color: var(--ivory);
    position: relative;
    z-index: 20;
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-height: 84px;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: inherit;
    flex: none;
}

.site-brand__crest {
    display: block;
    width: 62px;
    height: 62px;
    flex: none;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--gold);
    overflow: hidden;
    padding: 3px;
}

.site-brand__crest img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.site-brand__crest--small {
    width: 54px;
    height: 54px;
}

.site-brand__text {
    display: none;
    flex-direction: column;
    line-height: 1.25;
    /* Without this the flex item refuses to shrink below the wordmark's width
       and pushes the footer past the viewport on a 320px screen. */
    min-width: 0;
    overflow-wrap: break-word;
}

.site-brand__name {
    font-family: var(--font-display);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.site-brand__motto {
    font-size: 0.78rem;
    font-style: italic;
    color: rgba(251, 247, 239, 0.7);
}

.site-nav {
    display: none;
    margin-left: auto;
}

.site-nav ul {
    display: flex;
    gap: 1.1rem;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--ivory);
    font-size: 0.97rem;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.site-nav a:hover {
    border-bottom-color: var(--gold);
}

.site-nav a.is-current {
    color: #fff;
    border-bottom-color: var(--red);
}

.site-header__cta {
    display: none;
    flex: none;
}

/* Mobile menu: native disclosure, no JavaScript. */
.site-menu {
    margin-left: auto;
    flex: none;
}

.site-menu summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0 1rem;
    border: 2px solid var(--line-light);
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.site-menu summary::-webkit-details-marker {
    display: none;
}

.site-menu[open] summary {
    border-color: var(--gold);
}

.site-menu__panel {
    position: absolute;
    left: 0;
    right: 0;
    background: var(--charcoal);
    border-top: 1px solid var(--line-light);
    padding: var(--space-sm) var(--space-md) var(--space-md);
}

.site-menu__panel a {
    display: flex;
    align-items: center;
    min-height: 48px;
    color: var(--ivory);
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid var(--line-light);
}

.site-menu__panel a.is-current {
    color: var(--red);
}

.site-menu__cta {
    margin-top: var(--space-sm);
    justify-content: center;
    background: var(--red);
    border-radius: 6px;
    border-bottom: 0 !important;
    color: #fff !important;
}

/* ---------- Photography ---------- */

/* Photo heroes. The controller supplies only the URL, as --hero-image; the
   darkening gradient lives here so every hero keeps the same text contrast
   whichever photograph is chosen. */
.hero--photo,
.page-hero--photo {
    background-color: var(--charcoal);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero--photo {
    background-image:
        linear-gradient(100deg, rgba(32, 33, 31, 0.95) 0%, rgba(32, 33, 31, 0.86) 42%, rgba(32, 33, 31, 0.5) 100%),
        var(--hero-image);
}

.page-hero--photo {
    background-image:
        linear-gradient(100deg, rgba(32, 33, 31, 0.94) 0%, rgba(32, 33, 31, 0.82) 50%, rgba(32, 33, 31, 0.55) 100%),
        var(--hero-image);
}

/* On narrow screens the text sits over the whole width, so darken evenly. */
@media (max-width: 48rem) {
    .hero--photo,
    .page-hero--photo {
        background-image:
            linear-gradient(rgba(32, 33, 31, 0.9), rgba(32, 33, 31, 0.84)),
            var(--hero-image);
    }
}

/* A photograph sitting in the page flow, beside or above text. */
.media-figure {
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--cream);
}

/* Fed a 4:3 crop from `gallery:crops`, already framed on faces, so it fills the
   box at close to its own size and needs no further repositioning. */
.media-figure img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

/* Thumbnail strip at the top of a card. */
.card__media {
    margin: calc(var(--space-md) * -1) calc(var(--space-md) * -1) var(--space-sm);
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
}

.card__media img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
}

/* Dark feature card with a photograph behind it, as on the homepage teaser. */
.feature-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 22rem;
    padding: var(--space-md);
    border-radius: var(--radius);
    overflow: hidden;
    color: var(--ivory);
    background-color: var(--charcoal);
    background-image:
        linear-gradient(rgba(32, 33, 31, 0.35) 0%, rgba(32, 33, 31, 0.9) 68%),
        var(--hero-image);
    background-size: cover;
    background-position: center;
}

.feature-card h2,
.feature-card h3 {
    color: #fff;
    margin-bottom: 0.4rem;
}

.feature-card p {
    color: rgba(251, 247, 239, 0.85);
}

/* ---------- Heroes ---------- */

.hero {
    color: var(--ivory);
    padding: clamp(3.5rem, 9vw, 7rem) 0;
}

.hero__inner {
    max-width: 46rem;
}

.hero h1 {
    margin-bottom: var(--space-sm);
}

.hero__lead {
    font-size: clamp(1.05rem, 2.1vw, 1.3rem);
    color: rgba(251, 247, 239, 0.85);
    max-width: 34rem;
}

.page-hero {
    color: var(--ivory);
    padding: clamp(3rem, 7vw, 5.5rem) 0;
}

.page-hero__lead {
    font-size: 1.1rem;
    color: rgba(251, 247, 239, 0.82);
    max-width: 36rem;
    margin: 0;
}

/* ---------- Cards and grids ---------- */

.grid {
    display: grid;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.grid--3 {
    grid-template-columns: 1fr;
}

.grid--2 {
    grid-template-columns: 1fr;
}

.card {
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.section--cream .card {
    background: var(--ivory);
}

.card h3 {
    margin: 0;
}

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

.card .text-link {
    margin-top: auto;
    padding-top: var(--space-xs);
}

.card__icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--red);
    color: #fff;
    font-size: 1.4rem;
    margin-bottom: var(--space-xs);
}

.card__icon--gold {
    background: var(--gold);
}

.card__icon--horn {
    background: var(--horn);
}

.card--numbered {
    position: relative;
}

.card__number {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--gold);
    line-height: 1;
}

/* Split section: text beside a motif or photo panel. */
.split {
    display: grid;
    gap: var(--space-lg);
    align-items: center;
}

/* Stands in for photography the Union has not yet approved. A crest watermark on
   the lattice reads as deliberate ornament rather than an empty image frame. */
.split__panel {
    min-height: 280px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background-image:
        url("iun-logo.png"),
        repeating-linear-gradient(45deg, rgba(121, 88, 59, 0.1) 0 2px, transparent 2px 22px),
        repeating-linear-gradient(-45deg, rgba(121, 88, 59, 0.1) 0 2px, transparent 2px 22px);
    background-repeat: no-repeat, repeat, repeat;
    background-position: center, 0 0, 0 0;
    background-size: min(58%, 15rem) auto, auto, auto;
}

/* Two-column heading / body composition used under "Our mission". */
.lede {
    display: grid;
    gap: var(--space-md);
}

.lede h2 {
    margin: 0;
}

/* ---------- Gallery ---------- */

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

.gallery__item a {
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--cream);
}

/* A fixed ratio keeps the grid from shifting as the photographs load, so their
   intrinsic sizes never need reading on the server. */
.gallery__item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.25s ease;
}

/* The Media gallery shows each photograph whole rather than cropping it, so
   portraits letterbox against the tile instead of losing their edges. */
.gallery--contain .gallery__item img {
    object-fit: contain;
}

.gallery__item a:hover img {
    transform: scale(1.04);
}

/* ---------- Notices and empty states ---------- */

.notice {
    border: 1px solid var(--line);
    border-left: 5px solid var(--gold);
    border-radius: var(--radius);
    background: var(--ivory);
    padding: var(--space-md);
    margin-top: var(--space-md);
}

.section--cream .notice {
    background: #fff;
}

.notice h3 {
    margin-top: 0;
}

.notice p:last-child {
    margin-bottom: 0;
}

/* ---------- Contact ---------- */

.contact-grid {
    display: grid;
    gap: var(--space-lg);
    align-items: start;
}

.contact-details li {
    display: flex;
    gap: 0.9rem;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--line);
}

.contact-details li:last-child {
    border-bottom: 0;
}

.contact-details__label {
    display: block;
    font-weight: 700;
}

.contact-details a {
    font-size: 1.1rem;
    font-weight: 600;
}

.field {
    margin-bottom: var(--space-sm);
}

.field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.field input,
.field textarea {
    width: 100%;
    min-height: 44px;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--muted);
    border-radius: 6px;
    background: #fff;
    font-family: inherit;
    font-size: 1rem;
    color: var(--charcoal);
}

.field textarea {
    min-height: 9rem;
    resize: vertical;
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
    border-color: var(--red-dark);
    border-width: 2px;
}

.field__error {
    display: block;
    margin-top: 0.3rem;
    color: var(--red-dark);
    font-weight: 600;
}

.alert {
    border-radius: var(--radius);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-md);
    border: 1px solid;
}

.alert--success {
    background: #EDF6EE;
    border-color: #2E7D32;
    color: #1B4D1F;
}

.alert--error {
    background: #FDEDED;
    border-color: var(--red-dark);
    color: var(--red-dark);
}

/* ---------- Join banner ---------- */

.join-banner {
    background: var(--red);
    color: #fff;
}

.join-banner__inner {
    display: grid;
    gap: var(--space-md);
    padding-top: var(--space-lg);
    padding-bottom: var(--space-lg);
    align-items: center;
}

.join-banner h2 {
    margin: 0 0 0.4rem;
    color: #fff;
}

.join-banner__copy {
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    max-width: 38rem;
}

/* ---------- Footer ---------- */

.site-footer {
    background: var(--charcoal);
    color: var(--ivory);
    padding-top: var(--space-lg);
}

.site-footer__inner {
    display: grid;
    gap: var(--space-md);
    padding-bottom: var(--space-md);
}

.site-footer__brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.site-footer__brand .site-brand__text {
    display: flex;
}

.site-footer__nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.25rem;
}

.site-footer__nav a,
.site-footer__contact a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--ivory);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.site-footer__nav a:hover,
.site-footer__contact a:hover {
    border-bottom-color: var(--gold);
}

.site-footer__contact a {
    font-weight: 600;
}

.site-footer__legal {
    border-top: 1px solid var(--line-light);
    padding-top: var(--space-sm);
    padding-bottom: var(--space-md);
}

.site-footer__legal p {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(251, 247, 239, 0.65);
}

/* ---------- Breakpoints ---------- */

@media (min-width: 40rem) {
    .grid--2 {
        grid-template-columns: 1fr 1fr;
    }

    .site-brand__text {
        display: flex;
    }

    .grid--3 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 48rem) {
    .split {
        grid-template-columns: 1fr 1fr;
    }

    .lede {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-lg);
    }

    .contact-grid {
        grid-template-columns: 1.1fr 0.9fr;
    }

    .join-banner__inner {
        grid-template-columns: 1fr auto;
    }

    .site-footer__inner {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .site-footer__contact {
        grid-column: 1 / -1;
        display: flex;
        flex-wrap: wrap;
        gap: 0 var(--space-md);
        border-top: 1px solid var(--line-light);
        padding-top: var(--space-xs);
    }
}

@media (min-width: 62rem) {
    .grid--3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* The seven nav items, wordmark and Join button only fit in one row from about
   1088px; below that the disclosure menu is used, or the button overflows. */
@media (min-width: 68rem) {
    .site-nav,
    .site-header__cta {
        display: block;
    }

    .site-header__cta {
        display: inline-flex;
    }

    .site-menu {
        display: none;
    }

    .site-footer__contact {
        grid-column: auto;
        border-top: 0;
        padding-top: 0;
        justify-content: flex-end;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
