/* Home page screen-specific optimization layer */

.ssd-home *,
.ssd-home *::before,
.ssd-home *::after {
    box-sizing: border-box;
}

@media (min-width: 1400px) {
    .ssd-container {
        width: min(1240px, 90%);
    }

    .ssd-home h1 {
        max-width: 18ch;
    }
}

@media (max-width: 1199px) {
    .ssd-hero-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }

    .ssd-hero-panel {
        margin-top: 0.25rem;
    }
}

@media (max-width: 991px) {
    .ssd-header-inner {
        min-height: 70px;
    }

    .ssd-brand-logo {
        height: 58px;
    }

    .ssd-home .ssd-subtext {
        max-width: 100%;
    }

    .ssd-contact-image,
    .ssd-about-image {
        height: 200px;
    }
}

@media (max-width: 767px) {
    .ssd-global-header {
        position: sticky;
    }

    .ssd-container {
        width: min(1140px, 94%);
    }

    .ssd-hero {
        min-height: auto;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .ssd-home h1 {
        line-height: 1.14;
    }

    .ssd-section {
        padding: 1.6rem 0;
    }

    .ssd-team-grid {
        grid-template-columns: 1fr;
    }

    .ssd-team-avatar {
        width: 104px;
        height: 104px;
    }

    #ssd-client-portal {
        padding-top: 2.2rem;
        padding-bottom: 2.2rem;
    }

    .ssd-card,
    .ssd-service-card,
    .ssd-hero-panel,
    .ssd-portal-search,
    .ssd-emergency-card,
    .ssd-service-area {
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .ssd-hero-actions {
        gap: 0.6rem;
    }

    .ssd-btn {
        min-height: 44px;
        padding: 0.7rem 1rem;
    }

    .ssd-header-icon {
        min-height: 44px;
    }

    .ssd-portal-search {
        padding: 1.1rem;
        justify-items: stretch;
    }

    .ssd-portal-search .ssd-btn,
    .ssd-contact-actions .ssd-btn,
    .ssd-cta .ssd-btn {
        width: 100%;
        max-width: 100%;
    }

    .ssd-cta h2,
    .ssd-cta p {
        max-width: 42ch;
        margin-left: auto;
        margin-right: auto;
        padding-inline: 0.1rem;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .ssd-cta p {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .ssd-cta .ssd-btn {
        width: auto;
        max-width: calc(100% - 1rem);
        min-height: 40px;
        padding: 0.56rem 1rem;
        font-size: 0.92rem;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 0.9rem;
    }

    .ssd-contact-form,
    .ssd-contact-actions {
        width: 100%;
    }

    .ssd-contact-form input,
    .ssd-contact-form textarea {
        width: 100%;
        max-width: 100%;
    }

    .ssd-input-grid {
        grid-template-columns: 1fr;
    }

    .ssd-contact-grid .ssd-card:last-child {
        display: grid;
        gap: 0.85rem;
        align-content: start;
    }

    .ssd-cta-section {
        padding-top: 1.8rem;
        margin-bottom: 0;
        padding-bottom: 0.5rem;
    }

    .ssd-contact-image,
    .ssd-about-image,
    .ssd-panel-image {
        height: 190px;
    }
}

@media (max-width: 479px) {
    .ssd-brand-logo {
        height: 48px;
    }

    .ssd-home h1 {
        font-size: clamp(1.5rem, 9vw, 2rem);
    }

    .ssd-subtext,
    .ssd-page p {
        font-size: 0.95rem;
    }

    .ssd-card,
    .ssd-service-card,
    .ssd-hero-panel {
        padding: 1rem;
    }

    #ssd-client-portal {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .ssd-team-avatar {
        width: 96px;
        height: 96px;
    }

    .ssd-cta {
        padding-top: 0.75rem;
        padding-bottom: 1.2rem;
    }

    .ssd-contact-form textarea {
        min-height: 132px;
    }

    .ssd-cta h2,
    .ssd-cta p {
        max-width: 34ch;
        padding-inline: 0.2rem;
    }

    .ssd-cta p {
        font-size: 0.84rem;
        line-height: 1.34;
    }

    .ssd-cta .ssd-btn {
        max-width: calc(100% - 1.2rem);
        min-height: 38px;
        padding: 0.5rem 0.9rem;
        font-size: 0.88rem;
        margin-bottom: 0.8rem;
    }

    .ssd-cta-section {
        padding-top: 1.6rem;
        margin-bottom: 0;
        padding-bottom: 0.45rem;
    }

    .ssd-contact-image,
    .ssd-about-image,
    .ssd-panel-image {
        height: 170px;
    }
}
