/* Business Areas listing — Ashley-inspired layout with FKEC theme colors */

.business-areas-page {
    padding: 4rem 0 5rem;
}

.business-areas-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.business-areas-header .heading-h2 {
    margin-bottom: 1rem;
}

.business-areas-header .post-meta {
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.8;
}

.business-areas-grid {
    position: relative;
    --ba-card-gap: 1.5rem;
    row-gap: 1.5rem;
    overflow: visible;
}

.business-areas-grid > [class*="col-"] {
    position: relative;
    min-height: 110px;
    overflow: visible;
}

.ba-card {
    position: absolute;
    top: 0;
    inset-inline-start: calc(var(--ba-card-gap) * 0.5);
    width: calc(100% - var(--ba-card-gap));
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 110px;
    max-height: 110px;
    padding: 1.35rem 1.75rem;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: #e0f0ffc4 !important;
    background-size: cover;
    background-position: center;
    transition:
        transform 0.45s ease,
        border-color 0.35s ease,
        box-shadow 0.45s ease,
        min-height 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        max-height 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        padding 0.45s ease,
        width 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        inset-inline-start 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.35s ease,
        visibility 0.35s ease;
}

.ba-card--offset {
    margin-top: 4rem;
}

.ba-card__overlay {
    position: absolute;
    inset: 0;
    background: rgba(224, 240, 255, 0.92);
    transition: background 0.45s ease;
    z-index: 1;
}

.ba-card__content {
    position: relative;
    z-index: 2;
}

.ba-card__title {
    color: #083a5a;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0;
    transition: color 0.35s ease, font-size 0.35s ease, margin-bottom 0.35s ease;
}

.ba-card__desc {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ba-card__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1.25rem;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateY(8px);
    transition:
        opacity 0.35s ease 0.05s,
        max-height 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        margin 0.35s ease,
        transform 0.35s ease;
}

.ba-card__list li {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.88rem;
    line-height: 1.5;
    position: relative;
    padding-inline-start: 1rem;
}

.ba-card__list li::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0.55em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    /* background: #083a5a; */
    background: #ffffff;
}

.ba-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: #083a5a;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateY(6px);
    transition:
        gap 0.3s ease,
        color 0.3s ease,
        opacity 0.35s ease 0.1s,
        max-height 0.35s ease,
        transform 0.35s ease;
}

.ba-card__link svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.ba-card:hover,
.ba-card:focus-within {
    z-index: 20;
    justify-content: center;
    min-height: 350px;
    max-height: 350px;
    padding: 2.5rem;
    transform: translateY(-6px);
    border-color: #4986b1;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    opacity: 1;
    visibility: visible;
}

/* Expand hovered card to full grid row width (3 columns) */
@media (min-width: 768px) {
    /* Hide sibling cards in the same row only */
    .business-areas-grid:has(> [class*="col-"]:nth-child(3n + 1) .ba-card:hover) > [class*="col-"]:nth-child(3n + 1) + [class*="col-"] .ba-card,
    .business-areas-grid:has(> [class*="col-"]:nth-child(3n + 1) .ba-card:hover) > [class*="col-"]:nth-child(3n + 1) + [class*="col-"] + [class*="col-"] .ba-card,
    .business-areas-grid:has(> [class*="col-"]:nth-child(3n + 1) .ba-card:focus-within) > [class*="col-"]:nth-child(3n + 1) + [class*="col-"] .ba-card,
    .business-areas-grid:has(> [class*="col-"]:nth-child(3n + 1) .ba-card:focus-within) > [class*="col-"]:nth-child(3n + 1) + [class*="col-"] + [class*="col-"] .ba-card,
    .business-areas-grid:has(> [class*="col-"]:nth-child(3n + 2) .ba-card:hover) > [class*="col-"]:nth-child(3n + 2) - [class*="col-"] .ba-card,
    .business-areas-grid:has(> [class*="col-"]:nth-child(3n + 2) .ba-card:hover) > [class*="col-"]:nth-child(3n + 2) + [class*="col-"] .ba-card,
    .business-areas-grid:has(> [class*="col-"]:nth-child(3n + 2) .ba-card:focus-within) > [class*="col-"]:nth-child(3n + 2) - [class*="col-"] .ba-card,
    .business-areas-grid:has(> [class*="col-"]:nth-child(3n + 2) .ba-card:focus-within) > [class*="col-"]:nth-child(3n + 2) + [class*="col-"] .ba-card,
    .business-areas-grid:has(> [class*="col-"]:nth-child(3n) .ba-card:hover) > [class*="col-"]:nth-child(3n) - [class*="col-"] .ba-card,
    .business-areas-grid:has(> [class*="col-"]:nth-child(3n) .ba-card:hover) > [class*="col-"]:nth-child(3n) - [class*="col-"] - [class*="col-"] .ba-card,
    .business-areas-grid:has(> [class*="col-"]:nth-child(3n) .ba-card:focus-within) > [class*="col-"]:nth-child(3n) - [class*="col-"] .ba-card,
    .business-areas-grid:has(> [class*="col-"]:nth-child(3n) .ba-card:focus-within) > [class*="col-"]:nth-child(3n) - [class*="col-"] - [class*="col-"] .ba-card {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
    .business-areas-grid > [class*="col-"]:nth-child(3n + 1) .ba-card:hover,
    .business-areas-grid > [class*="col-"]:nth-child(3n + 1) .ba-card:focus-within {
        width: calc(300% - var(--ba-card-gap));
        inset-inline-start: calc(var(--ba-card-gap) * 0.5);
        inset-inline-end: auto;
    }

    .business-areas-grid > [class*="col-"]:nth-child(3n + 2) .ba-card:hover,
    .business-areas-grid > [class*="col-"]:nth-child(3n + 2) .ba-card:focus-within {
        width: calc(300% - var(--ba-card-gap));
        inset-inline-start: calc(-100% + var(--ba-card-gap) * 0.5);
        inset-inline-end: auto;
    }

    .business-areas-grid > [class*="col-"]:nth-child(3n) .ba-card:hover,
    .business-areas-grid > [class*="col-"]:nth-child(3n) .ba-card:focus-within {
        width: calc(300% - var(--ba-card-gap));
        inset-inline-start: calc(-200% + var(--ba-card-gap) * 0.5);
        inset-inline-end: auto;
    }

    .ba-card:hover .ba-card__content,
    .ba-card:focus-within .ba-card__content {
        display: grid;
        grid-template-columns: minmax(220px, 0.85fr) minmax(280px, 1.15fr);
        gap: 2.5rem;
        align-items: center;
        width: 100%;
    }

    .ba-card:hover .ba-card__title,
    .ba-card:focus-within .ba-card__title {
        grid-column: 1;
        grid-row: 1;
        align-self: end;
        margin-bottom: 1rem;
    }

    .ba-card:hover .ba-card__link,
    .ba-card:focus-within .ba-card__link {
        grid-column: 1;
        grid-row: 2;
        align-self: start;
    }

    .ba-card:hover .ba-card__list,
    .ba-card:focus-within .ba-card__list {
        grid-column: 2;
        grid-row: 1 / -1;
        align-self: center;
        grid-template-columns: 1fr 1fr;
        max-height: 200px;
        margin: 0;
    }
}

.ba-card:hover .ba-card__overlay,
.ba-card:focus-within .ba-card__overlay {
    background: linear-gradient(
        180deg,
        rgba(8, 58, 90, 0.25) 0%,
        rgba(8, 58, 90, 0.62) 45%,
        rgba(8, 58, 90, 0.9) 100%
    );
}

.ba-card:hover .ba-card__title,
.ba-card:focus-within .ba-card__title {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.ba-card:hover .ba-card__list,
.ba-card:focus-within .ba-card__list {
    opacity: 1;
    max-height: 220px;
    margin: 0 0 1.75rem;
    transform: translateY(0);
}

.ba-card:hover .ba-card__link,
.ba-card:focus-within .ba-card__link {
    opacity: 1;
    max-height: 40px;
    transform: translateY(0);
}

.ba-card:hover .ba-card__link {
    color: #5a9bc4;
    gap: 0.9rem;
}

[dir="ltr"] .ba-card:hover .ba-card__link svg {
    transform: translateX(4px);
}

[dir="rtl"] .ba-card:hover .ba-card__link svg {
    transform: translateX(-4px) scaleX(-1);
}

[dir="rtl"] .ba-card__link svg {
    transform: scaleX(-1);
}

/* Hero banner */
.business-areas-hero .img-overlay-wrap::after {
    background: linear-gradient(
        to bottom,
        rgba(8, 58, 90, 0.25) 0%,
        rgba(8, 58, 90, 0.55) 50%,
        rgba(8, 58, 90, 0.88) 80%,
        #083a5a 100%
    );
}

.business-areas-hero .jarallax {
    height: 350px;
}

/* Light theme text overrides (match existing pages) */
body:not([data-theme="dark"]) .business-areas-page .gsap-reveal,
body:not([data-theme="dark"]) .business-areas-page .post-meta {
    color: #ffffff !important;
}

body:not([data-theme="dark"]) .business-areas-page .heading-h2,
body:not([data-theme="dark"]) .business-areas-page .heading-h2 span {
    color: #ffffff !important;
}

@media (max-width: 991px) {
    .ba-card--offset {
        margin-top: 0;
    }

    .business-areas-grid > [class*="col-"] {
        min-height: 100px;
    }

    .ba-card {
        min-height: 100px;
        max-height: 100px;
        padding: 1.25rem 1.5rem;
    }

    .ba-card:hover,
    .ba-card:focus-within {
        justify-content: flex-end;
        min-height: 360px;
        max-height: 360px;
        padding: 2rem;
    }

    .ba-card__list {
        grid-template-columns: 1fr;
    }

    .ba-card:hover .ba-card__list,
    .ba-card:focus-within .ba-card__list {
        max-height: 280px;
    }
}

@media (max-width: 575px) {
    .business-areas-page {
        padding: 3rem 0 4rem;
    }

    .business-areas-grid > [class*="col-"] {
        min-height: 92px;
    }

    .ba-card {
        min-height: 92px;
        max-height: 92px;
        padding: 1.15rem 1.25rem;
    }

    .ba-card:hover,
    .ba-card:focus-within {
        justify-content: flex-end;
        min-height: 320px;
        max-height: 320px;
        padding: 1.5rem;
    }

    .ba-card__title {
        font-size: 1.05rem;
    }

    .ba-card:hover .ba-card__title,
    .ba-card:focus-within .ba-card__title {
        font-size: 1.35rem;
    }
}

/* Services section — full-bleed hover rows */
.ba-services-section {
    padding-left: 0;
    padding-right: 0;
}

.ba-services-section > .container {
    padding-left: 15px;
    padding-right: 15px;
}

/* Services hover-expand — Heights-style layout, FKEC theme colors */
.ba-hover-expand {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.ba-hover-expand__item {
    position: relative;
    min-height: 96px;
    overflow: hidden;
    cursor: pointer;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background-color: transparent;
    transition: min-height 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.ba-hover-expand__item:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.ba-hover-expand__item:focus,
.ba-hover-expand__item:focus-visible {
    outline: none;
}

.ba-hover-expand__item.is-active {
    min-height: 300px;
}

.ba-hover-expand__media {
    position: absolute;
    inset: 0;
    background-color: #02536a;
    background-color: #ffffff;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1.06);
    transition: opacity 0.45s ease, transform 0.7s ease;
    z-index: 0;
}

.ba-hover-expand__overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 58, 90, 0.35);
    opacity: 0;
    transition: opacity 0.45s ease, background 0.45s ease;
    z-index: 1;
}

.ba-hover-expand__item.is-active .ba-hover-expand__media {
    opacity: 1;
    transform: scale(1);
}

.ba-hover-expand__item.is-active .ba-hover-expand__overlay {
    opacity: 1;
    background: linear-gradient(
        100deg,
        rgba(8, 58, 90, 0.92) 0%,
        rgba(8, 58, 90, 0.78) 45%,
        rgba(8, 58, 90, 0.55) 100%
    );
}

.ba-hover-expand__content {
    position: relative;
    z-index: 2;
    display: grid !important;
    grid-template-columns: minmax(240px, 0.9fr) minmax(280px, 1.1fr);
    gap: 2.5rem;
    align-items: center;
    min-height: inherit;
    padding-top: 1.75rem;
    padding-bottom: 1.75rem;
}

.ba-hover-expand__left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.ba-hover-expand__index {
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.55) !important;
    min-width: 1.75rem;
    transition: color 0.35s ease;
}

.ba-hover-expand__title {
    margin: 0 !important;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.72) !important;
    transition: color 0.35s ease, font-size 0.35s ease;
}

.ba-hover-expand__right {
    min-width: 0;
    opacity: 0.35;
    transform: translateY(0);
    transition: opacity 0.35s ease;
}

.ba-hover-expand__item.is-active .ba-hover-expand__right {
    opacity: 1;
}

.ba-hover-expand__item.is-active .ba-hover-expand__index {
    color: #ffffff !important;
}

.ba-hover-expand__item.is-active .ba-hover-expand__title {
    color: #ffffff !important;
    font-size: 1.55rem;
}

.ba-hover-expand__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1.5rem;
}

.ba-hover-expand__list li {
    position: relative;
    padding-inline-start: 1rem;
    color: rgba(255, 255, 255, 0.88) !important;
    font-size: 0.92rem;
    line-height: 1.55;
}

.ba-hover-expand__list li::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0.55em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #4986b1;
}

[dir="rtl"] .ba-hover-expand__item.is-active .ba-hover-expand__overlay {
    background: linear-gradient(
        -100deg,
        rgba(8, 58, 90, 0.92) 0%,
        rgba(8, 58, 90, 0.78) 45%,
        rgba(8, 58, 90, 0.55) 100%
    );
}

[dir="rtl"] .ba-hover-expand__left {
    text-align: right;
}

@media (max-width: 991px) {
    .ba-hover-expand__content {
        grid-template-columns: 1fr;
        gap: 1.15rem;
        align-items: start;
    }

    .ba-hover-expand__item {
        min-height: 84px;
    }

    .ba-hover-expand__item.is-active {
        min-height: 340px;
    }

    .ba-hover-expand__right {
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        transform: translateY(8px);
        transition: opacity 0.35s ease, transform 0.45s ease, max-height 0.45s ease;
    }

    .ba-hover-expand__item.is-active .ba-hover-expand__right {
        opacity: 1;
        max-height: 420px;
        transform: translateY(0);
    }

    .ba-hover-expand__list {
        grid-template-columns: 1fr;
    }

    .ba-hover-expand__overlay {
        background: rgba(8, 58, 90, 0.25);
    }

    .ba-hover-expand__item.is-active .ba-hover-expand__overlay {
        background: rgba(8, 58, 90, 0.88);
    }
}

@media (max-width: 575px) {
    .ba-hover-expand__title {
        font-size: 1.1rem !important;
    }

    .ba-hover-expand__item.is-active .ba-hover-expand__title {
        font-size: 1.25rem !important;
    }

    .ba-hover-expand__content {
        padding-top: 1.25rem;
        padding-bottom: 1.25rem;
    }

    .ba-hover-expand__item.is-active .ba-hover-expand__content {
        padding-bottom: 1.65rem;
    }
}
