/**
 * footer.css — Al-Kifayah Theme
 * Footer multi-kolom, mengikuti format prototype (.ak-footer-grid).
 *
 * KONTRAK: setiap kolom memakai .ak-footer-col dan judulnya h2/h3/h4.
 * Menambah kolom baru cukup dengan menambah satu .ak-footer-col di
 * footer.tpl — gaya judul, paragraf, dan daftar tautan ikut otomatis.
 */

/* =====================================================================
   FOOTER WRAPPER
   ===================================================================== */
.ak-footer {
    margin-top: auto;
    border-top: 4px solid var(--ak-gold);
    background-color: var(--ak-primary-dark);
    color: var(--ak-white);
    padding: 3.5rem 0 1.5rem;
}

/*
 * Grid 4 kolom seperti prototype: identitas jurnal lebih lebar,
 * tiga kolom sisanya sama rata.
 */
.ak-footer-inner {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.ak-footer-col {
    min-width: 0;
}

/*
 * Jumlah kolom menyesuaikan kolom yang benar-benar dirender.
 * footer.tpl menyembunyikan kolom yang datanya kosong (mis. menu
 * Kebijakan belum dikonfigurasi), sehingga grid tidak boleh mematok
 * empat track. .ak-footer-col selalu menjadi anak pertama-pertama,
 * .ak-footer-custom dan .ak-footer-bottom menyusul dengan span penuh.
 */
.ak-footer-inner:not(:has(.ak-footer-col:nth-child(4))) {
    grid-template-columns: 1.5fr 1fr 1fr;
}

.ak-footer-inner:not(:has(.ak-footer-col:nth-child(3))) {
    grid-template-columns: 1.5fr 1fr;
}

.ak-footer-inner:not(:has(.ak-footer-col:nth-child(2))) {
    grid-template-columns: 1fr;
}

/* =====================================================================
   JUDUL KOLOM — emas dengan aksen garis pendek (prototype: h4::after)
   ===================================================================== */
.ak-footer-col > h2,
.ak-footer-col > h3,
.ak-footer-col > h4 {
    position: relative;
    margin: 0 0 1.2rem;
    padding-bottom: 0.4rem;
    color: var(--ak-gold);
    font-family: var(--ak-serif);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: break-word;
}

.ak-footer-col > h2::after,
.ak-footer-col > h3::after,
.ak-footer-col > h4::after {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--ak-gold);
    content: '';
}

/* =====================================================================
   TEKS DAN TAUTAN UMUM DI FOOTER
   ===================================================================== */
.ak-footer p,
.ak-footer-description {
    margin: 0 0 0.75rem;
    color: var(--ak-white-a78);
    font-size: 0.875rem;
    line-height: 1.6;
}

.ak-footer p:last-child {
    margin-bottom: 0;
}

.ak-footer a {
    color: var(--ak-white-a78);
    text-decoration: none;
}

.ak-footer a:hover,
.ak-footer a:focus {
    color: var(--ak-gold);
    text-decoration: underline;
}

.ak-footer a:focus-visible {
    outline: 2px solid var(--ak-gold);
    outline-offset: 2px;
}

/* Baris ISSN / ISBN di kolom identitas */
.ak-footer-issn {
    margin-top: 0.85rem;
    color: var(--ak-gold-light);
    font-size: 0.8rem;
    letter-spacing: 0.01em;
}

/* =====================================================================
   DAFTAR TAUTAN — {load_menu} OJS memakai .ak-footer-menu
   ===================================================================== */
.ak-footer-menu,
.ak-footer-links {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ak-footer-menu li,
.ak-footer-links li {
    margin-bottom: 0.5rem;
}

.ak-footer-menu li:last-child,
.ak-footer-links li:last-child {
    margin-bottom: 0;
}

.ak-footer-menu a,
.ak-footer-links a {
    font-size: 0.875rem;
}

/* Submenu di footer (jika Navigation Menu punya anak) */
.ak-footer-menu ul {
    margin: 0.5rem 0 0 0.75rem;
    padding: 0;
    list-style: none;
}

/* =====================================================================
   IKON SOSIAL — komponen bersama.
   Markup dari templates/frontend/components/socialMedia.tpl; dipakai di
   footer dan sidebar. Penyesuaian warna untuk sidebar ada di sidebar.css.
   ===================================================================== */
.ak-social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.ak-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--ak-white-a12);
    color: var(--ak-white);
    font-size: 0.95rem;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}

.ak-social-btn:hover,
.ak-social-btn:focus {
    background-color: var(--ak-gold);
    color: var(--ak-primary-dark);
    text-decoration: none;
}

.ak-social-icon {
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
}

/* =====================================================================
   KONTEN FOOTER KUSTOM — baris penuh di bawah grid kolom
   ===================================================================== */
.ak-footer-custom {
    grid-column: 1 / -1;
    padding-top: 1.5rem;
    border-top: 1px solid var(--ak-white-a16);
    color: var(--ak-white-a78);
    font-size: 0.875rem;
    line-height: 1.6;
}

.ak-footer-custom > *:last-child {
    margin-bottom: 0;
}

/* =====================================================================
   BOTTOM BAR — copyright + tautan PKP
   ===================================================================== */
.ak-footer-bottom {
    display: flex;
    grid-column: 1 / -1;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--ak-white-a16);
    color: var(--ak-white-a65);
    font-size: 0.825rem;
}

/* Bila konten kustom sudah memberi garis, bottom bar tidak perlu dua garis */
.ak-footer-custom + .ak-footer-bottom {
    border-top: 0;
    padding-top: 0.5rem;
}

.ak-footer-bottom a {
    color: inherit;
}

.ak-footer-bottom a:hover,
.ak-footer-bottom a:focus {
    color: var(--ak-gold);
}

/* =====================================================================
   RESPONSIVE — prototype: 4 kolom → 2 kolom (992px) → 1 kolom (768px)
   ===================================================================== */
@media (max-width: 992px) {
    .ak-footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .ak-footer {
        padding: 2.5rem 0 1.25rem;
    }

    .ak-footer-inner {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .ak-footer-bottom {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        text-align: center;
    }
}

/* =====================================================================
   KANTOR REDAKSI — varian footer
   Markup dari templates/frontend/components/editorialOffice.tpl
   ===================================================================== */
.ak-office-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ak-office-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.65rem;
    font-size: 0.85rem;
    line-height: 1.55;
}

.ak-office-item:last-child {
    margin-bottom: 0;
}

.ak-office-icon {
    flex-shrink: 0;
    width: 16px;
    text-align: center;
    line-height: 1.55;
}

.ak-office-name {
    font-weight: 700;
}

.ak-footer .ak-office-item {
    color: var(--ak-white-a78);
}

.ak-footer .ak-office-icon {
    color: var(--ak-gold);
}

.ak-office-map {
    display: inline-block;
    margin-left: 0.4rem;
    font-size: 0.8rem;
    white-space: nowrap;
}
