/* Public-site responsive compatibility layer.
   Loaded last on Home, About, Brands, and Contact so the existing visual
   design is preserved while narrow-screen layout and input behavior stay
   consistent across the public pages. */

html {
    min-width: 320px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-width: 320px;
}

img,
picture,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

.container,
.row,
.row > *,
[class*="col-"] {
    min-width: 0;
}

.people-copy h2,
.people-description,
.people-value strong,
.story-overlay,
#fileName,
.hero h1,
.page-header h1,
.section-title-modern,
.about-story-copy h2,
.core-values-heading h2,
.story-heading h2,
.contact-detail a,
.footer a {
    overflow-wrap: anywhere;
}

.hero-primary-link:focus-visible,
.btn:focus-visible,
.btn-sm-custom:focus-visible,
.brand-card-link:focus-visible,
.brand-link:focus-visible,
.footer a:focus-visible {
    outline: 3px solid rgba(47, 107, 255, 0.42);
    outline-offset: 3px;
}

.job-card .btn-sm-custom {
    display: flex;
    width: max-content;
    max-width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

@media (max-width: 991.98px) {
    .hero {
        min-height: auto;
        padding: clamp(72px, 10vw, 96px) 0;
    }

    .hero-content {
        max-width: 760px;
    }

    .page-header p,
    .section-description-modern,
    .about-story-copy > p,
    .core-values-heading p,
    .story-heading > p {
        max-width: 65ch;
    }

    .about-logo-panel img {
        max-width: min(100%, 350px);
    }
}

@media (max-width: 767.98px) {
    .hero {
        padding: 64px 0 58px;
    }

    .hero h1 {
        font-size: clamp(2.35rem, 11vw, 3.35rem);
        letter-spacing: -0.045em;
    }

    .hero-stats {
        width: 100%;
        margin-top: 38px;
    }

    .page-header {
        padding-top: 42px;
        padding-bottom: 34px;
    }

    .page-header h1 {
        font-size: clamp(1.9rem, 9vw, 2.5rem);
    }

    .page-header p {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .section-padding,
    .about-section,
    .people-section,
    .story-section,
    .contact-section {
        padding-top: 56px;
        padding-bottom: 56px;
    }

    .section-header-modern .section-title-modern,
    .brand-section .section-title-modern,
    .about-story-copy h2,
    .core-values-heading h2,
    .story-heading h2 {
        font-size: clamp(2rem, 9vw, 2.85rem);
        letter-spacing: -0.045em;
    }

    .contact-form-wrapper {
        margin-top: 0;
        margin-bottom: 0;
        padding: 24px 20px;
    }

    .contact-form-wrapper .form-control,
    .modal .form-control,
    .modal .form-select {
        min-height: 46px;
        font-size: 16px;
    }

    .contact-form-wrapper textarea.form-control,
    .modal textarea.form-control {
        min-height: 132px;
    }

    .contact-detail {
        padding: 22px 24px;
    }

    .contact-detail a,
    .brand-section .brand-visit-link,
    .brands-showcase .brand-link {
        display: inline-flex;
        min-height: 44px;
        align-items: center;
    }

    .branch-card {
        padding: 24px 22px 22px;
    }

    .map-wrapper iframe {
        min-height: 260px;
    }

    .job-card .job-header {
        flex-wrap: wrap;
        gap: 8px 12px;
    }

    .btn-sm-custom,
    .contact-form-wrapper .btn,
    .no-role-card .btn,
    .cta-section .btn {
        min-height: 44px;
    }

    .modal-dialog {
        width: auto;
        max-width: none;
        margin: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    }

    .modal-content {
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        overflow: hidden;
    }

    .modal-header {
        flex-shrink: 0;
        padding: 20px 18px 0 !important;
    }

    .modal-body {
        padding: 18px !important;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .modal-title {
        padding-right: 8px;
        font-size: 1rem;
        line-height: 1.4;
    }

    .modal .btn-close {
        width: 44px;
        height: 44px;
        padding: 0;
        flex: 0 0 44px;
        background-position: center;
    }

    .alert-dismissible {
        padding-right: 3.5rem;
    }

    .alert .btn-close {
        width: 44px;
        height: 44px;
        padding: 0;
        background-position: center;
    }

    body .footer ul li {
        margin-bottom: 2px;
    }

    body .footer ul li a {
        display: inline-flex;
        min-height: 44px;
        align-items: center;
        padding: 8px 0;
    }

    body .footer .footer-contact li {
        align-items: flex-start;
        margin-bottom: 4px;
    }

    body .footer .footer-contact li > i {
        margin-top: 13px;
    }

    body .footer .social-links a {
        width: 44px;
        height: 44px;
    }

    .story-sound {
        width: 44px;
        height: 44px;
    }

    .story-footer a,
    .people-link {
        min-height: 44px;
    }
}

@media (max-width: 575.98px) {
    .hero {
        padding: 54px 0 50px;
    }

    .hero h1 {
        font-size: clamp(2.15rem, 11.5vw, 2.8rem);
    }

    .hero .subtitle {
        margin-bottom: 28px;
        font-size: 0.98rem;
    }

    .hero-primary-link {
        min-height: 48px;
        padding-right: 20px;
        padding-left: 20px;
    }

    .hero-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        padding-top: 22px;
    }

    .hero-stat {
        display: block;
        width: 100%;
    }

    .hero-stat:last-child {
        grid-column: 1 / -1;
    }

    .hero-stat .number {
        min-width: 0;
        font-size: 1.4rem;
    }

    .brand-section .section-header-modern {
        padding-right: 0;
        padding-left: 0;
    }

    .brand-section .brands-grid-modern,
    .brands-showcase .brands-grid {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 0.75rem;
    }

    .brand-section .brands-grid-modern > [class*="col-"],
    .brands-showcase .brands-grid > [class*="col-"] {
        display: flex;
        width: 50%;
        flex: 0 0 auto;
    }

    .brand-section .brand-card-link,
    .brand-section .brand-card-modern,
    .brands-showcase .brand-card {
        width: 100%;
        height: 100%;
    }

    .brand-section .brand-card-modern,
    .brands-showcase .brand-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .brand-section .card-image-modern,
    .brands-showcase .brand-card .card-image {
        width: auto;
        height: 120px;
        min-height: 120px;
        margin: 10px 10px 0;
        padding: 12px;
    }

    .brand-section .brand-card-content,
    .brands-showcase .brand-card .brand-content {
        padding: 16px 12px 18px;
        border-top: 1px solid #e3eaf5;
        border-left: 0;
    }

    .brand-section .card-title-modern,
    .brands-showcase .brand-card .card-title {
        font-size: 0.9rem;
        overflow-wrap: anywhere;
    }

    .brand-section .card-text-modern,
    .brands-showcase .brand-card .card-text {
        margin-bottom: 12px;
        font-size: 0.8rem;
    }

    .brand-section .brand-visit-link,
    .brands-showcase .brand-link {
        gap: 7px;
        font-size: 0.8rem;
    }

    .people-media {
        padding-right: 16px;
        padding-left: 16px;
    }

    .people-media .tc-prev {
        left: -8px;
    }

    .people-media .tc-next {
        right: -8px;
    }

    .story-frame {
        max-height: min(76svh, 680px);
    }

    .story-overlay {
        padding: 22px;
    }

    .contact-section {
        padding-top: 40px;
        padding-bottom: 48px;
    }

    .contact-form-wrapper {
        padding: 22px 16px;
        border-radius: 12px;
    }

    .locations-section,
    #location-map {
        margin-top: 44px;
    }

    .section-heading,
    .map-heading {
        gap: 12px;
    }

    .branch-card {
        padding: 22px 18px 20px;
    }

    .contact-detail {
        padding: 20px;
    }

    .contact-form-wrapper .btn,
    .map-toolbar .btn-directions,
    .branch-actions .btn-directions {
        width: 100%;
    }

    .map-wrapper iframe {
        height: 240px;
        min-height: 240px;
    }

    .no-role-card {
        padding-right: 18px;
        padding-left: 18px;
    }

    body .footer {
        padding-top: 40px;
    }

    body .footer .footer-brand {
        overflow-wrap: anywhere;
    }
}

@media (max-width: 479.98px) {
    .about-metrics {
        grid-template-columns: 1fr;
    }

    .about-metric,
    .about-metric:first-child,
    .about-metric:last-child {
        width: 100%;
        min-height: 0;
        padding: 16px 0;
        border-right: 0;
        border-bottom: 1px solid #dce4ef;
    }

    .about-metric:last-child {
        border-bottom: 0;
    }
}

@media (max-width: 359.98px) {
    .page-header h1,
    .section-header-modern .section-title-modern,
    .brand-section .section-title-modern,
    .about-story-copy h2,
    .core-values-heading h2,
    .story-heading h2 {
        font-size: 2rem;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 40px 0;
    }

    .page-header {
        padding-top: 28px;
        padding-bottom: 24px;
    }

    .modal-dialog {
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    html,
    html:focus-within {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero-primary-link:hover,
    .brand-card:hover,
    .brand-card-modern:hover,
    .job-card:hover,
    .core-value-card:hover,
    .social-links a:hover {
        transform: none;
    }
}
