/* Compact screens and touch devices in landscape share the phone layout. */
@media screen and (max-width: 767px), screen and (max-width: 1100px) and (pointer: coarse) and (hover: none) {
    html, body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
    html, body { font-size: 16px; line-height: 1.5; }
    .grid-row { width: auto; margin-right: 16px; margin-left: 16px; }
    .grid-col { float: none; width: 100%; margin-left: 0; }
    .main-style .columns-col { float: none; width: 100%; padding-right: 0; padding-left: 0; }
    .main-style .columns-col + .columns-col { margin-top: 30px; }
    .main-nav { display: none; }
    .main-style h1 { font-size: 32px; line-height: 1.2; overflow-wrap: anywhere; }
    .main-style h2 { font-size: 28px; line-height: 1.25; }
    .main-style h3 { font-size: 22px; line-height: 1.3; }
    .main-style p, .home-content .tab-container .panel-container p { font-size: 16px; line-height: 1.6; text-align: left; }
    .main-style li { font-size: 16px; line-height: 1.6; }
    .main-style img, .page-footer-top img { max-width: 100%; height: auto; box-sizing: border-box; }
    .main-style iframe { max-width: 100%; }
    .main-style a, .page-footer-top a { overflow-wrap: anywhere; }
    .home-feedback-banner, .home-content .partners img { max-width: 100%; }
    .home-content .info-widget-index, .home-content .info-widget-index-vgallery { width: 100%; table-layout: fixed; }
    .home-content .info-widget-index th:first-child { width: 32px; }
    .home-content .info-widget-index td, .home-content .info-widget-index th { overflow-wrap: anywhere; }
    .home-content .news-list .drop-down-panel { padding: 16px; }
    .home-content .news-list .preview_picture {
        display: block;
        float: none !important;
        padding-right: 0 !important;
        margin: 0 auto 16px;
    }
    .home-content .news-list .panel-title { font-size: 18px; line-height: 1.4; padding: 16px 12px; }
    .home-content .news-list .panel-icon { width: 24px; padding: 16px 0 16px 12px; }
    .home-content .news-list .panel-last-child { width: 0; padding: 0; }
    .home-content .news-list a.news { display: inline-block; padding: 10px 0; }
    .page-header-bottom .grid-row { margin-bottom: 0; padding-right: 120px; min-height: 56px; }
    .logo, .page-header-bottom.fixed .logo { height: 44px; }
    .mobile-nav { display: block; margin-top: -28px; }
    .mobile-nav .switcher { display: flex; align-items: center; justify-content: center; gap: 10px; box-sizing: border-box; width: 116px; height: 56px; border: 1px solid #aaa; border-radius: 6px; color: #fff; }
    .mobile-nav .switcher i { font-size: 30px; }
    .mobile-nav .mobile-menu-label { display: inline; font-size: 18px; line-height: 1.2; }
    .mobile-nav ul {
        box-sizing: border-box;
        right: 0;
        width: calc(100vw - 32px);
        max-height: calc(100vh - 100px);
        max-height: calc(100dvh - 100px);
        overflow-y: auto;
        margin-top: 12px;
    }
    .mobile-nav ul a, .mobile-nav ul .mobile-nav__green-link { box-sizing: border-box; min-height: 60px; padding: 16px 20px; font-size: 20px; line-height: 28px; }
    .accessible-version-link { position: static; padding: 8px 16px; border-radius: 0; background: #535353; }
    .accessible-version-link a { display: flex; align-items: center; gap: 10px; margin: 0 !important; min-height: 44px; color: white; font-size: 14px; line-height: 1.4; }
    .accessible-version-link a::after { content: "Версия для слабовидящих"; }
    .accessible-version-link img { width: 56px; height: auto; }
    body .visitor-page, body .partners-page { padding-top: 32px; }
    .page-footer-top { font-size: 16px; line-height: 1.6; }
    .page-footer-top nobr { white-space: normal; }
    input[type="text"], input[type="email"], input[type="tel"], select, textarea { font-size: 16px; }
    #cookie-notification {
        box-sizing: border-box;
        max-height: 45vh;
        max-height: 45dvh;
        overflow-y: auto;
        padding: 12px 16px !important;
    }
    #cookie-notification > div { display: block !important; }
    #cookie-notification > div > div:first-child { min-width: 0 !important; padding-right: 0 !important; }
    #cookie-notification p { overflow-wrap: anywhere; }
    #cookie-notification > div > div:last-child { position: sticky; bottom: -12px; padding: 10px 0 12px; background: #f8f9fa; }
    #cookie-consent-btn { min-height: 44px; width: 100%; }
}

/* Touch targets also apply to tablets and computers with touchscreens. */
@media (any-pointer: coarse) {
    .mobile-nav .switcher, .visitor-button, .visitor-nav a,
    .visitor-details summary, .partners-card a, .news-card__link,
    .secondary-nav a, .social-links, #cookie-consent-btn {
        box-sizing: border-box;
        min-height: 48px;
    }
    .visitor-nav a, .partners-card a, .news-card__link, .secondary-nav a {
        display: inline-flex;
        align-items: center;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    .visitor-details summary { padding-top: 12px; padding-bottom: 12px; }
    .page input[type="text"], .page input[type="email"], .page input[type="tel"],
    .page select, .page textarea { min-height: 48px; font-size: 16px; }
    .page a:focus-visible, .page button:focus-visible, .page summary:focus-visible {
        outline: 3px solid #d8736e;
        outline-offset: 3px;
    }
}
