/*
 * KinTrek Hiking Guides lists: page-guides.php (all articles), category.php, tag.php.
 * Loaded after article-base.css (tokens, page base, header band, article card, catalog band).
 * No script: the category navigation scrolls with CSS on phones.
 */

.kt-guides-page {
    --kt-i-compass: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m15.5 8.5-2.2 4.8-4.8 2.2 2.2-4.8z'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------
 * Header band of a list
 * ------------------------------------------------------------------ */

.kt-hero--list .kt-hero__band {
    padding: 30px 0 44px;
}

.kt-hero--list .kt-hero__title {
    max-width: 820px;
    font-size: clamp(2.2rem, 1.3rem + 2.8vw, 3.6rem);
    line-height: 1.08;
}

.kt-hero__intro {
    max-width: 660px;
    margin-top: 18px;
    color: var(--kt-ink-2);
    font-size: clamp(1.05rem, 0.98rem + 0.3vw, 1.2rem);
    line-height: 1.65;
}

.kt-hero__intro > * {
    margin: 0;
}

.kt-hero__intro > * + * {
    margin-top: 0.8em;
}

.kt-hero__intro a {
    color: var(--kt-green-700);
    text-underline-offset: 0.2em;
}

.kt-hero__stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
    color: var(--kt-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.kt-hero__stats li + li::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    margin: 0 12px;
    border-radius: 50%;
    background: #b3bbb5;
    vertical-align: middle;
}

/* ------------------------------------------------------------------
 * Category navigation
 * ------------------------------------------------------------------ */

.kt-topics {
    margin-top: 30px;
}

.kt-topics__list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.kt-topics__item {
    flex: none;
}

.kt-topics__link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 8px 10px 8px 18px;
    border: 1px solid #d6e4da;
    border-radius: 999px;
    background: #fff;
    color: var(--kt-ink);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.kt-topics__link:hover {
    border-color: var(--kt-green-700);
    color: var(--kt-green-800);
    box-shadow: var(--kt-shadow-sm);
}

.kt-topics__count {
    min-width: 26px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--kt-green-50);
    color: var(--kt-green-800);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.kt-topics__link.is-active {
    border-color: var(--kt-green-800);
    background: var(--kt-green-800);
    color: #fff;
}

.kt-topics__link.is-active .kt-topics__count {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

/* ------------------------------------------------------------------
 * Cards
 * ------------------------------------------------------------------ */

.kt-guides {
    padding: 56px 0 96px;
    background: var(--kt-paper);
}

.kt-guides__featured {
    margin-bottom: 44px;
}

.kt-card--featured {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    border-radius: 24px;
}

.kt-card--featured:hover {
    transform: translateY(-2px);
}

.kt-card--featured .kt-card__media {
    aspect-ratio: auto;
    min-height: 400px;
}

.kt-card--featured .kt-card__topo {
    inset: -10% -20% -10% 0;
    opacity: 0.26;
}

.kt-card--featured .kt-card__body {
    justify-content: center;
    padding: 44px 48px;
}

.kt-card--featured .kt-card__title {
    font-size: clamp(1.5rem, 1.1rem + 1.1vw, 2.15rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.kt-card--featured.kt-card--long-title .kt-card__title {
    font-size: clamp(1.35rem, 1rem + 0.8vw, 1.75rem);
}

.kt-card--featured .kt-card__excerpt {
    margin-top: 16px;
    font-size: 1.02rem;
    -webkit-line-clamp: 4;
    line-clamp: 4;
}

.kt-card--featured .kt-card__meta {
    margin-top: 20px;
    padding-top: 0;
}

.kt-guides__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px 28px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.kt-guides__item {
    display: flex;
}

.kt-guides__item > .kt-card {
    flex: 1;
}

.kt-card--grid .kt-card__body {
    padding: 20px 22px 22px;
}

.kt-card--grid .kt-card__title {
    font-size: 1.12rem;
    line-height: 1.35;
}

/* ------------------------------------------------------------------
 * Page links
 * ------------------------------------------------------------------ */

.kt-pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: 60px;
}

.kt-pagination__status {
    margin: 0;
    color: var(--kt-muted);
    font-size: 0.85rem;
}

.kt-pagination__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.kt-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--kt-line);
    border-radius: 999px;
    background: #fff;
    color: var(--kt-ink);
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.kt-pagination a.page-numbers:hover {
    border-color: var(--kt-green-700);
    color: var(--kt-green-800);
}

.kt-pagination .page-numbers.current {
    border-color: var(--kt-green-800);
    background: var(--kt-green-800);
    color: #fff;
}

.kt-pagination .page-numbers.dots {
    min-width: 24px;
    padding: 0 4px;
    border-color: transparent;
    background: none;
}

.kt-pagination__arrow {
    width: 16px;
    height: 16px;
    background: currentColor;
    -webkit-mask: var(--kt-i-arrow) center / contain no-repeat;
    mask: var(--kt-i-arrow) center / contain no-repeat;
}

.kt-pagination__arrow--prev {
    transform: scaleX(-1);
}

/* ------------------------------------------------------------------
 * Empty list
 * ------------------------------------------------------------------ */

.kt-empty {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
    padding: 64px 40px 60px;
    overflow: hidden;
    border: 1px dashed #c9dccf;
    border-radius: 24px;
    background: var(--kt-green-50);
    text-align: center;
}

.kt-empty__topo {
    inset: -40% -30%;
    color: var(--kt-green-700);
    opacity: 0.08;
}

.kt-empty__icon {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--kt-shadow-sm);
}

.kt-empty__icon::before {
    content: "";
    width: 30px;
    height: 30px;
    background: var(--kt-green-700);
    -webkit-mask: var(--kt-i-compass) center / contain no-repeat;
    mask: var(--kt-i-compass) center / contain no-repeat;
}

.kt-empty__title {
    position: relative;
    margin: 22px 0 0;
    color: var(--kt-ink);
    font-size: clamp(1.35rem, 1.15rem + 0.6vw, 1.7rem);
    font-weight: 600;
    letter-spacing: -0.015em;
}

.kt-empty__text {
    position: relative;
    max-width: 520px;
    margin: 12px auto 0;
    color: var(--kt-ink-2);
    font-size: 1rem;
    line-height: 1.65;
}

.kt-empty__actions {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}

/* ------------------------------------------------------------------
 * Tablet and phone
 * ------------------------------------------------------------------ */

@media (max-width: 1099px) {
    .kt-guides__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px 22px;
    }

    .kt-card--featured {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .kt-card--featured .kt-card__media {
        min-height: 320px;
    }

    .kt-card--featured .kt-card__body {
        padding: 32px;
    }
}

@media (max-width: 767px) {
    .kt-hero--list .kt-hero__band {
        padding: 18px 0 30px;
    }

    .kt-hero--list .kt-hero__title {
        font-size: clamp(2rem, 1.4rem + 3vw, 2.5rem);
    }

    .kt-hero__intro {
        margin-top: 14px;
    }

    .kt-hero__stats {
        margin-top: 18px;
        font-size: 0.82rem;
    }

    /* Categories scroll sideways in one row, edge to edge. */
    .kt-topics {
        margin: 24px -20px 0;
    }

    .kt-topics__list {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 2px 20px 6px;
        scroll-padding-inline: 20px;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .kt-topics__list::-webkit-scrollbar {
        display: none;
    }

    .kt-topics__item {
        scroll-snap-align: start;
    }

    /* The active category moves next to "All guides", so it is visible without scrolling. */
    .kt-topics__item:first-child {
        order: -2;
    }

    .kt-topics__item:has(> .is-active) {
        order: -1;
    }

    .kt-guides {
        padding: 32px 0 64px;
    }

    .kt-guides__featured {
        margin-bottom: 28px;
    }

    .kt-card--featured {
        grid-template-columns: 1fr;
        border-radius: 20px;
    }

    .kt-card--featured .kt-card__media {
        min-height: 0;
        aspect-ratio: 16 / 10;
    }

    .kt-card--featured .kt-card__body {
        padding: 22px 20px 24px;
    }

    .kt-card--featured .kt-card__excerpt {
        font-size: 0.97rem;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }

    .kt-guides__grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .kt-card--grid .kt-card__body {
        padding: 18px 20px 20px;
    }

    /* Without a photo the card keeps only a thin contour band: long lists stay short. */
    .kt-card--grid.kt-card--plain .kt-card__media,
    .kt-card--featured.kt-card--plain .kt-card__media {
        aspect-ratio: 16 / 4;
    }

    .kt-pagination {
        margin-top: 40px;
    }

    .kt-pagination__word {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .kt-pagination .page-numbers.prev,
    .kt-pagination .page-numbers.next {
        padding: 0;
    }

    .kt-empty {
        padding: 48px 22px 44px;
    }

    .kt-empty__actions {
        flex-direction: column;
        align-items: stretch;
    }
}

@media print {
    .kt-topics,
    .kt-pagination {
        display: none !important;
    }
}
