/*
 * COAV Portfolio List
 * Location: /assets/css/coav-portfolio.css
 */

body:has(.coav-portfolio-page) #main-content,
body:has(.coav-portfolio-page) #et-main-area {
    overflow: visible;
}

.coav-portfolio-page {
    --coav-blue: #4778c5;
    --coav-ink: #202a38;
    --coav-muted: #6b7481;
    width: 100%;
    position: relative;
    z-index: 1;
    padding: 58px 24px 72px;
    background: #fff;
    color: var(--coav-ink);
    font-family: inherit;
}

.coav-portfolio-page *,
.coav-portfolio-page *::before,
.coav-portfolio-page *::after {
    box-sizing: border-box;
}

.coav-portfolio-page img {
    max-width: 100%;
}

.coav-portfolio-hero {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 0 38px;
    text-align: center;
}

.coav-portfolio-eyebrow {
    margin-bottom: 15px;
    color: var(--coav-blue);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2.3px;
    text-transform: uppercase;
}

.coav-portfolio-hero h1 {
    margin: 0;
    color: var(--coav-ink);
    font-size: clamp(40px, 6vw, 68px);
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1.04;
    overflow-wrap: anywhere;
}

.coav-portfolio-intro {
    max-width: 690px;
    margin: 20px auto 0;
    color: var(--coav-muted);
    font-size: 17px;
    line-height: 1.8;
}

.coav-portfolio-content {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
}

.coav-portfolio-filterbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 25px;
    padding: 22px 0;
    border-top: 1px solid #e5e8ed;
    border-bottom: 1px solid #e5e8ed;
}

.coav-portfolio-section-label {
    color: #687384;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

.coav-portfolio-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.coav-portfolio-page .coav-portfolio-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 39px;
    padding: 9px 14px;
    border: 1px solid #e1e5eb;
    border-radius: 3px;
    background: #fff;
    color: #455164;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    transition: background .2s, color .2s, border-color .2s;
}

.coav-portfolio-page .coav-portfolio-filter:hover,
.coav-portfolio-page .coav-portfolio-filter.is-active {
    border-color: var(--coav-blue);
    background: var(--coav-blue);
    color: #fff;
}

.coav-portfolio-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.coav-project-card {
    display: grid;
    grid-template-columns: minmax(250px, 38%) minmax(0, 1fr);
    min-width: 0;
    border: 1px solid #e5e9ee;
    background: #fff;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}

.coav-project-card:hover {
    transform: translateY(-2px);
    border-color: #d2dceb;
    box-shadow: 0 12px 32px rgb(23 43 69 / 7%);
}

.coav-project-photo {
    position: relative;
    min-width: 0;
    min-height: 255px;
    overflow: hidden;
    background: #edf0f4;
}

.coav-project-photo > img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .4s ease;
}

.coav-project-card:hover .coav-project-photo > img {
    transform: scale(1.035);
}

.coav-project-tag {
    position: absolute;
    top: 14px;
    left: 14px;
    max-width: calc(100% - 28px);
    padding: 8px 10px;
    background: #fff;
    color: #273347;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.3;
    text-transform: uppercase;
}

.coav-project-image-placeholder {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 255px;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eef1f5, #dfe5ed);
    color: #788394;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.coav-project-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 27px 30px;
}

.coav-project-logo-wrap {
    display: flex;
    align-items: center;
    min-height: 0;
    margin: 0 0 14px;
}

.coav-portfolio-page .coav-project-logo {
    display: block;
    width: auto;
    max-width: 150px;
    max-height: 48px;
    height: auto;
    object-fit: contain;
}

.coav-project-kicker {
    margin-bottom: 11px;
    color: var(--coav-blue);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    line-height: 1.6;
    text-transform: uppercase;
}

.coav-project-copy h2 {
    margin: 0 0 12px;
    color: #252f3d;
    font-size: clamp(21px, 2.3vw, 29px);
    font-weight: 800;
    letter-spacing: -.5px;
    line-height: 1.23;
    overflow-wrap: anywhere;
}

.coav-project-summary {
    max-width: 650px;
    margin: 0 0 20px;
    color: #6b7481;
    font-size: 13px;
    line-height: 1.8;
}

.coav-project-footer {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #edf0f3;
}

.coav-project-type {
    color: #7b8592;
    font-size: 11px;
    line-height: 1.5;
}

.coav-portfolio-page .coav-project-open {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    border: 0;
    background: transparent;
    color: #315e9e;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.5;
    cursor: pointer;
}

.coav-project-open span {
    font-size: 17px;
    transition: transform .2s ease;
}

.coav-project-open:hover span {
    transform: translate(3px, -2px);
}

.coav-portfolio-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 38px auto 0;
}

.coav-portfolio-pagination a,
.coav-portfolio-pagination span {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 8px 13px;
    border: 1px solid #e1e5eb;
    color: #344054;
    font-size: 12px;
    text-decoration: none;
}

.coav-portfolio-pagination .current {
    border-color: var(--coav-blue);
    background: var(--coav-blue);
    color: #fff;
}

.coav-portfolio-empty {
    padding: 50px 20px;
    border: 1px solid #e5e9ee;
    text-align: center;
}

.coav-portfolio-empty h2 {
    margin: 0 0 10px;
    font-size: 24px;
}

.coav-portfolio-empty p {
    color: var(--coav-muted);
}

.coav-portfolio-empty a {
    color: var(--coav-blue);
    font-weight: 700;
}

.coav-portfolio-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 22px;
    margin-top: 36px;
    padding: 29px 30px;
    background: #202a38;
    color: #fff;
}

.coav-portfolio-cta h2 {
    margin: 0 0 8px;
    color: #fff;
    font-size: 23px;
    line-height: 1.3;
}

.coav-portfolio-cta p {
    margin: 0;
    color: #c6cfdb;
    font-size: 13px;
    line-height: 1.7;
}

.coav-portfolio-page .coav-portfolio-cta a {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 14px 17px;
    background: var(--coav-blue);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.4;
    text-decoration: none;
    text-transform: uppercase;
}

.coav-portfolio-page .coav-portfolio-cta a:hover {
    background: #315e9e;
    color: #fff;
}

/*
 * Project detail modal.
 * The active modal raises its page wrapper above Divi's header stacking layer.
 */
.coav-project-modal[hidden] {
    display: none !important;
}

/*
 * IMPORTANT:
 * The modal is currently nested inside .coav-portfolio-page.
 * Raise the wrapper while the modal is open so the modal can appear above
 * Divi's header stacking context. The large z-index on the modal alone is
 * not sufficient when an ancestor creates a lower stacking context.
 */
body:has(.coav-project-modal:not([hidden])) .coav-portfolio-page {
    position: relative !important;
    z-index: 2147483646 !important;
}

.coav-project-modal:not([hidden]) {
    position: fixed !important;
    z-index: 2147483647 !important;
    inset: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding: 20px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
    background: rgb(16 23 34 / 84%);
}

.coav-project-modal .coav-project-modal-panel {
    position: relative;
    z-index: 1;
    width: min(1240px, 100%);
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    margin: 0 auto;
    overflow: auto;
    box-sizing: border-box;
    background: #fff;
    box-shadow: 0 25px 90px rgb(0 0 0 / 25%);
}

.coav-project-modal-close {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
    display: flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 0;
    background: #fff;
    color: #202a38;
    font-size: 27px;
    cursor: pointer;
}

.coav-project-modal-image {
    display: block;
    width: 100%;
    max-height: 42vh;
    object-fit: cover;
    background: #edf0f4;
}

.coav-project-modal-copy {
    padding: 25px 30px 30px;
}

.coav-project-modal-category {
    margin-bottom: 10px;
    color: var(--coav-blue);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.coav-project-modal-copy h2 {
    margin: 0 0 12px;
    color: var(--coav-ink);
    font-size: clamp(25px, 4vw, 36px);
    line-height: 1.2;
}

.coav-project-modal-description {
    margin: 0;
    color: var(--coav-muted);
    font-size: 14px;
    line-height: 1.85;
}

/*
 * Divi fixed-header spacing.
 * The template gets its own top clearance so the hero cannot sit under
 * a fixed/sticky Divi header. Tune --coav-fixed-header-space if needed.
 */
body.et_fixed_nav .coav-portfolio-page {
    padding-top: max(58px, var(--coav-fixed-header-space, 155px));
}

@media (max-width: 980px) {
    .coav-project-card {
        grid-template-columns: minmax(220px, 36%) minmax(0, 1fr);
    }

    .coav-project-copy {
        padding: 23px;
    }

    .coav-project-photo,
    .coav-project-image-placeholder {
        min-height: 235px;
    }
}

@media (max-width: 650px) {
    .coav-portfolio-page {
        padding: 38px 14px 48px;
    }

    body.et_fixed_nav .coav-portfolio-page {
        padding-top: max(38px, var(--coav-fixed-header-space, 125px));
    }

    .coav-portfolio-hero {
        padding-bottom: 28px;
    }

    .coav-portfolio-hero h1 {
        font-size: 40px;
        letter-spacing: -1.2px;
    }

    .coav-portfolio-intro {
        font-size: 15px;
    }

    .coav-portfolio-filterbar {
        align-items: flex-start;
    }

    .coav-portfolio-filters {
        width: 100%;
    }

    .coav-project-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .coav-project-photo {
        min-height: 0;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .coav-project-image-placeholder {
        min-height: 0;
    }

    .coav-project-copy {
        padding: 21px;
    }

    .coav-project-copy h2 {
        font-size: 24px;
    }

    .coav-project-footer {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .coav-portfolio-cta {
        padding: 23px;
    }

    .coav-project-modal:not([hidden]) {
        padding: 12px;
    }

    .coav-project-modal .coav-project-modal-panel {
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
    }

    .coav-project-modal-copy {
        padding: 22px;
    }
}


/* Multi-photo project carousel */
.coav-project-carousel,
.coav-project-carousel-track {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.coav-project-carousel {
    overflow: hidden;
    background: #edf0f4;
}

.coav-portfolio-page .coav-project-carousel-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease;
}

.coav-portfolio-page .coav-project-carousel-image.is-active {
    opacity: 1;
    visibility: visible;
}

.coav-portfolio-page .coav-project-photo > .coav-project-carousel {
    position: absolute;
    inset: 0;
}

.coav-carousel-arrow {
    position: absolute;
    z-index: 3;
    top: 50%;
    display: flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    border: 1px solid rgb(255 255 255 / 65%);
    border-radius: 50%;
    background: rgb(24 32 44 / 76%);
    color: #fff;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease;
}

.coav-carousel-arrow:hover {
    background: var(--coav-blue);
    color: #fff;
}

.coav-carousel-prev { left: 12px; }
.coav-carousel-next { right: 12px; }

.coav-carousel-count {
    position: absolute;
    z-index: 3;
    right: 14px;
    bottom: 14px;
    padding: 6px 9px;
    border-radius: 2px;
    background: rgb(24 32 44 / 76%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.coav-carousel-dots {
    position: absolute;
    z-index: 3;
    left: 50%;
    bottom: 17px;
    display: flex;
    align-items: center;
    gap: 6px;
    transform: translateX(-50%);
}

.coav-portfolio-page .coav-carousel-dot {
    display: block;
    width: 7px;
    height: 7px;
    padding: 0;
    border: 1px solid #fff;
    border-radius: 50%;
    background: rgb(255 255 255 / 45%);
    cursor: pointer;
}

.coav-portfolio-page .coav-carousel-dot.is-active {
    background: #fff;
    transform: scale(1.2);
}

.coav-project-photo > .coav-project-tag {
    z-index: 4;
}

.coav-project-logo-wrap {
    max-width: 100%;
}

.coav-portfolio-page .coav-project-logo {
    max-width: 145px;
    max-height: 45px;
    object-position: left center;
}

@media (prefers-reduced-motion: reduce) {
    .coav-portfolio-page .coav-project-carousel-image {
        transition: none;
    }
}

.coav-modal-gallery-controls {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -44px;
    padding: 0 12px;
    pointer-events: none;
}

.coav-modal-gallery-controls .coav-carousel-arrow {
    position: static;
    transform: none;
    pointer-events: auto;
}

.coav-modal-count {
    padding: 6px 9px;
    background: rgb(24 32 44 / 76%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

/* Responsive modal spacing and sizing. */
@media (max-width: 767px) {
    .coav-project-modal:not([hidden]) {
        padding: 10px;
    }

    .coav-project-modal .coav-project-modal-panel {
        width: 100%;
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
    }

    .coav-project-modal-copy {
        padding: 22px;
    }
}
