/*
Theme Name: Military Portal Child
Description: Швидка SEO-орієнтована тема військового порталу (дочірня до Twenty Twenty-Five).
Template: twentytwentyfive
Version: 2.0.0
Text Domain: milportal
*/

:root {
    --bg: #f3f4ef;
    --surface: #fff;
    --text: #1d221a;
    --muted: #5d6657;
    --line: #dde0d4;
    --dark: #1f2a1a;
    --accent: #6b7f3a;
    --accent-dark: #55662d;
    --alert: #b3341f;
    --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-dark); }
a:hover { color: var(--alert); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

.screen-reader-text, .skip-link:not(:focus) {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: #fff; padding: 8px 12px; }

/* Шапка */
.site-header { background: var(--dark); color: #fff; border-bottom: 3px solid var(--accent); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.site-name { color: #fff; font-size: 1.5rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; }
.site-logo img { max-height: 48px; width: auto; }
.header-search { display: flex; gap: 6px; }
.header-search input { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; font: inherit; }
.header-search button, .btn {
    padding: 8px 14px; border: 0; border-radius: var(--radius); background: var(--accent); color: #fff;
    font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block;
}
.header-search button:hover, .btn:hover { background: var(--accent-dark); color: #fff; }

.main-nav { background: #2a3824; }
.main-nav .wrap { overflow-x: auto; }
.menu { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; white-space: nowrap; }
.main-nav a { display: block; padding: 10px 12px; color: #e8ecdf; text-decoration: none; font-weight: 600; font-size: .95rem; }
.main-nav a:hover, .main-nav .current-menu-item a, .main-nav .current-cat a { background: var(--accent); color: #fff; }

/* Каркас */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; padding-top: 24px; padding-bottom: 40px; align-items: start; }
.sidebar { position: sticky; top: 16px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 1.8rem; }
.lead { color: var(--muted); }
.lead p { margin: 0; }

.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0 0 12px; padding: 0; font-size: .85rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "›"; margin-right: 4px; }
.breadcrumbs a { color: var(--muted); }

/* Карточки */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-img { display: block; aspect-ratio: 16 / 9; background: var(--line); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-cat { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-dark); text-decoration: none; }
.card-title { font-size: 1.05rem; margin: 0; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--alert); }
.card-excerpt { margin: 0; color: var(--muted); font-size: .95rem; }
.card-date { margin-top: auto; font-size: .8rem; color: var(--muted); }
.card-hero { grid-column: 1 / -1; }
.card-hero .card-title { font-size: 1.6rem; }

.pagination { grid-column: 1 / -1; }
.pagination .nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 6px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Статья */
.article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.article-head h1 { font-size: 2rem; }
.byline { color: var(--muted); font-size: .9rem; margin: 0 0 16px; }
.article-thumb { margin: 0 0 20px; }
.article-thumb img { width: 100%; border-radius: var(--radius); }
.entry { font-size: 1.05rem; overflow-wrap: anywhere; }
.entry h2 { font-size: 1.4rem; margin-top: 1.6em; }
.entry h3 { font-size: 1.2rem; margin-top: 1.4em; }
.entry img, .entry video, .entry iframe { max-width: 100%; }
.entry table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.entry th, .entry td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.entry th { background: var(--bg); }
.entry blockquote { margin: 1.2em 0; padding: .4em 1em; border-left: 4px solid var(--accent); background: var(--bg); }
.tags { color: var(--muted); font-size: .9rem; }
.related { margin-top: 28px; }
.related h2 { font-size: 1.3rem; }

.cat-more { margin-top: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.cat-more summary { cursor: pointer; font-weight: 700; }

/* Сайдбар */
.side-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.side-title { font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid var(--accent); padding-bottom: 6px; }
.popular-list { margin: 0; padding-left: 1.2em; }
.popular-list li { margin-bottom: 8px; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list a { display: block; padding: 5px 0; text-decoration: none; border-bottom: 1px solid var(--line); }

/* Подвал */
.site-footer { background: var(--dark); color: #c9d1bd; padding: 24px 0; font-size: .9rem; }
.site-footer a { color: #e8ecdf; }
.footer-nav .menu { flex-wrap: wrap; margin-bottom: 8px; }
.footer-copy { margin: 0; }

@media (max-width: 899px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; }
}
@media (max-width: 600px) {
    .grid { grid-template-columns: 1fr; }
    .page-head h1, .article-head h1 { font-size: 1.5rem; }
    .card-hero .card-title { font-size: 1.3rem; }
    .article { padding: 14px; }
    .header-search { width: 100%; }
    .header-search input { flex: 1; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
