/* ==========================================================================
   GUIDES PAGE — /guides
   css/guides/guides-page.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   LAYOUT
   -------------------------------------------------------------------------- */

.guides-page-hero {
    min-height: 320px;
}

.guides-page-layout {
    display: grid;
    grid-template-columns: 272px 1fr;
    gap: 28px;
    align-items: start;
    padding-bottom: 60px;
}

/* --------------------------------------------------------------------------
   SIDEBAR
   -------------------------------------------------------------------------- */

.guides-page-sidebar {
    position: sticky;
    top: 24px;
    border-radius: var(--border-medium);
    background: rgba(26, 26, 39, 0.85);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(91, 91, 120, 0.28);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(234, 60, 70, 0.3) transparent;
}
.guides-page-sidebar::-webkit-scrollbar { width: 4px; }
.guides-page-sidebar::-webkit-scrollbar-thumb {
    background: rgba(234, 60, 70, 0.35);
    border-radius: 4px;
}

/* --------------------------------------------------------------------------
   SIDEBAR SECTIONS — аккордеон
   -------------------------------------------------------------------------- */

.gpf-section {
    border-bottom: 1px solid rgba(91, 91, 120, 0.18);
}
.gpf-section:last-of-type { border-bottom: none; }

.gpf-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-clr);
    font-family: var(--primary-font);
    transition: background 0.2s;
}
.gpf-section-toggle:hover { background: rgba(255,255,255,0.03); }

.gpf-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: var(--content-text-clr);
}
.gpf-section-label svg { opacity: 0.6; flex-shrink: 0; }

.gpf-chevron {
    flex-shrink: 0;
    transition: transform 0.25s ease;
    opacity: 0.5;
}
.gpf-section-toggle.is-open .gpf-chevron { transform: rotate(180deg); }

/* Collapse */
.gpf-collapse {
    overflow: hidden;
    max-height: 2000px;
    opacity: 1;
    padding-bottom: 10px;
    transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.25s ease;
}
.gpf-collapse.is-collapsed {
    max-height: 0;
    opacity: 0;
    padding-bottom: 0;
}

/* --------------------------------------------------------------------------
   CATEGORY LIST
   -------------------------------------------------------------------------- */

.gpf-cat-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
}

.gpf-cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 18px;
    font-size: 13.5px;
    color: var(--content-text-clr);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: color 0.18s, background 0.18s, border-color 0.18s;
    line-height: 1.4;
}
.gpf-cat-item:hover {
    color: var(--text-clr);
    background: rgba(255,255,255,0.04);
    border-left-color: rgba(234,60,70,0.4);
}
.gpf-cat-item.is-active {
    color: var(--primary-clr);
    background: rgba(234,60,70,0.08);
    border-left-color: var(--primary-clr);
    font-weight: 600;
}
.gpf-cat-item--child { padding-left: 32px; font-size: 13px; }

.gpf-cat-count {
    font-size: 11px;
    color: rgba(163,163,193,0.55);
    background: rgba(91,91,120,0.2);
    padding: 1px 6px;
    border-radius: 10px;
    flex-shrink: 0;
    margin-left: 6px;
}
.gpf-cat-item.is-active .gpf-cat-count {
    background: rgba(234,60,70,0.15);
    color: rgba(234,60,70,0.75);
}

/* --------------------------------------------------------------------------
   GAME FILTER — search + list
   -------------------------------------------------------------------------- */

.gpf-game-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 14px;
    padding: 9px 12px;
    background: rgba(234,60,70,0.08);
    border: 1px solid rgba(234,60,70,0.22);
    border-radius: 8px;
}
.gpf-game-selected-logo {
    width: 36px; height: 36px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.gpf-game-selected-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-clr);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gpf-game-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border-radius: 50%;
    color: rgba(163,163,193,0.6);
    text-decoration: none;
    transition: background 0.18s, color 0.18s;
    flex-shrink: 0;
}
.gpf-game-clear:hover { background: rgba(234,60,70,0.2); color: var(--primary-clr); }

.gpf-game-search-wrap {
    position: relative;
    margin: 8px 14px 6px;
}
.gpf-game-search-icon {
    position: absolute;
    left: 10px; top: 50%;
    transform: translateY(-50%);
    color: rgba(163,163,193,0.45);
    pointer-events: none;
}
.gpf-game-search-input {
    width: 100%;
    padding: 8px 10px 8px 32px;
    background: rgba(17,18,27,0.7);
    border: 1px solid rgba(91,91,120,0.35);
    border-radius: 7px;
    color: var(--text-clr);
    font-family: var(--primary-font);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.gpf-game-search-input::placeholder { color: var(--field-placeholder-clr); }
.gpf-game-search-input:focus {
    border-color: rgba(234,60,70,0.5);
    background: rgba(17,18,27,0.9);
}

.gpf-game-list {
    max-height: 340px;
    overflow-y: auto;
    padding: 4px 0 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(91,91,120,0.35) transparent;
}
.gpf-game-list::-webkit-scrollbar { width: 4px; }
.gpf-game-list::-webkit-scrollbar-thumb {
    background: rgba(91,91,120,0.35);
    border-radius: 4px;
}

.gpf-game-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 14px;
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: background 0.18s, border-color 0.18s;
}
.gpf-game-item:hover { background: rgba(255,255,255,0.04); border-left-color: rgba(234,60,70,0.35); }
.gpf-game-item.is-active { background: rgba(234,60,70,0.08); border-left-color: var(--primary-clr); }
.gpf-game-item.is-hidden { display: none; }

.gpf-game-logo {
    width: 68px; height: 68px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(91,91,120,0.3);
}
.gpf-game-logo--empty {
    width: 68px; height: 68px;
    border-radius: 8px;
    flex-shrink: 0;
    border: 1px solid rgba(91,91,120,0.25);
    background: rgba(17,18,27,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(163,163,193,0.35);
}
.gpf-game-item-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--content-text-clr);
    line-height: 1.4;
    transition: color 0.18s;
}
.gpf-game-item:hover .gpf-game-item-name,
.gpf-game-item.is-active .gpf-game-item-name { color: var(--text-clr); }
.gpf-game-item.is-active .gpf-game-item-name { color: var(--primary-clr); font-weight: 600; }

.gpf-no-results {
    padding: 18px 14px;
    text-align: center;
    font-size: 13px;
    color: rgba(163,163,193,0.45);
}

.gpf-reset-wrap {
    padding: 12px 14px;
    border-top: 1px solid rgba(91,91,120,0.18);
}
.gpf-reset-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-clr);
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.18s;
}
.gpf-reset-btn:hover { background: rgba(234,60,70,0.1); }

/* --------------------------------------------------------------------------
   MOBILE FILTER BAR (только на mobile)
   -------------------------------------------------------------------------- */

.guides-mobile-bar { display: none; }

/* --------------------------------------------------------------------------
   MAIN CONTENT
   -------------------------------------------------------------------------- */

.guides-page-main { min-width: 0; }

.guides-page-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.guides-page-title {
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.guides-page-total {
    font-size: 13px;
    color: rgba(163,163,193,0.55);
    font-weight: 500;
    white-space: nowrap;
}

/* Активные чипы */
.guides-active-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.guides-active-chips--desktop { display: flex; }

.guides-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(234,60,70,0.09);
    border: 1px solid rgba(234,60,70,0.25);
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--primary-clr);
}
.guides-chip svg { opacity: 0.7; flex-shrink: 0; }
.guides-chip__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px; height: 16px;
    border-radius: 50%;
    text-decoration: none;
    color: var(--primary-clr);
    font-size: 14px;
    line-height: 1;
    margin-left: 2px;
    transition: background 0.18s;
}
.guides-chip__remove:hover { background: rgba(234,60,70,0.2); }

/* --------------------------------------------------------------------------
   SORT TOGGLE
   -------------------------------------------------------------------------- */

.guides-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.guides-sort__label {
    font-size: 13px;
    color: rgba(163,163,193,0.55);
    font-weight: 500;
    white-space: nowrap;
}
.guides-sort__btn {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: var(--content-text-clr);
    background: rgba(30,30,45,0.8);
    border: 1px solid rgba(91,91,120,0.28);
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    font-family: var(--primary-font);
}
.guides-sort__btn:hover {
    border-color: rgba(234,60,70,0.4);
    color: var(--text-clr);
}
.guides-sort__btn.is-active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 3px 10px rgba(234,60,70,0.3);
}

/* --------------------------------------------------------------------------
   GUIDE CARDS GRID
   -------------------------------------------------------------------------- */

.guides-page-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

/* --------------------------------------------------------------------------
   КАРТОЧКА — стилистика как у news-card
   -------------------------------------------------------------------------- */

.gp-card {
    background: var(--background-card-gradient);
    border: 1px solid var(--field-border-clr);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    overflow: hidden;
    will-change: transform;
    transition: all .3s ease;
}
.gp-card:hover {
    border-color: #6c6c8e;
    box-shadow: 0 12px 24px rgba(0, 0, 0, .5);
    transform: translateY(-6px);
}

.gp-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* Медиа — margin + border-radius как у news-card */
.gp-card__media {
    aspect-ratio: 16/10;
    border-radius: 10px;
    margin: 10px 10px 0;
    overflow: hidden;
    position: relative;
    background: var(--secondary-clr);
    flex-shrink: 0;
    transform: translateZ(0); /* GPU-слой для контейнера — исключает snap при clip */
}
.gp-card__thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity .3s ease-in-out!important;
}
.gp-card:hover .gp-card__thumb { transform: scale(1.05); }

/* Логотип игры (68×68) — правый верх */
.gp-card__game-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 48px;
    height: 48px;
    border-radius: 7px;
    overflow: hidden;
    border: 2px solid rgba(17,18,27,0.55);
    box-shadow: 0 3px 10px rgba(0,0,0,0.45);
    flex-shrink: 0;
}
.gp-card__game-badge-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Тег категории — левый низ */
.gp-card__cat-tag {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 11px !important;
    font-weight: 600;
    padding: 3px 10px !important;
    border-radius: 30px !important;
    background: rgba(0,0,0,.6) !important;
    max-width: calc(100% - 70px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    z-index: 2;
}

/* Тело */
.gp-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 14px 16px 16px;
    gap: 5px;
}

.gp-card__game-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--primary-clr);
    opacity: 0.85;
}

.gp-card__title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-clr);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gp-card__excerpt {
    font-size: 13px;
    color: var(--content-text-clr);
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    opacity: 0.85;
}

/* Мета-информация */
.gp-card__meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--field-border-clr);
    font-size: 13px;
    color: var(--content-text-clr);
}

.gp-card__author {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--content-text-clr);
    min-width: 0;
}
.gp-card__avatar {
    width: 20px; height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--field-border-clr);
}

.gp-card__meta-right {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.gp-card__date,
.gp-card__views {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--content-text-clr);
    opacity: 0.75;
    white-space: nowrap;
}
.gp-card__date svg,
.gp-card__views svg { opacity: 0.65; flex-shrink: 0; }

/* --------------------------------------------------------------------------
   PAGINATION
   -------------------------------------------------------------------------- */

.guides-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.guides-pagination__item,
.guides-pagination__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 8px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: var(--content-text-clr);
    background: rgba(30, 30, 45, 0.8);
    border: 1px solid rgba(91,91,120,0.28);
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
    font-family: var(--primary-font);
    cursor: pointer;
}
.guides-pagination__item:hover,
.guides-pagination__btn:hover {
    background: rgba(234,60,70,0.1);
    border-color: rgba(234,60,70,0.35);
    color: var(--text-clr);
    transform: translateY(-1px);
}
.guides-pagination__item.is-active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: #fff;
    cursor: default;
    box-shadow: 0 4px 14px rgba(234,60,70,0.35);
    transform: none;
}
.guides-pagination__btn.is-disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}
.guides-pagination__dots {
    color: rgba(163,163,193,0.4);
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 3px;
}

/* --------------------------------------------------------------------------
   EMPTY STATE
   -------------------------------------------------------------------------- */

.guides-page-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}
.guides-page-empty__icon { color: rgba(163,163,193,0.25); margin-bottom: 20px; }
.guides-page-empty__title { font-size: 22px; font-weight: 700; color: var(--text-clr); margin: 0 0 8px; }
.guides-page-empty__text  { font-size: 14px; color: var(--content-text-clr); margin: 0 0 24px; opacity: 0.8; }
.guides-page-empty__btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 22px;
    background: var(--primary-gradient);
    border-radius: var(--border-button-radius);
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(234,60,70,0.3);
    transition: opacity 0.2s, transform 0.2s;
}
.guides-page-empty__btn:hover { opacity: 0.88; transform: translateY(-1px); }

/* --------------------------------------------------------------------------
   RESPONSIVE — Tablet
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
    .guides-page-layout { grid-template-columns: 240px 1fr; gap: 22px; }
    .guides-page-grid   { grid-template-columns: repeat(2, 1fr); }
}

/* --------------------------------------------------------------------------
   RESPONSIVE — Mobile (≤860px)
   Сайдбар прячется, показывается inline-accordion через мобильный тоггл
   -------------------------------------------------------------------------- */

@media (max-width: 860px) {
    .guides-page-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* Сайдбар скрыт из потока по умолчанию */
    .guides-page-sidebar {
        position: static;
        top: auto;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        border-radius: var(--border-medium);
        margin-bottom: 0;
        border: 1px solid rgba(91,91,120,0.28);
        transition: max-height 0.4s ease, opacity 0.3s ease, margin-bottom 0.3s ease;
    }
    .guides-page-sidebar.is-mobile-open {
        max-height: 2400px;
        opacity: 1;
        margin-bottom: 16px;
        overflow-y: auto;
    }

    /* Мобильный бар — показываем */
    .guides-mobile-bar {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
        margin-bottom: 16px;
        padding: 0;
    }

    .guides-mobile-bar__toggle {
        display: flex;
        width: 100%;
        justify-content: center;
        align-items: center;
        gap: 8px;
        padding: 13px 20px;
        background: var(--primary-gradient);
        border: none;
        border-radius: 10px;
        color: #fff;
        font-family: var(--primary-font);
        font-size: 15px;
        font-weight: 700;
        cursor: pointer;
        box-shadow: 0 4px 18px rgba(234,60,70,0.35);
        transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    }
    .guides-mobile-bar__toggle:hover {
        opacity: 0.9;
        transform: translateY(-1px);
        box-shadow: 0 6px 22px rgba(234,60,70,0.45);
    }
    .guides-mobile-bar__toggle.is-open {
        opacity: 0.85;
        transform: none;
    }
    .guides-mobile-bar__toggle .guides-mobile-bar__chevron {
        transition: transform 0.25s ease;
        opacity: 0.85;
    }
    .guides-mobile-bar__toggle.is-open .guides-mobile-bar__chevron {
        transform: rotate(180deg);
    }

    .guides-mobile-bar__badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 18px; height: 18px;
        background: var(--primary-clr);
        color: #fff;
        font-size: 11px;
        font-weight: 700;
        border-radius: 50%;
        flex-shrink: 0;
    }
    .guides-mobile-bar__chips {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .guides-active-chips--desktop { display: none; }

    .guides-page-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}

/* --------------------------------------------------------------------------
   RESPONSIVE — Small Mobile (≤520px)
   -------------------------------------------------------------------------- */

@media (max-width: 520px) {
    .guides-page-grid  { grid-template-columns: 1fr; }
    .guides-page-title { font-size: 20px; }

    .gp-card__game-badge { width: 36px; height: 36px; }
    .gp-card__body       { padding: 12px 12px 14px; }
    .gp-card__title      { font-size: 14px; }
}
