.home-cards-section {
    background: #fff;
    overflow-x: clip;
}

.home-cards-section .section-head {
    max-width: 720px;
}

.home-cards-section .section-head h2 {
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.home-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
}

.home-card {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.home-card:hover,
.home-card:focus {
    color: inherit;
    text-decoration: none;
    outline: none;
}

.home-card:focus-visible .home-card__media {
    outline: 2px solid #111;
    outline-offset: 4px;
}

.home-card__media {
    overflow: hidden;
    margin-bottom: 22px;
    background: #f2f2f2;
    aspect-ratio: 4 / 3;
}

.home-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

@media (hover: hover) and (pointer: fine) {
    .home-card:hover .home-card__media img {
        transform: scale(1.05);
    }
}

.home-card__title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #111;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.home-card__subtitle {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #666;
    text-transform: none;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

/* Large tablet: 2 columns */
@media (max-width: 1199px) {
    .home-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px;
    }
}

/* Tablet / mobile */
@media (max-width: 991px) {
    .home-cards-section {
        padding-top: 60px !important;
        padding-bottom: 60px !important;
    }

    .home-cards-section .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .home-cards-section .section-head {
        margin-bottom: 28px !important;
        max-width: 100%;
    }

    .home-cards-section .section-head .font-36 {
        font-size: 28px !important;
        line-height: 1.25;
    }

    .home-cards-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        max-width: 560px;
        margin: 0 auto;
    }
}

/* Phones */
@media (max-width: 767px) {
    .home-cards-section {
        padding-top: 48px !important;
        padding-bottom: 48px !important;
    }

    .home-cards-section .section-head .font-36 {
        font-size: 24px !important;
    }

    .home-cards-section .section-head .font-16 {
        font-size: 14px !important;
        line-height: 1.55;
    }

    .home-cards-grid {
        gap: 28px;
        max-width: 100%;
    }

    .home-card__media {
        margin-bottom: 16px;
    }

    .home-card__title {
        font-size: 18px;
        letter-spacing: 0.03em;
    }

    .home-card__subtitle {
        font-size: 14px;
        line-height: 1.55;
    }
}

/* Small phones */
@media (max-width: 399px) {
    .home-cards-section {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }

    .home-cards-section .section-head .font-36 {
        font-size: 22px !important;
    }

    .home-card__title {
        font-size: 16px;
    }

    .home-card__subtitle {
        font-size: 13px;
    }
}

/* Services page banner + spacing */
.page-services .home-cards-section {
    background: #fff;
}

.page-services .wt-bnr-inr-entry .banner-title-name h2 {
    word-wrap: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}

@media (max-width: 767px) {
    .page-services .wt-bnr-inr {
        min-height: 180px;
    }

    .page-services .wt-bnr-inr-entry .banner-title-name h2 {
        font-size: 15px !important;
        letter-spacing: 2px !important;
        line-height: 1.45;
    }
}

/* Service card detail modal */
.home-card-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.home-card-modal[hidden] {
    display: none !important;
}

body.home-card-modal-open {
    overflow: hidden;
}

.home-card-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.home-card-modal__dialog {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    width: min(880px, 100%);
    max-height: min(90vh, 640px);
    overflow: hidden;
    background: #fff;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.home-card-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.home-card-modal__close:hover {
    background: rgba(0, 0, 0, 0.75);
}

.home-card-modal__media {
    min-height: 0;
    background: #f2f2f2;
}

.home-card-modal__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-card-modal__body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 2rem 2rem 1.75rem;
    overflow-y: auto;
}

.home-card-modal__title {
    margin: 0 0 8px;
    padding-right: 2rem;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #111;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.home-card-modal__subtitle {
    margin: 0 0 1rem;
    font-size: 15px;
    line-height: 1.55;
    color: #666;
}

.home-card-modal__details {
    flex: 1;
    font-size: 15px;
    line-height: 1.7;
    color: #444;
}

.home-card-modal__details p {
    margin: 0 0 0.85em;
}

.home-card-modal__details p:last-child {
    margin-bottom: 0;
}

.home-card-modal__details ul,
.home-card-modal__details ol {
    margin: 0 0 0.85em;
    padding-left: 1.2em;
}

.home-card-modal__details li {
    margin-bottom: 0.35em;
}

@media (max-width: 767px) {
    .home-card-modal {
        padding: 1rem;
        align-items: flex-end;
    }

    .home-card-modal__dialog {
        grid-template-columns: 1fr;
        max-height: min(92vh, 720px);
        width: 100%;
    }

    .home-card-modal__media {
        aspect-ratio: 16 / 9;
        max-height: 200px;
    }

    .home-card-modal__body {
        padding: 1.35rem 1.25rem 1.5rem;
    }

    .home-card-modal__title {
        font-size: 18px;
        letter-spacing: 0.03em;
    }
}
