/* Homepage service gateways: independent photo assets and live, shadow-free copy. */
[data-home-page] > .hero { padding-bottom: 128px; }
[data-home-page] .home-service-gateways {
    position: relative;
    z-index: 3;
    isolation: isolate;
    width: min(1160px, calc(100% - 32px));
    margin: -66px auto calc(var(--home-section-gap, 32px) + 16px);
    direction: rtl;
}
[data-home-page] .home-service-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}
[data-home-page] .home-service-card {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 115px;
    height: auto;
    aspect-ratio: 5 / 1;
    overflow: hidden;
    box-sizing: border-box;
    border: 0;
    border-radius: 6px;
    background: #eaf4fd url('../images/home-services/v2-background.webp') center / 100% 100% no-repeat;
    box-shadow: 0 3px 10px rgba(42, 95, 151, .09);
    color: #102c52;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease;
}
/* Match the mobile site heading blue; elevate only the paired service cards. */
[data-home-page] {
    --home-brand-blue: #2477D3;
}
[data-home-page] .home-service-card:not(.home-service-card--appointment) {
    box-shadow:
        0 8px 22px rgba(20, 73, 138, 0.12),
        0 2px 6px rgba(20, 73, 138, 0.08);
}
[data-home-page] .home-service-card:not(.home-service-card--appointment):hover {
    box-shadow:
        0 12px 28px rgba(20, 73, 138, 0.16),
        0 4px 10px rgba(20, 73, 138, 0.10);
}
[data-home-page] .home-service-card:not(.home-service-card--appointment) .home-service-copy strong {
    color: var(--home-brand-blue);
}
/* Keep the existing desktop 2x2 layout; the replacement fifth card is mobile/tablet-only. */
@media (min-width: 992px) and (pointer: fine), (min-width: 992px) and (pointer: none), (min-width: 1200px) {
    [data-home-page] .home-service-card--clinic { display: none; }
}
[data-home-page] .home-service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(42, 95, 151, .14);
}
[data-home-page] .home-service-card:focus-visible {
    outline: 3px solid #1666bb;
    outline-offset: 2px;
}
[data-home-page] .home-service-art {
    position: absolute;
    inset-block: 5px;
    right: 3px;
    width: calc(40% - 6px);
    pointer-events: none;
}
[data-home-page] .home-service-art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: right center;
}
[data-home-page] .home-service-card--consultation .home-service-art img,
[data-home-page] .home-service-card--consultation .home-consultation-art {
    display: block;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 3px rgba(20, 48, 75, .23));
}
[data-home-page] .home-consultation-tie-color {
    flood-color: var(--home-search-submit-red, #ef0f0f);
}
[data-home-page] .home-service-card--clinic .home-service-art img {
    object-fit: contain;
    object-position: right center;
    filter: drop-shadow(0 2px 3px rgba(20, 48, 75, .15));
}
[data-home-page] .home-service-copy {
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    width: 60%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    padding: 5px 8px;
    gap: 4px;
    direction: rtl;
    text-align: center;
    text-shadow: none;
    overflow-wrap: break-word;
}
[data-home-page] .home-service-copy strong {
    font-size: clamp(15px, 1.36vw, 21px);
    font-weight: 800;
    line-height: 1.4;
    color: #0b2950;
    text-shadow: none;
}
[data-home-page] .home-service-copy > span {
    color: #405b75;
    font-size: clamp(10px, .97vw, 14px);
    line-height: 1.5;
    text-shadow: none;
}
/* Retain the actual existing blue photographic background; crop its old doctor offscreen. */
[data-home-page] .home-service-card--appointment {
    --appointment-blue-edge: linear-gradient(to bottom, #46a1d8 0%, #4ea7dd 18%, #50abe1 35%, #50a9e0 52%, #4ba6de 70%, #47a2da 87%, #3f9dd4 100%);
    background: #54acd6;
    background-image: url('../images/home-services/appointment.webp'), var(--appointment-blue-edge);
    /* The left 78.125% of the original photo is entirely blue (the old doctor starts at ~80%). */
    background-size: 128% 100%, 100% 100%;
    background-position: left center, center;
    background-repeat: no-repeat;
}
[data-home-page] .home-service-card--appointment .home-service-art {
    inset-block: 0;
    right: 0;
    width: 54%;
}
[data-home-page] .home-service-card--appointment .home-service-art img {
    object-position: right bottom;
    transform: translateX(-15%);
    filter: url(#home-service-brighter-red);
}
[data-home-page] .home-service-card--appointment .home-service-copy {
    left: 0;
    width: 46%;
}
[data-home-page] .home-service-card--appointment .home-service-copy strong,
[data-home-page] .home-service-card--appointment .home-service-copy > span {
    color: #fff;
}
@media (max-width: 991px) and (min-width: 768px) {
    [data-home-page] .home-service-copy strong { font-size: 14px; }
    [data-home-page] .home-service-copy > span { font-size: 10px; }
}
@media (max-width: 991.98px), (max-width: 1199.98px) and (pointer: coarse) {
    [data-home-page] > .hero { padding-bottom: 32px; }
    [data-home-page] .home-service-gateways {
        width: calc(100% - 20px);
        margin: 0 auto calc(var(--home-section-gap, 24px) + 16px);
    }
    [data-home-page] .home-service-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }
    [data-home-page] .home-service-card {
        height: 75px;
        min-height: 75px;
        aspect-ratio: auto;
    }
    [data-home-page] .home-service-card--appointment {
        grid-column: 1 / -1;
        height: clamp(92px, 25vw, 120px);
        min-height: 0;
    }
    [data-home-page] .home-service-card:not(.home-service-card--appointment) .home-service-art {
        width: calc(37% - 4px);
        right: 2px;
        inset-block: 4px;
    }
    [data-home-page] .home-service-card:not(.home-service-card--appointment) .home-service-copy {
        width: 63%;
        padding: 3px;
        gap: 2px;
    }
    [data-home-page] .home-service-card:not(.home-service-card--appointment) .home-service-copy strong {
        font-size: 11px;
        line-height: 1.3;
    }
    [data-home-page] .home-service-card:not(.home-service-card--appointment) .home-service-copy > span {
        font-size: 9px;
        line-height: 1.3;
    }
    [data-home-page] .home-service-card--appointment .home-service-copy strong {
        font-size: clamp(13px, 3.7vw, 18px);
        line-height: 1.45;
    }
    [data-home-page] .home-service-card--appointment .home-service-copy > span {
        font-size: clamp(9px, 2.6vw, 12px);
        line-height: 1.5;
    }
}
/* Card-specific artwork adjustments follow the common mobile and desktop rules.
   Reserve a separate text area so the larger hospital does not cover its title. */
[data-home-page] .home-service-card--consultation .home-service-art {
    right: 0;
}
[data-home-page] .home-service-card--laboratory .home-service-art {
    right: 0;
    inset-block: 8px 0;
}
[data-home-page] .home-service-card--laboratory .home-service-art img {
    object-position: right bottom;
}
[data-home-page] .home-service-card--centers .home-service-art {
    right: 0;
    inset-block: 0;
    width: 48%;
}
[data-home-page] .home-service-card--centers .home-service-art img {
    object-position: right bottom;
}
[data-home-page] .home-service-card--centers .home-service-copy {
    width: 52%;
}
[data-home-page] .home-service-card--clinic .home-service-art {
    right: 8px;
    width: calc(40% - 12px);
}
@media (max-width: 991.98px), (max-width: 1199.98px) and (pointer: coarse) {
    [data-home-page] .home-service-card.home-service-card--consultation .home-service-art {
        right: 0;
        width: 37%;
    }
    [data-home-page] .home-service-card.home-service-card--laboratory .home-service-art {
        right: 0;
        inset-block: 8px 0;
        width: 37%;
    }
    [data-home-page] .home-service-card.home-service-card--centers .home-service-art {
        right: 0;
        inset-block: 0;
        width: 40%;
    }
    [data-home-page] .home-service-card.home-service-card--centers .home-service-copy {
        width: 60%;
    }
    [data-home-page] .home-service-card.home-service-card--clinic .home-service-art {
        right: 8px;
        width: calc(37% - 10px);
    }
}
@media (max-width: 359px) {
    [data-home-page] .home-service-card.home-service-card--centers .home-service-art {
        width: 36%;
    }
    [data-home-page] .home-service-card.home-service-card--centers .home-service-copy {
        width: 64%;
    }
}
/* The hospital title uses the shared service title size; allow wrapping on narrow cards. */
[data-home-page] .home-service-card--centers .home-service-copy strong {
    white-space: normal;
}
@media (prefers-reduced-motion: reduce) {
    [data-home-page] .home-service-card { transition: none; }
}

/* Only the office appointment card receives the same diagonal portrait shine.
   The card's existing overflow and border radius clip the moving highlight. */
[data-home-page] .home-service-card--appointment::after {
    content: "";
    position: absolute;
    inset: -50%;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(45deg, transparent 38%, rgba(255, 255, 255, .30) 50%, transparent 51%);
    transform: translate(-75%, 75%);
    animation: home-appointment-shine 4s linear infinite;
}
@keyframes home-appointment-shine {
    0% { transform: translate(-75%, 75%); }
    31.5%, 100% { transform: translate(75%, -75%); }
}
@media (prefers-reduced-motion: reduce) {
    [data-home-page] .home-service-card--appointment::after {
        display: none;
        animation: none;
    }
}

/* The photographic desktop hero ends before the independent service cards. */
@media (min-width: 992px) and (pointer: fine), (min-width: 992px) and (pointer: none), (min-width: 1200px) {
    [data-home-page] > .hero:has(> .home-hero-slideshow) {
        padding-bottom: 54px;
    }
    [data-home-page] > .hero:has(> .home-hero-slideshow) + .home-service-gateways {
        margin: 24px auto calc(var(--home-section-gap, 32px) + 16px);
    }
}
