/* Scoped selectors keep theme figure/image defaults from changing tile geometry. */
.acfg {
    --acfg-gap: 0px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--acfg-gap);
    width: 100%;
    padding: 0;
    margin: 0;
    /* Preserve ACF order; deliberately avoid grid-auto-flow: dense. */
    grid-auto-flow: row;
}
.acfg > .acfg__tile {
    position: relative;
    min-width: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background: #222;
    border: 0;
    border-radius: 0;
}
/* A wide tile has exactly the height of a square, including when gaps are used. */
.acfg__tile::before { content: ""; display: block; padding-top: 100%; }
.acfg > .acfg__tile--wide { grid-column: span 2; }
.acfg__tile--wide::before { padding-top: calc((100% - var(--acfg-gap)) / 2); }
.acfg .acfg__media { position: absolute; inset: 0; display: block; color: inherit; }
.acfg .acfg__image {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    object-fit: cover;
    object-position: center;
    transition: transform 1200ms ease;
}
.acfg__tile--top .acfg__image { object-position: center top; }
.acfg__tile--bottom .acfg__image { object-position: center bottom; }
.acfg__tile--left .acfg__image { object-position: left center; }
.acfg__tile--right .acfg__image { object-position: right center; }
/* Overlay sits above the photo and below the centered caption. */
.acfg__tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 400ms ease;
    z-index: 1;
}
.acfg .acfg__caption {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 3vw, 48px);
    margin: 0;
    color: #fff;
    background: none;
    pointer-events: none;
    text-align: center;
    line-height: 1.3;
    opacity: 0;
    transition: opacity 400ms ease;
    z-index: 2;
}
.acfg .acfg__title, .acfg .acfg__subtitle {
    display: block;
    overflow-wrap: anywhere;
    max-width: 100%;
    padding: 0;
}
.acfg .acfg__title {
    margin: 0;
    color: #c9a875;
    font-size: clamp(26px, 3.2vw, 56px);
    font-family:'Bebas Neue';
    line-height: 1.1;
}
.acfg .acfg__subtitle {
    color: #fff;
    font-size: clamp(14px, 1vw, 18px);
    line-height: 1.4;
    margin: .6em 0 0;
}
.acfg__tile:hover::after,
.acfg__tile:focus-within::after,
.acfg .acfg__tile:hover .acfg__caption,
.acfg .acfg__tile:focus-within .acfg__caption { opacity: 1; }
.acfg__tile:focus-visible,
.acfg a.acfg__media:focus-visible { outline: 3px solid #f5d800; outline-offset: -6px; }
.acfg__tile:hover .acfg__image,
.acfg__tile:focus-within .acfg__image { transform: scale(1.06); }
/* Tap a non-linked captioned tile to reveal it. Linked tiles remain navigable. */
@media (prefers-reduced-motion: reduce) {
    .acfg .acfg__image,
    .acfg .acfg__caption,
    .acfg__tile::after { transition: none; }
    .acfg__tile:hover .acfg__image,
    .acfg__tile:focus-within .acfg__image { transform: none; }
}
@media (max-width: 899px) {
    .acfg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 599px) {
    .acfg { grid-template-columns: minmax(0, 1fr); }
    .acfg > .acfg__tile--wide { grid-column: auto; }
    /* Keep wide photos landscape on phones. */
    .acfg__tile--wide::before { padding-top: 50%; }
}

.acfg > .acfg__separator {
    grid-column: 1 / -1;
    background: #797b4c;
    padding: clamp(24px, 4vw, 56px) 20px;
    text-align: center;
}

.acfg .acfg__separator h3 {
    margin: 0;
    padding: 0;
    color: #fff;
    font-size: clamp(24px, 2.5vw, 40px);
    line-height: 1.2;
    text-align: center;
    overflow-wrap: anywhere;
}
