﻿
/* =========================================================
   SAINT ANNE'S RUN
   HISTORICAL ARCHIVE HOMEPAGE CARDS
   ========================================================= */


/* SECTION LAYOUT */

#legacy .legacy-intro,
#legacy .historical-gallery {
    min-width: 0;
}

#legacy .historical-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    align-content: start;
    gap: 12px;
    padding-top: 30px;
}

    #legacy .historical-gallery > figure {
        align-self: start;
        min-width: 0;
        margin: 0;
    }


/* CLICKABLE CARDS */

#legacy .legacy-photo-link {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    color: var(--ink);
    text-decoration: none;
}

    #legacy .legacy-photo-link:focus-visible {
        outline: 3px solid var(--salmon);
        outline-offset: 4px;
    }


    /* CONSISTENT IMAGE CONTAINERS */

    #legacy .legacy-photo-link .historic-photo,
    #legacy .legacy-photo-link .historic-photo.homepage-image-slot,
    #legacy .legacy-photo-link .document-photo,
    #legacy .legacy-photo-link .document-photo.homepage-image-slot {
        display: block;
        position: relative;
        width: 100%;
        height: auto !important;
        min-height: 0 !important;
        flex: 0 0 auto !important;
        aspect-ratio: 16 / 10 !important;
        overflow: hidden;
        background: #e4ded6;
    }


    /* GENERAL IMAGE RULE */

    #legacy .legacy-photo-link
    .assigned-homepage-photo {
        position: absolute !important;
        inset: 0 !important;
        display: block;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center;
        transition: transform .3s ease;
    }


/* HENRY FITZGIBBON

   Keep his face visible while retaining
   a consistent editorial image format.
*/

#legacy .legacy-category-photo:first-child
.historic-photo .assigned-homepage-photo {
    object-fit: cover !important;
    object-position: center 18% !important;
}


/* MISTLE CAT

   Fill the frame without letterboxing.
*/

#legacy .legacy-category-photo:nth-child(2)
.historic-photo .assigned-homepage-photo {
    object-fit: cover !important;
    object-position: center 45% !important;
}


/* HISTORICAL DOCUMENTS

   Match image dimensions to other cards.
*/

#legacy .legacy-category-photo:nth-child(3)
.document-photo .assigned-homepage-photo {
    object-fit: cover !important;
    object-position: center !important;
}


/* HOVER EFFECT */

#legacy .legacy-photo-link:hover
.assigned-homepage-photo {
    transform: scale(1.025);
}


/* CAPTIONS */

#legacy .historical-gallery
.legacy-category-photo figcaption {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    padding: 14px 5px 18px;
    min-height: 105px;
    background: transparent;
}


/* CATEGORY TITLES */

#legacy .legacy-category-photo
figcaption strong {
    display: inline-block;
    color: var(--salmon-dark);
    font: 700 11px/1.5 Arial, Helvetica, sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease;
}

#legacy .legacy-photo-link:hover
figcaption strong {
    border-bottom-color: var(--salmon-dark);
}


/* DESCRIPTIONS */

#legacy .legacy-category-photo
figcaption > span:not(.legacy-photo-action) {
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 13px;
    line-height: 1.55;
    max-width: 35ch;
}


/* REMOVE REDUNDANT ACTION TEXT */

#legacy .legacy-category-photo
.legacy-photo-action {
    display: none;
}


/* TABLET */

@media (max-width: 1050px) {

    #legacy .historical-gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding: 15px 5% 25px;
    }
}


/* MOBILE */

@media (max-width: 700px) {

    #legacy .historical-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    #legacy .legacy-category-photo
    figcaption strong {
        font-size: 10px;
    }

    #legacy .legacy-category-photo
    figcaption > span:not(.legacy-photo-action) {
        font-size: 12px;
    }
}


/* SMALL MOBILE */

@media (max-width: 440px) {

    #legacy .historical-gallery {
        grid-template-columns: 1fr;
    }

        #legacy .historical-gallery
        .legacy-category-photo figcaption {
            min-height: 0;
            padding: 12px 5px 20px;
        }
}


/* ACCESSIBILITY */

@media (prefers-reduced-motion: reduce) {

    #legacy .legacy-photo-link
    .assigned-homepage-photo,
    #legacy .legacy-category-photo
    figcaption strong {
        transition: none;
    }

    #legacy .legacy-photo-link:hover
    .assigned-homepage-photo {
        transform: none;
    }
}
