/**
 * AVTMO — components.css
 * Komponen tambahan di luar style.css utama.
 * Diload setelah style.css.
 */

/* ── Tabs ── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--color-border); margin-bottom: var(--space-6); }
.tab-link {
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}
.tab-link:hover { color: var(--color-primary); }
.tab-link.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Progress Bar ── */
.progress { height: 8px; background: var(--color-divider); border-radius: var(--radius-full); overflow: hidden; }
.progress__bar {
    height: 100%;
    background: var(--color-accent);
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
}
.progress__bar--success { background: var(--color-success); }
.progress__bar--info    { background: var(--color-info); }

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11,31,51,0.6);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-base);
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
    background: var(--color-bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: var(--transition-base);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal__header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--color-divider);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal__title { font-size: var(--text-lg); font-weight: var(--font-bold); color: var(--color-primary); }
.modal__close {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}
.modal__close:hover { background: var(--color-divider); color: var(--color-primary); }
.modal__body { padding: var(--space-6); }
.modal__footer { padding: var(--space-4) var(--space-6); border-top: 1px solid var(--color-divider); display: flex; gap: var(--space-3); justify-content: flex-end; }

/* ── Toast Notification ── */
.toast-container {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.toast {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    box-shadow: var(--shadow-xl);
    font-size: var(--text-sm);
    min-width: 280px;
    max-width: 360px;
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    animation: toast-in 0.3s ease;
}
.toast--success { border-left: 4px solid var(--color-success); }
.toast--error   { border-left: 4px solid var(--color-danger); }
.toast--warning { border-left: 4px solid var(--color-warning); }
@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Skeleton Loading ── */
.skeleton {
    background: linear-gradient(90deg, var(--color-divider) 25%, #e8ecf0 50%, var(--color-divider) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}
@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-text  { height: 1em; margin-bottom: var(--space-2); }
.skeleton-title { height: 1.5em; width: 60%; margin-bottom: var(--space-3); }
.skeleton-img   { height: 200px; border-radius: var(--radius-xl); }

/* ── Upload Area ── */
.upload-area {
    border: 2px dashed var(--color-border-strong);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    text-align: center;
    cursor: pointer;
    transition: var(--transition-base);
    background: var(--color-bg);
}
.upload-area:hover, .upload-area.drag-over {
    border-color: var(--color-accent);
    background: var(--color-accent-light);
}
.upload-area__icon { font-size: 2rem; margin-bottom: var(--space-3); }
.upload-area__text { font-size: var(--text-sm); color: var(--color-text-muted); }
.upload-area__hint { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-2); }

/* ── Stat Grid ── */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-5); }
@media (max-width: 768px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stat-grid { grid-template-columns: 1fr 1fr; } }

/* ── Info List (profil anggota) ── */
.info-list { display: flex; flex-direction: column; gap: 0; }
.info-list__row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: var(--space-4);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-divider);
    font-size: var(--text-sm);
}
.info-list__row:last-child { border-bottom: none; }
.info-list__label { color: var(--color-text-muted); font-weight: var(--font-medium); }
.info-list__value { color: var(--color-text); font-weight: var(--font-normal); word-break: break-word; overflow-wrap: anywhere; }

@media (max-width: 480px) {
    .info-list__row { grid-template-columns: 1fr; gap: var(--space-1); padding: var(--space-2) 0; }
    .info-list__label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.04em; }
}

/* ── Spinner ── */
.spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty State ── */
.empty-state { text-align: center; padding: var(--space-16) var(--space-8); }
.empty-state__icon { font-size: 3rem; margin-bottom: var(--space-4); opacity: 0.6; }
.empty-state__title { font-size: var(--text-lg); font-weight: var(--font-semibold); color: var(--color-text-muted); margin-bottom: var(--space-2); }
.empty-state__desc  { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-6); }

/* ── Article Body Typography ── */

.entry-content {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--color-text);
}

/* Jarak antar paragraf */
.entry-content p {
    margin-top: 0;
    margin-bottom: var(--space-5);
}

/* Heading di dalam konten */
.entry-content h2,
.entry-content h3,
.entry-content h4 {
    color: var(--color-primary);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    margin-top: var(--space-8);
    margin-bottom: var(--space-4);
}
.entry-content h2 { font-size: var(--text-2xl); }
.entry-content h3 { font-size: var(--text-xl); }
.entry-content h4 { font-size: var(--text-lg); }

/* List */
.entry-content ul,
.entry-content ol {
    margin-bottom: var(--space-5);
    padding-left: var(--space-8);
}
.entry-content ul { list-style-type: disc; }
.entry-content ol { list-style-type: decimal; }
.entry-content li {
    margin-bottom: var(--space-2);
    line-height: var(--leading-relaxed);
}
.entry-content li > p { text-indent: 0; margin-bottom: var(--space-2); }

/* Blockquote */
.entry-content blockquote {
    margin: var(--space-6) 0;
    padding: var(--space-4) var(--space-6);
    border-left: 4px solid var(--color-accent);
    background: var(--color-bg);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    color: var(--color-text-secondary);
    font-style: italic;
}
.entry-content blockquote p {
    text-indent: 0;
    margin-bottom: 0;
}

/* Gambar */
.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    display: block;
    margin: var(--space-6) auto;
}
.entry-content figure { margin: var(--space-6) 0; }
.entry-content figcaption {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-2);
    font-style: italic;
}

/* Link */
.entry-content a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.entry-content a:hover { color: var(--color-accent-dark); }

/* Garis pemisah */
.entry-content hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--space-8) 0;
}

/* Tabel */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-6);
    font-size: var(--text-sm);
}
.entry-content th,
.entry-content td {
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    text-align: left;
}
.entry-content th {
    background: var(--color-primary);
    color: #fff;
    font-weight: var(--font-semibold);
}
.entry-content tr:nth-child(even) td { background: var(--color-bg); }

/* Inline code */
.entry-content code {
    background: var(--color-bg);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.875em;
    color: var(--color-primary);
    border: 1px solid var(--color-border);
}
.entry-content pre {
    background: var(--color-primary);
    color: #e2e8f0;
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin-bottom: var(--space-5);
}
.entry-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: var(--text-sm);
}

/* ── News Cards (Homepage) ── */

/* Featured: layout horizontal, artikel pertama */
.news-featured {
    display: grid;
    grid-template-columns: 2fr 3fr;
    overflow: hidden;
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    background: var(--color-bg-card);
    box-shadow: var(--shadow-card);
    transition: var(--transition-all);
}
.news-featured:hover { box-shadow: var(--shadow-lg); }
.news-featured--no-thumb {
    grid-template-columns: 1fr;
}

.news-featured__img-wrap {
    overflow: hidden;
    min-height: 260px;
}
.news-featured__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.news-featured:hover .news-featured__img-wrap img {
    transform: scale(1.04);
}

.news-featured__no-thumb {
    min-height: 8px;
    background: var(--color-accent);
}

.news-featured__body {
    padding: var(--space-8);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--space-5);
}
.news-featured__meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}
.news-featured__meta-sep { color: var(--color-border-strong); }
.news-featured__title {
    font-size: var(--text-2xl);
    font-weight: var(--font-extrabold);
    color: var(--color-primary);
    line-height: var(--leading-tight);
    margin: 0;
}
.news-featured__title a { color: inherit; text-decoration: none; }
.news-featured__title a:hover { color: var(--color-accent); }
.news-featured__excerpt {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    margin: 0;
    flex: 1;
}
.news-featured__cta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--color-accent);
    text-decoration: none;
    width: fit-content;
    border-bottom: 1.5px solid transparent;
    transition: border-color 0.15s ease, color 0.15s ease;
    padding-bottom: 1px;
}
.news-featured__cta:hover {
    color: var(--color-accent-dark);
    border-bottom-color: var(--color-accent-dark);
}

/* Grid cards: artikel ke-2 dst */
.news-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    background: var(--color-bg-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: var(--transition-all);
}
.news-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.news-card__img-wrap {
    overflow: hidden;
    height: 186px;
    flex-shrink: 0;
}
.news-card__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.news-card:hover .news-card__img-wrap img { transform: scale(1.05); }

.news-card__no-thumb {
    height: 4px;
    background: var(--color-accent);
    flex-shrink: 0;
}

.news-card__body {
    padding: var(--space-5) var(--space-6);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.news-card__meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}
.news-card__title {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    color: var(--color-primary);
    line-height: var(--leading-tight);
    margin: 0;
    flex: 1;
}
.news-card__title a { color: inherit; text-decoration: none; }
.news-card__title a:hover { color: var(--color-accent); }
.news-card__excerpt {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    margin: 0;
}

.news-card__footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-divider);
}
.news-card__link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-accent);
    text-decoration: none;
}
.news-card__link:hover { color: var(--color-accent-dark); }
.news-card__link svg { transition: transform 0.15s ease; }
.news-card__link:hover svg { transform: translateX(3px); }

/* Responsif: featured card stack vertikal di mobile */
@media (max-width: 640px) {
    .news-featured {
        grid-template-columns: 1fr;
    }
    .news-featured__img-wrap {
        min-height: 200px;
        max-height: 240px;
    }
    .news-featured__body {
        padding: var(--space-6);
    }
    .news-featured__title {
        font-size: var(--text-xl);
    }
}
