/* ==========================================================================
   AJIEL Theme — Sidebar Widgets & Statistics Bar
   ========================================================================== */

.ajiel-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Journal homepage panels */
.ajiel-sidebar__panel {
    padding: 20px;
    background: var(--ajiel-white);
    border: 1px solid var(--ajiel-border);
    border-radius: var(--ajiel-radius-lg);
    box-shadow: var(--ajiel-shadow-sm);
}

.ajiel-sidebar__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    padding-bottom: 12px;
    color: var(--ajiel-navy);
    border-bottom: 1px solid var(--ajiel-border);
    font-size: 1rem;
    font-weight: 700;
}

.ajiel-sidebar__title svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    stroke: var(--ajiel-teal);
    fill: none;
}

.ajiel-cta-panel {
    padding: 24px;
    color: var(--ajiel-white);
    background: linear-gradient(145deg, var(--ajiel-navy), var(--ajiel-navy-deep));
    border: 1px solid rgba(196, 154, 58, .38);
    border-radius: var(--ajiel-radius-lg);
    box-shadow: var(--ajiel-shadow-md);
}

.ajiel-cta-panel__badge {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 4px 10px;
    color: var(--ajiel-white);
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: var(--ajiel-radius-pill);
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .08em;
}

.ajiel-cta-panel__title {
    margin: 0 0 8px;
    color: var(--ajiel-white);
    font-family: var(--ajiel-font-heading);
    font-size: 1.25rem;
    line-height: 1.3;
}

.ajiel-cta-panel__desc {
    margin: 0 0 18px;
    color: rgba(255, 255, 255, .82);
    font-size: .875rem;
    line-height: 1.6;
}

.ajiel-cta-panel__btn {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    color: var(--ajiel-navy-deep);
    background: var(--ajiel-gold);
    border: 1px solid var(--ajiel-gold);
    border-radius: var(--ajiel-radius-sm);
    font-size: .8125rem;
    font-weight: 700;
    text-align: center;
    transition: background var(--ajiel-duration) var(--ajiel-ease),
        border-color var(--ajiel-duration) var(--ajiel-ease),
        transform var(--ajiel-duration) var(--ajiel-ease);
}

.ajiel-cta-panel__btn:hover {
    color: var(--ajiel-navy-deep);
    background: #D8B45B;
    border-color: #D8B45B;
    transform: translateY(-1px);
}

.ajiel-cta-panel__btn svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.ajiel-resources-list {
    display: grid;
    gap: 8px;
}

.ajiel-resource-item {
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    color: var(--ajiel-text);
    background: var(--ajiel-surface);
    border: 1px solid transparent;
    border-radius: var(--ajiel-radius-sm);
    font-size: .8125rem;
    font-weight: 600;
    transition: background var(--ajiel-duration) var(--ajiel-ease),
        border-color var(--ajiel-duration) var(--ajiel-ease),
        color var(--ajiel-duration) var(--ajiel-ease);
}

.ajiel-resource-item:hover {
    color: var(--ajiel-navy);
    background: var(--ajiel-mint);
    border-color: var(--ajiel-border);
}

.ajiel-resource-item svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    stroke: var(--ajiel-teal);
    stroke-width: 1.8;
    fill: none;
}

.ajiel-resource-item__text {
    flex: 1;
}

.ajiel-resource-item__arrow {
    color: var(--ajiel-gold);
    font-size: 1rem;
}

.ajiel-announcements-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ajiel-announcement-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--ajiel-border);
}

.ajiel-announcement-item:first-child {
    padding-top: 0;
}

.ajiel-announcement-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.ajiel-announcement-item__date {
    color: var(--ajiel-muted);
    font-size: .75rem;
}

.ajiel-announcement-item__title {
    margin: 4px 0;
    color: var(--ajiel-navy);
    font-size: .875rem;
    line-height: 1.4;
}

.ajiel-announcement-item__title a {
    color: inherit;
}

.ajiel-announcement-item__desc {
    margin: 0;
    color: var(--ajiel-muted);
    font-size: .8125rem;
    line-height: 1.5;
}

/* ── 1. Call to Action Banner (AJIEL identity) ── */
.ajiel-sidebar-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(18, 51, 84, 0.05);
    border: 1px solid #EBF1F5;
    transition: all var(--ajiel-duration, 0.2s) var(--ajiel-ease, ease);
    background: #ffffff;
    padding: 18px 16px;
    text-align: center;
    text-decoration: none;
}

.ajiel-sidebar-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(18, 51, 84, 0.1);
    border-color: #DCE8EF;
}

.ajiel-sidebar-cta img {
    max-width: 170px;
    width: 100%;
    max-height: 170px;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    transition: transform 0.25s ease;
}

.ajiel-sidebar-cta:hover img {
    transform: scale(1.03);
}

/* ── Generic Sidebar Widget Container ── */
.ajiel-sidebar-widget {
    background: #ffffff;
    border: 1px solid #EBF1F5;
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 2px 6px rgba(18, 51, 84, 0.03);
}

.ajiel-sidebar-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #F1F5F9;
}

.ajiel-sidebar-widget__title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--ajiel-navy, #123354);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.ajiel-sidebar-widget__title svg {
    width: 19px;
    height: 19px;
    stroke: var(--ajiel-teal, #176A86);
    stroke-width: 2.2;
    fill: none;
    flex-shrink: 0;
}

.ajiel-sidebar-widget__more {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ajiel-teal, #176A86);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all 0.2s ease;
}

.ajiel-sidebar-widget__more:hover {
    color: var(--ajiel-teal-dark, #12495D);
    transform: translateX(2px);
}

/* ── 2. Top 5 Articles Widget (Artikel Terpopuler) ── */
.ajiel-top-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(229, 180, 60, 0.15), rgba(245, 158, 11, 0.25));
    color: #B45309;
    border: 1px solid rgba(229, 180, 60, 0.35);
}

.ajiel-top-articles-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ajiel-top-article-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #F1F5F9;
    transition: all 0.2s ease-in-out;
}

.ajiel-top-article-card:hover {
    background: #F8FAFC;
    border-color: #E2E8F0;
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(18, 51, 84, 0.05);
}

.ajiel-top-article-rank {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.875rem;
    font-weight: 800;
    color: #ffffff;
    background: #94A3B8;
}

/* Rank-specific styling */
.ajiel-top-article-rank-1 .ajiel-top-article-rank {
    background: linear-gradient(135deg, #D8B45B, #C49A3A);
    box-shadow: 0 3px 8px rgba(245, 158, 11, 0.35);
}

.ajiel-top-article-rank-2 .ajiel-top-article-rank {
    background: linear-gradient(135deg, #64748B, #475569);
    box-shadow: 0 3px 8px rgba(100, 116, 139, 0.3);
}

.ajiel-top-article-rank-3 .ajiel-top-article-rank {
    background: linear-gradient(135deg, #00877C, #005A53);
    box-shadow: 0 3px 8px rgba(23, 106, 134, 0.3);
}

.ajiel-top-article-rank-4 .ajiel-top-article-rank,
.ajiel-top-article-rank-5 .ajiel-top-article-rank {
    background: #F1F5F9;
    color: #475569;
    border: 1px solid #E2E8F0;
}

.ajiel-top-article-info {
    flex: 1;
    min-width: 0;
}

.ajiel-top-article-journal {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ajiel-teal, #176A86);
    margin-bottom: 2px;
}

.ajiel-top-article-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--ajiel-navy, #123354);
    line-height: 1.35;
    margin: 0 0 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ajiel-top-article-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ajiel-top-article-title a:hover {
    color: var(--ajiel-teal, #176A86);
}

.ajiel-top-article-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.ajiel-top-article-authors {
    font-size: 0.6875rem;
    color: #64748B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

.ajiel-top-article-stats {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.ajiel-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #475569;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    padding: 1px 5px;
    border-radius: 6px;
    line-height: 1.3;
}

.ajiel-stat-pill svg {
    color: var(--ajiel-teal, #176A86);
    flex-shrink: 0;
}

.ajiel-top-articles-empty {
    font-size: 0.8125rem;
    color: #64748B;
    padding: 12px;
    text-align: center;
    margin: 0;
}

/* ── Announcements Widget (Legacy / Fallback) ── */
.ajiel-announcements-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ajiel-announcement-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid #F1F5F9;
}

.ajiel-announcement-card:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.ajiel-announcement-date {
    width: 48px;
    height: 54px;
    background: var(--ajiel-teal, #176A86);
    color: #ffffff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(23, 106, 134, 0.25);
}

.ajiel-announcement-date__day {
    font-size: 1.125rem;
    font-weight: 800;
    line-height: 1;
}

.ajiel-announcement-date__month {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 2px;
    letter-spacing: 0.05em;
}

.ajiel-announcement-date__year {
    font-size: 0.5625rem;
    opacity: 0.85;
}

.ajiel-announcement-info {
    flex: 1;
    min-width: 0;
}

.ajiel-announcement-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--ajiel-navy, #123354);
    line-height: 1.35;
    margin: 0 0 3px;
}

.ajiel-announcement-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ajiel-announcement-title a:hover {
    color: var(--ajiel-teal, #176A86);
}

.ajiel-announcement-desc {
    font-size: 0.725rem;
    color: #64748B;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── 3. Browse by Subject Widget ── */
.ajiel-subject-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.ajiel-subject-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.78125rem;
    font-weight: 700;
    transition: all var(--ajiel-duration, 0.2s) var(--ajiel-ease, ease);
}

.ajiel-subject-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

.ajiel-subject-card__icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ajiel-subject-card__icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.ajiel-subject-card--pendidikan {
    background: #EAF8F4;
    color: #0F766E;
    border: 1px solid rgba(15, 118, 110, 0.18);
}

.ajiel-subject-card--sains {
    background: #EBF3FC;
    color: #0369A1;
    border: 1px solid rgba(3, 105, 161, 0.18);
}

.ajiel-subject-card--sosial {
    background: #F3EFFB;
    color: #6D28D9;
    border: 1px solid rgba(109, 40, 217, 0.18);
}

.ajiel-subject-card--teknologi {
    background: #FEF3EB;
    color: #C2410C;
    border: 1px solid rgba(194, 65, 12, 0.18);
}

.ajiel-subject-card--keislaman {
    background: #E6F5F4;
    color: #005A54;
    border: 1px solid rgba(0, 90, 84, 0.18);
}

.ajiel-subject-card--ekonomi {
    background: #FDEEF1;
    color: #BE123C;
    border: 1px solid rgba(190, 18, 60, 0.18);
}

/* ── 4. Horizontal Statistics Bar (Full-Width Strip Below Grid) ── */
.ajiel-stats-bar {
    background: #F0F7F6;
    border: 1px solid rgba(23, 106, 134, 0.14);
    border-radius: 12px;
    padding: 18px 28px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: center;
    margin-top: 10px;
}

.ajiel-stat-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ajiel-stat-item:not(:last-child) {
    border-right: 1px solid rgba(23, 106, 134, 0.14);
    padding-right: 16px;
}

.ajiel-stat-item__icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid rgba(23, 106, 134, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ajiel-teal, #176A86);
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(23, 106, 134, 0.08);
}

.ajiel-stat-item__icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.ajiel-stat-item__data {
    display: flex;
    flex-direction: column;
}

.ajiel-stat-item__num {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--ajiel-navy, #123354);
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.ajiel-stat-item__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748B;
    margin-top: 2px;
}

/* ── Responsive for Sidebar and Stats ── */
@media (max-width: 992px) {
    .ajiel-content-grid {
        grid-template-columns: 1fr;
    }

    .ajiel-stats-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .ajiel-stat-item:nth-child(2) {
        border-right: none;
    }
}

@media (max-width: 540px) {
    .ajiel-stats-bar {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .ajiel-stat-item:not(:last-child) {
        border-right: none;
        border-bottom: 1px solid rgba(23, 106, 134, 0.14);
        padding-bottom: 12px;
    }
}
