/* ===================================
   ARTICLES INDEX - SPECIFIC STYLES
   ✅ v2: Termasuk styles yang sebelumnya
   inline di index.blade.php
   =================================== */

/* ===================================
   MAIN CONTENT
   =================================== */
.main-content {
    padding: 20px 0 60px;
}

/* ===================================
   FILTER SECTION
   =================================== */
.filter-section {
    background: var(--article-white);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--article-shadow);
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-header h5 {
    margin: 0;
    font-weight: 700;
    color: var(--article-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-header h5 i { color: var(--article-primary); }

.filter-header .badge {
    font-size: .9rem;
    padding: 6px 12px;
}

.filter-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-controls .form-select {
    min-width: 180px;
    border: 1px solid var(--article-border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--article-text);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.filter-controls .form-select:focus {
    border-color: var(--article-primary);
    box-shadow: 0 0 0 .2rem rgba(25,60,118,.15);
}

/* ===================================
   ARTICLES GRID
   =================================== */
.articles-grid {
    margin-bottom: 40px;
    margin-left: 0;
    margin-right: 0;
}

.articles-grid .col-md-6,
.articles-grid .col-lg-4 {
    padding-left: 8px;
    padding-right: 8px;
    margin-bottom: 20px;
}

.article-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.article-link:hover { color: inherit; }

.article-link .article-card,
.articles-grid .article-card {
    width: 100% !important;
    max-width: 100% !important;
    flex-shrink: 1;
    margin: 0 auto;
}

/* ===================================
   IMAGE PROTECTION
   (dipindah dari inline <style> di blade)
   =================================== */
img,
video {
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* ===================================
   PAGINATION MODERN
   (dipindah dari inline <style> di blade)
   =================================== */
.pagination-modern { gap: 6px; }

.pagination-modern .page-link {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #193c76;
    font-weight: 600;
    padding: .5rem .75rem;
    min-width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
    background: #fff;
}

.pagination-modern .page-link:hover {
    background: #f7fafc;
    border-color: #193c76;
    color: #193c76;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(25,60,118,.15);
}

.pagination-modern .page-item.active .page-link {
    background: linear-gradient(135deg, #193c76 0%, #2c5aa0 100%);
    border-color: #193c76;
    color: #fff;
    box-shadow: 0 4px 12px rgba(25,60,118,.3);
    transform: translateY(-2px);
}

.pagination-modern .page-item.disabled .page-link {
    background: #f7fafc;
    border-color: #e2e8f0;
    color: #cbd5e0;
    opacity: .6;
    cursor: not-allowed;
}

.pagination-modern .page-link i { font-size: .75rem; }

/* ===================================
   CATEGORY HIGHLIGHT CHIPS
   (dipindah dari inline <style> di blade)
   =================================== */
.category-highlight-section {
    background: #fff;
    border: 1px solid #e8edf5;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(25,60,118,.06);
}

.category-highlight-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-highlight-scroll::-webkit-scrollbar { display: none; }

.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: .5rem 1rem;
    border-radius: 50px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #374151;
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
    flex-shrink: 0;
    cursor: pointer;
}

.category-chip:hover {
    border-color: #193c76;
    background: #f0f4ff;
    color: #193c76;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25,60,118,.15);
}

.category-chip.active {
    border-color: #193c76;
    background: linear-gradient(135deg, #193c76 0%, #2c5aa0 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(25,60,118,.25);
}

.category-chip.active:hover {
    background: linear-gradient(135deg, #122d59 0%, #1f4080 100%);
    color: #fff;
    transform: translateY(-2px);
}

.category-chip-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    flex-shrink: 0;
    overflow: hidden;
}

.category-chip-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    pointer-events: none;
}

.category-chip-icon.icon-fallback {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #4338ca;
    font-size: .8rem;
}

.category-chip.active .category-chip-icon.icon-fallback {
    background: rgba(255,255,255,.2);
    color: #fff;
}

/* ===================================
   SIDEBAR CATEGORY LIST
   (dipindah dari inline <style> di blade)
   =================================== */
.sidebar-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}

.sidebar-category-label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
}

.sidebar-cat-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: .6rem .875rem;
    border-radius: 10px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-size: .84rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
    margin-bottom: 8px;
}

.sidebar-cat-chip:last-child { margin-bottom: 0; }

.sidebar-cat-chip:hover {
    border-color: #193c76;
    background: #f0f4ff;
    color: #193c76;
    text-decoration: none;
    transform: translateX(4px);
}

.sidebar-cat-chip.active {
    border-color: #193c76;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%);
    color: #193c76;
}

.sidebar-cat-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
}

.sidebar-cat-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    pointer-events: none;
}

.sidebar-cat-icon i { font-size: .8rem; color: #4338ca; }

.sidebar-cat-chip.active .sidebar-cat-icon {
    background: linear-gradient(135deg, #193c76 0%, #2c5aa0 100%);
}

.sidebar-cat-chip.active .sidebar-cat-icon i { color: #fff; }

.sidebar-cat-info { flex: 1; min-width: 0; }

.sidebar-cat-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-cat-count { font-size: .72rem; font-weight: 500; color: #9ca3af; }

.sidebar-cat-chip.active .sidebar-cat-count { color: #6b85c4; }

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 992px) {
    .filter-header { flex-direction: column; align-items: flex-start; }
    .filter-controls { width: 100%; }
    .filter-controls .form-select { flex: 1; min-width: auto; }

    .articles-grid,
    .articles-grid .col-md-6,
    .articles-grid .col-lg-4 {
        margin-left: 0;
        margin-right: 0;
    }

    .articles-grid .col-md-6,
    .articles-grid .col-lg-4 { margin-bottom: 16px; }
}

@media (max-width: 576px) {
    .main-content { padding: 15px 0 40px; }

    .filter-section { padding: 15px; margin-bottom: 20px; }
    .filter-header h5 { font-size: 1rem; }

    .pagination-modern { gap: 4px; }
    .pagination-modern .page-link {
        min-width: 34px;
        height: 34px;
        padding: .4rem .6rem;
        font-size: .875rem;
    }
    .pagination-modern .page-link i { font-size: .7rem; }

    .category-highlight-section { padding: .75rem 1rem; }

    .articles-grid { padding-left: 4px; padding-right: 4px; }

    .articles-grid .col-md-6,
    .articles-grid .col-lg-4 {
        flex: 0 0 100%;
        max-width: 100%;
        padding-left: 8px;
        padding-right: 8px;
        margin-bottom: 20px;
    }

    .articles-grid .article-card {
        box-shadow: 0 4px 16px rgba(0,0,0,.10);
    }

    .articles-grid .article-card .titles p {
        font-size: .93rem;
        padding: 16px 14px;
        min-height: 72px;
        -webkit-line-clamp: 3;
    }

    .articles-grid .article-card .stats span {
        padding: 7px 10px;
        font-size: .78rem;
    }
}

@media (max-width: 399px) {
    .articles-grid { padding-left: 2px; padding-right: 2px; }

    .articles-grid .col-md-6,
    .articles-grid .col-lg-4 {
        padding-left: 6px;
        padding-right: 6px;
        margin-bottom: 16px;
    }

    .articles-grid .article-card .titles p {
        font-size: .88rem;
        padding: 14px 12px;
        min-height: 66px;
    }
}