/**
 * UG-610 homepage hero carousel.
 * Figma: SW_EXT_the-universal-group 18332:8666 (desktop 1440), 18716:14950 (mobile 375).
 * Slide markup lives in the "home-hero-slide-*" CMS blocks:
 *   .ug-hero-copy > .ug-hero-eyebrow, .ug-hero-title (em = red), .ug-hero-subtitle, .ug-hero-text, .ug-hero-ctas
 *   .ug-hero-visual > img
 */

.ug-hero {
    --ug-hero-gutter: clamp(20px, 7vw, 100px);
    background: #f5f5f5;
    clear: both;
    color: #1a1a1a;
    font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0 auto;
    /* Design width; wider screens get the page background on both sides instead of a stretched banner */
    max-width: 1440px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

/* All slides share one grid cell, so the hero is always as tall as its tallest slide: autoplay never changes
   its height, and the controls and the sections below never jump. Only the active slide is visible. */
.ug-hero-track {
    display: grid;
}

/* The visual keeps the banner shape (1320x1040, Figma 660x520 at 1440) at every width, so a banner made
   at that size always fills it exactly; the row height follows it (520px at 1440). */
.ug-hero-slide {
    display: grid;
    grid-area: 1 / 1;
    grid-template-columns: 1fr min(45.83%, 660px);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.ug-hero-slide.-active {
    animation: ug-hero-fade .45s ease;
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

/* Saving a slide block in the admin makes Page Builder wrap its HTML (data-content-type="html", or a row with an
   inner div). The wrappers would be the slide's only grid item, stacking the copy above the image, so they are
   taken out of the layout and the copy and visual stay the grid's two columns. */
.ug-hero-slide [data-content-type],
.ug-hero-slide [data-element="inner"] {
    display: contents;
}

@keyframes ug-hero-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .ug-hero-slide.-active {
        animation: none;
    }
}

/* Copy */
.ug-hero-copy {
    align-self: center;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: calc(620px + var(--ug-hero-gutter) + 40px);
    padding: 32px 40px 72px var(--ug-hero-gutter);
}

.ug-hero-eyebrow {
    align-self: flex-start;
    background: #fbe3e8;
    color: #c41230;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .1em;
    line-height: 1.4;
    padding: 5px 12px;
    text-transform: uppercase;
}

.ug-hero .ug-hero-title {
    color: #1a1a1a;
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -.5px;
    line-height: 1.08;
    margin: 0;
    max-width: 600px;
    text-transform: none;
}

.ug-hero-title em {
    color: #c8102e;
    font-style: normal;
}

.ug-hero .ug-hero-subtitle {
    font-size: 20px;
    font-weight: 700;
    line-height: 24px;
    margin: 0;
}

.ug-hero .ug-hero-text {
    color: #293335;
    font-size: 16px;
    line-height: 1.55;
    margin: 0;
    max-width: 494px;
}

.ug-hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}

.ug-hero .ug-hero-cta {
    align-items: center;
    border: 1px solid #293335;
    border-radius: 3px;
    box-sizing: border-box;
    display: inline-flex;
    font-size: 16px;
    font-weight: 700;
    height: 40px;
    justify-content: center;
    letter-spacing: .3px;
    padding: 0 22px;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color .15s, color .15s, border-color .15s;
    white-space: nowrap;
}

.ug-hero .ug-hero-cta.-primary {
    background: #c41230;
    border-color: #c41230;
    color: #fff;
}


.ug-hero .ug-hero-cta.-secondary {
    background: #fff;
    color: #293335;
}


/* Visual: the whole image is always shown (contain); any leftover space is filled with a blurred,
   darkened copy of the same image (--ug-hero-bg, set by hero-carousel.js) instead of flat bars. */
.ug-hero-visual {
    align-self: center;
    aspect-ratio: 1320 / 1040;
    background: #111;
    overflow: hidden;
    position: relative;
}

.ug-hero-visual::before {
    background: var(--ug-hero-bg, none) center / cover no-repeat;
    content: '';
    filter: blur(28px) brightness(.55);
    inset: -40px;
    position: absolute;
}

.ug-hero-visual img {
    display: block;
    height: 100%;
    object-fit: contain;
    position: relative;
    width: 100%;
}

/* Controls */
.ug-hero-controls {
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.ug-hero-controls > * {
    pointer-events: auto;
}

.ug-hero .ug-hero-arrow {
    align-items: center;
    background: #fff;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    cursor: pointer;
    display: flex;
    height: 38px;
    justify-content: center;
    margin-top: -19px;
    min-height: 0;
    padding: 0;
    position: absolute;
    top: 50%;
    width: 38px;
}


.ug-hero-arrow.-prev {
    left: 20px;
}

.ug-hero-arrow.-next {
    right: 20px;
}

.ug-hero-arrow::before {
    border: solid #1a1a1a;
    border-width: 0 2px 2px 0;
    content: '';
    height: 7px;
    margin-right: 3px;
    transform: rotate(-45deg);
    width: 7px;
}

.ug-hero-arrow.-prev::before {
    margin: 0 0 0 3px;
    transform: rotate(135deg);
}

.ug-hero-indicator {
    align-items: center;
    background: #fff;
    bottom: 16px;
    display: flex;
    gap: 14px;
    left: var(--ug-hero-gutter);
    padding: 8px 13px;
    position: absolute;
}

.ug-hero-count {
    color: #999;
    font-size: 12px;
    font-weight: 800;
    line-height: 16px;
    white-space: nowrap;
}

.ug-hero-count b {
    color: #c8102e;
}

.ug-hero-segments {
    display: flex;
    gap: 6px;
}

.ug-hero .ug-hero-segment {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    cursor: pointer;
    height: 16px;
    min-height: 0;
    padding: 0;
    position: relative;
    width: 26px;
}

.ug-hero-segment::before {
    background: #dcdcdc;
    content: '';
    height: 4px;
    left: 0;
    margin-top: -2px;
    position: absolute;
    top: 50%;
    transition: background-color .2s;
    width: 100%;
}

.ug-hero-segment.-active::before {
    background: #c8102e;
}

/* Focus: nothing on mouse click (the theme outlines any focused link/button), a red outline from the keyboard */
.ug-hero .ug-hero-cta:focus,
.ug-hero .ug-hero-arrow:focus,
.ug-hero .ug-hero-segment:focus {
    box-shadow: none;
    outline: none;
}

.ug-hero .ug-hero-cta:focus,
.ug-hero .ug-hero-cta:visited {
    text-decoration: none;
}

.ug-hero .ug-hero-cta.-primary:focus,
.ug-hero .ug-hero-cta.-primary:visited {
    color: #fff;
}

.ug-hero .ug-hero-cta.-secondary:focus,
.ug-hero .ug-hero-cta.-secondary:visited {
    color: #293335;
}

.ug-hero .ug-hero-cta:focus-visible,
.ug-hero .ug-hero-arrow:focus-visible,
.ug-hero .ug-hero-segment:focus-visible {
    outline: 2px solid #c41230;
    outline-offset: 2px;
}

/* Hover only for a real pointer: touch devices keep no sticky hover state */
@media (hover: hover) and (pointer: fine) {
    .ug-hero .ug-hero-cta.-primary:hover {
        background: #930d24;
        border-color: #930d24;
        color: #fff;
        text-decoration: none;
    }

    .ug-hero .ug-hero-cta.-secondary:hover {
        background: #293335;
        color: #fff;
        text-decoration: none;
    }

    /* Design base template: dark arrow with a white icon */
    .ug-hero .ug-hero-arrow:hover {
        background: #464646;
    }

    .ug-hero .ug-hero-arrow:hover::before {
        border-color: #fff;
    }

    .ug-hero-segment:hover:not(.-active)::before {
        background: #b9b9b9;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .ug-hero-slide {
        grid-template-columns: 1fr 40%;
    }

    .ug-hero .ug-hero-title {
        font-size: 34px;
    }

    .ug-hero-copy {
        padding: 32px 24px 72px 72px;
    }

    .ug-hero-indicator {
        left: 72px;
    }

    .ug-hero .ug-hero-cta {
        font-size: 14px;
        padding: 0 16px;
    }
}

/* Mobile: visual on top, copy below, controls row at the bottom (Figma 375) */
@media (max-width: 767px) {
    .ug-hero-slide {
        display: flex;
        flex-direction: column;
    }

    .ug-hero-visual {
        order: -1;
        width: 100%;
    }

    .ug-hero-copy {
        gap: 14px;
        max-width: none;
        padding: 24px 16px 20px;
    }

    .ug-hero .ug-hero-title {
        font-size: 32px;
        line-height: 1.1;
    }

    .ug-hero .ug-hero-text {
        line-height: 1.5;
    }

    .ug-hero-ctas {
        flex-direction: column;
    }

    .ug-hero .ug-hero-cta {
        height: 46px;
        white-space: normal;
        width: 100%;
    }

    .ug-hero-controls {
        align-items: center;
        display: flex;
        justify-content: space-between;
        padding: 0 16px 24px;
        position: static;
    }

    .ug-hero .ug-hero-arrow,
    .ug-hero-indicator {
        margin: 0;
        position: static;
    }
}
