/**
 * sidebar.css — Al-Kifayah Theme
 * Sidebar konten (kolom kanan) dan komponen widget.
 *
 * KONTRAK STYLING — dibuat generik dengan sengaja:
 *
 *   Wadah sidebar : .ak-sidebar (halaman umum) dan .ak-home-sidebar (homepage)
 *   Widget        : .pkp_block (markup baku block plugin OJS),
 *                   .ak-widget (widget milik tema),
 *                   .ak-config-section (section dari pengaturan tema)
 *   Judul widget  : .title / .ak-widget-title / h2 / h3 pertama di dalam widget
 *   Isi widget    : .content
 *
 * Konsekuensinya: menambah blok sidebar baru dari Journal Settings > Website
 * (atau menambah section tema baru) TIDAK memerlukan CSS tambahan — markup
 * baku OJS `<div class="pkp_block block_x"><h2 class="title">..</h2>
 * <div class="content">..</div></div>` otomatis mendapat gaya yang sama.
 */

/* =====================================================================
   WADAH SIDEBAR
   ===================================================================== */
.ak-sidebar,
.ak-home-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
    padding: 0;
    align-self: start;
}

/* =====================================================================
   WIDGET — kartu putih, satu gaya untuk semua jenis blok
   ===================================================================== */
.ak-sidebar .pkp_block,
.ak-sidebar .ak-widget,
.ak-sidebar .ak-config-section,
.ak-home-sidebar .pkp_block,
.ak-home-sidebar .ak-widget,
.ak-home-sidebar .ak-config-section {
    margin: 0;
    padding: 1.25rem;
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius-md);
    background-color: var(--ak-background);
    box-shadow: var(--ak-shadow-sm);
    color: var(--ak-text);
    font-size: 0.9rem;
}

/* =====================================================================
   JUDUL WIDGET
   `h2.pkp_screen_reader` (blok tanpa judul tampak, mis. makeSubmission)
   sengaja tidak ikut agar tetap tersembunyi secara visual.
   ===================================================================== */
.ak-sidebar .pkp_block > .title,
.ak-sidebar .ak-widget > .ak-widget-title,
.ak-sidebar .ak-config-section > .ak-section-title,
.ak-home-sidebar .pkp_block > .title,
.ak-home-sidebar .ak-widget > .ak-widget-title,
.ak-home-sidebar .ak-config-section > .ak-section-title {
    display: block;
    margin: 0 0 1rem;
    padding: 0 0 0.5rem;
    border: 0;
    border-bottom: 2px solid var(--ak-surface);
    color: var(--ak-primary);
    font-family: var(--ak-serif);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

/* Aksen emas pada judul section tema — dinetralkan di dalam sidebar
   supaya seragam dengan judul .pkp_block. */
.ak-sidebar .ak-config-section > .ak-section-title::after,
.ak-home-sidebar .ak-config-section > .ak-section-title::after {
    content: none;
}

/* =====================================================================
   ISI WIDGET
   ===================================================================== */
.ak-sidebar .pkp_block > .content,
.ak-home-sidebar .pkp_block > .content,
.ak-sidebar .ak-widget > .content,
.ak-home-sidebar .ak-widget > .content {
    font-size: 0.875rem;
    line-height: 1.55;
}

.ak-sidebar .pkp_block > .content > *:last-child,
.ak-home-sidebar .pkp_block > .content > *:last-child {
    margin-bottom: 0;
}

/* =====================================================================
   NAV ITEM SIDEBAR — SATU definisi untuk semua bentuk markup.

   Didukung dua bentuk:
     1. <ul><li><a>            markup baku block plugin OJS
     2. <div class="ak-sidebar-links"><a>...   Custom Block Manager

   Bentuk ke-2 sengaja dikunci ke WADAH-nya (.ak-sidebar-links), bukan ke
   class pada tiap <a>. Editor WYSIWYG OJS kerap membuang class pada elemen
   saat konten disunting ulang, sehingga tautan yang kehilangan
   class="ak-sidebar-link" tetap ikut tergaya.
   ===================================================================== */
.ak-sidebar .pkp_block .content ul,
.ak-home-sidebar .pkp_block .content ul,
.ak-sidebar .ak-widget .content ul,
.ak-home-sidebar .ak-widget .content ul,
.ak-sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/*
 * <br> sisa penyuntingan WYSIWYG. Wadahnya sudah memakai flex + gap,
 * sehingga <br> hanya menimbulkan celah kosong yang tidak rata.
 */
.ak-sidebar-links br,
.ak-sidebar-journal-info > br {
    display: none;
}

.ak-sidebar .pkp_block .content li > a,
.ak-home-sidebar .pkp_block .content li > a,
.ak-sidebar .ak-widget .content li > a,
.ak-home-sidebar .ak-widget .content li > a,
.ak-sidebar-links > a,
a.ak-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--ak-radius-sm);
    background-color: var(--ak-surface);
    color: var(--ak-text);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}

.ak-sidebar .pkp_block .content li > a:hover,
.ak-sidebar .pkp_block .content li > a:focus,
.ak-home-sidebar .pkp_block .content li > a:hover,
.ak-home-sidebar .pkp_block .content li > a:focus,
.ak-sidebar .ak-widget .content li > a:hover,
.ak-sidebar .ak-widget .content li > a:focus,
.ak-home-sidebar .ak-widget .content li > a:hover,
.ak-home-sidebar .ak-widget .content li > a:focus,
.ak-sidebar-links > a:hover,
.ak-sidebar-links > a:focus,
a.ak-sidebar-link:hover,
a.ak-sidebar-link:focus {
    background-color: var(--ak-primary);
    color: var(--ak-white);
}

/* Ikon di depan label — prototype: .ak-sidebar-nav-item i */
.ak-link-icon {
    flex-shrink: 0;
    width: 18px;
    text-align: center;
    color: var(--ak-primary);
    line-height: 1;
}

.ak-link-icon br {
    display: none;
}

.ak-sidebar-links > a:hover .ak-link-icon,
.ak-sidebar-links > a:focus .ak-link-icon,
a.ak-sidebar-link:hover .ak-link-icon,
a.ak-sidebar-link:focus .ak-link-icon {
    color: var(--ak-gold);
}

/* Sublist (mis. browse by category) sedikit menjorok */
.ak-sidebar .pkp_block .content ul ul,
.ak-home-sidebar .pkp_block .content ul ul {
    margin-top: 0.35rem;
    padding-left: 0.75rem;
}

/* Daftar teks milik tema (indexing, akreditasi) */
.ak-sidebar .ak-config-list,
.ak-home-sidebar .ak-config-list {
    color: var(--ak-muted);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Tombol di dalam widget memenuhi lebar kartu */
.ak-sidebar .ak-button,
.ak-home-sidebar .ak-button {
    width: 100%;
    margin-top: 0.6rem;
}

.ak-sidebar .ak-button:first-child,
.ak-home-sidebar .ak-button:first-child {
    margin-top: 0;
}

/* Form pencarian / input di dalam widget */
.ak-sidebar .pkp_block input[type="text"],
.ak-sidebar .pkp_block input[type="search"],
.ak-sidebar .pkp_block select,
.ak-home-sidebar .pkp_block input[type="text"],
.ak-home-sidebar .pkp_block input[type="search"],
.ak-home-sidebar .pkp_block select {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius-sm);
    background-color: var(--ak-background);
    color: var(--ak-text);
}

/* Gambar di dalam widget (mis. logo, banner) */
.ak-sidebar .pkp_block img,
.ak-home-sidebar .pkp_block img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* =====================================================================
   KANTOR REDAKSI & MEDIA SOSIAL — varian widget
   Komponen yang sama dipakai di footer (lihat footer.css). Di sidebar
   keduanya memakai kerangka .ak-widget sehingga otomatis seragam dengan
   blok sidebar lain.
   ===================================================================== */
.ak-sidebar .ak-office-item,
.ak-home-sidebar .ak-office-item {
    color: var(--ak-text);
}

.ak-sidebar .ak-office-icon,
.ak-home-sidebar .ak-office-icon {
    color: var(--ak-primary);
}

.ak-sidebar .ak-office-item a,
.ak-home-sidebar .ak-office-item a {
    color: var(--ak-primary);
    text-decoration: none;
}

.ak-sidebar .ak-office-item a:hover,
.ak-sidebar .ak-office-item a:focus,
.ak-home-sidebar .ak-office-item a:hover,
.ak-home-sidebar .ak-office-item a:focus {
    text-decoration: underline;
}

/* Tombol sosial di sidebar memakai warna terang, bukan gelap seperti footer */
.ak-sidebar .ak-social-btn,
.ak-home-sidebar .ak-social-btn {
    background-color: var(--ak-surface);
    border: 1px solid var(--ak-border);
    color: var(--ak-primary);
}

.ak-sidebar .ak-social-btn:hover,
.ak-sidebar .ak-social-btn:focus,
.ak-home-sidebar .ak-social-btn:hover,
.ak-home-sidebar .ak-social-btn:focus {
    background-color: var(--ak-primary);
    border-color: var(--ak-primary);
    color: var(--ak-white);
}

/* Widget ini tidak memakai <ul> tautan, jadi netralkan gaya daftar nav */
.ak-sidebar .ak-editorial-office .ak-office-list,
.ak-home-sidebar .ak-editorial-office .ak-office-list {
    display: block;
    gap: 0;
}

/* =====================================================================
   JOURNAL TEMPLATE DOWNLOAD CARD
   Kartu khusus unduhan template artikel
   ===================================================================== */

.ak-sidebar .ak-template-card,
.ak-home-sidebar .ak-template-card {
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: 1px solid var(--ak-primary);
    border-radius: var(--ak-radius-md);
    background: linear-gradient(
        145deg,
        var(--ak-primary) 0%,
        #283617 100%
    );
    color: var(--ak-white);
    box-shadow: var(--ak-shadow-sm);
}

/*
 * Aksen dekoratif di sudut kartu
 */
.ak-sidebar .ak-template-card::after,
.ak-home-sidebar .ak-template-card::after {
    content: "";
    position: absolute;
    right: -48px;
    top: -48px;
    width: 125px;
    height: 125px;
    border: 22px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    pointer-events: none;
}

/*
 * Header kartu
 */
.ak-template-card__header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.12);
}

/*
 * Label kecil
 */
.ak-template-card__badge {
    color: var(--ak-gold);
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    line-height: 1.4;
}

/*
 * Ikon unduhan
 */
.ak-template-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: var(--ak-gold);
    font-size: 1.25rem;
    font-weight: 700;
}

/*
 * Isi kartu
 */
.ak-template-card__body {
    position: relative;
    z-index: 1;
    padding: 1.25rem 1.1rem 1.15rem;
}

/*
 * Judul kartu
 * Menggunakan selector khusus agar tidak terkena
 * gaya judul widget .pkp_block.
 */
.ak-sidebar .ak-template-card__title,
.ak-home-sidebar .ak-template-card__title {
    margin: 0 0 0.65rem;
    padding: 0;
    border: 0;
    color: var(--ak-white);
    font-family: var(--ak-serif);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
}

/*
 * Deskripsi
 */
.ak-sidebar .ak-template-card__description,
.ak-home-sidebar .ak-template-card__description {
    margin: 0 0 1.1rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.825rem;
    line-height: 1.65;
}

/*
 * Tombol unduhan
 */
.ak-sidebar .ak-template-card__button,
.ak-home-sidebar .ak-template-card__button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--ak-gold);
    border-radius: var(--ak-radius-sm);
    background: var(--ak-gold);
    color: #283617 !important;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.4;
    text-align: center;
    text-decoration: none !important;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}

/*
 * Hover tombol
 */
.ak-sidebar .ak-template-card__button:hover,
.ak-sidebar .ak-template-card__button:focus,
.ak-home-sidebar .ak-template-card__button:hover,
.ak-home-sidebar .ak-template-card__button:focus {
    border-color: var(--ak-white);
    background: var(--ak-white);
    color: var(--ak-primary) !important;
    text-decoration: none !important;
    transform: translateY(-1px);
}

/*
 * Ikon pada tombol
 */
.ak-template-card__button span {
    font-size: 1.1rem;
    font-weight: 900;
    line-height: 1;
}

/*
 * Footer kartu
 */
.ak-template-card__footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.13);
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.68rem;
    font-weight: 600;
}

/*
 * RESPONSIVE
 */
@media (max-width: 480px) {
    .ak-template-card__body {
        padding: 1.1rem 1rem;
    }

    .ak-sidebar .ak-template-card__title,
    .ak-home-sidebar .ak-template-card__title {
        font-size: 1.05rem;
    }

    .ak-sidebar .ak-template-card__description,
    .ak-home-sidebar .ak-template-card__description {
        font-size: 0.8rem;
    }
}
/* =====================================================================
   RECOMMENDED ACADEMIC TOOLS
   ===================================================================== */

.ak-recommended-tools {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

/* Header */
.ak-tools-header {
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--ak-surface);
}

.ak-tools-header__label {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--ak-primary);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.ak-tools-header__title {
    margin: 0 0 0.45rem;
    color: var(--ak-primary);
    font-family: var(--ak-serif);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
}

.ak-tools-header__description {
    margin: 0;
    color: var(--ak-muted);
    font-size: 0.78rem;
    line-height: 1.6;
}

/* Tool item */
.ak-tool-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem;
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius-sm);
    background-color: var(--ak-background);
    color: var(--ak-text);
    text-decoration: none !important;
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease,
        transform 0.15s ease;
}

.ak-tool-item:hover,
.ak-tool-item:focus {
    border-color: var(--ak-primary);
    background-color: var(--ak-surface);
    color: var(--ak-text);
    text-decoration: none !important;
    transform: translateY(-1px);
}

/* Logo container */
.ak-tool-item__logo {
    display: flex;
    flex: 0 0 48px;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius-sm);
    background-color: #ffffff;
}

/* Logo image */
.ak-tool-item__logo img {
    display: block;
    width: 34px;
    height: 34px;
    object-fit: contain;
}

/* Content */
.ak-tool-item__content {
    min-width: 0;
    flex: 1;
}

.ak-tool-item__content h4 {
    margin: 0 0 0.2rem;
    color: var(--ak-primary);
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.35;
}

.ak-tool-item__content p {
    margin: 0 0 0.35rem;
    color: var(--ak-muted);
    font-size: 0.72rem;
    line-height: 1.5;
}

.ak-tool-item__link {
    color: var(--ak-primary);
    font-size: 0.68rem;
    font-weight: 700;
}

.ak-tool-item:hover .ak-tool-item__link,
.ak-tool-item:focus .ak-tool-item__link {
    color: var(--ak-gold);
}

/* Mobile */
@media (max-width: 480px) {
    .ak-tool-item {
        gap: 0.65rem;
        padding: 0.65rem;
    }

    .ak-tool-item__logo {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
    }

    .ak-tool-item__logo img {
        width: 29px;
        height: 29px;
    }

    .ak-tool-item__content h4 {
        font-size: 0.82rem;
    }

    .ak-tool-item__content p {
        font-size: 0.7rem;
    }
}