/**
 * Hero Carousel Plugin Styles - Lucas Oil Design
 * Version: 1.0.0
 * Matches staging.lucasoil.ca design
 */

/* Import Niveau Grotesk font if available */
@import url('https://use.typekit.net/af/2cd6bf/00000000000000003b9b01ed/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n5&v=3') format("woff2");

/* -------- GLOBAL CAROUSEL ---------- */
.hero-container {
    width: 100%;
    z-index: 0;
    /* Content frame for slide-content max-width and arrow-control clamping
       on ultrawide viewports. Override in child theme to retune. */
    --content-frame: 1920px;
}

/* Dynamic slide backgrounds from ACF.
   When the slide uses an image background, the actual <picture><img>
   sits inside the slide as a sibling of the content (see .slider-slide-image
   below). For color/gradient backgrounds the inline style still applies. */
.slider-slide {
    background-position: center;
    background-size: cover;
    /* Brand radial-gradient fallback (mirrors .slider-footer-container)
       so any micro-frame between slide transitions — before the new
       image paints — looks intentional rather than revealing the
       white page bg. farthest-corner auto-scales to the larger hero
       area so it stays proportionally similar to the footer. */
    background: radial-gradient(farthest-corner at 120% 10%, rgba(0, 42, 118, 1) 20%, rgba(0, 0, 0, 1) 100%);
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh; /* Default fallback, will be overridden by dynamic CSS */
    overflow: hidden; /* clip the absolutely-positioned image */
}
/* Same gradient fallback on the carousel/inner so any gap during slide
   transform animations (when both incoming and outgoing slides translate)
   is filled with the brand radial gradient rather than page-white. */
.hero-container .carousel,
.hero-container .carousel-inner {
    background: radial-gradient(farthest-corner at 120% 10%, rgba(0, 42, 118, 1) 20%, rgba(0, 0, 0, 1) 100%);
}

/* Hero image rendered as <picture><img> for proper preloading + WebP. */
.slider-slide-image {
    position: absolute;
    inset: 0;
    z-index: 0;
    /* Ensures the <picture> behaves as a block container for its <img> */
    display: block;
}
.slider-slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* ----- Image fit: contain (with blurred same-image backdrop) -----
   When the global image_fit setting is 'contain', the foreground <img>
   shows the whole image (may letterbox); a duplicate <img> sits behind
   it as a cover-fit, blurred backdrop so the empty bands fill with a
   color-matched extension of the image rather than a flat gradient. */
.slider-slide-image-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    pointer-events: none;
}
.slider-slide-image-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    /* scale(1.1) hides the soft alpha fade at the blur edges that would
       otherwise reveal the page background through the rim. */
    filter: blur(40px);
    transform: scale(1.1);
    display: block;
}
.image-fit-contain .slider-slide-image {
    z-index: 1;
}
/* Below 1920px viewport: the foreground inherits the base object-fit:cover
   (image fills the slide, backdrop hidden behind it). The blurred backdrop
   is hidden to skip its blur computation since it's not visible anyway. */
.image-fit-contain .slider-slide-image-bg {
    display: none;
}
/* At >=1920px: switch to true contain. Picture sizes to image natural
   aspect at width = min(100vw, 2000px), centered in the slide. The
   blurred backdrop becomes visible and fills the surrounding area.
   Img height: auto means it renders at natural aspect — always filling
   the picture's width (no pillarboxing for tall sources; vertical
   overflow is clipped by slide's overflow:hidden). */
@media (min-width: 1920px) {
    .image-fit-contain .slider-slide-image-bg {
        display: block;
    }
    .image-fit-contain .slider-slide-image {
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        width: min(100vw, 2050px);
        height: auto;
        transform: translate(-50%, -50%);
    }
    .image-fit-contain .slider-slide-image img {
        height: auto;
    }
}

/* Ensure consistent height across all carousel items */
.hero-container .carousel-item {
    height: inherit;
}

.hero-container .carousel-inner {
    height: inherit;
}

/* -------- CAROUSEL CONTROLS ---------- */
.carousel-control-prev-icon {
    position: absolute;
}

.carousel-control-next-icon {
    position: absolute;
}

/* -------- SLIDE CONTENT ---------- */
.slide-content {
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: center;
    padding: 40px 20px;
}

.slide-content h1 {
    font-family: "niveau-grotesk", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-weight: bold;
    text-align: left;
    text-transform: uppercase;
    color: #ffffff;
    text-shadow: 3px 3px 3px #000000;
}

.slide-content h2 {
    font-family: "niveau-grotesk", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-weight: 400;
    text-align: left;
    text-transform: uppercase;
    color: #ffffff;
    text-shadow: 3px 3px 3px #000000;
}

.blue-btn {
    font-family: "niveau-grotesk", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    display: block;
    background-color: #003da5;
    border-radius: 1px;
    color: #ffffff;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
}

.blue-btn:hover {
    background-color: #db0632;
}

.slide-content img {
    height: auto;
    position: absolute;
    right: 0;
    bottom: 0;
    margin-bottom: -80px
}

/* -------- SLIDER FOOTER ---------- */
.slider-footer-container {
    width: 100%;
    background: radial-gradient(farthest-corner at 120% 10%, rgba(0, 42, 118, 1) 20%, rgba(0, 0, 0, 1) 100%);
    z-index: 2;
    flex: 0
}

.slider-footer-content {
    margin-left: auto;
    margin-right: auto;
    padding: 0 40px
}

.product-slide-title {
    color: #ffffff;
    font-family: "niveau-grotesk", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 24px;
    font-weight: 600;
    text-transform: uppercase;
    padding-bottom: 10px;
}

.benefit-slider-outer {
    display: flex;
    flex-direction: row;
    gap: 20px
}

.benefit-slider {
    display: flex;
    flex-direction: row;
    align-items: center; /* vertically center the label text against the icon */
}
/* Square frame with centered icon. Source icons differ in aspect ratio
   (some wide, some tall, some square) — without a fixed-size frame each
   benefit's icon rendered at a different size. The flex centering +
   object-fit: contain keeps every icon visually sized and aligned the
   same regardless of source dimensions. */
.benefit-slider-frame {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}
.benefit-slider img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.benefit-slider h4 {
    font-size: 21px;
    font-style: normal;
    font-weight: 400;
    font-family: "niveau-grotesk", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    display: inline-block;
    text-transform: uppercase;
}

.benefit-line1 {
    color: #2d79ff;
}

.benefit-line2 {
    color: #ffffff;
}

/* Additional button styles for plugin */
.white-btn {
    font-family: "niveau-grotesk", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    display: block;
    background-color: #ffffff;
    border-radius: 1px;
    color: #003da5;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
}

.white-btn:hover {
    background-color: #f0f0f0;
    color: #db0632;
}

.outline-btn {
    font-family: "niveau-grotesk", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    display: block;
    background-color: transparent;
    border: 2px solid #ffffff;
    border-radius: 1px;
    color: #ffffff;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
}

.outline-btn:hover {
    background-color: #ffffff;
    color: #003da5;
}

/* Slide overlay for readability */
.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    z-index: 1;
}

/* Content alignment helpers */
.slider-slide.align-left .slide-content {
    text-align: left;
}

.slider-slide.align-center .slide-content {
    text-align: center;
}

.slider-slide.align-center .slide-content h1,
.slider-slide.align-center .slide-content h2 {
    text-align: center;
}

.slider-slide.align-center .product-image {
    position: relative !important;
    float: none !important;
    margin: 30px auto 0;
    display: block;
}

.slider-slide.align-right .slide-content {
    text-align: right;
}

/* Title size variations */


/* Carousel base styles */
.carousel-inner {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-item {
    position: relative;
    display: none;
    float: left;
    width: 100%;
    margin-right: -100%;
    backface-visibility: hidden;
    transition: transform .6s ease-in-out;
}

.carousel-item.active {
    display: block;
}

/* Carousel indicators */
.carousel-indicators {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 15;
    display: flex;
    justify-content: center;
    padding-left: 0;
    margin-right: 15%;
    margin-left: 15%;
    list-style: none;
}

.carousel-indicators button {
    box-sizing: content-box;
    flex: 0 1 auto;
    width: 30px;
    height: 3px;
    margin-right: 3px;
    margin-left: 3px;
    text-indent: -999px;
    cursor: pointer;
    background-color: #fff;
    background-clip: padding-box;
    border: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    opacity: .5;
    transition: opacity .6s ease;
}

.carousel-indicators .active {
    opacity: 1;
}

/* Messages */
.no-slides-message,
.carousel-disabled-message {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    color: #6c757d;
    padding: 50px 20px;
    text-align: center;
}

/* -------- RESPONSIVE CSS ---------- */
/* Phone - Mobile First Approach */
@media screen and (min-width: 1px) {
    .carousel-control-prev-icon {left: 10px}
    .carousel-control-next-icon {right: 10px;}
    .slide-content {width: 90%; padding: 20px 20px;}
    .slide-content h1 {font-size: 20px;width: 90%;}
    .slide-content h2 {font-size: 22px;width: 90%;}
    .blue-btn {width:200px;font-size: 20px;margin: 10px auto 30px auto;padding: 10px 0px;}
    .slide-content img  {width: 200px;display: none;}
    .slider-footer-container {padding: 30px 0px 40px 0px;}
    .slider-footer-content {width: 90%;}
    .benefit-slider-outer { flex-direction: column; gap: 10px }
    .benefit-slider {margin-right: 0px;}
    .benefit-slider-frame { width: 45px; height: 45px; }
    .benefit-slider h4 { font-size: 17px; }
    .slide-content h1.title-small {font-size: 24px;}
    .slide-content h1.title-medium {font-size: 28px;}
    .slide-content h1.title-large {font-size: 32px;}
    .slide-content h1.title-extra-large {font-size: 50px;}
}

/* Tablet */
@media screen and (min-width: 768px) {
    .carousel-control-prev-icon {left: 30px}
    .carousel-control-next-icon {right: 30px;}
    .slide-content {width: 768px; padding: 20px 20px; }
    .slide-content h1 {font-size: 38px;width: 100%;margin-left:20px;}
    .slide-content h2 {font-size: 28px;width: 80%;margin-left:20px;}
    .blue-btn {width:250px;font-size: 26px;margin: 20px 0 20px 20px;padding: 20px 0px;}
    .slide-content img  {width: 220px; display: inline-block; margin-bottom: -45px;}
    .slider-footer-container {padding: 30px 0px 40px 0px;}
    .slider-footer-content {width: 768px;}
    .benefit-slider-outer { flex-direction: row; gap: 20px }
    .benefit-slider {margin-right: 0px;}
    .benefit-slider-frame { width: 50px; height: 50px; }
    .benefit-slider h4 { font-size: 19px; }
    .slide-content h1.title-small {font-size: 32px;}
    .slide-content h1.title-medium {font-size: 36px;}
    .slide-content h1.title-large {font-size: 40px;}
    .slide-content h1.title-extra-large {font-size: 52px;}
}

/* Desktop */
@media screen and (min-width: 1280px) {
    .carousel-control-prev-icon {left: 30px}
    .carousel-control-next-icon {right: 30px;}
    .slide-content {width: 1280px; padding: 20px 20px;}
    .slide-content h1 {font-size: 52px;width: 70%;margin-left:20px;}
    .slide-content h2 {font-size: 32px;width: 60%;margin-left:20px;}
    .blue-btn {width:250px;font-size: 26px;margin: 20px 0 0 20px;padding: 20px 0px;}
    .slide-content img  {width: 350px;margin-bottom: -80px;}
    .slider-footer-container {padding: 30px 0px 40px 0px;}
    .slider-footer-content {width: 1280px;}
    .benefit-slider {margin-right: 30px;}
    .benefit-slider-frame { width: 50px; height: 50px; }
    .slide-content h1.title-small {font-size: 38px;}
.slide-content h1.title-medium {    font-size: 44px;}
.slide-content h1.title-large {    font-size: 52px;}
.slide-content h1.title-extra-large {    font-size: 60px;}
}

/* UHD */
@media screen and (min-width: 1920px) {
    .carousel-control-prev-icon {left: 30px}
    .carousel-control-next-icon {right: 30px;}
    .slide-content {width: 1620px; padding: 20px 0;}
    .slide-content h1 {font-size: 52px;width: 70%;margin-left:0px;}
    .slide-content h2 {font-size: 38px;width: 40%;margin-left:0px;}
    .blue-btn {width:250px;font-size: 26px;margin: 20px 0 0 0;padding: 20px 0px;}
    .slide-content img  {width: 350px;}
    .slider-footer-container {padding: 30px 0px 40px 0px;}
    .slider-footer-content {width: 1620px;}
    .benefit-slider {margin-right: 30px;}
    .benefit-slider-frame { width: 70px; height: 70px; }
    .benefit-slider h4 { font-size: 22px; }
}

/* Product image alias for compatibility */
.product-image {
    /* Inherits from .slide-content img */
}

/* Animation Classes */
.animate__animated {
    animation-duration: 1s;
    animation-fill-mode: both;
}

.animate__fadeInUp {
    animation-name: fadeInUp;
}

.animate__fadeInLeft {
    animation-name: fadeInLeft;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translate3d(-40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Override Bootstrap defaults to match Lucas Oil */
.carousel-control-prev,
.carousel-control-next {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 15%;
    color: #fff;
    text-align: center;
    opacity: 0.5;
    transition: opacity 0.15s ease;
    background: none;
    border: 0;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 0.9;
}

/* Clamp the controls to a centered content frame on ultrawide viewports so
   the arrows don't fly to the far edges of the screen. Below the frame
   width, max() resolves to 0 (current behavior). At/above the frame width,
   the parent button is offset inward by half the overflow, putting the
   30px icon inside the frame edge automatically. */
.carousel-control-prev {
    left: max(0px, calc((100vw - var(--content-frame, 1920px)) / 2));
}

.carousel-control-next {
    right: max(0px, calc((100vw - var(--content-frame, 1920px)) / 2));
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: 50%;
    background-size: 100% 100%;
}

.carousel-control-prev-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M5.25 0l-4 4 4 4 1.5-1.5L4.25 4l2.5-2.5L5.25 0z'/%3e%3c/svg%3e");
}

.carousel-control-next-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M2.75 0l-1.5 1.5L3.75 4l-2.5 2.5L2.75 8l4-4-4-4z'/%3e%3c/svg%3e");
}
