/*
 * Graceful Zen Blog - Professional Pagination Styles
 * Профессиональные стили пагинации без отображения общего количества страниц
 *
 * @package Graceful Zen Blog
 * @version 1.0.0
 */

/* ========== ОСНОВНЫЕ СТИЛИ ПАГИНАЦИИ ========== */
.graceful-zen-pagination-final {
    margin: 45px auto 35px;
    text-align: center;
    max-width: 600px;
    font-family: inherit;
}

.pagination-container {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border-radius: 16px;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8ecef;
    padding: 6px;
    gap: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.pagination-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(22, 183, 204, 0.02) 0%,
        rgba(20, 165, 184, 0.02) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.pagination-container:hover::before {
    opacity: 1;
}

.pagination-container:hover {
    box-shadow:
        0 8px 30px rgba(22, 183, 204, 0.15),
        0 2px 8px rgba(22, 183, 204, 0.08);
    border-color: rgba(22, 183, 204, 0.3);
}

/* ========== НАВИГАЦИОННЫЕ КНОПКИ ========== */
.pagination-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 105px;
    height: 40px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1.5px solid transparent;
    border-radius: 12px;
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.pagination-nav:not(.disabled):hover {
    background: linear-gradient(135deg, #16b7cc 0%, #14a5b8 100%);
    border-color: #16b7cc;
    color: #ffffff;
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 6px 16px rgba(22, 183, 204, 0.25);
}

.pagination-nav.disabled {
    background: #f1f3f4;
    color: #adb5bd;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-nav i {
    font-size: 11px;
    transition: transform 0.3s ease;
}

.pagination-nav.prev-page i {
    margin-right: 6px;
}

.pagination-nav.next-page i {
    margin-left: 6px;
}

.pagination-nav.prev-page:not(.disabled):hover i {
    transform: translateX(-2px);
}

.pagination-nav.next-page:not(.disabled):hover i {
    transform: translateX(2px);
}

/* ========== ИНДИКАТОР ТЕКУЩЕЙ СТРАНИЦЫ ========== */
.current-page-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: linear-gradient(135deg, #16b7cc 0%, #14a5b8 100%);
    border-radius: 12px;
    color: #ffffff;
    font-weight: 600;
    min-width: 110px;
    justify-content: center;
    box-shadow:
        0 3px 12px rgba(22, 183, 204, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
}

.current-page-indicator::before {
    content: "";
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    border-radius: 11px 11px 0 0;
}

.page-label {
    font-size: 12px;
    opacity: 0.9;
    font-weight: 500;
}

.page-number {
    font-size: 15px;
    font-weight: 700;
}

/* ========== ПРЕДСТОЯЩИЕ СТРАНИЦЫ ========== */
.upcoming-pages {
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0 8px;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: #f8f9fa;
    border: 1px solid #e8ecef;
    border-radius: 9px;
    color: #6c757d;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.page-link:hover {
    border-color: #16b7cc !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, #16b7cc 0%, #14a5b8 100%) !important;
    transform: translateY(-1px) scale(1.1);
    box-shadow: 0 4px 12px rgba(22, 183, 204, 0.25);
    z-index: 10;
    position: relative;
}

.page-link:hover,
.page-link:hover *,
.page-link:focus,
.page-link:active {
    color: #ffffff !important;
    text-shadow: none !important;
}

.more-indicator {
    color: #adb5bd;
    font-weight: 600;
    padding: 0 6px;
    font-size: 14px;
    opacity: 0.7;
}

/* ========== ЭФФЕКТЫ ПРИ НАВЕДЕНИИ ========== */
.pagination-container:hover .current-page-indicator {
    box-shadow:
        0 4px 16px rgba(22, 183, 204, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ========== АНИМАЦИИ ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.graceful-zen-pagination-final {
    animation: fadeInUp 0.4s ease-out;
}

/* Улучшенные переходы для лучшего UX */
.pagination-nav,
.page-link,
.current-page-indicator {
    will-change: transform;
}

/* ========== АДАПТИВНЫЙ ДИЗАЙН ========== */

/* Планшеты */
@media (max-width: 768px) {
    .graceful-zen-pagination-final {
        margin: 30px auto 25px;
        padding: 0 15px;
    }

    .pagination-container {
        gap: 1px;
        padding: 4px;
        border-radius: 14px;
    }

    .pagination-nav {
        min-width: 85px;
        height: 36px;
        padding: 6px 12px;
        font-size: 12px;
        border-radius: 10px;
    }

    .current-page-indicator {
        min-width: 90px;
        padding: 6px 14px;
        border-radius: 10px;
    }

    .nav-text {
        display: none;
    }

    .pagination-nav {
        min-width: 40px;
    }

    .upcoming-pages {
        margin: 0 4px;
    }

    .page-link {
        width: 30px;
        height: 30px;
        font-size: 11px;
        border-radius: 8px;
    }
}

/* Мобильные устройства */
@media (max-width: 480px) {
    .graceful-zen-pagination-final {
        margin: 25px auto 20px;
    }

    .pagination-container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        padding: 8px;
        border-radius: 12px;
    }

    .current-page-indicator {
        order: -1;
        width: 100%;
        margin-bottom: 4px;
        min-width: auto;
    }

    .upcoming-pages {
        order: 1;
        margin: 4px 0 0;
    }

    .nav-text {
        display: inline;
    }

    .pagination-nav {
        min-width: 80px;
        height: 34px;
        font-size: 11px;
    }

    .page-link {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }
}
}

/* Дополнительные стили для четкого отображения текста */
.page-link {
text-align: center;
line-height: 1;
vertical-align: middle;
user-select: none;
}

/* Очень маленькие экраны */
@media (max-width: 320px) {
    .graceful-zen-pagination-final {
        margin: 20px auto 15px;
        padding: 0 10px;
    }

    .pagination-container {
        padding: 6px;
        gap: 4px;
    }

    .pagination-nav {
        min-width: 70px;
        height: 32px;
        font-size: 10px;
        padding: 4px 8px;
    }

    .current-page-indicator {
        padding: 6px 12px;
        font-size: 11px;
    }

    .page-number {
        font-size: 13px;
    }

    .page-label {
        font-size: 10px;
    }

    .page-link {
        width: 26px;
        height: 26px;
        font-size: 9px;
    }
}

/* ========== ACCESSIBILITY УЛУЧШЕНИЯ ========== */

/* Высокий контраст для пользователей с нарушениями зрения */
@media (prefers-contrast: high) {
    .pagination-container {
        border: 2px solid #000000;
    }

    .pagination-nav:not(.disabled) {
        border: 2px solid #495057;
    }

    .current-page-indicator {
        background: #000000;
        border: 2px solid #000000;
    }

    .page-link {
        border: 2px solid #495057;
    }
}

/* Уменьшенная анимация для пользователей с вестибулярными расстройствами */
@media (prefers-reduced-motion: reduce) {
    .graceful-zen-pagination-final,
    .pagination-nav,
    .page-link,
    .current-page-indicator,
    .pagination-container,
    .pagination-container::before {
        animation: none;
        transition: none;
    }

    .pagination-nav:hover,
    .page-link:hover {
        transform: none;
    }
}

/* Фокус для клавиатурной навигации */
.pagination-nav:focus,
.page-link:focus {
    outline: 2px solid #16b7cc;
    outline-offset: 2px;
}

/* ========== ТЕМНАЯ ТЕМА (при поддержке) ========== */
@media (prefers-color-scheme: dark) {
    .pagination-container {
        background: #1a1a1a;
        border-color: #404040;
        box-shadow:
            0 4px 20px rgba(0, 0, 0, 0.3),
            0 1px 3px rgba(0, 0, 0, 0.2);
    }

    .pagination-nav {
        background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
        color: #e0e0e0;
    }

    .pagination-nav.disabled {
        background: #2a2a2a;
        color: #666666;
    }

    .page-link {
        background: #2a2a2a;
        border-color: #404040;
        color: #cccccc;
    }

    .more-indicator {
        color: #666666;
    }
}

/* ========== PRINT СТИЛИ ========== */
@media print {
    .graceful-zen-pagination-final {
        display: none;
    }
}
/*
 * Content Overflow Fix for Graceful Zen Blog
 *
 * Дополнительные стили для предотвращения обрезания контента
 * и улучшения отображения длинного текста на главной странице
 * и страницах категорий.
 */

/* Общие улучшения для контентных блоков */
.blog .content-column article,
.category .content-column article {
    align-items: stretch !important;
}

.blog .post-content-col,
.category .post-content-col {
    justify-content: flex-start !important;
    align-items: stretch !important;
}

/* Улучшения для текстового контента */
.blog .post-page-content,
.category .post-page-content {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    line-height: 1.6;
}

/* Дополнительные отступы для читаемости */
.blog .post-page-content p:not(:last-child),
.category .post-page-content p:not(:last-child) {
    margin-bottom: 15px;
}

/* Обработка длинных слов и ссылок */
.blog .post-page-content,
.category .post-page-content,
.blog .post-page-content *,
.category .post-page-content * {
    word-break: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
}

/* Улучшения для мобильных устройств */
@media (max-width: 768px) {
    .blog .post-content-col,
    .category .post-content-col {
        height: auto !important;
        min-height: auto !important;
    }

    .blog .post-page-content,
    .category .post-page-content {
        padding: 10px 0;
    }
}

/* Дополнительная защита от overflow */
.content-column {
    overflow: visible !important;
}

.content-column li {
    overflow: visible !important;
}

/* Обеспечиваем, что контент может расширяться */
.blog .post-content-col .post-page-content,
.category .post-content-col .post-page-content {
    flex: 1 1 auto;
    display: block;
    overflow: visible;
}

/* Стили для очень длинного контента */
@media (min-width: 992px) {
    .blog .content-column article,
    .category .content-column article {
        align-items: flex-start;
    }

    .blog .post-content-col,
    .category .post-content-col {
        min-height: 340px;
        height: auto !important;
        max-height: none !important;
    }
}

/* Улучшения для заголовков внутри контента */
.blog .post-page-content h1,
.blog .post-page-content h2,
.blog .post-page-content h3,
.blog .post-page-content h4,
.blog .post-page-content h5,
.blog .post-page-content h6,
.category .post-page-content h1,
.category .post-page-content h2,
.category .post-page-content h3,
.category .post-page-content h4,
.category .post-page-content h5,
.category .post-page-content h6 {
    margin: 15px 0 10px 0;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Стили для списков в контенте */
.blog .post-page-content ul,
.blog .post-page-content ol,
.category .post-page-content ul,
.category .post-page-content ol {
    margin: 10px 0;
    padding-left: 20px;
}

.blog .post-page-content li,
.category .post-page-content li {
    margin-bottom: 5px;
    word-wrap: break-word;
}

/* Стили для изображений в контенте */
.blog .post-page-content img,
.category .post-page-content img {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
}

/* Стили для блочных элементов */
.blog .post-page-content blockquote,
.category .post-page-content blockquote {
    margin: 15px 0;
    padding: 10px 15px;
    border-left: 3px solid #16b7cc;
    background: #f8f9fa;
    word-wrap: break-word;
}

/* Обеспечиваем корректную работу с continue-read */
.blog .continue-read,
.category .continue-read {
    margin-top: auto;
    padding-top: 15px;
}

/* Замена текста "Related Posts" на "Похожие" через CSS */
h2:contains("Related Posts"),
h3:contains("Related Posts"),
.related-posts-title:contains("Related Posts") {
    font-size: 0;
}

h2:contains("Related Posts")::before,
h3:contains("Related Posts")::before,
.related-posts-title:contains("Related Posts")::before {
    content: "Похожие";
    font-size: 1.5rem;
    font-weight: bold;
    color: inherit;
}

/* Дополнительные селекторы для заголовков связанных постов */
.related-posts h2,
.related-posts h3,
.related-posts-heading,
.graceful-related-posts h2,
.graceful-related-posts h3 {
    position: relative;
}

/* Скрываем английский текст и показываем русский */
.related-posts h2[data-title*="Related"],
.related-posts h3[data-title*="Related"],
.graceful-related-posts h2[data-title*="Related"],
.graceful-related-posts h3[data-title*="Related"] {
    visibility: hidden;
}

.related-posts h2[data-title*="Related"]::after,
.related-posts h3[data-title*="Related"]::after,
.graceful-related-posts h2[data-title*="Related"]::after,
.graceful-related-posts h3[data-title*="Related"]::after {
    content: "Похожие";
    visibility: visible;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
}
/*
 * Favicon and PWA Styles for Graceful Zen Blog
 *
 * Дополнительные стили для поддержки favicon и PWA функциональности
 */

/* Стили для favicon в разных состояниях */
link[rel="icon"] {
    transition: all 0.3s ease;
}

/* Поддержка высокого разрешения для Retina дисплеев */
@media only screen and (-webkit-min-device-pixel-ratio: 2),
       only screen and (min--moz-device-pixel-ratio: 2),
       only screen and (-o-min-device-pixel-ratio: 2/1),
       only screen and (min-device-pixel-ratio: 2),
       only screen and (min-resolution: 192dpi),
       only screen and (min-resolution: 2dppx) {

    /* Обеспечиваем четкость иконок на Retina */
    link[rel="apple-touch-icon"] {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Стили для PWA установки */
.pwa-install-button {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #16b7cc 0%, #14a5b8 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(22, 183, 204, 0.3);
    z-index: 9999;
    transition: all 0.3s ease;
}

.pwa-install-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(22, 183, 204, 0.4);
}

.pwa-install-button.show {
    display: block;
    animation: slideInFromRight 0.5s ease;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Стили для splash screen (iOS) */
@media screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) {
    /* iPhone X/XS */
    link[rel="apple-touch-startup-image"] {
        content: url('/wp-content/themes/graceful-zen-blog/favicon/apple-touch-icon.png');
    }
}

/* Скрытие стандартных элементов браузера в PWA режиме */
@media all and (display-mode: standalone) {
    /* Стили для автономного режима PWA */
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* Скрываем элементы, которые не нужны в PWA */
    .browser-only {
        display: none !important;
    }
}

/* Стили для уведомления об установке PWA */
.pwa-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    max-width: 300px;
    text-align: center;
    display: none;
}

.pwa-notification.show {
    display: block;
    animation: popIn 0.5s ease;
}

@keyframes popIn {
    from {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.pwa-notification h3 {
    color: #16b7cc;
    margin: 0 0 15px 0;
    font-size: 18px;
}

.pwa-notification p {
    color: #666;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.pwa-notification .buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.pwa-notification button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pwa-notification .install-btn {
    background: #16b7cc;
    color: white;
}

.pwa-notification .install-btn:hover {
    background: #14a5b8;
}

.pwa-notification .cancel-btn {
    background: #f8f9fa;
    color: #666;
}

.pwa-notification .cancel-btn:hover {
    background: #e9ecef;
}

/* Overlay для PWA уведомления */
.pwa-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
}

.pwa-overlay.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 768px) {
    .pwa-install-button {
        bottom: 15px;
        right: 15px;
        padding: 10px 16px;
        font-size: 13px;
    }

    .pwa-notification {
        max-width: 280px;
        padding: 20px;
        margin: 0 20px;
    }

    .pwa-notification .buttons {
        flex-direction: column;
    }

    .pwa-notification button {
        width: 100%;
    }
}

/* Стили для темной темы */
@media (prefers-color-scheme: dark) {
    .pwa-notification {
        background: #2d3748;
        color: white;
    }

    .pwa-notification p {
        color: #cbd5e0;
    }

    .pwa-notification .cancel-btn {
        background: #4a5568;
        color: #cbd5e0;
    }

    .pwa-notification .cancel-btn:hover {
        background: #2d3748;
    }
}

/* Анимация для лоадинга favicon */
@keyframes faviconPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.favicon-loading {
    animation: faviconPulse 1.5s ease-in-out infinite;
}

/* Стили для индикатора уведомлений в favicon */
.favicon-badge {
    position: relative;
}

.favicon-badge::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: #ff4444;
    border-radius: 50%;
    border: 1px solid white;
}
