/**
 * Стили инфраструктуры — архив + категории
 *
 * @package Arkhyz
 */

/* =============================================
   ОБЩИЕ / КОНТЕЙНЕР
   ============================================= */
body.post-type-archive-infrastructure .ast-container,
body.tax-infra_type .ast-container {
    padding-left: 0;
    padding-right: 0;
}

body.post-type-archive-infrastructure #primary,
body.tax-infra_type #primary {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-top: 0;
    margin-bottom: 0;
}

body.post-type-archive-infrastructure #content,
body.post-type-archive-infrastructure .site-content,
body.tax-infra_type #content,
body.tax-infra_type .site-content {
    margin-top: 0;
}

body.post-type-archive-infrastructure .entry-header,
body.tax-infra_type .entry-header {
    display: none;
}

.infra-archive {
    overflow-x: hidden;
}

.infra-archive .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    box-sizing: border-box;
}

/* =============================================
   BREADCRUMBS
   ============================================= */
.infra-archive .arkhyz-breadcrumbs {
    padding: 15px 0;
    font-size: 13px;
    color: #999;
}

.infra-archive .arkhyz-breadcrumbs a {
    color: #666;
    text-decoration: none;
}

.infra-archive .arkhyz-breadcrumbs a:hover {
    color: var(--arkhyz-primary, #2563eb);
}

.infra-archive .arkhyz-breadcrumbs .sep {
    margin: 0 6px;
    color: #ccc;
}

.infra-archive .arkhyz-breadcrumbs .current {
    color: #333;
}

/* Mobile back */
.infra-mobile-back {
    display: none;
}

.infra-mobile-back__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 0;
    font-size: 14px;
    color: #666;
    text-decoration: none;
}

.infra-mobile-back__link:hover {
    color: #333;
}

/* =============================================
   HEADER
   ============================================= */
.infra-header {
    padding: 32px 0 20px;
}

.infra-header__title {
    font-size: 36px;
    font-weight: 800;
    margin: 0 0 8px;
    color: #1a1a2e;
}

.infra-header__desc {
    font-size: 16px;
    color: #666;
    margin: 0 0 8px;
    max-width: 700px;
}

.infra-header__count {
    font-size: 14px;
    color: #999;
}

.infra-header__count strong {
    font-weight: 600;
    color: #333;
}

/* =============================================
   CATEGORY TABS
   ============================================= */
.infra-categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.infra-cat-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 24px;
    border: 1px solid #e0e0e0;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    text-decoration: none;
    background: #fff;
    transition: all .2s;
    white-space: nowrap;
}

.infra-cat-link:hover {
    border-color: #bbb;
    color: #333;
    background: #f8f9fa;
}

.infra-cat-link.active {
    background: var(--arkhyz-primary, #F57C00);
    border-color: var(--arkhyz-primary, #F57C00);
    color: #fff;
}

.infra-cat-count {
    font-size: 11px;
    font-weight: 600;
    background: rgba(0, 0, 0, .08);
    padding: 1px 7px;
    border-radius: 10px;
}

.infra-cat-link.active .infra-cat-count {
    background: rgba(255, 255, 255, .2);
}

/* =============================================
   GRID & CARDS
   ============================================= */
.infra-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding-bottom: 60px;
}

.infra-card {
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e9ecef;
    transition: box-shadow .2s, transform .2s;
    display: flex;
    flex-direction: column;
}

.infra-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, .08);
    transform: translateY(-2px);
}

.infra-card__image {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f1f3f5;
}

.infra-card__image > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.infra-card:hover .infra-card__image > img {
    transform: scale(1.04);
}

/* =============================================
   SLIDER
   ============================================= */
.infra-slider {
    position: relative;
}

.infra-slider__track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform .3s ease;
}

.infra-slider__slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
}

.infra-slider__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.infra-slider__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
    padding: 0;
}

.infra-card:hover .infra-slider__btn {
    opacity: 1;
}

.infra-slider__btn:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.infra-slider__btn--prev {
    left: 8px;
}

.infra-slider__btn--next {
    right: 8px;
}

.infra-slider__dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 2;
}

.infra-slider__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .5);
    transition: background .2s;
}

.infra-slider__dot.active {
    background: #fff;
}

.infra-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #ccc;
}

.infra-card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, .7);
}

.infra-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 18px 20px;
}

.infra-card__title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #1a1a2e;
    line-height: 1.3;
}

.infra-card__details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    flex: 1;
}

.infra-card__detail {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}

.infra-card__detail svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: #999;
}

.infra-card__detail a {
    color: var(--arkhyz-primary, #2563eb);
    text-decoration: none;
    font-weight: 500;
}

.infra-card__detail a:hover {
    text-decoration: underline;
}

.infra-card__detail--note {
    color: #888;
    font-style: italic;
}

.infra-card__route-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    text-decoration: none;
    background: #fff;
    transition: all .2s;
    margin-top: auto;
}

.infra-card__route-btn:hover {
    border-color: var(--arkhyz-primary, #2563eb);
    color: var(--arkhyz-primary, #2563eb);
    background: rgba(37, 99, 235, .04);
}

.infra-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

/* =============================================
   SEO TEXT & FAQ
   ============================================= */
.infra-seo-text {
    max-width: 800px;
    margin: 40px 0 0;
    padding: 28px 0;
    border-top: 1px solid #e9ecef;
}

.infra-seo-text h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #1a1a2e;
}

.infra-seo-text p {
    font-size: 15px;
    line-height: 1.7;
    color: #555;
    margin: 0 0 10px;
}

.infra-seo-text p:last-child {
    margin-bottom: 0;
}

.infra-faq {
    max-width: 800px;
    margin: 32px 0 0;
    padding: 28px 0 40px;
    border-top: 1px solid #e9ecef;
}

.infra-faq__title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 20px;
    color: #1a1a2e;
}

.infra-faq__item {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: box-shadow .2s;
}

.infra-faq__item[open] {
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
}

.infra-faq__question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.infra-faq__question::-webkit-details-marker {
    display: none;
}

.infra-faq__question::after {
    content: '';
    width: 10px;
    height: 10px;
    border-right: 2px solid #999;
    border-bottom: 2px solid #999;
    transform: rotate(45deg);
    flex-shrink: 0;
    margin-left: 16px;
    transition: transform .2s;
}

.infra-faq__item[open] .infra-faq__question::after {
    transform: rotate(-135deg);
}

.infra-faq__answer {
    padding: 0 20px 16px;
    font-size: 14px;
    line-height: 1.7;
    color: #555;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
    .infra-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .infra-archive .container {
        padding: 0 16px;
    }

    .infra-archive .arkhyz-breadcrumbs {
        display: none;
    }

    .infra-mobile-back {
        display: block;
    }

    .infra-header__title {
        font-size: 26px;
    }

    .infra-header {
        padding: 16px 0 16px;
    }

    .infra-categories {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        margin-bottom: 20px;
        scrollbar-width: none;
    }

    .infra-categories::-webkit-scrollbar {
        display: none;
    }

    .infra-cat-link {
        flex: 0 0 auto;
        font-size: 13px;
        padding: 7px 14px;
    }

    .infra-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .infra-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .infra-card__content {
        padding: 12px 14px 16px;
    }
}
