/**
Theme Name: BredAstra
Author: Bredoed
Author URI: http://wpastra.com/about/
Description: Тема на базе Astra со своими настройками.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bredastra
Template: astra
*/

body.page {
    background-color: #fff7e6;
}


/* 1. Сброс стилей Astra для иконочного меню */
.main-header-menu .menu-item[class*="icon-"] {
    margin: 0;
    padding: 0;
}


.main-header-menu .menu-item[class*="icon-"] a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    margin: 0;
}


/* 2. Контейнер меню: базовые настройки для мобильных */
.main-header-menu {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-evenly !important; /* Равномерное распределение на мобильных */
    align-items: center !important;
    width: 100% !important;
    max-width: 357px !important; /* Ширина для мобильных (как 7 иконок) */
    margin: 0 auto !important;
}

/* 2.1. Настройки для ПК: больше воздуха */
@media (min-width: 768px) {
    .main-header-menu {
        max-width: 500px !important; /* Увеличиваем ширину контейнера на ПК */
        gap: 20px !important; /* Фиксированные отступы между иконками */
        justify-content: center !important; /* Центрируем с отступами */
    }
}


/* 3. Базовые стили для всех SVG в меню */
.main-header-menu .menu-item[class*="icon-"] svg {
    width: 51px;
    height: 51px;
    color: #82C134 !important;
    fill: currentColor !important;
    transition: color 0.2s ease, fill 0.2s ease, transform 0.1s ease;
    display: block;
}


/* 4. Активное состояние (текущая страница WordPress) */
.main-header-menu .menu-item[class*="icon-"].current-menu-item svg,
.main-header-menu .menu-item[class*="icon-"].current_page_item svg {
    color: #ffffff !important;
    fill: currentColor !important;
}


/* 5. Тактильный отклик для мобильных (момент нажатия) */
.main-header-menu .menu-item[class*="icon-"] a:active svg {
    transform: scale(0.90);
}


/* 6. Hover-эффект ТОЛЬКО для устройств с мышью (ПК) */
@media (hover: hover) {
    .main-header-menu .menu-item[class*="icon-"] a:hover svg {
        color: #FF6600 !important;
        fill: currentColor !important;
        transform: scale(1.08);
    }
}


/* 7. Убираем подчеркивание и границы у иконок меню */
.main-header-menu .menu-item[class*="icon-"] a,
.main-header-menu .menu-item[class*="icon-"] a:visited,
.main-header-menu .menu-item[class*="icon-"] a:hover,
.main-header-menu .menu-item[class*="icon-"] a:focus,
.main-header-menu .menu-item[class*="icon-"] a:active {
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    outline: none !important;
}


.main-header-menu .menu-item[class*="icon-"] svg {
    text-decoration: none !important;
}


/* 8. Доступность: текст виден только роботам и скринридерам */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* 9. Адаптация для мобильных */
.ast-header-break-point .main-header-menu,
.ast-header-break-point .main-navigation {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-evenly !important;
}


.ast-header-break-point .main-header-bar .main-header-bar-navigation {
    display: flex !important;
}


.ast-header-break-point .ast-button-wrap .menu-toggle {
    display: none !important;
}


/* 10. Уменьшаем иконки на очень узких экранах */
@media (max-width: 400px) {
    .main-header-menu .menu-item[class*="icon-"] svg {
        width: 44px !important;
        height: 44px !important;
    }
}

/* 11. Блок стилей текста слогана в футере для НЕСУСВЕТного */
.site-footer .slogan {
    font-family: inherit;
    font-size: 1.5rem;
    letter-spacing: 0.08em;
    color: #ffffff;
    text-align: center;
/*    margin: 0.5rem 0;*/
    opacity: 0.85;
}
/* === АККОРДЕОН === */

/* Скрываем иконку "+" */
.wp-block-accordion-heading__toggle-icon {
    display: none !important;
}

/* Убираем подчёркивание во всех состояниях */
/* ===== Аккордеон: базовая очистка ===== */
.wp-block-accordion-heading__toggle,
.wp-block-accordion-heading__toggle-title,
.wp-block-accordion-heading__toggle:link,
.wp-block-accordion-heading__toggle:visited,
.wp-block-accordion-heading__toggle:hover,
.wp-block-accordion-heading__toggle:active,
.wp-block-accordion-heading__toggle:focus {
    text-decoration: none !important;
    text-underline-offset: 0;
    background: #ffffff !important;
    background-color: #ffffff !important;
    box-shadow: none !important;
}

/* Компенсируем правый отступ, убрав иконку */
.wp-block-accordion-heading__toggle {
    padding-right: var(--wp--preset--spacing--50) !important;
}

/* ===== Цвет текста только для состояний ===== */
/* Посещённая ссылка — тёмно-зелёный */
.wp-block-accordion-heading__toggle:visited {
    color: var(--wp--preset--color--ast-global-color-8) !important;
}

/* При наведении / фокусе / активации — тёмно-зелёный, фон белый */
.wp-block-accordion-heading__toggle:hover,
.wp-block-accordion-heading__toggle:active,
.wp-block-accordion-heading__toggle:focus {
    color: var(--wp--preset--color--ast-global-color-8) !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
}

/* === Стили для стихотворений === */

.poem-content {
    font-family: Georgia, serif;
    font-size: 1.1em;
    line-height: 1.8;
    white-space: pre-wrap; /* сохраняет переносы строк */
    margin: 2em 0;
}

.poem-content p {
    margin: 0.5em 0;
}

/* Бейджик 18+ */
.badge-18 {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #c0392b;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    line-height: 1;
    z-index: 10;
}

.single-poem {
    position: relative;
}

/* Предисловие */
.poem-preface {
    font-style: italic;
    color: #666;
    margin: 1em 0 2em;
    padding-left: 1em;
    border-left: 2px solid #ddd;
}

/* Сноска */
.poem-note {
    font-size: 0.9em;
    color: #888;
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px solid #eee;
    font-style: italic;
}

/* Классы (метки) */
.poem-classes {
    margin-top: 2em;
}

.poem-class-tag {
    display: inline-block;
    background: #f0f0f0;
    color: #333;
    padding: 3px 10px;
    margin: 3px 5px 3px 0;
    border-radius: 12px;
    font-size: 0.85em;
    text-decoration: none;
}

.poem-class-tag:hover {
    background: #e0e0e0;
}

/* Архив стихов */
.poems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2em;
    margin: 2em 0;
}

.poem-card {
    border: 1px solid #eee;
    padding: 1.5em;
    border-radius: 4px;
}

.poem-card h2 {
    font-size: 1.2em;
    margin-bottom: 0.5em;
}

.poem-card h2 a {
    text-decoration: none;
    color: #333;
}

.poem-card h2 a:hover {
    color: #0073aa;
}

.poem-excerpt {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 1em;
}

.poem-meta {
    font-size: 0.85em;
    color: #999;
}

/* ============================================================
   СТРАНИЦА ПОИСКА — единый блок стилей
   ============================================================ */

/* --- 1. Контейнер страницы (70% ширины по центру) --- */
.search-results-wrapper {
    max-width: 70%;
    margin: 0 auto;
}

/* --- 2. Заголовок страницы поиска --- */
.custom-search-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #82c134;
}
.custom-search-header .search-query {
    color: #555;
    font-style: italic;
    font-weight: 400;
}

/* --- 3. Карточка результата поиска --- */
.custom-search-result {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #82c134;
}
.custom-search-result:last-child {
    border-bottom: none;
}

/* 3.1. Заголовок записи */
.custom-search-result .entry-title {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
    font-weight: 500;
    line-height: 1.3;
}
.custom-search-result .entry-title a {
    text-decoration: none;
    color: #222;
    transition: color 0.3s ease;
}
.custom-search-result .entry-title a:hover {
    color: var(--wp--preset--color--ast-global-color-1);
}

/* 3.2. Отрывок / текст стихотворения */
.custom-search-result .entry-summary {
    font-size: 1rem;
    line-height: 1.2;
    color: #444;
    margin-bottom: 1rem;
    white-space: pre-wrap; /* сохраняем переносы строк в стихах */
}

/* 3.3. Строка "дата + ссылка" на одной линии */
.entry-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 0.5rem;
}
.entry-meta-row .published {
    font-size: 0.85rem;
    color: #888;
}
.entry-meta-row .read-more-link {
    font-size: 0.9rem;
    text-decoration: none;
    border-bottom: 1px dotted #82c134;
    color: #ff6600;
    white-space: nowrap;
    transition: all 0.3s ease;
}
.entry-meta-row .read-more-link:hover {
    border-bottom-style: solid;
    color: var(--wp--preset--color--ast-global-color-1);
}

/* --- 4. Пагинация --- */
.custom-search-pagination {
    text-align: center;
    margin-top: 2rem;
}

/* --- 5. Блок "Ничего не найдено" --- */
.custom-no-results {
    text-align: center;
    padding: 2rem 0;
}
.custom-no-results .page-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}
.custom-no-results .page-content p {
    font-size: 1rem;
    color: #555;
    margin-bottom: 1.5rem;
}

/* --- 6. Чистая форма поиска (без мусора Astra) --- */
.clean-custom-search-form {
    display: flex;
    gap: 0;
    max-width: 450px;
    margin: 0 auto;
    background: transparent !important;
    border: none !important;
}

/* 6.1. Поле ввода */
.clean-custom-search-form .clean-search-field {
    flex: 1;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    color: #333;
    background-color: #fff;
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 4px 0 0 4px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.clean-custom-search-form .clean-search-field:focus {
    border-color: #82c134;
    box-shadow: 0 0 0 2px rgba(130, 193, 52, 0.1);
}
.clean-custom-search-form .clean-search-field::placeholder {
    color: #999;
    font-style: italic;
}

/* 6.2. Кнопка "Найти" */
.clean-custom-search-form .clean-search-submit {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
    background-color: #82c134;
    border: 1px solid #82c134;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}
.clean-custom-search-form .clean-search-submit:hover {
    background-color: #6da828;
    border-color: #6da828;
}

/* 6.3. Гарантированно убираем иконки/псевдоэлементы от темы */
.clean-custom-search-form .clean-search-submit::before,
.clean-custom-search-form .clean-search-submit::after,
.clean-custom-search-form .clean-search-submit svg,
.clean-custom-search-form .clean-search-submit .ast-icon {
    display: none !important;
    content: "" !important;
}

/* 6.4. Скрываем технический label для скринридеров */
.clean-custom-search-form .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- 7. Принудительное скрытие мусорных форм Astra --- */
.custom-no-results .search-form:not(.clean-custom-search-form),
.custom-no-results .ast-search-form {
    display: none !important;
}

/* ============================================================
   АДАПТИВНОСТЬ
   ============================================================ */
@media (max-width: 768px) {
    .search-results-wrapper {
        max-width: 90%;
    }
    .entry-meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .clean-custom-search-form {
        max-width: 100%;
    }
}

/* ==========================================================================
   Стили для архива стихов и шорткода случайной выборки
   ========================================================================== */

/* Общий контейнер для списка стихов */
.poems-archive {
    max-width: 800px;
    margin: 0 auto;
    color: #3a3a3a;
}

/* Вводный текст перед блоком стихов */
.archive-intro {
    font-weight: 300;
    font-style: italic;
    color: #666666;
    margin: 0 0 2em 0;
}

/* Карточка одного стихотворения */
.poem {
    position: relative;
    background: #ffffff;
    padding: 1.5em 2em;
    margin-bottom: 1em;
    border-radius: 4px;
    border: 1px solid #eaeaea;
}

/* Убираем нижний отступ у последней карточки в списке */
.poem:last-child {
    margin-bottom: 0;
}

/* Название (Заголовок) стихотворения */
.poem .entry-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: #222222;
    margin: 0 0 0.5em 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* Предисловие или эпиграф к стиху */
.poem .poem-preface {
    font-weight: 300;
    font-style: italic;
    color: #666666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 1.5em 0;
}

/* Основной текст стихотворения */
.poem .entry-content.clear {
    font-size: 1.05rem;
    color: #333333;
    margin: 1.5em 0;
}

/* Сброс лишних отступов у абзацев внутри текста */
.poem .entry-content.clear p {
    margin-bottom: 0;
}

/* Сноски, примечания автора внизу стиха */
.poem .poem-note {
    font-weight: 300;
    font-style: italic;
    color: #666666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-top: 2em;
    padding-top: 1.5em;
    border-top: 1px solid #f0f0f0;
}

/* Мета-панель (дата и иконки) */
.poem .poem-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 2em;
    padding-top: 1.5em;
    border-top: 1px solid #f0f0f0;
    font-size: 0.9rem;
    color: #747474;
    font-weight: 400;
}

/* Контейнер для SVG-иконок классов */
.poem .poem-meta .class-icons {
    display: inline-flex;
    gap: 10px;
    margin-left: 4px;
}

/* Сами иконки SVG */
.poem .poem-meta .class-icons svg {
    width: 40px;
    height: 40px;
    color: #999999;
    transition: color 0.2s ease, transform 0.2s ease;
}

/* Анимация при наведении на иконку */
.poem .poem-meta .class-icons svg:hover {
    color: #ff6600;
    transform: scale(1.05);
}

/* Специфический отступ для карточки 18+, чтобы текст не налезал на бэйдж */
.poem.is-adult {
    padding-right: 3.5em;
}

/* Бэйдж (плашка) 18+ */
.poem .age-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--clobal-color-0, #ff6600);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 0 4px 0 8px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ==========================================================================
   Стили для обычной постраничной навигации (Группы)
   ========================================================================== */

.poems-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 3em 0;
}

.poems-nav a, 
.poems-nav span {
    padding: 8px 14px;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    text-decoration: none;
    color: #555555;
    font-size: 0.9rem;
    background: #ffffff;
    transition: all 0.2s;
}

.poems-nav a:hover {
    border-color: #3a3a3a;
    color: #222222;
}

.poems-nav span.current {
    background: #3a3a3a;
    color: #ffffff;
    border-color: #3a3a3a;
}

/* ==========================================================================
   Стили для кнопки получения новых случайных стихов (Классы)
   ========================================================================== */

/* Блок-обертка для центрирования кнопки */
.poems-random-action {
    display: flex;
    justify-content: center;
    margin: 3em 0;
}

/* Кнопка "Перемешать / Нажми еще" */
.poem-reload-btn {
    padding: 12px 28px;
    background: #455d2b;
    color: #ffffff;
    border: 1px solid #455d2b;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease-in-out;
}

/* Эффект при наведении на кнопку */
.poem-reload-btn:hover {
    background: #ff6600;
    border-color: #ff6600;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Эффект при клике на кнопку */
.poem-reload-btn:active {
    transform: translateY(0);
}
