
/*
 * Endorsements page
 *
 * Organizations appear first when populated, followed by
 * State & National and Local individual endorsements.
 * Image-backed entries precede text-only entries.
 *
 * Component effects are defined here; brand colors and
 * shared semantic values come from the token system.
 */

.page-endorsements {
    --endorsement-photo-radius: var(--radius-lg);

    --endorsement-photo-gradient:
        linear-gradient(
            180deg,
            transparent 30%,
            color-mix(
                in srgb,
                var(--color-photo-scrim) 16%,
                transparent
            ) 48%,
            color-mix(
                in srgb,
                var(--color-photo-scrim) 48%,
                transparent
            ) 65%,
            color-mix(
                in srgb,
                var(--color-photo-scrim) 82%,
                transparent
            ) 82%,
            color-mix(
                in srgb,
                var(--color-photo-scrim) 97%,
                transparent
            ) 100%
        );

    --endorsement-caption-shadow:
        0 1px 3px
        color-mix(
            in srgb,
            var(--color-black) 60%,
            transparent
        );

    --endorsement-caption-secondary:
        color-mix(
            in srgb,
            var(--color-photo-text) 96%,
            transparent
        );
}

/*
 * Interior hero
 */

.page-endorsements .hero--interior .hero__heading {
    max-width: 22ch;
    line-height: 1.12;
    letter-spacing: 0.015em;
}

/*
 * Section backgrounds
 */

.endorsements-section {
    padding-block: var(--space-9);
    color: var(--color-text-primary);
}

.endorsements-section--organizations {
    background: var(--color-surface-contrast);
    color: var(--color-text-on-contrast);
}

.endorsements-section--state-national {
    background: var(--color-surface-accent);
}

.endorsements-section--local {
    background: var(--color-surface-primary);
}

.endorsements-section__header {
    max-width: 52rem;
    margin-bottom: var(--space-7);
}

.endorsements-section__heading {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--type-display-section);
    font-weight: var(--font-display-weight);
    line-height: 1.15;
    letter-spacing: 0.015em;
}

.endorsements-section__description {
    margin: var(--space-3) 0 0;
    color: var(--color-text-secondary);
    font-size: 1.05rem;
    line-height: 1.65;
}

.endorsements-section--organizations
.endorsements-section__description {
    color: var(--color-text-on-contrast-muted);
}

/*
 * Photo and logo grid
 */

.endorsements-media-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-5);
}

.endorsement-photo {
    position: relative;
    min-width: 0;
    margin: 0;
}

.endorsement-photo__media {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--endorsement-photo-radius);
    background: var(--color-media-placeholder);
}

.endorsement-photo__media img {
    display: block;
    width: 100%;
    height: 100%;
}

/*
 * Individual portraits
 */

.endorsement-photo--portrait {
    overflow: hidden;
    border-radius: var(--endorsement-photo-radius);
}

.endorsement-photo--portrait
.endorsement-photo__media img {
    object-fit: cover;
}

/*
 * Photo overlay
 *
 * The shading uses the shared photographic scrim color.
 * The five opacity stops are a component-specific effect.
 */

.endorsement-photo--portrait
.endorsement-photo__media::after {
    position: absolute;
    inset: 0;
    z-index: 1;

    content: "";
    pointer-events: none;

    background: var(--endorsement-photo-gradient);
}

/*
 * Caption overlay
 */

.endorsement-photo--portrait
.endorsement-photo__caption {
    position: absolute;
    inset-inline: 0;
    inset-block-end: 0;
    z-index: 2;

    display: flex;
    flex-direction: column;
    gap: 0.25rem;

    padding: var(--space-4);

    background: transparent;
    color: var(--color-photo-text);

    text-shadow: var(--endorsement-caption-shadow);
}

.endorsement-photo--portrait
.endorsement-photo__name {
    color: var(--color-photo-text);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.25;
}

.endorsement-photo--portrait
.endorsement-photo__detail {
    color: var(--endorsement-caption-secondary);
    font-size: 0.9rem;
    line-height: 1.35;
}

/*
 * Organization logos
 *
 * Logo presentation is intentionally separate from
 * the photographic overlay.
 */

.endorsement-photo--logo
.endorsement-photo__media {
    display: grid;
    place-items: center;
    padding: var(--space-5);
    background: var(--color-surface-primary);
}

.endorsement-photo--logo
.endorsement-photo__media img {
    object-fit: contain;
}

.endorsement-photo--logo
.endorsement-photo__caption {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding-top: var(--space-3);
}

.endorsement-photo--logo
.endorsement-photo__name {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.4;
}

.endorsement-photo--logo
.endorsement-photo__detail {
    color: var(--color-text-on-contrast-subtle);
    font-size: 0.88rem;
    line-height: 1.5;
}

/*
 * Text-only endorsements
 */

.endorsements-section__subheading {
    margin: var(--space-8) 0 var(--space-4);
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.4;
}

.endorsements-name-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: var(--space-7);
    row-gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.endorsement-name {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
    padding-block: var(--space-4);
    border-top: 1px solid var(--color-border);
}

.endorsements-section--organizations
.endorsement-name {
    border-color: var(--color-border-on-contrast);
}

.endorsement-name__name {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.4;
}

.endorsement-name__detail {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.endorsements-section--organizations
.endorsement-name__detail {
    color: var(--color-text-on-contrast-subtle);
}

/*
 * Responsive layouts
 */

@media (max-width: 64rem) {
    .endorsements-media-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 48rem) {
    .endorsements-section {
        padding-block: var(--space-8);
    }

    .endorsements-section__header {
        margin-bottom: var(--space-6);
    }

    .endorsements-media-grid,
    .endorsements-name-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--space-4);
    }
}

@media (max-width: 32rem) {
    .endorsements-media-grid,
    .endorsements-name-grid {
        grid-template-columns: 1fr;
    }

    .endorsements-media-grid {
        row-gap: var(--space-6);
    }
}
