/*
Theme Name: PortalNews Ultimate UA Engine
Theme URI: https://portalnews.kr.ua/
Description: Повністю українізована версія (UA). Швидкість рухомого рядка зменшено вдвічі для комфортного читання. Додано віджет живої дати та часу. У сайдбар інтегровані автоматичні графіки криптовалют (BTC, ETH) та актуальні курси валют (USD, EUR, PLN), які оновлюються самі.
Version: 1.3.0
Author: Gemini Developer
Text Domain: portalnews-ua
*/

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; background: #f4f6f9; color: #1e293b; line-height: 1.6; overflow-x: hidden; } /* Забороняємо гуляння сторінки вліво-вправо */
a { color: #0284c7; text-decoration: none; transition: color 0.1s ease; }
a:hover { color: #0369a1; text-decoration: underline; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; display: flex; gap: 30px; width: 100%; }

/* Шапка та інфо-панель */
header { background: #ffffff; border-bottom: 1px solid #e2e8f0; padding: 15px 0; box-shadow: 0 2px 10px rgba(0,0,0,0.05); width: 100%; }
.header-wrap { display: flex; justify-content: space-between; align-items: center; max-width: 1240px; margin: 0 auto; padding: 0 20px; flex-wrap: wrap; gap: 10px; }
.logo a { font-size: 24px; font-weight: 800; color: #0f172a; text-transform: uppercase; }
.logo span { color: #0284c7; }

/* Блок дати та часу */
.header-datetime { font-size: 13px; color: #64748b; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.header-datetime span { color: #0284c7; font-weight: 700; }

nav { max-width: 100%; overflow-x: auto; }
nav ul { display: flex; list-style: none; gap: 20px; white-space: nowrap; }
nav a { color: #475569; font-weight: 700; font-size: 14px; text-transform: uppercase; }

/* УПО КУЛЬНИЙ РУХОМИЙ РЯДОК */
.news-ticker-container { background: #0f172a; color: #ffffff; height: 40px; display: flex; align-items: center; overflow: hidden; border-bottom: 3px solid #0284c7; font-size: 13px; font-weight: 700; width: 100%; position: relative; }
.ticker-label { background: #0284c7; padding: 0 15px; height: 100%; display: flex; align-items: center; text-transform: uppercase; letter-spacing: 0.5px; z-index: 10; white-space: nowrap; box-shadow: 5px 0 15px rgba(0,0,0,0.3); }
.ticker-wrap { flex: 1; overflow: hidden; display: flex; align-items: center; position: relative; width: 100%; }
.ticker-track { display: flex; white-space: nowrap; padding-left: 100%; animation: readyTicker 50s linear infinite; }
.ticker-track:hover { animation-play-state: paused; }
.ticker-item { padding: 0 30px; display: flex; align-items: center; color: #e2e8f0; }
.ticker-item::before { content: '⚡'; margin-right: 10px; color: #0284c7; }
.ticker-item a { color: #ffffff; }
.ticker-item a:hover { color: #38bdf8; }

@keyframes readyTicker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

/* Плитки сторінок */
.top-pages-bar { background: #e2e8f0; padding: 30px 0; margin-bottom: 30px; border-bottom: 1px solid #cbd5e1; width: 100%; overflow: hidden; }
.pages-title-label { font-size: 12px; color: #475569; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 15px; }
.pages-tiles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 15px; }
.page-tile-item { background: #ffffff; border: 1px solid #cbd5e1; border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.page-tile-item:hover { border-color: #0284c7; transform: translateY(-1px); }
.page-tile-thumb { height: 130px; background: #cbd5e1; overflow: hidden; }
.page-tile-thumb img { width: 100%; height: 100%; object-fit: cover; }
.page-tile-content { padding: 15px; flex: 1; }
.page-tile-item h3 { font-size: 15px; font-weight: 700; color: #0f172a; margin-bottom: 5px; }
.page-tile-item p { font-size: 13px; color: #64748b; line-height: 1.4; }

/* Каркас контенту */
main { flex: 1; min-width: 0; width: 100%; }
aside { 
    width: 320px; 
    flex-shrink: 0; 
    display: flex; 
    flex-direction: column; 
    gap: 20px; 
    position: -webkit-sticky;
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

.block-heading { font-size: 15px; font-weight: 800; text-transform: uppercase; color: #0f172a; border-left: 4px solid #0284c7; padding-left: 10px; margin: 30px 0 15px; }

/* Формат по замовчуванню: Список (Перші 5) */
.single-row-list { display: flex; flex-direction: column; gap: 15px; margin-bottom: 30px; }
.single-row-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 15px; display: flex; gap: 20px; align-items: center; }
.single-row-thumb { width: 140px; height: 95px; border-radius: 6px; overflow: hidden; flex-shrink: 0; background: #e2e8f0; }
.single-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.single-row-content { flex: 1; min-width: 0; }
.single-row-meta { font-size: 11px; color: #94a3b8; margin-bottom: 4px; }
.single-row-title { font-size: 17px; font-weight: 700; line-height: 1.4; word-wrap: break-word; }
.single-row-title a { color: #0f172a; }
.single-row-excerpt { font-size: 13.5px; color: #475569; margin-top: 5px; }

/* Формат: Сітка (Решта) */
.news-blocks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 15px; }
.grid-block-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.grid-block-thumb { height: 130px; background: #e2e8f0; overflow: hidden; }
.grid-block-thumb img { width: 100%; height: 100%; object-fit: cover; }
.grid-block-content { padding: 12px; flex: 1; min-width: 0; }
.grid-block-meta { font-size: 10px; color: #94a3b8; margin-bottom: 4px; }
.grid-block-title { font-size: 14px; font-weight: 700; line-height: 1.4; word-wrap: break-word; }
.grid-block-title a { color: #0f172a; }

/* Сайдбар блоки */
.sidebar-widget { background: #ffffff; border: 1px solid #e2e8f0; padding: 20px; border-radius: 8px; }
.widget-head { font-size: 13px; font-weight: 800; text-transform: uppercase; color: #0f172a; margin-bottom: 15px; padding-bottom: 5px; border-bottom: 2px solid #0284c7; }
.side-posts-list { display: flex; flex-direction: column; gap: 12px; }
.side-post-item { display: flex; gap: 12px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid #f1f5f9; }
.side-post-item:last-child { border-bottom: none; padding-bottom: 0; }
.side-post-thumb { width: 55px; height: 55px; border-radius: 4px; overflow: hidden; flex-shrink: 0; background: #e2e8f0; }
.side-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.side-post-title { font-size: 13px; font-weight: 700; line-height: 1.3; }
.side-post-title a { color: #1e293b; }

/* Фінансові інформери у сайдбарі */
.currency-table { width: 100%; border-collapse: collapse; font-size: 13px; font-weight: 600; }
.currency-table td { padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.currency-table tr:last-child td { border-bottom: none; }
.cur-name { color: #0f172a; display: flex; align-items: center; gap: 6px; }
.cur-val { text-align: right; color: #16a34a; }

/* Одиночна стаття */
.main-article-box { background: #ffffff; border: 1px solid #e2e8f0; padding: 35px; border-radius: 8px; }
.main-article-title { font-size: 28px; font-weight: 800; color: #0f172a; line-height: 1.3; margin-bottom: 12px; }
.main-article-meta { font-size: 12px; color: #64748b; margin-bottom: 25px; padding-bottom: 10px; border-bottom: 1px solid #f1f5f9; }
.main-article-content { font-size: 16px; line-height: 1.65; color: #334155; }
.main-article-content p { margin-bottom: 18px; }
.main-article-content img { max-width: 100%; height: auto; display: block; margin: 20px auto; border-radius: 6px; }

.auto-seo-ring { margin-top: 40px; background: #f0fdf4; border: 1px solid #bbf7d0; padding: 20px; border-radius: 8px; display: flex; align-items: center; gap: 15px; }
.auto-seo-ring-thumb { width: 60px; height: 60px; border-radius: 4px; overflow: hidden; flex-shrink: 0; background: #e2e8f0; }
.auto-seo-ring-thumb img { width: 100%; height: 100%; object-fit: cover; }
.auto-seo-ring-label { font-size: 11px; color: #16a34a; font-weight: 800; text-transform: uppercase; display: block; margin-bottom: 2px; }
.auto-seo-ring-title { font-size: 14px; font-weight: 700; color: #0f172a; }

footer { background: #0f172a; color: #94a3b8; padding: 30px 0; margin-top: 60px; text-align: center; font-size: 13px; border-top: 4px solid #0284c7; width: 100%; }

/* Мобільна адаптація — повне виправлення рухомого рядка та сіток */
@media (max-width: 992px) {
    .container { flex-direction: column; padding: 0 15px; gap: 20px; }
    aside { width: 100%; position: static !important; align-self: auto !important; }
    .header-wrap { flex-direction: column; text-align: center; }
    .single-row-card { flex-direction: column; align-items: flex-start; gap: 12px; }
    .single-row-thumb { width: 100%; height: 180px; }
    .pages-tiles-grid { grid-template-columns: 1fr; }
    .main-article-box { padding: 20px 15px; }
    .main-article-title { font-size: 22px; }
}