/* =============================================
   READING PROGRESS BAR
   ============================================= */

#topProgressBar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    z-index: 9999;
    opacity: 0;
    transition: width 0.15s ease, opacity 0.3s ease;
    border-radius: 0 2px 2px 0;
    pointer-events: none;
}

/* =============================================
   ARTICLE GRID LAYOUT
   ============================================= */

.articles-grid-container {

    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 32px;
    margin-bottom: 80px;
}

/* 3 columns on large screens */
@media screen and (min-width: 1100px) {
    .articles-grid-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 40px 28px;
    }
}

/* =============================================
   MOBILE ARTICLE CARD — Clean Vertical Layout
   Berlaku di max-width: 600px (mobile only)
   ============================================= */

@media screen and (max-width: 600px) {

    /* Grid: 1 kolom */
    .articles-grid-container {
        grid-template-columns: 1fr;
        gap: 32px;
        margin-bottom: 60px;
        padding: 0 16px;
    }

    /* Section padding mobile */
    .section.narrow,
    section.narrow {
        padding-left: 0;
        padding-right: 0;
    }

    /* Card link */
    .article-card-link {
        display: block;
        border-radius: 0;
        overflow: visible;
        transition: none;
        padding: 0;
        border: none;
    }

    .article-card-link:hover {
        transform: none;
    }

    /* Card: vertical layout — gambar di atas, teks di bawah */
    .article-card {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        height: auto;
        background: transparent;
        border-radius: 0;
    }

    /* Image: hero style untuk semua card */
    .article-card__image-wrap {
        width: 100%;
        height: 220px;
        flex-shrink: 0;
        border-radius: 12px;
        overflow: hidden;
        order: 1; /* Pastikan selalu di atas */
        background: var(--hover);
        margin: 0;
    }

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

    .article-card-link:active .article-card__image {
        transform: scale(1.04);
    }

    /* Body */
    .article-card__body {
        flex: 1;
        padding: 0 4px;
        min-width: 0;
        order: 2; /* Pastikan di bawah gambar */
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        width: 100%;
    }

    /* Category badge */
    .article-card__categories {
        margin-bottom: 10px;
        gap: 6px;
    }

    .category-badge {
        font-size: 10px;
        padding: 4px 12px;
        letter-spacing: 0.05em;
    }

    /* Judul */
    .article-card__title {
        font-size: 22px;
        line-height: 1.4;
        margin: 0 0 10px;
        font-weight: 700;
        color: var(--primary);
        transition: color 0.2s ease;
    }

    .article-card-link:active .article-card__title {
        color: var(--accent, #27ae60);
    }

    /* Excerpt (tampilkan sedikit, 2 baris) */
    .article-card__excerpt {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 14px;
        line-height: 1.6;
        color: var(--grey);
        opacity: 0.8;
        margin-bottom: 12px;
    }

    /* Meta */
    .article-card__meta {
        font-size: 13px;
        opacity: 0.5;
        font-weight: 500;
        padding-top: 0;
        margin-top: auto;
        color: var(--grey);
        letter-spacing: 0.01em;
    }
}

/* =============================================
   LIST VIEW TOGGLE (articles-list-container-alt)
   ============================================= */

.articles-list-container-alt {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
}

.articles-list-container-alt .article-card {
    flex-direction: row;
    align-items: center;
}

.articles-list-container-alt .article-card__image-wrap {
    width: 250px;
    height: 180px;
    margin-right: 32px;
    margin-bottom: 0;
}

.articles-list-container-alt .article-card__body {
    padding: 0;
}

.articles-list-container-alt .article-card__title {
    font-size: 22px;
    margin-bottom: 12px;
}

@media screen and (max-width: 768px) {
    .articles-list-container-alt .article-card {
        flex-direction: column;
    }

    .articles-list-container-alt .article-card__image-wrap {
        width: 100%;
        margin-right: 0;
        margin-bottom: 16px;
    }
}

/* =============================================
   PAGINATION (Minimalis & Rata Tengah)
   ============================================= */

.pagination-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 60px;
    margin-bottom: 80px;
    clear: both;
}

nav[aria-label="Page navigation"] {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0 auto;
}

ul.pagination {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 16px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
    clear: both;
}

ul.pagination .page-item .page-link {
    font-size: 16px;
    font-weight: 500;
    color: var(--grey);
    text-decoration: none;
    transition: color 0.15s ease, transform 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    min-width: 36px;
    padding: 0 12px;
}

ul.pagination .page-item .page-link:hover {
    color: var(--primary);
    transform: translateY(-2px);
}

ul.pagination .page-item.active .page-link {
    color: var(--primary);
    font-weight: 700;
}

ul.pagination .page-item .page-prev,
ul.pagination .page-item .page-next {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}



/* =============================================
   ARTICLE CARD
   ============================================= */

.article-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    overflow: visible;
    transition: transform 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.article-card-link:hover {
    transform: translateY(-4px);
    text-decoration: none;
}

.article-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    border: none;
}

.article-card-link:hover .article-card {
    border-color: transparent;
}

/* --- Image --- */
.article-card__image-wrap {
    width: 100%;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--hover);
    border-radius: 12px;
}

@media screen and (min-width: 1100px) {
    .article-card__image-wrap {
        height: 210px;
    }
}

.article-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* --- Body --- */
.article-card__body {
    padding: 14px 4px 8px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* --- Categories --- */
.article-card__categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

/* --- Title --- */
.article-card__title {
    font-size: 18px;
    font-family: var(--serif, serif);
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 10px;
    line-height: 1.4;
    /* limit to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.article-card-link:hover .article-card__title {
    color: var(--accent, #27ae60);
}

/* --- Excerpt --- */
.article-card__excerpt {
    font-size: 14px;
    color: var(--grey);
    line-height: 1.65;
    margin: 0 0 14px;
    flex: 1;
    /* limit to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Meta --- */
.article-card__meta {
    font-size: 13px;
    font-weight: 600;
    color: var(--grey);
    opacity: 0.45;
    margin-top: auto;
    padding-top: 10px;
    border-top: none;
}

/* =============================================
   CATEGORY BADGE
   ============================================= */

.category-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    background: rgba(39, 174, 96, 0.1);
    color: var(--accent, #27ae60);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-decoration: none;
    text-transform: uppercase;
    transition: background 0.2s ease;
    cursor: pointer;
}

.category-badge:hover,
a.category-badge:hover {
    background: rgba(39, 174, 96, 0.2);
    text-decoration: none;
}

/* =============================================
   HEADER CATEGORY DROPDOWN
   ============================================= */

.category-dropdown-wrapper {
    position: relative;
    margin-left: 8px;
}

.category-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 210px;
    background: var(--background-color);
    border: 1.5px solid var(--horizontalRule, rgba(0, 0, 0, 0.12));
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 200;
}

.category-dropdown-wrapper.open .category-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.category-dropdown-item {
    display: flex;
    align-items: center;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    transition: background 0.15s ease;
}

.category-dropdown-item:hover {
    background: var(--hover);
    text-decoration: none;
}

.category-dropdown-item.active {
    color: var(--accent, #27ae60);
    background: rgba(39, 174, 96, 0.08);
    font-weight: 600;
}

.dropdown-item-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--horizontalRule, rgba(0, 0, 0, 0.2));
    margin-right: 10px;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.category-dropdown-item.active .dropdown-item-dot {
    background: var(--accent, #27ae60);
}

.category-dropdown-item:hover .dropdown-item-dot {
    background: var(--primary);
}

.dropdown-item-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    color: var(--grey);
    opacity: 0.5;
    background: var(--hover);
    padding: 2px 7px;
    border-radius: 50px;
}

.dropdown-divider {
    height: 1px;
    background: var(--horizontalRule, rgba(0, 0, 0, 0.08));
    margin: 6px 4px;
}

@media screen and (max-width: 735px) {
    .category-dropdown-wrapper {
        margin-left: 4px;
    }
}

/* =============================================
   TAXONOMY INDEX PAGE (/categories/)
   ============================================= */

.category-page-header {
    margin: 60px 0 40px;
}

.category-page-title {
    font-size: 42px;
    font-family: var(--serif, serif);
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 10px;
}

.category-page-subtitle {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent, #27ae60);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.8;
    margin: 0 0 8px;
}

.categories-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin: 40px 0 100px;
}

.category-index-card {
    display: flex;
    flex-direction: column;
    padding: 28px 24px;
    border-radius: 12px;
    border: 1.5px solid var(--horizontalRule, rgba(0, 0, 0, 0.1));
    text-decoration: none;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.category-index-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent, #27ae60);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.category-index-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    border-color: rgba(39, 174, 96, 0.3);
}

.category-index-card:hover::before {
    transform: scaleX(1);
}

.category-index-card__name {
    font-size: 20px;
    font-weight: 700;
    font-family: var(--serif, serif);
    color: var(--primary);
    margin: 0 0 8px;
}

.category-index-card__count {
    font-size: 13px;
    color: var(--grey);
    opacity: 0.55;
    margin: 0;
}

@media screen and (max-width: 540px) {
    .categories-index-grid {
        grid-template-columns: 1fr;
    }

    .category-page-title {
        font-size: 30px;
    }
}

/* =============================================
   LOGO SIZE OVERRIDE
   ============================================= */

#logo-desktop svg {
    width: auto;
    height: 85px;
}

#logo-mobile svg {
    width: auto;
    height: 28px;
}

/* =============================================
   FOOTER MINIMALIS
   ============================================= */

.footer-minimal {
    margin-top: 60px;
    padding-bottom: 48px;
}

.footer-minimal__inner {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* Social icons */
.footer-minimal__social {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 24px;
}

.footer-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--grey);
    opacity: 0.45;
    transition: opacity 0.2s ease, color 0.2s ease, background 0.2s ease;
    text-decoration: none;
}

.footer-social-link:hover {
    opacity: 1;
    color: var(--primary);
    background: var(--hover);
    text-decoration: none;
}

/* Divider */
.footer-minimal__divider {
    width: 40px;
    height: 1px;
    background: var(--horizontalRule, rgba(0, 0, 0, 0.12));
    margin-bottom: 20px;
}

/* Copyright / tagline */
.footer-minimal__copy {
    font-size: 13px;
    color: var(--grey);
    opacity: 0.5;
    margin: 0 0 18px;
    text-align: center;
    line-height: 1.6;
}

.footer-minimal__copy strong {
    color: var(--primary);
    opacity: 1;
    font-weight: 700;
}

/* Footer nav */
.footer-minimal__nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.footer-minimal__nav a {
    font-size: 12px;
    font-weight: 600;
    color: var(--grey);
    opacity: 0.4;
    text-decoration: none;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: opacity 0.2s ease;
}

.footer-minimal__nav a:hover {
    opacity: 0.9;
    text-decoration: none;
}

@media screen and (max-width: 540px) {
    .footer-minimal__inner {
        padding: 0 20px;
    }

    .footer-minimal__nav {
        gap: 16px;
    }
}

/* =============================================
   MOBILE RESPONSIVE OVERRIDES (max-width: 540px)
   Hanya berlaku di mobile, tidak mengubah desktop
   ============================================= */

@media screen and (max-width: 540px) {

    /* --- Nav: kurangi jarak atas agar konten tidak terdesakl ke bawah --- */
    .nav-container {
        padding-top: 56px !important;
    }

    /* --- Article Hero: kurangi margin besar bawaan tema --- */
    .article-header {
        margin: 80px auto 48px !important;
        padding: 0 24px !important;
    }

    /* --- Judul Artikel: perkecil font agar tidak terlalu besar --- */
    .article-hero-heading {
        font-size: 26px !important;
        line-height: 1.35 !important;
        margin-bottom: 16px !important;
    }

    /* --- Meta box (author + tanggal): clean & professional --- */
    .article-hero-subtitle {
        padding: 0 !important;
        border: none !important;
        flex-direction: row !important;
        align-items: center !important;
        margin-top: 8px !important;
        margin-bottom: 24px !important;
    }

    .article-meta {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 8px !important;
        font-size: 13px !important;
        color: var(--grey) !important;
    }

    /* --- Author Avatar: tampilkan bulat dan bisa diklik --- */
    .article-author-avatar {
        display: block !important;
        width: 28px !important;
        height: 28px !important;
        border-radius: 50% !important;
        overflow: hidden !important;
        margin-right: 8px !important;
        box-shadow: 0 2px 6px rgba(0,0,0,0.08) !important;
    }

    .article-author-avatar img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .article-author-link {
        display: inline-flex !important;
        align-items: center !important;
        color: var(--primary) !important;
        font-weight: 600 !important;
        text-decoration: none !important;
    }


    /* --- Hero Image: tampilkan dengan benar di mobile --- */
    .article-hero-image {
        position: relative !important;
        width: calc(100% - 48px) !important;
        margin: 0 24px !important;
        height: auto !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
        border-radius: 12px !important;
        overflow: hidden !important;
    }

    .article-hero-image img {
        width: 100% !important;
        height: auto !important;
        display: block !important;
        border-radius: 12px !important;
    }

    /* --- Post Body: kurangi padding atas yang berlebihan --- */
    .post-content {
        padding-top: 40px !important;
    }

    /* --- Paragraf artikel: pastikan ada padding horizontal --- */
    p {
        padding-left: 24px !important;
        padding-right: 24px !important;
        font-size: 16px !important;
        line-height: 1.75 !important;
    }

    /* --- Headings dalam artikel: samakan padding dengan paragraf --- */
    h1, h2, h3, h4, h5, h6 {
        padding-left: 24px !important;
        padding-right: 24px !important;
        max-width: 100% !important;
    }

    h1 {
        font-size: 26px !important;
        line-height: 1.35 !important;
    }

    h2 {
        font-size: 20px !important;
    }

    h3 {
        font-size: 18px !important;
    }

    /* --- Section padding: sedikit lebih rapat di mobile --- */
    .section.narrow,
    section.narrow {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .section {
        padding: 0 !important;
    }
}

/* Extra small phones (< 390px) */
@media screen and (max-width: 390px) {
    .article-header {
        margin: 72px auto 40px !important;
        padding: 0 20px !important;
    }

    .article-hero-heading {
        font-size: 24px !important;
    }

    .article-hero-image {
        width: calc(100% - 40px) !important;
        margin: 0 20px !important;
    }

    p {
        padding-left: 20px !important;
        padding-right: 20px !important;
        font-size: 15px !important;
    }

    h1, h2, h3, h4, h5, h6 {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}

/* =============================================
   ARABIC TYPOGRAPHY (Amiri Font)
   ============================================= */

.arabic-text {
    direction: rtl;
    text-align: right;
    font-family: 'Amiri', serif !important;
    font-size: 26px !important;
    line-height: 2 !important;
    margin-top: 1.2em !important;
    margin-bottom: 1.2em !important;
    font-weight: 400 !important;
}

@media screen and (max-width: 600px) {
    .arabic-text {
        font-size: 24px !important; /* Dikecilkan sedikit agar pas */
        line-height: 2.1 !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}

/* =============================================
   HERO LAYOUT BUG FIX (DESKTOP & GLOBAL)
   ============================================= */
/* Memastikan gambar hero tidak absolute agar tidak menutupi teks markdown (overlap bug),
   dan membuang jarak super besar (160px padding & 120px margin) bawaan tema Novela. */

.article-header {
    margin-bottom: 45px !important;
}

.article-hero-image {
    position: relative !important;
    margin-bottom: 0px !important;
}

.post-content {
    padding-top: 45px !important;
    margin-top: 0px !important;
}

/* Memperbaiki progress-bar yang mendesak konten hingga turun sejauh 425px */
.aside-container {
    height: 0 !important;
    overflow: visible !important;
}