/*
	Custom styles
*/

/* CTA grid on home page */
.cta-grid {
    display: flex !important;
    flex-wrap: wrap;
    list-style: none;
    row-gap: 1.1rem;
}

.cta-grid > li {
    aspect-ratio: 380 / 253;
    overflow: hidden;
    box-sizing: border-box;
}

.cta-grid > li img {
    width: 100%;
    display: block;
}

/* Form tile within CTA grid */
.cta-grid li.form_cta {
    position: relative;
    overflow: hidden;
}

.cta-grid li.form_cta .actual {
    position: absolute;
    top: 0;
    left: 0.625rem;
    right: 0.625rem;
    aspect-ratio: 380 / 253;
    background-color: #0066a8;
    overflow: hidden;
}

/* Only let the tile grow/overlay once CF7 has an actual message to show (not mid-submit) */
.cta-grid li.form_cta:has(.wpcf7-form:not(.init):not(.submitting)) {
    overflow: visible;
}

.cta-grid li.form_cta:has(.wpcf7-form:not(.init):not(.submitting)) .actual {
    aspect-ratio: unset;
    height: auto;
    overflow: visible;
}

li.form_cta .wpcf7-response-output {
    background-color: #ffffff !important;
    color: #333333 !important;
    border-color: #ffffff !important;
}

/* Stretch CF7's wrappers through to .bulletin-request so it fills the tile's height */
.cta-grid li.form_cta .actual .wpcf7,
.cta-grid li.form_cta .actual form.wpcf7-form {
    height: 100%;
}

.cta-grid li.form_cta .bulletin-request {
    background-color: #0066a8;
    border-color: #0066a8;
    padding: 0.625rem 1rem 0.5rem;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cta-grid li.form_cta .bulletin-request input[type="text"],
.cta-grid li.form_cta .bulletin-request input[type="email"],
.cta-grid li.form_cta .bulletin-request input[type="phone"],
.cta-grid li.form_cta .bulletin-request input[type="password"] {
    background-color: #66a3cb;
}

.cta-grid li.form_cta h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.cta-grid li.form_cta .row {
    margin-bottom: 0;
}

.cta-grid li.form_cta .wpcf7-not-valid-tip {
    margin-top: 0.125rem;
    font-size: 0.7rem;
    padding: 2px 4px;
}

.cta-grid li.form_cta input[type="text"],
.cta-grid li.form_cta input[type="email"] {
    height: 1.75rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.cta-grid li.form_cta input[type="submit"] {
    height: 1.75rem;
    line-height: 1.75rem;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 0.8rem;
}

li.form_cta input[type="submit"]:hover,
li.form_cta input[type="submit"]:focus {
    background-color: #FFFFFF;
    border-color: #78B5E7;
    color: #0066a8;
}

.cta-grid li.form_cta p {
    margin-bottom: 0;
}

/* Mobile: image tiles — centre images horizontally */
.show-for-small li.free_wysiwyg {
    text-align: center;
}

/* Mobile: form tile — white border matches image tile framing so visible content areas align */
.show-for-small li.form_cta .actual {
    border: 0.4375rem solid #FFFFFF;
    overflow: hidden;
}


/* Nav subscribe item (menu-item-13) */
header .bottom nav.main-nav ul#menu-main-menu li.menu-item-13 {
    background-color: #0066a8;
}
header .bottom nav.main-nav ul#menu-main-menu li.menu-item-13:hover {
    background-color: #78B5E7;
}

/* Success buttons — form CTA submit, mc4wp join */
button.success, .button.success {
    background-color: #78B5E7;
    border-color: #5a9fd4;
    background-image: none;
    padding-left: 2.75rem;
}
button.success:hover, button.success:focus,
.button.success:hover, .button.success:focus {
    background-color: #0066a8;
    border-color: #004f82;
}
.subscribe .button.success {
    background-image: none;
}

/* Keep video height matched to its real aspect ratio at any container width */
.page-template-protel-home .wp-video {
    height: auto !important;
    aspect-ratio: 1260 / 350;
}

/* Let triangle tip hang below the video edge instead of sitting flush */
.page-template-protel-home .hero-banner .message .cta {
    bottom: -0.5rem;
}

/* Cap logo size below 1024px so it can only shrink, not jump bigger when its column % grows */
@media only screen and (max-width: 64em) {
    header .logo-row img {
        width: 100%;
        max-width: 14.5rem;
    }
}

/* Give TRIAL SEARCH the same left spacing as the menu headings, and guard against browser visited-link colour */
.right-off-canvas-menu .trial-cta-mobile h3 a,
.right-off-canvas-menu .trial-cta-mobile h3 a:visited,
.right-off-canvas-menu .trial-cta-mobile:hover h3 a {
    padding-left: 0.9375rem;
}

.right-off-canvas-menu .trial-cta-mobile h3 a,
.right-off-canvas-menu .trial-cta-mobile h3 a:visited {
    color: white;
}

/* Distinguish non-clickable section headings from the nav links below them */
.right-off-canvas-menu h3.menu-heading {
    color: #999999;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    font-weight: bold;
}

@media only screen and (max-width: 64em) {
    .page-template-protel-home header .logo-row {
        margin-bottom: 1.875rem;
    }

    /* Match .cta triangle's breakpoint so button doesn't show without its backdrop */
    .page-template-protel-home .hero-banner .message .cta .button {
        display: none;
    }
}

/* Margin utilities */
.margin-0  { margin: 0 !important; }
.margin-1  { margin: 0.5rem !important; }
.margin-2  { margin: 1rem !important; }
.margin-3  { margin: 1.5rem !important; }
.margin-4  { margin: 2rem !important; }
.margin-5  { margin: 3rem !important; }

.margin-top-0 { margin-top: 0 !important; }
.margin-top-1 { margin-top: 0.5rem !important; }
.margin-top-2 { margin-top: 1rem !important; }
.margin-top-3 { margin-top: 1.5rem !important; }
.margin-top-4 { margin-top: 2rem !important; }
.margin-top-5 { margin-top: 3rem !important; }

.margin-bottom-0 { margin-bottom: 0 !important; }
.margin-bottom-1 { margin-bottom: 0.5rem !important; }
.margin-bottom-2 { margin-bottom: 1rem !important; }
.margin-bottom-3 { margin-bottom: 1.5rem !important; }
.margin-bottom-4 { margin-bottom: 2rem !important; }
.margin-bottom-5 { margin-bottom: 3rem !important; }

.margin-left-0 { margin-left: 0 !important; }
.margin-left-1 { margin-left: 0.5rem !important; }
.margin-left-2 { margin-left: 1rem !important; }
.margin-left-3 { margin-left: 1.5rem !important; }
.margin-left-4 { margin-left: 2rem !important; }
.margin-left-5 { margin-left: 3rem !important; }

.margin-right-0 { margin-right: 0 !important; }
.margin-right-1 { margin-right: 0.5rem !important; }
.margin-right-2 { margin-right: 1rem !important; }
.margin-right-3 { margin-right: 1.5rem !important; }
.margin-right-4 { margin-right: 2rem !important; }
.margin-right-5 { margin-right: 3rem !important; }
