/* =========================================================================
   Хабы тегов (/tag/...)
   Разметка: tag.php, inc/partials/tag-hub-strip.php
   ========================================================================= */

/* Литеральный акцент: на этой сборке --gk-color-accent-10 может резолвиться
   в пустое значение (Kirki печатает `html{--accent-color:;}`), и тогда var()
   не подхватывает фолбэк — фон кнопок и активных элементов молча становится
   прозрачным, а белый текст на нём исчезает. */
:root {
    --gk-hub-accent: #0b008a;
    --gk-hub-accent-hover: #09006f;
}

.gdt-dark,
.darkmysite_dark_mode_enabled {
    --gk-hub-accent: #7aa2ff;
    --gk-hub-accent-hover: #9bb8ff;
}

.gk-hub {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.gk-hub-kicker {
    margin: 0;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
    color: var(--gk-color-text-muted, #666f82);
}

.gk-hub-hero,
.gk-hub-section,
.gk-hub-strip {
    background: var(--gk-color-secondary-30, #fff);
    border: 1px solid var(--gk-color-border-soft, #e8ebf2);
    border-radius: 10px;
}

/* --- Шапка хаба --- */

.gk-hub-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: 22px 20px;
}

.gk-hub-hero--with-cover {
    padding: 0;
    min-height: 320px;
    display: flex;
    align-items: flex-end;
}

.gk-hub-hero__media {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.gk-hub-hero__image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: 50% 35%;
}

.gk-hub-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 12, 23, .10) 24%, rgba(9, 11, 21, .70) 68%, rgba(9, 11, 21, .93) 100%);
    pointer-events: none;
}

.gk-hub-hero__body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.gk-hub-hero--with-cover .gk-hub-hero__body {
    padding: 24px 20px 20px;
}

.gk-hub-title {
    margin: 0;
    font-size: 32px;
    line-height: 1.08;
    font-weight: 700;
    word-break: break-word;
    color: var(--gk-color-text-main, #1f1f20);
}

.gk-hub-subtitle {
    margin: 0;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 500;
    color: var(--gk-color-text-muted, #6f7687);
}

.gk-hub-description {
    max-width: 76ch;
    font-size: 16px;
    line-height: 1.75;
    color: var(--gk-color-text-main, #1f1f20);
}

.gk-hub-description > p {
    margin-bottom: 12px;
}

.gk-hub-description > :last-child {
    margin-bottom: 0;
}

.gk-hub-hero--with-cover .gk-hub-kicker,
.gk-hub-hero--with-cover .gk-hub-subtitle {
    color: rgba(255, 255, 255, .86);
}

.gk-hub-hero--with-cover .gk-hub-title {
    color: #fff;
    text-shadow: 0 1px 16px rgba(0, 0, 0, .38);
}

.gk-hub-hero--with-cover .gk-hub-description {
    color: rgba(255, 255, 255, .92);
    text-shadow: 0 1px 10px rgba(0, 0, 0, .30);
}

/* --- Дата обновления и упоминания --- */

.gk-hub-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
}

.gk-hub-meta__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(31, 31, 32, .06);
    font-size: 12.5px;
    line-height: 1.4;
    white-space: nowrap;
    color: var(--gk-color-text-muted, #6f7687);
}

.gk-hub-meta__item b {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--gk-color-text-main, #1f1f20);
}

.gk-hub-hero--with-cover .gk-hub-meta__item {
    background: rgba(255, 255, 255, .16);
    color: rgba(255, 255, 255, .88);
}

.gk-hub-hero--with-cover .gk-hub-meta__item b {
    color: #fff;
}

/* --- Кнопки --- */

.gk-hub-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.gk-hub-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 15px;
    border: 1px solid var(--gk-color-border-soft, #dfe3ea);
    border-radius: 7px;
    background: var(--gk-color-secondary-30, #fff);
    color: var(--gk-color-text-main, #1f1f20);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color .18s, border-color .18s, color .18s;
}

.gk-hub-btn:hover,
.gk-hub-btn:focus {
    border-color: var(--gk-hub-accent, #0b008a);
    color: var(--gk-hub-accent, #0b008a);
    text-decoration: none;
}

.gk-hub-btn--primary {
    background: var(--gk-hub-accent, #0b008a);
    border-color: var(--gk-hub-accent, #0b008a);
    color: #fff;
}

.gk-hub-btn--primary:hover,
.gk-hub-btn--primary:focus {
    background: var(--gk-hub-accent-hover, #09006f);
    border-color: var(--gk-hub-accent-hover, #09006f);
    color: #fff;
}

/* --- Секции --- */

.gk-hub-section {
    padding: 16px 18px;
}

.gk-hub-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.gk-hub-section__title {
    margin: 0 0 12px;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
    color: var(--gk-color-text-muted, #666f82);
}

.gk-hub-section__head .gk-hub-section__title {
    margin-bottom: 0;
}

.gk-hub-section__count {
    font-size: 12.5px;
    color: var(--gk-color-text-muted, #6f7687);
}

.gk-hub-empty {
    margin: 0;
    color: var(--gk-color-text-muted, #6f7687);
    font-size: 15px;
}

/* --- Ключевые вехи --- */

.gk-hub-milestones {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

.gk-hub-milestone {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.gk-hub-milestone__thumb,
.gk-hub-entry__thumb,
.gk-hub-strip__thumb {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    background: var(--gk-color-primary-60, #f2f4f8);
}

.gk-hub-milestone__thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.gk-hub-thumb-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 64px;
    background: var(--gk-color-primary-60, #f2f4f8);
}

.gk-hub-milestone__body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.gk-hub-milestone__title {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.32;
    font-weight: 600;
}

.gk-hub-milestone__title a,
.gk-hub-entry__title a,
.gk-hub-strip__title a {
    color: var(--gk-color-text-main, #1f1f20);
    text-decoration: none;
}

.gk-hub-milestone__title a:hover,
.gk-hub-entry__title a:hover,
.gk-hub-strip__title a:hover {
    color: var(--gk-hub-accent, #0b008a);
}

.gk-hub-milestone__date {
    font-size: 12.5px;
    color: var(--gk-color-text-muted, #6f7687);
}

/* --- Журнал обновлений --- */

.gk-hub-journal {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.gk-hub-journal__month {
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--gk-color-border-soft, #e8ebf2);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--gk-color-text-main, #1f1f20);
}

.gk-hub-journal__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.gk-hub-entry {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 108px;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--gk-color-border-soft, #eef0f5);
}

.gk-hub-entry:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.gk-hub-entry--milestone {
    padding-left: 10px;
    border-left: 3px solid var(--gk-hub-accent, #0b008a);
}

.gk-hub-entry__date {
    padding-top: 2px;
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--gk-color-text-muted, #6f7687);
}

.gk-hub-entry__body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.gk-hub-entry__label {
    align-self: flex-start;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(31, 31, 32, .06);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--gk-color-text-muted, #6f7687);
}

.gk-hub-entry__title {
    margin: 0;
    font-size: 16.5px;
    line-height: 1.34;
    font-weight: 600;
}

.gk-hub-entry__excerpt {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--gk-color-text-muted, #6f7687);
}

.gk-hub-entry__thumb img {
    display: block;
    width: 108px;
    height: 68px;
    object-fit: cover;
}

/* --- Пагинация журнала ---
   paginate_links( type = list ) отдаёт <ul class="page-numbers"> со ссылками
   внутри, поэтому оформляем именно a/span, а не сам список. */

.gk-hub-pagination {
    margin-top: 16px;
}

.gk-hub-pagination .page-numbers {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
}

.gk-hub-pagination .page-numbers li {
    display: flex;
}

.gk-hub-pagination .page-numbers a,
.gk-hub-pagination .page-numbers span {
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e3e7f0;
    border-radius: 8px;
    background: #fff;
    color: #30384c;
    font-size: 13.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    text-decoration: none;
}

.gk-hub-pagination .page-numbers a:hover {
    border-color: var(--gk-hub-accent, #0b008a);
    color: var(--gk-hub-accent, #0b008a);
}

.gk-hub-pagination .page-numbers .current {
    border-color: var(--gk-hub-accent, #0b008a);
    background: var(--gk-hub-accent, #0b008a);
    color: #fff;
}

.gk-hub-pagination .page-numbers .dots {
    border: 0;
    min-width: auto;
    padding: 0 3px;
    background: transparent;
}

/* --- Смежные темы --- */

.gk-hub-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.gk-hub-tag {
    display: inline-flex;
    padding: 6px 12px;
    border: 1px solid var(--gk-color-border-soft, #e8ebf2);
    border-radius: 999px;
    font-size: 13.5px;
    color: var(--gk-color-text-main, #1f1f20);
    text-decoration: none;
}

.gk-hub-tag:hover {
    border-color: var(--gk-hub-accent, #0b008a);
    color: var(--gk-hub-accent, #0b008a);
    text-decoration: none;
}

/* --- Полоса темы под материалом --- */

.gk-hub-strip {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    margin: 20px 0;
}

.gk-hub-strip__thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.gk-hub-strip__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.gk-hub-strip__title {
    margin: 0;
    font-size: 19px;
    line-height: 1.25;
    font-weight: 700;
}

/* --- Тёмная тема --- */

.gdt-dark .gk-hub-hero,
.gdt-dark .gk-hub-section,
.gdt-dark .gk-hub-strip,
.gdt-dark .gk-hub-btn,
.gdt-dark .gk-hub-pagination .page-numbers a,
.gdt-dark .gk-hub-pagination .page-numbers span,
.darkmysite_dark_mode_enabled .gk-hub-hero,
.darkmysite_dark_mode_enabled .gk-hub-section,
.darkmysite_dark_mode_enabled .gk-hub-strip,
.darkmysite_dark_mode_enabled .gk-hub-btn,
.darkmysite_dark_mode_enabled .gk-hub-pagination .page-numbers a,
.darkmysite_dark_mode_enabled .gk-hub-pagination .page-numbers span {
    background: var(--gk-color-secondary-30, #272727);
    border-color: var(--gk-color-border-soft, rgba(231, 234, 240, .14));
    color: var(--gk-color-text-main, #e7eaf0);
}

.gdt-dark .gk-hub-meta__item,
.gdt-dark .gk-hub-entry__label,
.darkmysite_dark_mode_enabled .gk-hub-meta__item,
.darkmysite_dark_mode_enabled .gk-hub-entry__label {
    background: rgba(231, 234, 240, .10);
}

.gdt-dark .gk-hub-thumb-placeholder,
.gdt-dark .gk-hub-milestone__thumb,
.gdt-dark .gk-hub-entry__thumb,
.darkmysite_dark_mode_enabled .gk-hub-thumb-placeholder,
.darkmysite_dark_mode_enabled .gk-hub-milestone__thumb,
.darkmysite_dark_mode_enabled .gk-hub-entry__thumb {
    background: rgba(231, 234, 240, .07);
}

/* Акцентные элементы перекрывают общие тёмные правила выше — иначе активная
   кнопка и текущая страница теряют заливку из-за специфичности. */
.gdt-dark .gk-hub-btn--primary,
.gdt-dark .gk-hub-pagination .page-numbers .current,
.darkmysite_dark_mode_enabled .gk-hub-btn--primary,
.darkmysite_dark_mode_enabled .gk-hub-pagination .page-numbers .current {
    background: var(--gk-hub-accent, #7aa2ff);
    border-color: var(--gk-hub-accent, #7aa2ff);
    color: #0f1115;
}

.gdt-dark .gk-hub-btn--primary:hover,
.gdt-dark .gk-hub-btn--primary:focus,
.darkmysite_dark_mode_enabled .gk-hub-btn--primary:hover,
.darkmysite_dark_mode_enabled .gk-hub-btn--primary:focus {
    background: var(--gk-hub-accent-hover, #9bb8ff);
    border-color: var(--gk-hub-accent-hover, #9bb8ff);
    color: #0f1115;
}

/* --- Адаптив --- */

@media (max-width: 991px) {
    .gk-hub-entry {
        grid-template-columns: 44px minmax(0, 1fr) 92px;
    }

    .gk-hub-entry__thumb img {
        width: 92px;
        height: 58px;
    }
}

@media (max-width: 767px) {
    .gk-hub-title {
        font-size: 26px;
    }

    .gk-hub-hero--with-cover {
        min-height: 240px;
        padding: 0;
    }

    .gk-hub-hero,
    .gk-hub-section {
        padding: 14px;
    }

    .gk-hub-entry {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .gk-hub-entry__thumb,
    .gk-hub-entry__excerpt {
        display: none;
    }

    .gk-hub-entry__title {
        font-size: 15.5px;
    }

    .gk-hub-strip {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .gk-hub-strip__thumb {
        max-width: 220px;
    }
}
