/*
Theme Name: Шинник
Theme URI: http://shinnik.by
Author: ОАО «Белшина»
Description: Тема официального сайта газеты «Шинник» — новостной портал предприятия.
Version: 2.0.0
Text Domain: shinnik
*/

/* ============ TOKENS ============ */
:root {
    --red: #a11c20;
    --red-dark: #8a171b;
    --red-link: #b01e23;
    --bg: #f2f2f0;
    --panel: #ffffff;
    --text: #111111;
    --muted: #555555;
    --border: #d8d8d5;
}

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: 'PT Sans', Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        repeating-linear-gradient(45deg, rgba(0,0,0,.02) 0 1px, transparent 1px 3px),
        repeating-linear-gradient(-45deg, rgba(255,255,255,.4) 0 1px, transparent 1px 3px);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red-link); text-decoration: none; }
a:hover { color: #000; text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; }
ul { margin: 0; padding: 0; list-style: none; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 12px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }

/* ============ TOP STRIP ============ */
.topstrip { font-size: 12px; color: #333; }
.topstrip .wrap { display: flex; justify-content: space-between; align-items: flex-start; padding-top: 8px; padding-bottom: 4px; }
.topstrip a { color: #333; }
.topstrip a:hover { color: var(--red-link); }
.topstrip-left { padding-top: 4px; }
.topstrip-right { text-align: right; }
.topstrip-time { color: #444; }
.topstrip-official { display: block; font-size: 11px; color: #777; margin-top: 2px; }

/* ============ HEADER / LOGO ============ */
.site-header { padding: 6px 0 10px; }
.header-inner { display: flex; align-items: center; justify-content: center; }
.brand { display: inline-block; line-height: 0; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 370px; max-width: 100%; height: auto; display: block; }

/* ============ MAIN NAV (RED) ============ */
.main-nav {  }
.main-nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--red); }
.nav-menu { display: flex; flex-wrap: wrap; }
.nav-menu > li > a {
    display: block;
    color: #fff;
    padding: 8px 14px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .2px;
}
.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a { background: var(--red-dark); color: #fff; text-decoration: none; }

/* search inside red bar */
.search-form { display: flex; align-items: center; background: #fff; border-radius: 2px; overflow: hidden; margin: 5px 0; }
.search-field { border: 0; padding: 6px 8px; font-size: 12px; width: 150px; outline: none; font-family: inherit; }
.search-submit { border: 0; background: var(--red-dark); color: #fff; padding: 6px 9px; cursor: pointer; display: flex; align-items: center; }
.search-submit:hover { background: #000; }

/* ============ SUBNAV (GRAY) ============ */
.subnav {  }
.subnav-menu { display: flex; flex-wrap: wrap; align-items: center; }
.subnav-menu > li { display: flex; align-items: center; }
.subnav > .wrap { background: #dededb; border-bottom: 1px solid #cfcfcb; }
.subnav-menu > li > a {
    display: block;
    color: #333;
    padding: 6px 10px;
    font-size: 13px;
}
.subnav-menu > li > a:hover { color: var(--red-link); text-decoration: none; }
.subnav-menu > li + li::before { content: '|'; color: #999; font-size: 12px; }

/* ============ LAYOUT ============ */
.site-body { padding-top: 14px; padding-bottom: 24px; }
.content-area {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: start;
    background: #fff;
    padding: 16px 18px 18px;
    border: 1px solid var(--border);
    border-radius: 3px;
}
.content-area.home-area { grid-template-columns: minmax(0, 1fr) 250px 240px; gap: 16px; }
.site-main { min-width: 0; }

/* ============ NEWS SLIDER ============ */
.news-slider { position: relative; background: #000; margin-bottom: 14px; overflow: hidden; }
.slider-track { position: relative; }
.slide { display: none; position: relative; }
.slide.active { display: block; animation: slide-fade .45s ease; }
@keyframes slide-fade { from { opacity: .4; } to { opacity: 1; } }
.slide img { width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; display: block; }
.slide-caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.62);
    color: #fff;
    padding: 10px 14px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
}
.slide:hover .slide-caption { background: rgba(161,28,32,.85); }
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 46px;
    border: 0;
    background: rgba(0,0,0,.32);
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 3;
}
.slider-arrow:hover { background: rgba(161,28,32,.92); }
.slider-arrow.prev { left: 0; }
.slider-arrow.next { right: 0; }
.slider-dots { position: absolute; top: 8px; right: 10px; display: flex; gap: 6px; z-index: 3; }
.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 0;
    padding: 0;
    background: rgba(255,255,255,.55);
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(0,0,0,.25);
}
.slider-dot.active { background: #fff; }

/* ============ FEATURED ============ */
.featured { margin-bottom: 14px; background: #000; position: relative; }
.featured-link { display: block; position: relative; }
.featured-image img { width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; display: block; }
.featured-caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.62);
    color: #fff;
    padding: 10px 14px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
}
.featured-date { display: none; }
.featured-link:hover .featured-caption { background: rgba(161,28,32,.85); }

/* ============ NEWS FEED ============ */
.news-feed { display: block; }
.news-item {
    padding: 12px 0 14px;
    border-bottom: 1px solid var(--border);
}
.news-item:last-child { border-bottom: 0; }
.news-date {
    font-size: 12px;
    color: var(--red-link);
    text-align: right;
    margin-bottom: 2px;
}
.news-title { font-size: 22px; font-weight: 700; margin: 0 0 8px; line-height: 1.15; }
.news-title a { color: #111; }
.news-title a:hover { color: var(--red-link); text-decoration: none; }
.news-row { display: flex; gap: 12px; align-items: flex-start; }
.news-thumb { flex: 0 0 140px; }
.news-thumb img { width: 140px; height: 95px; object-fit: cover; }
.news-excerpt { font-size: 13px; color: #333; line-height: 1.45; }

/* ============ PAGINATION ============ */
.pagination { margin: 16px 0 0; }
.pagination ul { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pagination li a, .pagination li span {
    display: inline-block;
    padding: 3px 9px;
    font-size: 13px;
    color: #333;
    background: #fff;
    border: 1px solid #ccc;
}
.pagination li .current { background: var(--red); color: #fff; border-color: var(--red); }
.pagination li a:hover { background: var(--red); color: #fff; border-color: var(--red); text-decoration: none; }

/* ============ SIDEBAR ============ */
.site-sidebar { display: flex; flex-direction: column; gap: 14px; }
.widget { background: transparent; }
.widget-title {
    background: var(--red);
    color: #fff;
    font-size: 15px;
    font-weight: 400;
    text-transform: uppercase;
    text-align: center;
    margin: 0;
    padding: 6px 10px;
    letter-spacing: .3px;
}
.widget ul { padding: 8px 0; }

/* Fotorяд: photo + bold caption list */
.fotorad-grid { display: flex; flex-direction: column; gap: 12px; padding: 10px 0; }
.fotorad-item { display: block; }
.fotorad-item img { width: 100%; height: auto; }
.fotorad-item { position: relative; }
.fotorad-item::after { content: ''; }
.fotorad-grid .fotorad-item { color: #111; }
.fotorad-grid .fotorad-item img { margin-bottom: 6px; }
/* caption comes from title attribute — use a wrapper instead */
.fotorad-figure { margin: 0 0 12px; }
.fotorad-figure img { width: 100%; height: auto; margin-bottom: 6px; }
.fotorad-figure figcaption { font-size: 13px; font-weight: 700; color: #111; line-height: 1.25; }
.fotorad-figure a { color: #111; }
.fotorad-figure a:hover { color: var(--red-link); text-decoration: none; }

/* Fact */
.fact-content { padding: 10px 0; font-size: 12.5px; color: #333; }
.fact-content strong { color: #111; }
.fact-content p { margin: 0 0 8px; }
.fact-list li { margin-bottom: 6px; color: #333; }
.fact-full { padding: 8px 0; font-size: 12.5px; color: #333; line-height: 1.45; }
.fact-full img { display: block; margin: 0 auto 8px; max-width: 100%; height: auto; }
.fact-full-title { font-size: 13px; font-weight: 700; color: #111; margin: 0 0 6px; line-height: 1.25; }
.fact-full-text p { margin: 0 0 6px; }
.fact-full-text ul { margin: 4px 0; padding-left: 16px; }
.fact-full-text li { margin-bottom: 4px; }

/* Weather */
.weather-box { padding: 10px; text-align: center; background: #fff; border: 1px solid var(--border); }
.weather-city { font-size: 12px; color: #777; }
.weather-temp { font-size: 32px; font-weight: 700; color: var(--red); line-height: 1.1; }
.weather-desc { font-size: 12px; color: #555; margin-bottom: 6px; }
.weather-link { font-size: 12px; }

/* Resource banners */
.resource-list { display: flex; flex-direction: column; gap: 8px; padding: 8px 0 0; }
.resource-banner { display: block; }
.resource-banner img {
    display: block;
    width: 100%;
    max-width: 240px;
    height: auto;
    margin: 0 auto;
    border: 1px solid var(--border);
    background: #fff;
}
.resource-banner:hover img { border-color: var(--red); }

/* Resource banners as widgets (Внешний вид → Виджеты → «Баннеры-ресурсы») */
.resource-list .widget { margin: 0; padding: 0; }
.resource-list .widget .wp-block-image,
.resource-list .widget .wp-block-group,
.resource-list .widget figure {
    margin: 0;
    padding: 0;
}
.resource-list .widget img {
    display: block;
    width: 100%;
    max-width: 240px;
    height: auto;
    margin: 0 auto;
    border: 1px solid var(--border);
    background: #fff;
}
.resource-list .widget.aligncenter { text-align: center; }
.resource-list .widget:hover img { border-color: var(--red); }
.resource-list .widget a:hover img { border-color: var(--red); }
.resource-list .widget .wp-block-image a:hover img { border-color: var(--red); }

/* ============ FOOTER ============ */
.site-footer { background: #dededb; border-top: 1px solid #cfcfcb; margin-top: 10px; padding: 14px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer-copy { font-size: 12px; color: #444; line-height: 1.5; }
.footer-copy .footer-title { font-weight: 700; color: #222; }
.footer-brand { display: flex; align-items: center; gap: 8px; color: var(--red); text-align: right; }
.footer-brand .fb-name { font-size: 18px; font-weight: 700; color: var(--red); letter-spacing: 1px; }
.footer-brand .fb-sub { font-size: 10px; color: #666; letter-spacing: .5px; }

/* ============ SINGLE / PAGE ============ */
.entry-header { margin-bottom: 12px; }
.entry-meta { font-size: 12px; color: var(--red-link); margin-bottom: 4px; }
.entry-title { font-size: 28px; color: #111; }
.entry-image { background: #000; }
.entry-image img { width: 100%; }
.entry-content { background: #fff; padding: 18px; border: 1px solid var(--border); font-size: 14px; }
.entry-content p { margin: 0 0 1em; }
.entry-content h2 { font-size: 18px; color: #111; margin: 1.3em 0 .6em; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.entry-content h2:first-child { margin-top: 0; }
.entry-content h3 { font-size: 16px; color: #111; margin: 1.1em 0 .5em; }
.entry-content ul, .entry-content ol { margin: 0 0 1em; padding-left: 1.5em; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li { margin-bottom: .5em; }
.entry-content strong { color: #000; }
.entry-content a { color: var(--red-link); }
.entry-content a:hover { color: #000; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
    .content-area,
    .content-area.home-area { grid-template-columns: 1fr; }
    .brand-logo { width: 320px; }
    .home-area .photo-col .fotorad-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 12px;
    }
    .home-area .res-col .resource-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 10px;
    }
}
@media (max-width: 600px) {
    .topstrip .wrap { flex-direction: column; gap: 4px; }
    .topstrip-right { text-align: left; }
    .brand-logo { width: 250px; }
    .main-nav .wrap { flex-direction: column; align-items: stretch; }
    .nav-menu > li > a { padding: 7px 10px; font-size: 13px; }
    .subnav-menu > li + li::before { display: none; }
    .search-field { width: 100%; }
    .slide-caption { font-size: 13px; padding: 8px 10px; }
    .slider-arrow { width: 26px; height: 38px; font-size: 24px; }
    .slider-dot { width: 8px; height: 8px; }
    .news-title { font-size: 18px; }
    .news-thumb { flex: 0 0 110px; }
    .news-thumb img { width: 110px; height: 78px; }
    .footer-inner { flex-direction: column; align-items: flex-start; }
    .footer-brand { text-align: left; }
}
