﻿/* ============ Articles (Site + Admin) ============ */

.articles-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

.articles-page__header {
    text-align: center;
    margin-bottom: 32px;
}

.articles-page__title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
}

.articles-page__subtitle {
    color: #6b7280;
    margin: 0;
}

.articles-page__layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
}

@media (max-width: 900px) {
    .articles-page__layout {
        grid-template-columns: 1fr;
    }
}

/* ---- Filter ---- */
.articles-filter {
    background: #fff;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
}

.articles-filter__row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 10px;
}

@media (max-width: 700px) {
    .articles-filter__row {
        grid-template-columns: 1fr;
    }
}

.articles-filter__input,
.articles-filter__select {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-family: inherit;
}

.articles-filter__btn {
    background: #2563eb;
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 10px 18px;
    cursor: pointer;
}

    .articles-filter__btn:hover {
        background: #1d4ed8;
    }

/* ---- Grid + Card ---- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.article-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    transition: transform .2s, box-shadow .2s;
}

    .article-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    }

.article-card__image-link {
    position: relative;
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f3f4f6;
}

.article-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.article-card:hover .article-card__image {
    transform: scale(1.05);
}

.article-card__badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

.article-card__badge--featured {
    background: #f59e0b;
}

.article-card__body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.article-card__kind {
    display: inline-block;
    color: #111827;
    text-decoration: none;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    align-self: flex-start;
}

    .article-card__kind i {
        margin-left: 4px;
    }

.article-card__title {
    font-size: 16px;
    margin: 0;
    line-height: 1.6;
}

    .article-card__title a {
        color: #111827;
        text-decoration: none;
    }

        .article-card__title a:hover {
            color: #2563eb;
        }

.article-card__summary {
    color: #6b7280;
    font-size: 13px;
    margin: 0;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #6b7280;
}

.article-card__meta-item i {
    margin-left: 4px;
}

.article-card__more {
    margin-top: auto;
    color: #2563eb;
    text-decoration: none;
    font-size: 13px;
}

/* ---- Pagination ---- */
.articles-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 30px;
}

.articles-pagination__link {
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #111827;
    text-decoration: none;
    font-size: 14px;
}

    .articles-pagination__link:hover {
        background: #f3f4f6;
    }

    .articles-pagination__link.is-active {
        background: #2563eb;
        color: #fff;
        border-color: #2563eb;
    }

.articles-pagination__dots {
    padding: 8px 4px;
    color: #6b7280;
}

/* ---- Sidebar ---- */
.articles-page__sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.articles-sidebar-box {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.articles-sidebar-box__title {
    font-size: 15px;
    margin: 0 0 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f3f4f6;
}

.articles-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.articles-sidebar-list__item {
    padding: 8px 0;
    border-bottom: 1px dashed #f3f4f6;
    font-size: 13px;
}

    .articles-sidebar-list__item:last-child {
        border-bottom: 0;
    }

    .articles-sidebar-list__item a {
        color: #111827;
        text-decoration: none;
    }

        .articles-sidebar-list__item a:hover {
            color: #2563eb;
        }

.articles-sidebar-list__meta {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 3px;
}

.articles-sidebar-list__count {
    color: #9ca3af;
}

.articles-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    background: #fff;
    border-radius: 12px;
}

/* ---- Detail ---- */
.article-detail {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

.article-detail__header {
    margin-bottom: 20px;
    text-align: center;
}

.article-detail__kind {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    color: #111827;
    text-decoration: none;
    font-size: 12px;
    margin-bottom: 12px;
}

    .article-detail__kind i {
        margin-left: 4px;
    }

.article-detail__title {
    font-size: 28px;
    margin: 10px 0;
    line-height: 1.5;
}

.article-detail__meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    color: #6b7280;
    font-size: 13px;
}

.article-detail__image,
.article-detail__media {
    margin: 24px 0;
    border-radius: 12px;
    overflow: hidden;
}

    .article-detail__image img {
        width: 100%;
        display: block;
    }

.article-detail__video {
    width: 100%;
    display: block;
}

.ratio {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
}

    .ratio iframe {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        border: 0;
    }

.article-detail__summary {
    background: #f9fafb;
    border-right: 4px solid #2563eb;
    padding: 16px;
    margin: 20px 0;
    color: #374151;
    font-size: 14px;
    line-height: 1.8;
    border-radius: 8px;
}

.article-content {
    font-size: 15px;
    line-height: 2;
    color: #1f2937;
}

    .article-content h1, .article-content h2, .article-content h3 {
        margin-top: 24px;
    }

    .article-content img {
        max-width: 100%;
        border-radius: 8px;
        height: auto;
    }

    .article-content blockquote {
        border-right: 4px solid #e5e7eb;
        padding: 8px 16px;
        color: #4b5563;
        margin: 16px 0;
        background: #f9fafb;
    }

    .article-content table {
        width: 100%;
        border-collapse: collapse;
        margin: 16px 0;
    }

    .article-content th, .article-content td {
        border: 1px solid #e5e7eb;
        padding: 8px;
    }

.article-detail__gallery {
    margin-top: 32px;
}

.article-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.article-gallery__item {
    display: block;
    border-radius: 8px;
    overflow: hidden;
}

    .article-gallery__item img {
        width: 100%;
        height: 140px;
        object-fit: cover;
        transition: transform .2s;
    }

    .article-gallery__item:hover img {
        transform: scale(1.05);
    }

.article-detail__related {
    margin-top: 40px;
}

    .article-detail__related h2 {
        margin-bottom: 16px;
    }

/* ============ Admin ============ */
.admin-page {
    padding: 20px;
}

.admin-page__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-page__title {
    font-size: 22px;
    margin: 0;
}

.admin-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    background: #fff;
    padding: 14px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

    .admin-filter .form-control {
        padding: 8px 12px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        min-width: 160px;
    }

.admin-table-wrap {
    background: #fff;
    border-radius: 10px;
    overflow: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .admin-table th, .admin-table td {
        padding: 10px 12px;
        text-align: right;
        border-bottom: 1px solid #f3f4f6;
    }

    .admin-table th {
        background: #f9fafb;
        font-weight: 700;
    }

    .admin-table .actions {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
    }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-secondary {
    background: #e5e7eb;
    color: #374151;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-secondary {
    background: #e5e7eb;
    color: #111827;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}

.btn-warning {
    background: #f59e0b;
    color: #fff;
}

.btn-info {
    background: #0ea5e9;
    color: #fff;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 16px;
}

    .form-grid .span-2 {
        grid-column: span 2;
    }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .form-group label {
        font-weight: 600;
        font-size: 13px;
    }

.form-control {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-family: inherit;
}

    .form-control:focus {
        outline: 0;
        border-color: #2563eb;
    }

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.current-image {
    margin-top: 8px;
    padding: 8px;
    background: #f9fafb;
    border-radius: 8px;
}

.admin-pagination {
    display: flex;
    justify-content: center;
    gap: 14px;
    align-items: center;
    margin-top: 20px;
}

.text-danger {
    color: #dc2626;
    font-size: 12px;
}

@media (max-width: 700px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

        .form-grid .span-2 {
            grid-column: auto;
        }
}

.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 12px auto;
    border-radius: 8px;
}

.article-content figure {
    margin: 20px 0;
    display: block;
}

.article-content figcaption {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    margin-top: 8px;
}

.article-content p {
    margin: 12px 0;
    line-height: 1.9;
}

.article-content {
    line-height: 1.9;
    font-size: 15px;
}