/**
 * Categories Page Styles (Mobile First)
 */

/* Base styles: 320px+ */
.decategories {
    padding: 24px 0;
    background: #f8f9fa;
    min-height: 100vh;
}

.decategories__container {
    width: min(100%, 1224px);
    margin: 0 auto;
    padding: 0 clamp(12px, 4vw, 32px);
    box-sizing: border-box;
}

.decategories__title {
    text-align: center;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: #173750;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Tabs */
.decategories__tabs {
    background: #fff;
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 24px;
}

.decategories__tabs::-webkit-scrollbar {
    display: none;
}

.decategories__tabs.is-even {
    overflow-x: hidden;
    scroll-snap-type: none;
    justify-content: space-between;
    gap: 12px;
}

.decategories__tabs.is-even .decategories__tab {
    flex: 1 1 0;
    min-width: 0;
}

.decategories__tab {
    appearance: none;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    background: transparent;
    color: #173750;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    flex: 0 0 auto;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    white-space: nowrap;
    position: relative;
    scroll-snap-align: center;
}

.decategories__tab:hover {
    color: #173750;
    text-decoration: none;
}

.decategories__tab.is-active {
    background: #173750;
    color: #fff;
    box-shadow: 0 8px 20px rgba(23, 55, 80, 0.2);
}

.decategories__tab::after {
    content: '';
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 6px;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease;
    opacity: 0.8;
}

.decategories__tab:hover::after,
.decategories__tab:focus-visible::after {
    transform: scaleX(1);
}

.decategories__tab.is-active::after {
    transform: scaleX(0);
}

/* Panels */
.decategories__panels {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
    padding: 16px;
}

.decategories__panel {
    display: none;
}

.decategories__panel.is-visible {
    display: block;
}

.decategories__description {
    font-size: 1rem;
    line-height: 1.7;
    color: #173750;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #eef2f6;
}

.decategories__empty {
    text-align: center;
    color: #666;
    padding: 40px 20px;
    font-size: 1rem;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}

.article-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

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

.article-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .article-card__image img {
    transform: scale(1.05);
}

.article-card__content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.article-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: #173750;
    margin: 0;
    line-height: 1.3;
}

.article-card__date {
    font-size: 0.75rem;
    color: #888;
}

/* Tablet: 768px+ */
@media (min-width: 768px) {
    .decategories {
        padding: 40px 0;
    }

    .decategories__panels {
        padding: 24px;
    }

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

/* Desktop: 1024px+ */
@media (min-width: 1024px) {
    .decategories {
        padding: 60px 0;
    }

    .decategories__title {
        margin-bottom: 32px;
    }

    .decategories__panels {
        padding: 32px;
    }

    .articles-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 28px;
    }

    .article-card__content {
        padding: 20px;
    }

    .article-card__title {
        font-size: 1.125rem;
    }
}

/* Large Desktop: 1440px+ */
@media (min-width: 1440px) {
    .decategories__container {
        max-width: 1400px;
    }

    .articles-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Full HD: 1920px+ */
@media (min-width: 1920px) {
    .decategories__container {
        max-width: 1600px;
    }
}
