/* ============================================================
   CITY NEWS — Responsive Master
   Mobile-first adaptation + SEO compliance
   ============================================================ */

/* === GLOBAL RESETS === */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { overflow-x: hidden; }
img, video, svg { max-width: 100%; height: auto; display: block; }

/* === MIN TOUCH TARGETS 44px === */
.btn-header, .mobile-toggle, .mobile-nav-close,
.nav-list li a, .breaking-ticker a, .news-card a,
.slider-main a, .slider-side-item a, .city-service-card,
.service-link, .widget a, .scroll-top,
.post-nav a, button, a.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.nav-list li a { padding: 12px 16px; min-height: 44px; }
.mobile-nav a { padding: 16px 0; min-height: 48px; font-size: 16px; }
.city-service-card { padding: 20px; min-height: 44px; }
.service-link { padding: 12px 8px; min-height: 44px; }

/* === 1024px — Tablet landscape === */
@media (max-width: 1024px) {
    .container { padding: 0 16px; }
    .content-grid { grid-template-columns: 1fr; gap: 24px; }
    .sidebar { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .single-layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .news-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .slider-grid { grid-template-columns: 1fr; }
    .slider-side { grid-template-columns: repeat(2, 1fr); }
}

/* === 768px — Tablet portrait === */
@media (max-width: 768px) {
    /* Header */
    .header-search, .header-cta { display: none; }
    .mobile-toggle { display: flex; min-height: 44px; min-width: 44px; justify-content: center; align-items: center; }
    .site-logo { font-size: 1.4rem; }

    /* Top bar */
    .top-bar { font-size: 12px; padding: 5px 0; }
    .top-bar-left { gap: 10px; }
    .top-bar-right { gap: 10px; }

    /* Navigation */
    .nav-list li a { padding: 10px 12px; font-size: 13px; min-height: 40px; }
    .main-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Hero slider */
    .slider-main .slider-img { height: 240px; }
    .slider-title { font-size: 1.15rem; }
    .slider-overlay { padding: 16px; }
    .slider-side { grid-template-columns: 1fr; }
    .slider-side-item { flex-direction: row; }
    .slider-side-img { width: 100px; min-height: 70px; flex-shrink: 0; }

    /* News grids */
    .news-grid-3, .news-grid-2 { grid-template-columns: 1fr; }
    .news-item { flex-direction: column; }
    .news-item .news-item-img { width: 100%; min-height: 160px; }
    .news-item .news-item-body { padding: 14px; }

    /* Sidebar */
    .sidebar { grid-template-columns: 1fr; }
    .services-grid { grid-template-columns: repeat(3, 1fr); }
    .city-services-full { grid-template-columns: repeat(2, 1fr); }

    /* Breaking ticker */
    .breaking { overflow: hidden; }
    .breaking-ticker a { font-size: 13px; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr; }

    /* Single post */
    .single-thumb { max-height: 280px; }
    .single-title { font-size: 1.4rem; }
}

/* === 480px — Mobile portrait === */
@media (max-width: 480px) {
    .container { padding: 0 12px; }
    body { font-size: 16px; line-height: 1.5; }

    /* Header */
    .site-logo { font-size: 1.15rem; }
    .header-inner { padding: 10px 0; gap: 12px; }

    /* Top bar */
    .top-bar { display: none; }

    /* Hero */
    .slider-main .slider-img { height: 200px; }
    .slider-title { font-size: 1rem; }
    .slider-overlay { padding: 12px; }
    .slider-meta { font-size: 11px; gap: 8px; flex-wrap: wrap; }

    /* News */
    .news-card-img { height: 180px; }
    .news-title { font-size: 0.95rem; }
    .news-meta { font-size: 12px; }

    /* Services */
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .city-services-full { grid-template-width: 1fr; grid-template-columns: 1fr; }
    .city-service-card { padding: 14px; }
    .city-service-card h4 { font-size: 0.88rem; }
    .city-service-card p { font-size: 0.78rem; }

    /* Single */
    .single-title { font-size: 1.25rem; }
    .single-thumb { max-height: 200px; }
    .post-nav { flex-direction: column; }
    .post-nav a { white-space: normal; text-align: center; }

    /* Sidebar widgets */
    .widget { padding: 14px; }
    .widget-title { font-size: 0.95rem; }

    /* Footer */
    .footer-grid { gap: 1.5rem; }

    /* Breaking */
    .breaking-label { font-size: 11px; padding: 4px 8px; }
    .breaking-ticker a { font-size: 12px; }

    /* Scroll to top */
    .scroll-top { width: 40px; height: 40px; bottom: 16px; right: 16px; }
}

/* === HORIZONTAL SCROLL PREVENTION === */
.content-grid, .single-layout, .slider-grid, .news-grid-3,
.news-grid-2, .footer-grid, .services-grid, .city-services-full,
.catalog-grid, .catalog-cats-grid {
    max-width: 100%;
    overflow-wrap: break-word;
}

/* === CATALOG RESPONSIVE === */
@media (max-width: 1024px) {
    .catalog-cats-grid { grid-template-columns: repeat(3, 1fr); }
    .catalog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .catalog-hero-title { font-size: 1.3rem; }
    .catalog-cats-grid { grid-template-columns: repeat(3, 1fr); }
    .catalog-grid { grid-template-columns: 1fr; }
    .catalog-filter-form { flex-direction: column; }
    .catalog-filter-group { width: 100%; }
    .catalog-select, .catalog-input { width: 100%; min-height: 44px; }
}
@media (max-width: 480px) {
    .catalog-cats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* === ACCESSIBILITY — FOCUS VISIBLE === */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

/* === REDUCE MOTION === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}

/* === SAFE AREA (notch phones) === */
@supports (padding: env(safe-area-inset-top)) {
    .site-header { padding-top: env(safe-area-inset-top); }
    .site-footer { padding-bottom: env(safe-area-inset-bottom); }
}

/* === PRINT === */
@media print {
    .site-header, .main-nav, .breaking, .sidebar, .site-footer,
    .scroll-top, .mobile-nav, .hero-slider, .top-bar { display: none !important; }
    body { background: #fff; color: #000; }
    .content-grid, .single-layout { grid-template-columns: 1fr; }
    a { color: #000; text-decoration: underline; }
}
