/**
 * Theme Name: Red Cow
 */

/* Inline body links override per-block link colours, including visited links. */
:where(.wp-site-blocks, .editor-styles-wrapper)
:is(p, li, dt, dd, figcaption, h1, h2, h3, h4, h5, h6)
a[href]:not(.wp-element-button, .wp-block-button__link):not(:where(header, footer, nav, .wp-block-navigation, .wp-block-redcow-redcow-nav-bar, .wp-block-redcow-redcow-footer) a) {
    color: var(--wp--preset--color--brandPrimary, #b50600) !important;
    text-decoration: underline !important;
}

:where(.wp-site-blocks, .editor-styles-wrapper)
:is(p, li, dt, dd, figcaption, h1, h2, h3, h4, h5, h6)
a[href]:not(.wp-element-button, .wp-block-button__link):not(:where(header, footer, nav, .wp-block-navigation, .wp-block-redcow-redcow-nav-bar, .wp-block-redcow-redcow-footer) a):is(:hover, :focus-visible) {
    color: inherit !important;
}


.letterbox-container, .wp-block-image.letterbox-container > * {
    aspect-ratio: 30 / 13 !important;
}

.wp-block-image.letterbox-container img {
    object-fit: cover;
}

.letterbox-thin-container, .wp-block-image.letterbox-thin-container > * {
    aspect-ratio: 30 / 10 !important;
}

.letterbox-thin-container:has(img) {
    overflow: hidden;
}

.letterbox-thin-container:has(img) .wp-block-image {
    width: 100%;
    height: 100%;
    margin: 0;
}

.wp-block-image.letterbox-thin-container img,
.letterbox-thin-container .wp-block-image img,
.letterbox-thin-container .wp-block-post-featured-image img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

.text-outline-white {
    -webkit-text-stroke: 6px white;
}


/* Phone links retain the same appearance in every interaction state. */
.redcow-footer-contact a[href^="tel:"] {
    color: #fff !important;
    text-decoration: underline !important;
    text-decoration-color: #fff !important;
    transition: none;
}

@media (max-width: 782px) {
    .column-reverse-wrap {
        flex-wrap: wrap-reverse !important;
    }

    [style*="padding-left:var(--wp--preset--spacing--80)"] {
        padding-left: 24px !important;
    }

    [style*="padding-right:var(--wp--preset--spacing--80)"] {
        padding-right: 24px !important;
    }

    footer.wp-block-template-part .has-brand-primary-background-color {
        box-sizing: border-box;
        min-width: 0;
        width: 100%;
        padding-right: 24px !important;
        padding-left: 24px !important;
    }

    footer.wp-block-template-part .wp-block-group,
    footer.wp-block-template-part .wp-block-columns,
    footer.wp-block-template-part .wp-block-column {
        min-width: 0;
        max-width: 100%;
    }

    footer.wp-block-template-part .wp-image-135,
    footer.wp-block-template-part figure:has(> .wp-image-135) {
        box-sizing: border-box;
        width: 100% !important;
        max-width: 100%;
        height: auto;
    }

    /* Keep contact icons independent of the available text width. */
    .redcow-footer-locations {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto auto auto;
        gap: 20px 16px !important;
        align-items: stretch;
    }

    /* Share title, address and phone tracks across both locations. */
    .redcow-footer-locations > .wp-block-group {
        display: grid;
        grid-template-rows: subgrid;
        grid-row: span 3;
        align-items: start;
    }

    .redcow-footer-locations .redcow-footer-contact {
        margin-bottom: 0 !important;
    }

    .redcow-footer-contact {
        gap: 10px !important;
    }

    .redcow-footer-contact > .wp-block-image {
        flex: 0 0 20px;
        width: 20px;
    }

    .redcow-footer-contact img {
        display: block;
        width: 100% !important;
        height: auto !important;
    }

    .redcow-footer-contact p {
        font-size: clamp(0.875rem, 3.5vw, 1rem);
        overflow-wrap: normal;
        word-break: normal;
    }

    /* Scale badges with their columns instead of retaining a fixed height. */
    .redcow-footer-badges > .wp-block-group {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
        align-items: center;
    }

    .redcow-footer-badges > .wp-block-group:nth-child(2) {
        grid-template-columns: 1.25fr 1fr;
    }

    .redcow-footer-badges > .wp-block-group:nth-child(3) {
        grid-template-columns: minmax(0, 1fr);
    }

    .redcow-footer-badges .wp-block-image {
        min-width: 0;
    }

    .redcow-footer-badges img {
        display: block;
        width: auto !important;
        max-width: 100%;
        height: auto !important;
        max-height: 60px;
    }

    .redcow-footer-badges > .wp-block-group:nth-child(n + 2) img {
        max-height: 35px;
    }

    .redcow-footer-links {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 16px;
    }

    .redcow-footer-links .has-large-font-size,
    .redcow-footer-locations .has-large-font-size {
        font-size: clamp(0.75rem, calc(4.5vw - 2.88px), 1.125rem) !important;
        overflow-wrap: normal;
        word-break: normal;
    }

    .redcow-footer-lower > .wp-block-social-links {
        width: 100%;
        justify-content: center;
    }

}
