/* =========================================================
   HOME SPLIDE CAROUSEL
   80% centered content width version
   ========================================================= */


/* ---------------------------------------------------------
   1. CAROUSEL WIDTH / CONTAINMENT
   --------------------------------------------------------- */

.home-splide,
.home-splide .wp-block-splide-carousel {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    box-sizing: border-box;
}

.home-splide .splide__track {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}


/* ---------------------------------------------------------
   2. CONSTRAIN ALL SLIDE CONTENT TO 80%
   --------------------------------------------------------- */

.home-splide .splide__slide > * {
    width: 80% !important;
    max-width: 80% !important;

    margin-left: auto !important;
    margin-right: auto !important;

    box-sizing: border-box;
}


/* ---------------------------------------------------------
   3. IMAGE — FILL THE 80% CONTENT AREA
   --------------------------------------------------------- */

.home-splide .wp-block-image {
    width: 100% !important;
    max-width: 100% !important;

    height: auto !important;
    max-height: none !important;

    margin-left: auto !important;
    margin-right: auto !important;

    overflow: hidden !important;
    box-sizing: border-box;
}

.home-splide .wp-block-image img {
    display: block !important;

    width: 100% !important;
    max-width: 100% !important;

    height: auto !important;
    max-height: none !important;

    margin: 0 !important;
}


/* ---------------------------------------------------------
   4. KEEP SLIDE CONTENT IN NORMAL FLOW
   --------------------------------------------------------- */

.home-splide .splide__slide {
    position: relative !important;
    height: auto !important;
    min-width: 0 !important;

    box-sizing: border-box;
}


/* ---------------------------------------------------------
   5. SPLIDE ARROWS
   --------------------------------------------------------- */

.home-splide {
    position: relative;
}

.home-splide .splide__arrows {
    position: static !important;
}

.home-splide .splide__arrow {
    width: 40px !important;
    height: 40px !important;

    top: 50% !important;
    transform: translateY(-50%) !important;

    z-index: 20 !important;
    opacity: 1 !important;
}

.home-splide .splide__arrow--prev {
    left: 12px !important;
}

.home-splide .splide__arrow--next {
    right: 12px !important;
}


/* ---------------------------------------------------------
   6. ARROW ICON SIZE
   --------------------------------------------------------- */

.home-splide .splide__arrow svg {
    width: 16px !important;
    height: 16px !important;
}


/* ---------------------------------------------------------
   END HOME SPLIDE CAROUSEL
   --------------------------------------------------------- */

/* =========================================================
   HOME PAGE HERO — GIF, TEXT OVERLAY & BUTTONS
   ========================================================= */


/* =========================================================
   1. HERO CONTAINER
   ========================================================= */

.hero-container {
    position: relative;
    width: 100%;
    overflow: visible !important;

    /* Enables container-relative typography */
    container-type: inline-size;
}


/* =========================================================
   2. HERO GIF / IMAGE
   ========================================================= */

.hero-gif {
    width: 100%;
    margin: 100px 0 0 0 !important;
}

.hero-gif img {
    display: block;
    width: 100%;
    height: auto;
}


/* =========================================================
   3. DESKTOP OVERLAY CONTENT
   ========================================================= */

.hero-overlay {
    position: absolute;
    top: -8.5%;
    left: 1.85%;
    z-index: 2;

    width: 47%;
    box-sizing: border-box;
}


/* =========================================================
   4. DESKTOP HERO TEXT
   ========================================================= */

/*
 * 1cqw = 1% of the hero container width.
 * Text scales proportionally with the GIF.
 */

.hero-heading-line-1,
.hero-heading-line-2 {
    font-size: 3.65cqw !important;
    line-height: 0.80 !important;
    margin: 0;
}

/* Hide mobile heading on desktop */
.hero-heading-mobile {
    display: none;
}

/* Different widths follow the triangular white space */
.hero-heading-line-1 {
    width: 100%;
}

.hero-heading-line-2 {
    width: 82%;
}


/* =========================================================
   5. DESKTOP BUTTONS
   ========================================================= */

.hero-buttons {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;

    margin-top: 16px;
}


/* =========================================================
   6. BUTTON STACKING ON NARROW DESKTOPS
   ========================================================= */

@media (min-width: 1141px) and (max-width: 1360px) {

    .hero-buttons.wp-block-spectra-buttons {
        flex-direction: column !important;
        align-items: flex-start !important;
        width: max-content !important;
        max-width: 100%;
    }

}


/* =========================================================
   7. TABLET & MOBILE LAYOUT
   ========================================================= */

@media (max-width: 1140px) {

    /* Stack text above the hero GIF */
    .hero-container {
        display: flex;
        flex-direction: column;
        width: 100%;
        overflow: visible !important;
    }

    /* Text overlay becomes a normal content section */
    .hero-overlay {
        position: static;
        order: 1;

        top: auto;
        left: auto;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;

        box-sizing: border-box;

        /* Comfortable spacing from screen edges */
        padding: 20px 24px 24px;
        margin: 0;

        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    /* GIF moves below text */
    .hero-gif {
        order: 2;
        width: 100%;
        max-width: 100%;
        margin: 0 !important;
    }

    /* Hide desktop-specific heading lines */
    .hero-heading-line-1,
    .hero-heading-line-2 {
        display: none !important;
    }

    /* Show mobile heading */
    .hero-heading-mobile {
        display: block !important;

        text-align: center !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;

        box-sizing: border-box;

        margin: 0 !important;
        padding: 0;

        font-size: clamp(48px, 8vw, 92px) !important;
        line-height: 0.9 !important;

        /* Prevent long words from causing overflow */
        overflow-wrap: break-word;
    }

    /* Center buttons below the heading */
    .hero-buttons.wp-block-spectra-buttons {
        display: flex !important;
        flex-direction: row !important;

        justify-content: center !important;
        align-items: center !important;

        flex-wrap: wrap !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;

        box-sizing: border-box;

        margin: 20px auto 0 !important;
        gap: 8px;
    }

    /* Prevent individual buttons from exceeding the area */
    .hero-buttons.wp-block-spectra-buttons > * {
        max-width: 100%;
        box-sizing: border-box;
    }

}


/* =========================================================
   8. SMALL MOBILE SCREENS
   ========================================================= */

@media (max-width: 767px) {

    /* Slightly narrower padding on phones */
    .hero-overlay {
        padding: 20px 16px 12px;
    }

    /* Responsive heading */
    .hero-heading-mobile {
        font-size: clamp(36px, 8vw, 60px) !important;
        line-height: 0.95 !important;
    }

    /* Buttons can wrap instead of extending off-screen */
    .hero-buttons.wp-block-spectra-buttons {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 10px;
    }

}


/* =========================================================
   END OF HOME PAGE HERO CSS
   ========================================================= */


/* This is to make the hero image of the Work With Us page match the height of the content in the left column */

.equal-height-columns {
    align-items: stretch !important;
}

/* Make both columns stretch to the height of the taller one */
.equal-height-columns > .wp-block-column {
    align-self: stretch !important;
}

/* Right column becomes a flex container */
.cover-image-column {
    display: flex !important;
    flex-direction: column;
}

/* Image block fills the entire right column */
.cover-image-column .wp-block-image {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    margin: 0 !important;
}

/* Actual image fills that space and crops as necessary */
.cover-image-column .wp-block-image img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

@media (max-width: 767px) {

    .equal-height-columns {
        align-items: initial !important;
    }

    .equal-height-columns > .wp-block-column {
        align-self: auto !important;
    }

    .cover-image-column {
        display: block !important;
    }

    .cover-image-column .wp-block-image {
        height: auto !important;
        flex: none !important;
    }

    .cover-image-column .wp-block-image img {
        width: 100% !important;
        height: auto !important;
        object-fit: initial;
    }
}

/* This is the end of the Work With Us page edits */

/* This is to get the Ottawa Axo to be full height on the new home page */

/* =========================================================
   EQUAL-HEIGHT TWO-COLUMN IMAGE LAYOUT
   ========================================================= */

.equal-height-columns {
    align-items: stretch !important;
}

/* Make both columns stretch to the full row height */
.equal-height-columns > .wp-block-column {
    align-self: stretch !important;
}

/* Right column becomes a flex container */
.image-fill-column {
    display: flex !important;
    flex-direction: column;
}

/* Make the Image block fill the right column */
.image-fill-column .wp-block-image {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    margin: 0 !important;
}

/* Make the actual image fill the Image block */
.image-fill-column .wp-block-image img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

/* End of the Ottawa Axo height adjustment */

/* This is to get the caption to show over blurred images */

.hover-caption {
    overflow: hidden;
}

.hover-caption .wp-block-uagb-image__figure {
    position: relative;
    overflow: hidden;
    margin: 0;
}

.hover-caption img {
    display: block;
    width: 100%;
    transition: filter 1s ease, transform 1s ease !important;
}

.hover-caption .uagb-image-caption {
    position: absolute !important;
    inset: 0 !important;

    display: flex !important;
    align-items: center;
    justify-content: center;

    margin: 0 !important;
    padding: 20px !important;
    box-sizing: border-box;

    color: white !important;
    font-size: 22px;
    text-align: center;

    background: rgba(0, 0, 0, 0.25);

    opacity: 0 !important;
    visibility: hidden;

    transition: opacity 1s ease, visibility 1s ease !important;

    z-index: 5;
    pointer-events: none;
}

.hover-caption:hover .uagb-image-caption {
    opacity: 1 !important;
    visibility: visible;
}

.hover-caption:hover img {
    filter: blur(6px);
    transform: scale(1.03);
}

/* This is the end of the blurred caption piece */

/* This is to fix the Carousel in Spectra's Gallery Block */
.project-carousel-fix .spectra-image-gallery__media-wrapper,
.project-carousel-fix .spectra-image-gallery__media,
.project-carousel-fix .slick-slide > div {
    height: auto !important;
    min-height: 0 !important;
}

.project-carousel-fix img.spectra-image-gallery__media-thumbnail--carousel {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
}
/* End of Carousel fix */

/* Make VideoPress fill its column */
.wp-block-column > .full-width-video {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.wp-block-column > .full-width-video .jetpack-videopress-player__wrapper {
    width: 100% !important;
    max-width: none !important;
}

.wp-block-column > .full-width-video iframe {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
}

/* End of VideoPress fill its column */

/* This is to make the "scroll to" behaviour smooth on the whole website */

html {
  scroll-behavior: smooth;
}

[id] {
    scroll-margin-top: 124px;
}
/* end of smooth scrolling */
	
/* This code hides the side menus on mobile and makes the content full width */
	
@media (max-width: 767px) {

    .mobile-hide-sidebar {
        display: none !important;
    }

    .mobile-full-content {
        width: 100% !important;
        max-width: 100% !important;
        flex-basis: 100% !important;
				min-width: 0 !important;
    }

    /*
     * Allow content inside the main column to shrink
     * to the available mobile width.
     */
    .mobile-full-content > * {
        min-width: 0 !important;
        max-width: 100% !important;
    }
}
	
/* This is the end of the mobile side menu handling */

/* Start of the Main Header Menu styling options (buttons and links) */
.header-nav-area a:not(.wp-element-button):hover,
.header-nav-area a:not(.wp-element-button):focus-visible {
    color: #FF9443 !important;
}

.header-nav-area .wp-block-button__link:hover,
.header-nav-area .wp-block-button__link:focus-visible {
    background-color: #FF9443 !important;
    color: var(--wp--preset--color--theme-1) !important;
}

/* End of Main Header Menu Styling */

/* This is to make the sidebar menus stop before overlapping the footer */

.sticky-keep-inside {
    --spectra-sticky-keep-inside-parent: 1 !important;
	z-index: 100 !important;
}

/* End of the Sidebar Menu Overlap fix */

/* Fix for the Design Catalogue flashing at the wrong size */

.instant-gallery .agrfuxd-carousel-figure img {
    visibility: hidden;
}

.delayed-template-content {
    visibility: hidden;
}

/* end of the Design Catalogue Flash fix */


/* This is for the News page */

/* =========================================================
   NEWS GRID — 4 columns desktop
   ========================================================= */

.news-card {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    column-gap: 24px;
    row-gap: 40px;
    padding: 0;
    margin: 0;
}


/* Each individual news item */
.news-card > li {
    display: block;
    min-width: 0;
}


/* =========================================================
   FEATURED IMAGE
   ========================================================= */

.news-card-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    margin: 0 0 8px 0 !important;
}

.news-card-image img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}


/* If image is linked, make link fill image area */
.news-card-image a {
    display: block;
    width: 100%;
    height: 100%;
}


/* DATE */

.news-card .wp-block-post-date {
    margin: 0 0 8px 0 !important;
}


/* TITLE */

.news-card-title {
    margin: 0 0 10px 0 !important;
}


/* EXCERPT */

.news-card .wp-block-post-excerpt {
    margin: 0 !important;
}


/* Remove default paragraph margins inside excerpt */
.news-card .wp-block-post-excerpt p {
    margin-top: 0;
    margin-bottom: 0;
}


/* TABLET */

@media (max-width: 1024px) {
    .news-card {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}


/* MOBILE */

@media (max-width: 767px) {
    .news-card {
        grid-template-columns: 1fr !important;
    }
}

/* End of News Page */

/* This is to make the 'our work' page entries look nicer */


/* DESKTOP: Four columns with shared row heights */
.work-card-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 16px;
    row-gap: 8px;
    align-items: stretch;
}

/* Each card shares the parent's three rows */
.work-card-grid > .wp-block-column {
    display: grid !important;
    grid-template-rows: subgrid;
    grid-row: span 3;

    min-width: 0;
    margin: 0 !important;
}

/* Remove default WordPress spacing */
.work-card-grid > .wp-block-column > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Centre images in their shared row */
.work-card-grid .wp-block-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.work-card-grid .wp-block-image img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* TABLET & MOBILE — TWO COLUMNS */

@media screen and (max-width: 1024px) {

    body .work-card-grid.wp-block-columns {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    body .work-card-grid.wp-block-columns > .wp-block-column {
        width: auto !important;
        min-width: 0 !important;
        flex-basis: auto !important;
        margin: 0 !important;
    }
}
/* END OF OUR WORK CARD GRID*/


/* Scott testing below */