/**
 * HiRise Windows – Frontend Styles
 * Plugin:  hirisewindows
 * Author:  websults (https://websults.com)
 *
 * Add all frontend-facing CSS rules below.
 * Organise by component or section (e.g. hero, project filter, slider).
 */

/* ============================================================
   Search Menu Module – Hide wp_list_pages Fallback
   Divi falls back to wp_list_pages() when the assigned menu has
   no items. page_item (not menu-item) identifies fallback links.
   The search icon lives outside the <ul> and is unaffected.
   ============================================================ */
.et_pb_menu_0_tb_header .et_pb_menu__menu > nav > ul > li {
    display: none !important;
}

/* Search input text is white by default (set for dark headers) — override for light header */
/* Divi sets color:white !important on .et_pb_menu .et_pb_menu__search-input (sheetIndex 11).
   We load at sheetIndex 2, so same specificity loses. Adding a third class wins at any position. */
.et_pb_menu_0_tb_header.et_pb_menu .et_pb_menu__search-input {
    color: #333 !important;
}

/* Hide the browser's native search-cancel (×) button — Divi's own close button handles this */
.et_pb_menu_0_tb_header .et_pb_menu__search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    display: none;
}

/* Hide the magnifying glass while search is open so it doesn't overlap the × close button.
   The search container is position:absolute and overlays the static search button. */
.et_pb_menu_0_tb_header:has(.et_pb_menu__search-container--visible) .et_pb_menu__search-button {
    opacity: 0;
    pointer-events: none;
}
.et_pb_menu_0_tb_header .et_pb_menu__search-button {
    transition: opacity 0.15s;
}

/* ============================================================
   Navigation Dropdown – Fade-in Downward Animation
   Desktop only (Divi breakpoint ≥ 981 px).

   Divi Theme Builder menus (et_pb_menu module) already manage
   visibility/opacity for show/hide. We layer a translateY(-10px)
   start position + transition on top so the panel slides in from
   slightly above on hover, matching the Clark Construction effect.
   Selector targets .et-menu (Divi TB nav class) rather than
   #top-menu which is only present in Divi's legacy header.
   ============================================================ */
@media (min-width: 981px) {

    /* Transparent bridge below the nav item that fills the 14 px gap.
       Without it the mouse leaves the li's bounding box while crossing
       the gap, killing :hover and the JS class before reaching the panel. */
    .et-menu li.menu-item-has-children::after,
    .et_pb_menu .nav li.menu-item-has-children::after {
        content: '';
        display: block;
        position: absolute;
        bottom: -14px;
        left: 0;
        right: 0;
        height: 14px;
    }

    /* Base: start above + invisible (Divi already sets vis/opacity) */
    .et-menu li.menu-item-has-children > .sub-menu,
    .et_pb_menu .nav li.menu-item-has-children > .sub-menu {
        display: block !important;
        visibility: hidden;
        opacity: 0;
        transform: translateY(-10px);
        /* Push down so the panel top aligns with the header bottom */
        margin-top: 14px;
        transition:
            opacity    0.25s ease,
            transform  0.25s ease,
            visibility 0s    linear 0.25s;
        pointer-events: none;
    }

    /* Hover / JS-class: slide into place */
    .et-menu li.menu-item-has-children:hover > .sub-menu,
    .et_pb_menu .nav li.menu-item-has-children:hover > .sub-menu,
    .et-menu li.menu-item-has-children.nav-submenu--open > .sub-menu,
    .et_pb_menu .nav li.menu-item-has-children.nav-submenu--open > .sub-menu {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
        transition:
            opacity    0.25s ease,
            transform  0.25s ease,
            visibility 0s    linear 0s;
        pointer-events: auto;
    }
}

/* ============================================================
   Recent News Slider – Scrollbar + Card Restyle
   Matches the Clark Construction visual style:
   draggable progress bar, blue titles, transparent card bg.
   ============================================================ */

/* Scrollbar track */
.project-slider .swiper-scrollbar {
    position: relative;
    margin-top: 25px;
    height: 3px;
    background: #d1d1d1;
    border-radius: 0;
    cursor: pointer;
}

/* Scrollbar drag handle */
.project-slider .swiper-scrollbar-drag {
    background: #233c88;
    border-radius: 0;
    height: 100%;
}

/* Card background – transparent so Divi section bg shows through */
.project-card_wrap {
    background: transparent;
}

/* Card title – brand blue */
.project-card_title {
    color: #233c88;
}

/* ============================================================
   News Filter — [news_filter] shortcode
   ============================================================ */

/* Filter bar */
.news-filter__bar {
    padding: 20px 0 24px;
}

.news-filter__label {
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #1a3a6b;
    margin-bottom: 12px;
}

.news-filter__controls {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.news-filter__dropdown {
    flex: 1 1 160px;
    height: 44px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: #333;
    border: 1px solid #b0c8de;
    border-radius: 3px;
    padding: 0 36px 0 14px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #fff;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="%23555" viewBox="0 0 320 512"><path d="M143 352c12.5 12.5 32.8 12.5 45.3 0l136-136c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 274.7 41.9 171c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l136 136z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 11px 11px;
    cursor: pointer;
}

.news-filter__button {
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #fff;
    background: #233c88;
    border: none;
    padding: 0 22px;
    height: 44px;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.25s ease;
}

.news-filter__button:hover {
    background: #2685c6;
}

.news-filter__button-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.news-filter__clear {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 11px;
    color: #233c88;
    text-decoration: none;
    letter-spacing: 0.05em;
}

.news-filter__clear:hover {
    text-decoration: underline;
}

/* Grid wrap — negative margin pulls first row into the filter bar */
.news-filter__grid-wrap {
    position: relative;
}

.news-filter__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* News card */
.news-card {
    background: #fff;
    position: relative;
    cursor: pointer;
    transition: box-shadow 0.3s ease;
}

.news-card:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
}

/* Stretched link covers entire card */
.news-card .stretched-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.news-card__image {
    aspect-ratio: 1.406;
    overflow: hidden;
    width: 100%;
    background: #e8ecf0;
}

.news-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.news-card:hover .news-card__image img {
    transform: scale(1.04);
}

.news-card__body {
    padding: 14px 16px 18px;
}

.news-card__title {
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #111;
    line-height: 1.4;
    margin: 0 0 10px;
    transition: color 0.2s ease;
}

.news-card:hover .news-card__title {
    color: #233c88;
}

.news-card__read-more {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #233c88;
}

/* No results */
.news-filter__no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 0;
    color: #666;
    font-family: 'Roboto', sans-serif;
}

/* Load More */
.news-filter__load-more {
    text-align: center;
    margin-top: 32px;
}

.news-filter__load-more-btn {
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #fff;
    background: #233c88;
    border: none;
    padding: 12px 32px;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.25s ease;
}

.news-filter__load-more-btn:hover {
    background: #2685c6;
}

/* Loading state overlay */
.news-filter__grid-wrap.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .news-filter__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .news-filter__bar {
        padding: 16px 16px 18px;
    }

    .news-filter__controls {
        flex-direction: column;
        gap: 10px;
    }

    .news-filter__dropdown {
        width: 100%;
        flex: 1 1 auto;
    }

    .news-filter__button {
        width: 100%;
    }

    .news-filter__grid {
        grid-template-columns: 1fr;
    }

    .news-filter__grid-wrap {
        margin-top: -20px;
    }
}
