/*
Theme Name: ProstoWay Shoubiz
Author: GDB
Description: Adapted copy of prostowayfast for shoubiz.prostoway.com - logo, h1 and category slugs in index.php remapped to shoubiz show-business categories (Зірки, Музика, Кіно, Серіали, ТВ-шоу, Скандали, Інтерв'ю, Стиль зірок, Особисте життя). Базова колірна гама порталу (білий фон, фірмовий помаранчевий акцент) збережена.
Version: 1.0-shoubiz
*/

:root {
    --primary-color: #111;
    --accent-color: #ff6600; /* ProstoWay помаранчевий */
    --accent-hover: #e55c00;
    --bg-color: #fff;
    --text-color: #333;
    --sidebar-bg: #f9f9f9;
    --gap: 30px;
}

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

body {
    font-family: 'Rubik', sans-serif !important;
    color: var(--text-color);
    background: var(--bg-color);
    line-height: 1.6;
    margin: 0;
    overflow-x: hidden;
    width: 100%;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
a:hover { color: var(--accent-color); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 { 
    font-family: 'Rubik', sans-serif !important; 
    font-weight: 700; 
    margin-bottom: 15px;
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* --- HEADER --- */
.site-header {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 30px;
    background: #fff;
    position: relative;
    z-index: 1000;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap; /* Щоб елементи не падали в другий рядок на ПК */
}
.logo-img { max-height: 50px; width: auto; flex-shrink: 0; }

.back-to-main {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #888;
    text-decoration: none;
    padding: 4px 8px;
    margin-right: 12px;
    border-radius: 6px;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}
.back-to-main:hover { background: #f5f5f5; color: var(--accent-color); }
.back-to-main svg   { color: var(--accent-color); flex-shrink: 0; }
.back-to-main img   { width: 22px; height: 22px; display: block; border-radius: 4px; }

/* Гамбургер */
.mobile-menu-toggle { display: none; }

/* Меню на ПК — один ряд для 10 пунктів */
.main-navigation {
    flex: 1;
    margin: 0 20px;
    min-width: 0; /* дозволяє flex item стискатись при потребі */
}
.header-menu-list {
    display: flex;
    justify-content: center;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap; /* змушуємо один ряд */
}
.header-menu-list li a {
    text-decoration: none;
    color: #333;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.2px;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.header-menu-list li a:hover, .header-menu-list li.current-menu-item a { color: var(--accent-color); border-bottom-color: var(--accent-color); }

/* ПОШУК (ВИПРАВЛЕНО) */
.search-wrap { 
    position: relative; 
    z-index: 1000; 
    display: flex; 
    align-items: center; 
    height: 100%; 
    flex-shrink: 0;
}
.search-trigger { 
    cursor: pointer; 
    background: transparent; 
    border: none; 
    padding: 5px; 
    display: flex; 
    align-items: center; 
}
.search-trigger svg { stroke: var(--accent-color); }

/* Форма випадає рівно під шапкою */
.header-search-form { 
    display: none; 
    position: absolute; 
    right: 0; 
    top: 100%; /* Прив'язка до низу батька */
    margin-top: 15px; /* Невеликий відступ */
    background: #fff; 
    padding: 15px; 
    border: 1px solid #eee; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); 
    width: 280px; 
    border-radius: 5px; 
}
.header-search-form.active { display: flex; gap: 5px; }
.search-field { width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 4px; }
.search-submit { background: var(--accent-color); color: #fff; border: none; padding: 0 15px; border-radius: 4px; cursor: pointer; font-weight: bold; }

/* --- GRID LAYOUT --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: grid; gap: 40px; align-items: start; }
.news-sidebar { grid-area: sidebar; }
.content-grid, .single-post-content { grid-area: content; }

/* 1. Сайдбар ЗЛІВА (Архіви, Пошук, Автор) - ГОЛОВНОЇ ТУТ НЕМАЄ */
body.blog .container, body.archive .container, body.search .container, body.author .container {
    display: grid;
    gap: 40px;
    grid-template-columns: 300px 1fr; 
    grid-template-areas: "sidebar content";
    align-items: start;
}

/* 2. Сайдбар СПРАВА (Стаття, Сторінка) */
body.single .container, body.page .container {
    grid-template-columns: 1fr 300px;
    grid-template-areas: "content sidebar";
}

/* --- САЙДБАР --- */
.news-sidebar { background-color: transparent; padding: 0; height: fit-content; }
.news-sidebar h2 { font-size: 18px; font-weight: 900; text-transform: uppercase; margin-bottom: 15px; padding-left: 10px; border-left: 5px solid var(--accent-color); line-height: 1; color: #000; border-bottom: none; }
.news-list-scroll { background-color: var(--sidebar-bg); padding: 20px; border-radius: 8px; }
.sidebar-date-header { font-size: 14px; font-weight: 700; color: #000; margin-top: 20px; margin-bottom: 10px; opacity: 0.8; }
.sidebar-date-header:first-child { margin-top: 0; }
.sidebar-text-item { display: flex; gap: 10px; margin-bottom: 12px; align-items: baseline; line-height: 1.35; }
.sidebar-time { font-size: 13px; color: var(--accent-color); font-weight: 600; flex-shrink: 0; min-width: 38px; }
.sidebar-link { font-size: 15px; color: #222; font-weight: 400; text-decoration: none; }
.sidebar-link:hover { color: var(--accent-color); }

/* --- НОВІ БЛОКИ В САЙДБАРІ (Дім, Їжа, Поради) --- */

.sidebar-widgets {
    margin-top: 40px; /* Відступ від стрічки новин */
}

.sidebar-widget-block {
    margin-bottom: 30px;
    background: #fff;
    /* Якщо хочете фон як у стрічки, розкоментуйте: background: var(--sidebar-bg); padding: 15px; border-radius: 8px; */
}

.widget-title {
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 15px;
    border-left: 4px solid var(--accent-color);
    padding-left: 10px;
    line-height: 1;
}
.widget-title a {
    color: #000;
    text-decoration: none;
}

.sidebar-thumb-item {
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}
.sidebar-thumb-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar-thumb-link {
    display: flex;
    gap: 12px;
    align-items: center;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
}
.sidebar-thumb-link:hover {
    color: var(--accent-color);
}

.mini-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

/* --- ПОРТАЛЬНІ БЛОКИ --- */
.portal-section { margin-bottom: 50px; }
.section-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #eee; margin-bottom: 25px; padding-bottom: 10px; }
.section-title { font-size: 24px; font-weight: 800; text-transform: uppercase; color: #000; position: relative; }
.section-title::after { content: ''; position: absolute; bottom: -12px; left: 0; width: 100%; height: 2px; background: var(--accent-color); }
.section-more { font-size: 13px; font-weight: 700; text-transform: uppercase; color: #999; }
.section-more:hover { color: var(--accent-color); }

.portal-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.portal-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }

.portal-card { display: flex; flex-direction: column; }
.portal-thumb { width: 100%; height: 180px; object-fit: cover; border-radius: 6px; margin-bottom: 12px; background: #f0f0f0; transition: opacity 0.2s; }
.portal-card:hover .portal-thumb { opacity: 0.9; }
.portal-card h3 { font-size: 16px; line-height: 1.4; margin: 0; font-weight: 700; }
.portal-card a { color: #222; }
.portal-card a:hover { color: var(--accent-color); }
.portal-card-lg .portal-thumb { height: 280px; }
.portal-card-lg h3 { font-size: 22px; }
.portal-excerpt { font-size: 15px; color: #555; margin-top: 10px; }

/* --- SINGLE POST --- */
.single-post-content h1 { font-size: 34px; line-height: 1.2; margin-top: 0; }
.single-meta { display: flex; justify-content: center; align-items: center; gap: 20px; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid #eee; flex-wrap: wrap; }
.meta-author { display: flex; align-items: center; gap: 10px; }
.meta-author img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: block; }
.author-name-link { font-weight: 700; color: var(--accent-color); text-decoration: none; font-size: 16px; }
.meta-date { color: #999; font-size: 14px; }

.single-featured-wrap { width: 100%; height: 500px; overflow: hidden; border-radius: 8px; margin-bottom: 30px; }
.single-featured-wrap img { width: 100%; height: 100%; object-fit: cover; }

/* --- СТИЛІ ДЛЯ КОНТЕНТУ WORDPRESS (ВИПРАВЛЕННЯ КАРТИНОК ТА ПОСИЛАНЬ) --- */
.entry-content { font-size: 18px; line-height: 1.7; color: #222; }
.entry-content p { margin-bottom: 20px; }
.entry-content h2 { font-size: 24px; margin-top: 40px; margin-bottom: 20px; color: #000; }
.entry-content blockquote { border-left: 5px solid var(--accent-color); background: #f9f9f9; padding: 20px; margin: 30px 0; font-style: italic; }
.entry-content ul, .entry-content ol { margin: 0 0 20px 25px; list-style-position: outside; }
.entry-content li { margin-bottom: 8px; }

/* Виправлення ховеру заголовків */
.modern-card:hover .card-title,
.grid-item:hover .card-title,
.portal-card:hover h3 {
    color: var(--accent-color) !important;
}

/* 1. Посилання в тексті - ЗЕЛЕНІ */
.entry-content a {
    color: var(--accent-color);
    text-decoration: underline;
    font-weight: 500;
}
.entry-content a:hover {
    color: var(--accent-hover);
    text-decoration: none;
}

/* 2. Вирівнювання картинок (Align Center/Left/Right) */
.entry-content img.aligncenter, 
.entry-content .aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
}
.entry-content img.alignright, 
.entry-content .alignright {
    float: right;
    margin-left: 20px;
    margin-bottom: 20px;
}
.entry-content img.alignleft, 
.entry-content .alignleft {
    float: left;
    margin-right: 20px;
    margin-bottom: 20px;
}
/* Очистка потоку після картинок */
.entry-content::after { content: ""; display: table; clear: both; }


/* --- СТОРАНКА АВТОРА & АРХІВИ --- */
.author-profile-box { display: flex; gap: 30px; background: #f9f9f9; padding: 30px; border-radius: 12px; margin-bottom: 40px; align-items: flex-start; }
.author-avatar-wrap img { width: 500px !important; height: 150px !important; border-radius: 50% !important; object-fit: cover !important; border: 4px solid #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.1); margin-bottom: 10px; }
.author-info h1 { margin-top: 0; font-size: 28px; line-height: 1.2; }
.author-bio { font-size: 15px; color: #555; margin-bottom: 15px; line-height: 1.6; }
.author-socials { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.author-socials svg, .social-btn svg { width: 18px !important; height: 18px !important; display: block; }
.social-btn { display: flex; align-items: center; justify-content: center; width: 36px !important; height: 36px !important; border-radius: 50%; background: #e0e0e0; color: #333; transition: 0.2s all; text-decoration: none; flex-shrink: 0; }
.social-btn:hover { background: var(--accent-color); color: #fff; transform: translateY(-2px); }

body.author .posts-grid, body.archive .posts-grid, body.search .posts-grid { 
    display: grid; grid-template-columns: repeat(3, 1fr) !important; gap: 25px; 
}
body.author .post-card img, body.archive .post-card img, body.search .post-card img { 
    height: 160px !important; width: 100%; object-fit: cover; margin-bottom: 10px; border-radius: 6px; 
}
body.author .post-card h3, body.archive .post-card h3, body.search .post-card h3 { 
    font-size: 16px; font-weight: 700; line-height: 1.4; margin: 0; 
}

/* --- ПАГІНАЦІЯ --- */
.pagination { margin: 40px 0 60px; display: flex; justify-content: center; }
.nav-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; }
.page-numbers { display: flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px; background: #fff; border: 1px solid #ddd; border-radius: 4px; color: #333; text-decoration: none; font-weight: 700; font-size: 14px; transition: 0.2s; }
.page-numbers.current { background: var(--accent-color); color: #fff; border-color: var(--accent-color); }
.page-numbers:hover:not(.current) { background: #f0f0f0; border-color: #ccc; }
.page-numbers.dots { border: none; background: transparent; color: #999; }

/* --- СТОРІНКА 404 (ОНОВЛЕНА) --- */

.error-404-wrap {
    text-align: center;
    padding: 60px 0;
    width: 100%;
}

/* Велика цифра 404 */
.title-404 {
    font-size: 120px;
    line-height: 1;
    color: var(--accent-color); /* Зелений */
    margin-bottom: 10px;
    font-weight: 800;
}

.error-404-wrap h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

.error-404-wrap p {
    color: #666;
    margin-bottom: 30px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    font-size: 16px;
}

/* Кнопка */
.btn-404 {
    background: var(--accent-color);
    color: #fff !important;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 700;
    display: inline-block;
    text-transform: uppercase;
    text-decoration: none;
    margin-bottom: 60px;
    transition: 0.2s;
}
.btn-404:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

/* Блок "Свіжі публікації" */
.related-posts {
    border-top: 1px solid #eee;
    padding-top: 40px;
}

.related-title {
    margin-bottom: 30px;
    display: block;
    font-weight: 700;
    color: #999;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 14px;
}

/* Сітка 4 колонки */
.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    text-align: left; /* Текст заголовків зліва */
}

/* Картка статті на 404 */
.related-card img {
    width: 100%;
    height: 160px; /* Фіксована висота, як скрізь */
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
    transition: opacity 0.2s;
}
.related-card:hover img {
    opacity: 0.9;
}

.related-card h4 {
    font-size: 16px;
    line-height: 1.4;
    margin: 0;
    font-weight: 700;
}
.related-card a {
    text-decoration: none;
    color: #333;
}
.related-card a:hover {
    color: var(--accent-color);
}

/* Мобільна версія 404 */
@media (max-width: 900px) {
    .title-404 { font-size: 80px; }
    .related-grid {
        grid-template-columns: 1fr; /* Одна колонка на телефоні */
    }
}

/* --- FOOTER --- */
.site-footer { margin-top: 60px; background: #fff; color: #333; border-top: 1px solid #eee; padding: 30px 0; font-size: 13px; }
.footer-flex-row { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 30px; }
.footer-left { flex: 1; min-width: 200px; }
.copyright { font-weight: 700; margin-bottom: 10px; color: #000; }
.footer-center { flex: 2; text-align: center; min-width: 300px; }
.footer-email { font-weight: 800; margin-bottom: 5px; color: #000; }
.footer-email a { text-decoration: none; color: #000; }
.footer-warning { color: #777; line-height: 1.4; font-size: 12px; margin-bottom: 15px; }
.footer-menu-list { list-style: none; padding: 0; margin: 0; display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.footer-menu-list li a { text-decoration: none; color: #000; font-weight: 800; font-size: 14px; text-transform: uppercase; }
.footer-menu-list li a:hover { color: var(--accent-color); }
.footer-right { flex: 1; display: flex; justify-content: flex-end; min-width: 150px; }
.footer-socials { display: flex; gap: 15px; }
.footer-socials a { color: #999; transition: 0.2s; display: flex; align-items: center; }
.footer-socials a:hover { color: var(--accent-color); transform: translateY(-2px); }
.footer-socials svg { width: 24px; height: 24px; }

/* --- MOBILE VERSION --- */
@media (max-width: 900px) {
    .container { display: flex !important; flex-direction: column; padding: 0 20px !important; width: 100%; overflow-x: hidden; }
    
    /* Шапка мобільна */
    .header-inner { flex-wrap: wrap; padding: 0 15px; } /* Дозволяємо перенесення */
    .logo-link { order: 1; margin-right: auto; }
    .search-wrap { order: 2; margin-right: 15px; }
    
    .mobile-menu-toggle { 
        display: flex; flex-direction: column; justify-content: space-between; 
        width: 30px; height: 20px; 
        background: transparent; border: none; cursor: pointer; 
        order: 3; z-index: 2000;
    }
    .mobile-menu-toggle span { width: 100%; height: 3px; background: var(--accent-color); border-radius: 2px; }
    
    .main-navigation { display: none; width: 100%; order: 4; margin-top: 15px; border-top: 1px solid #eee; }
    .main-navigation.open { display: block; }
    .header-menu-list { flex-direction: column; gap: 0; }
    .header-menu-list li a { display: block; padding: 12px 0; border-bottom: 1px solid #f9f9f9; text-align: center; }

    /* Порядок блоків */
    body.single .single-post-content, body.archive .content-grid, body.search .content-grid, body.author .content-grid, body.page .single-post-content { order: 1; width: 100%; }
    body.single .news-sidebar, body.archive .news-sidebar, body.search .news-sidebar, body.author .news-sidebar, body.page .news-sidebar { order: 2; width: 100%; margin-top: 30px; border-top: 5px solid #f4f4f4; padding-top: 20px; }

    /* Адаптація автора і рубрик */
    .author-profile-box { flex-direction: column; text-align: center; }
    body.author .posts-grid, body.archive .posts-grid, body.search .posts-grid { grid-template-columns: 1fr !important; }
    
    .portal-grid-4, .portal-grid-2 { grid-template-columns: 1fr; gap: 25px; }
    .single-featured-wrap { height: 250px !important; }
    h1 { font-size: 26px; }
    .single-meta { flex-direction: column; gap: 10px; text-align: center; }
    
    /* Футер */
    .footer-flex-row { flex-direction: column; align-items: center; text-align: center; }
    .footer-right { justify-content: center; order: 3; }
    .footer-left { order: 2; margin-top: 10px; }
    .footer-center { order: 1; }
    .footer-menu-list { flex-direction: column; gap: 10px; }
}