/**
 * hero.css — Al-Kifayah Theme
 * Hero section homepage.
 */

.ak-hero {
    position: relative;
    isolation: isolate;
    color: var(--ak-white);
    background: linear-gradient(
        120deg,
        color-mix(in srgb, var(--ak-primary) 97%, black),
        color-mix(in srgb, var(--ak-primary-dark) 90%, black)
    );
    border-bottom: 4px solid var(--ak-gold);
}

.ak-hero::before {
    position: absolute;
    z-index: -2;
    inset: 0;
    background: var(--ak-primary-dark);
    content: '';
}

.ak-hero.has-background-image::before {
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--ak-primary-dark) 94%, transparent),
        color-mix(in srgb, var(--ak-primary) 78%, transparent)
    ), var(--ak-hero-image) center / cover no-repeat;
}

/* Fallback untuk browser yang tidak mendukung color-mix */
@supports not (color: color-mix(in srgb, red, blue)) {
    .ak-hero {
        background: linear-gradient(120deg, var(--ak-primary), var(--ak-primary-dark));
    }
}

.ak-hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(380px, 1fr);
    align-items: center;
    gap: 2.5rem;
    padding: 4rem 0;
}

.ak-hero h2,
.ak-hero .ak-hero-title {
    max-width: 760px;
    margin: 0 0 1rem;
    color: var(--ak-white);
    font: 700 clamp(1.8rem, 4vw, 2.8rem)/1.25 var(--ak-serif);
}

.ak-hero p,
.ak-hero-description {
    max-width: 720px;
    margin: 0 0 1.4rem;
    color: var(--ak-white-a90);
    font-size: 1.05rem;
}

.ak-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.6rem;
}

.ak-meta-pill {
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--ak-white-a25);
    border-radius: 999px;
    background-color: var(--ak-white-a12);
    color: var(--ak-white);
    font-size: 0.78rem;
}

/* =====================================================================
   HERO COPY — Kolom kiri (label, judul, deskripsi, meta, tombol)
   ===================================================================== */
.ak-hero-copy {
    min-width: 0;
}

/* Label institusi di atas judul — badge emas */
.ak-hero-label {
    display: inline-block;
    margin-bottom: 0.75rem;
    padding: 0.2rem 0.75rem;
    border-radius: 5px;
    background-color: var(--ak-gold);
    color: var(--ak-primary-dark);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ak-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/*
 * Tombol "Current Issue" di hero.
 * Latar putih (atau warna Background dari pengaturan tema) dengan teks
 * warna Primary, agar kontras di atas hero yang gelap.
 */
.ak-button-hero-outline {
    background-color: var(--ak-background);
    border-color: var(--ak-background);
    color: var(--ak-primary);
}

.ak-button-hero-outline:hover,
.ak-button-hero-outline:focus {
    background-color: var(--ak-gold-light);
    border-color: var(--ak-gold-light);
    color: var(--ak-primary-dark);
}

.ak-button-hero-outline:focus-visible {
    outline: 3px solid var(--ak-gold);
    outline-offset: 2px;
}

/* =====================================================================
   HERO CURRENT ISSUE — Kartu showcase edisi terkini (kolom kanan)
   ===================================================================== */
.ak-hero-issue {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.75rem;
    border-top: 5px solid var(--ak-gold);
    border-radius: 12px;
    background-color: var(--ak-background);
    color: var(--ak-text);
    box-shadow: var(--ak-shadow-md);
}

/* Cover edisi — gambar asli dari OJS */
.ak-hero-issue-cover {
    display: block;
    flex-shrink: 0;
    width: 190px;
    max-width: 44%;
    height: auto;
    border: 2px solid var(--ak-gold);
    border-radius: 8px;
    box-shadow: var(--ak-shadow-sm);
    object-fit: cover;
}

/* Fallback ketika edisi tidak punya cover — kartu sampul generatif */
.ak-hero-issue-cover-fallback {
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1.414;
    padding: 0.85rem;
    background: linear-gradient(145deg, var(--ak-primary), var(--ak-primary-dark));
    color: var(--ak-white);
    font: 700 0.9rem/1.3 var(--ak-serif);
    text-align: center;
    overflow-wrap: break-word;
    hyphens: auto;
}

.ak-hero-issue-details {
    flex: 1;
    min-width: 0;
}

/* Kicker "Current Issue" */
.ak-hero-issue-kicker {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--ak-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/*
 * Override warna dari .ak-hero (teks putih) — di dalam kartu putih ini
 * teks harus memakai warna konten normal agar tetap terbaca.
 */
.ak-hero-issue-details h3 {
    margin: 0 0 0.35rem;
    color: var(--ak-primary);
    font: 700 1.3rem/1.3 var(--ak-serif);
    overflow-wrap: break-word;
}

.ak-hero-issue-details p,
.ak-hero-issue-details div {
    max-width: none;
    margin: 0 0 0.6rem;
    color: var(--ak-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.ak-hero-issue-details .ak-button {
    width: 100%;
    margin-top: 0.4rem;
}

/* Keadaan kosong — belum ada edisi yang diterbitkan */
.ak-hero-issue-empty {
    flex: 1;
    text-align: center;
}

.ak-hero-issue-empty h3 {
    margin: 0 0 0.4rem;
    color: var(--ak-primary);
    font: 700 1.1rem/1.3 var(--ak-serif);
}

.ak-hero-issue-empty p {
    max-width: none;
    margin: 0;
    color: var(--ak-muted);
    font-size: 0.875rem;
}

/* Gambar hero opsional (di atas hero text) */
.ak-hero-image img {
    display: block;
    width: 100%;
    max-height: 360px;
    object-fit: cover;
}

@media (max-width: 768px) {
    .ak-hero-inner {
        grid-template-columns: 1fr;
        padding: 2.8rem 0;
    }

    .ak-hero-actions .ak-button {
        flex: 1 1 auto;
    }

    .ak-hero-issue {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .ak-hero-issue-cover {
        width: 140px;
        max-width: 60%;
        margin: 0 auto;
    }
}
