/*
Theme Name: Veteran Policy Theme (Gov Standard Final)
Author: Admin
Description: Тема, адаптована під дизайн-код (Наказ № 181) з шрифтами e-Ukraine
Version: 5.0 (Restored Original + Archive Grid Fix)
*/

/* 1. ШРИФТИ */
@font-face { font-family: 'e-Ukraine'; src: url('fonts/e-Ukraine-Light.otf') format('opentype'); font-weight: 300; font-style: normal; }
@font-face { font-family: 'e-Ukraine'; src: url('fonts/e-Ukraine-Regular.otf') format('opentype'); font-weight: 400; font-style: normal; }
@font-face { font-family: 'e-Ukraine'; src: url('fonts/e-Ukraine-Medium.otf') format('opentype'); font-weight: 500; font-style: normal; }
@font-face { font-family: 'e-Ukraine'; src: url('fonts/e-Ukraine-Bold.otf') format('opentype'); font-weight: 700; font-style: normal; }

/* 2. БАЗОВІ ЗМІННІ */
:root {
    --text-main: #000000;
    --text-gray: #454545;
    --bg-white: #FFFFFF;
    --bg-header: #E7EEF3;
    --accent-yellow: #FFB800;
    --border-color: #CCCCCC;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { background: var(--bg-white); color: var(--text-main); font-family: 'e-Ukraine', sans-serif; line-height: 1.5; font-weight: 300; font-size: 18px; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
h1, h2, h3, h4, h5 { font-family: 'e-Ukraine', sans-serif; font-weight: 400; margin-bottom: 24px; color: var(--text-main); }
a { color: var(--text-main); text-decoration: none; transition: 0.2s; }
a:hover { text-decoration: underline; }

/* 3. ВЕРХНЯ СМУЖКА */
.gov-top-bar { background: #fff; border-bottom: 1px solid var(--border-color); padding: 10px 0; font-size: 14px; }
.diia-link { display: flex; align-items: center; gap: 15px; color: #000; }
.diia-logo { font-weight: 700; font-size: 16px; }

/* 4. ШАПКА */
.header { background-color: var(--bg-header); padding: 30px 0; border-bottom: 1px solid var(--border-color); position: relative; z-index: 500; }
.header-flex { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.header-logo-part img { width: 70px; height: auto; display: block; }
.header-title-part { flex-grow: 1; padding: 0 30px; border-left: 1px solid #ccc; margin-left: 20px; }
.gov-subtitle { display: block; font-size: 15px; color: var(--text-gray); text-transform: uppercase; font-weight: 500; margin-bottom: 5px; letter-spacing: 0.05em; }
.gov-main-title { font-size: 28px; font-weight: 700; color: #000; line-height: 1.1; margin: 0; text-transform: uppercase; }
.header-tools-part { min-width: 200px; display: flex; justify-content: flex-end; }

/* 🔥 ФІКС ДОСТУПНОСТІ (Щоб панель була поверх усього) 🔥 */
.accessibility-panel { position: relative; z-index: 9999 !important; }
.access-btn-large { background-color: var(--accent-yellow); color: #000; border: 2px solid #000; padding: 12px 24px; font-family: 'e-Ukraine', sans-serif; font-weight: 700; font-size: 16px; text-transform: uppercase; cursor: pointer; display: flex; align-items: center; gap: 10px; border-radius: 6px; box-shadow: 4px 4px 0 rgba(0,0,0,0.15); transition: transform 0.1s; }
.access-btn-large:hover { transform: translateY(2px); box-shadow: 2px 2px 0 rgba(0,0,0,0.15); }

.access-controls { display: none; position: fixed !important; right: 20px !important; top: 80px !important; background: #fff; border: 3px solid #000; padding: 20px; width: 280px; z-index: 100000 !important; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.access-controls.open { display: block !important; }
.ac-title { font-weight: 700; margin-bottom: 8px; font-size: 14px; }
.ac-group { display: flex; gap: 5px; margin-bottom: 15px; }
.ac-group button { flex: 1; padding: 8px; border: 1px solid #ccc; background: #fff; cursor: pointer; font-weight: 500; }
.ac-group button:hover { background: #eee; }

/* 5. МЕНЮ */
.nav-wrapper { background: #fff; border-bottom: 1px solid var(--border-color); padding: 15px 0; }
.nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 30px; }
.nav ul li a { color: #000 !important; font-weight: 500; font-size: 16px; text-transform: uppercase; }
.nav ul li a:hover { color: var(--text-gray) !important; text-decoration: underline; }
#crumbs { margin-top: 15px; font-size: 14px; color: var(--text-gray); }
#crumbs a { color: var(--text-gray); text-decoration: underline; }

/* 6. СЛАЙДЕР */
.slider { width: 100%; max-width: 1100px; height: 500px; margin: 30px auto; position: relative; background: #fff; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.slides { height: 100%; width: 100%; }
.slide { display: none; height: 100%; width: 100%; }
.slide.active { display: block; }
.slide img { width: 100%; height: 100%; object-fit: contain; background: #fff; display: block; }
.prev, .next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0, 0, 0, 0.3); color: #fff; border: none; cursor: pointer; width: 45px; height: 45px; border-radius: 50%; font-size: 24px; display: flex; align-items: center; justify-content: center; transition: all 0.3s; z-index: 10; }
.next { right: 10px; } .prev { left: 10px; }
.prev:hover, .next:hover { background: #FFB800; color: #000; }
.slider-stop { position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%); z-index: 10; }
#stop { background: rgba(255, 255, 255, 0.8); color: #000; border: 1px solid #ccc; padding: 5px 15px; font-size: 12px; border-radius: 20px; cursor: pointer; font-weight: bold; }
#stop:hover { background: #FFB800; border-color: #FFB800; }

/* 7. КОНТЕНТ */
.region { padding: 48px 0; }
.region-cards { display: flex; gap: 32px; margin-top: 32px; flex-wrap: wrap; }
.card { flex: 1; min-width: 300px; background: #fff; border: 1px solid var(--border-color); padding: 32px; border-top: 4px solid var(--accent-yellow); transition: 0.2s; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; }
.info-details { width: 100%; margin-top: 20px; display: none; }
.info-content { background: var(--bg-light); border: 1px solid var(--border-color); padding: 30px; }

.news { background: var(--bg-light); padding: 48px 0; }
.news-list { display: flex; gap: 24px; flex-wrap: wrap; }

/* Стандартна картка (3 в ряд для головної) */
.news-item { background: #fff; border: 1px solid var(--border-color); width: calc(33.333% - 16px); display: flex; flex-direction: column; }
.news-item img { width: 100%; height: 200px; object-fit: cover; }
.news-item h3 { padding: 15px; font-size: 18px; font-weight: 500; }
.read-more { display: inline-block; margin: 15px; padding: 10px 24px; background: #000; color: #fff; font-weight: 500; }

/* Твої втрачені кнопки файлів! */
.wp-block-file__button { background: #000 !important; color: #fff !important; padding: 10px 20px !important; border-radius: 4px !important; }

/* 8. КАРТА */
.veteran-map-section { padding: 48px 0; background: #fff; border-top: 1px solid var(--border-color); }
.veteran-map-section h2 { text-align: center; margin-bottom: 20px; }
.map-responsive { overflow: hidden; padding-bottom: 56.25%; position: relative; height: 0; border: 1px solid var(--border-color); background: #f4f4f4; }
.map-responsive iframe { left: 0; top: 0; height: 100%; width: 100%; position: absolute; border: 0; }

/* 9. ФУТЕР */
.footer { background: #1D1D1D; color: #fff; padding: 60px 0 30px; border-top: 5px solid var(--accent-yellow); margin-top: 50px; }
.footer-content { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 40px; }
.footer-col { flex: 1; min-width: 250px; }
.footer-col h4 { color: var(--accent-yellow); font-size: 18px; margin-bottom: 20px; text-transform: uppercase; border-bottom: 1px solid #444; padding-bottom: 10px; display: inline-block; }
.footer-col p, .footer-col li a, .footer-col a { color: #e0e0e0 !important; font-size: 16px; line-height: 1.6; text-decoration: none; }
.footer-col a:hover { color: #fff !important; text-decoration: underline; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.social-btn { display: inline-block; padding: 10px 20px; border: 1px solid #fff; color: #fff !important; text-decoration: none; border-radius: 4px; font-weight: 500; transition: 0.3s; }
.social-btn:hover { background: #fff; color: #000 !important; }
.partners { padding: 40px 0; background: #fff; border-top: 1px solid #ccc; text-align: center; }
.partners h2 { margin-bottom: 30px; }
.partners-logos { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; }
.partners-logos img { height: 50px; filter: grayscale(100%); opacity: 0.8; }
.partners-logos img:hover { filter: grayscale(0); opacity: 1; }

/* КНОПКА ВГОРУ */
#toTop { display: none; position: fixed; bottom: 30px; right: 30px; z-index: 9999; background: var(--accent-yellow); color: #000; border: 2px solid #000; width: 50px; height: 50px; border-radius: 50%; font-size: 24px; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.3); transition: 0.3s; }
#toTop:hover { transform: translateY(-3px); }

/* 10. ВОДЯНИЙ ЗНАК */
body::before { content: "УПРАВЛІННЯ\AВЕТЕРАНСЬКОЇ ПОЛІТИКИ\AЗАКАРПАТСЬКА ОВА"; white-space: pre; text-align: center; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-15deg); font-family: 'e-Ukraine', sans-serif; font-size: 4vw; font-weight: 700; color: #000; opacity: 0.03; z-index: -9999; pointer-events: none; }

/* 11. КОНТРАСТНІ РЕЖИМИ */
body.contrast-bw { --bg-white: #fff; --bg-header: #fff; --text-main: #000; --accent-yellow: #000; --bg-light: #fff; }
body.contrast-bw * { background: #fff !important; color: #000 !important; border-color: #000 !important; box-shadow: none !important; }
body.contrast-bw img { filter: grayscale(100%); }

body.contrast-yb { --bg-white: #000; --bg-header: #000; --text-main: #FFFF00; --accent-yellow: #FFFF00; --bg-light: #000; }
body.contrast-yb, body.contrast-yb .header, body.contrast-yb .footer, body.contrast-yb .region, body.contrast-yb .nav-wrapper { background-color: #000 !important; color: #FFFF00 !important; }
body.contrast-yb .gov-main-title, body.contrast-yb .gov-subtitle, body.contrast-yb .diia-link, body.contrast-yb .nav ul li a, body.contrast-yb a { color: #FFFF00 !important; }
body.contrast-yb * { color: #FFFF00 !important; border-color: #FFFF00; }
body.contrast-yb .card, body.contrast-yb .news-item, body.contrast-yb .info-content, body.contrast-yb input, body.contrast-yb button { background-color: #000 !important; border: 1px solid #FFFF00 !important; }

/* 12. АДАПТИВНІСТЬ */
@media (max-width: 992px) {
    .header-flex { flex-direction: column; text-align: center; }
    .gov-main-title { font-size: 18px; line-height: 1.3; margin-bottom: 5px; }
    .gov-subtitle { font-size: 12px; }
    .header { padding: 15px 0; }
    .header-title-part { border-left: none; padding: 0; margin: 0; border-top: 1px solid #ccc; padding-top: 15px; margin-top: 10px; width: 100%; }
    .header-tools-part { width: 100%; justify-content: center; margin-top: 15px; }
    .access-btn-large { width: 100%; justify-content: center; }
    .nav ul { justify-content: center; }
    .region-cards, .news-list { flex-direction: column; }
    .news-item, .card { width: 100%; }
    .footer-content { flex-direction: column; text-align: center; }
    .footer-col h4 { border-bottom: none; }
}

/* 13. БЕЗПЕЧНІ СТИЛІ (ТАБЛИЦІ ТА КАРТКИ) */
.info-content table, .entry-content table, .region-cards table { width: 100%; border-collapse: collapse; margin: 20px 0; background: #fff; font-size: 15px; }
.info-content th, .info-content td, .entry-content th, .entry-content td, .region-cards th, .region-cards td { border: 1px solid #ccc; padding: 10px 15px; text-align: left; vertical-align: middle; }
.info-content th, .entry-content th, .region-cards th { background-color: #f2f2f2; font-weight: 700; color: #000; }
.info-content tr:nth-child(even), .entry-content tr:nth-child(even), .region-cards tr:nth-child(even) { background-color: #fafafa; }
.info-content tr:hover, .entry-content tr:hover, .region-cards tr:hover { background-color: #fffde7; }

.clickable-card { cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.clickable-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); border-color: var(--accent-yellow); z-index: 10; }
.card-arrow { display: inline-block; margin-top: 15px; font-weight: 700; font-size: 14px; color: #000; background: #FFB800; padding: 6px 12px; border-radius: 4px; text-transform: uppercase; }

@media (max-width: 768px) { div[style*="overflow-x: auto"] { width: 100%; overflow-x: scroll; -webkit-overflow-scrolling: touch; } }

/* 14. СТИЛІ ДЛЯ СТОРІНКИ "ВСІ НОВИНИ" */
.all-news-link-wrapper { margin-top: 40px; display: flex; justify-content: center; }
.btn-archive { display: inline-block; padding: 14px 32px; background-color: #000; color: #fff !important; font-family: 'e-Ukraine', sans-serif; font-weight: 500; font-size: 16px; text-transform: uppercase; transition: 0.3s ease; border: none; cursor: pointer; }
.btn-archive:hover { background-color: var(--accent-yellow); color: #000 !important; text-decoration: none; transform: translateY(-2px); }
.news-archive-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 50px; }
.navigation.pagination { margin: 40px 0; text-align: center; }
.navigation.pagination .nav-links { display: flex; justify-content: center; gap: 10px; }
.navigation.pagination .page-numbers { padding: 10px 15px; border: 1px solid var(--border-color); background: #fff; font-weight: 500; }
.navigation.pagination .page-numbers.current { background: var(--accent-yellow); border-color: #000; color: #000; }
@media (max-width: 992px) { .news-archive-grid { grid-template-columns: 1fr; } }

/* 🔥 ФІКС АРХІВУ (4 В РЯД) 🔥 */
.archive-grid { display: flex !important; flex-wrap: wrap !important; gap: 20px !important; }
.archive-grid .news-item { width: calc(25% - 15px) !important; margin-bottom: 20px; }
.archive-grid .news-item img { height: 160px !important; }
.archive-grid .news-item h3 { font-size: 16px !important; padding: 12px; }
@media (max-width: 992px) { .archive-grid .news-item { width: calc(50% - 10px) !important; } }
@media (max-width: 600px) { .archive-grid .news-item { width: 100% !important; } }