/* =========================================================
   PENGUMUMAN.CSS — STYLE MANDIRI
   Versi 1
   Tujuan:
   - Tidak mengubah style.css utama
   - Floating pengumuman tetap manis
   - Menyiapkan layout UTAMA + maksimal 6 SUB
   - SUB akan menjadi grid 3 x 2 setelah pengumuman.js diperbarui
   ========================================================= */

/* ---------- LAYER DASAR ---------- */

#pengumuman {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 999;
}

#pengumuman .pengumuman-wrapper {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    box-sizing: border-box;
    z-index: 9990;
}

#pengumuman .pengumuman-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(1.5px);
}

/* ---------- FLOATING CARD ---------- */

#pengumuman .pengumuman-card {
    position: relative;
    z-index: 9991;
    width: min(92vw, 760px);
    max-width: 760px;
    max-height: 82vh;
    height: auto;
    overflow: hidden;
    box-sizing: border-box;

    background: rgba(1, 87, 15, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 20px;
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.34),
        0 8px 28px rgba(0, 0, 0, 0.18);

    backdrop-filter: blur(10px);
}

#pengumuman .pengumuman-layout {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 0.40fr) minmax(0, 0.60fr);
    gap: 0;
    align-items: stretch;
    box-sizing: border-box;
}

/* ---------- KOLOM UTAMA ---------- */

#pengumuman .pengumuman-main-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    padding: 10px 4px 0 10px;
}

#pengumuman .pengumuman-main-stage {
    width: 100%;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 4px;
    padding: 16px 4px 6px;
    box-sizing: border-box;
}

#pengumuman .pengumuman-main-media {
    width: 100%;
    height: min(54vh, 390px);
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    box-sizing: border-box;
}

#pengumuman .pengumuman-gambar-utama {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ---------- KOLOM SUB ---------- */

#pengumuman .pengumuman-sub-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    padding: 14px 12px 10px 8px;
}

/*
   JS berikutnya akan menggunakan:
   .pengumuman-sub-grid
   .pengumuman-sub-item

   Target:
   3 kolom x 2 baris = maksimal 6 gambar.
*/

#pengumuman .pengumuman-sub-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
}

#pengumuman .pengumuman-sub-item {
    position: relative;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    transition:
        transform 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease;
}

#pengumuman .pengumuman-sub-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.34);
}

#pengumuman .pengumuman-gambar-sub {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#pengumuman .pengumuman-sub-count {
    margin-top: 6px;
    text-align: right;
    font-size: 10px;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.70);
    font-weight: 500;
}

/* Fallback untuk JS lama yang masih hanya merender satu SUB */
#pengumuman .pengumuman-sub-media {
    width: 100%;
    height: min(54vh, 390px);
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
}

#pengumuman .pengumuman-sub-media .pengumuman-gambar-sub {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ---------- JUDUL ---------- */

#pengumuman .pengumuman-bawah {
    margin-top: 2px;
    padding: 8px 10px 10px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 6px;
}

#pengumuman .pengumuman-judul-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

#pengumuman .pengumuman-judul-bawah {
    margin: 0;
    color: #063b24;
    font-size: clamp(11px, 1.05vw, 15px);
    line-height: 1.2;
    font-weight: 800;
    text-align: center;
}

/* ---------- TOMBOL ---------- */

#pengumuman .pengumuman-nav,
#pengumuman .pengumuman-btn {
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    background: #e7f2eb;
    color: #086536;
    box-sizing: border-box;
}

#pengumuman .pengumuman-nav-samping {
    width: 32px;
    min-width: 32px;
    height: 46px;
    min-height: 46px;
    padding: 0;
    justify-self: center;
    align-self: center;
    z-index: 4;
    font-size: 25px;
    line-height: 1;
}

#pengumuman .pengumuman-nav:hover,
#pengumuman .pengumuman-btn:hover {
    transform: translateY(-1px);
}

#pengumuman .pengumuman-close {
    position: absolute;
    top: 9px;
    right: 9px;
    z-index: 20;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    color: #164b31;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.14);
}

/* ---------- KONDISI TANPA SUB ---------- */

#pengumuman .pengumuman-card.tanpa-sub {
    width: min(92vw, 430px);
}

#pengumuman .pengumuman-card.tanpa-sub .pengumuman-layout {
    grid-template-columns: 1fr;
}

#pengumuman .pengumuman-card.tanpa-sub .pengumuman-main-column {
    padding-right: 10px;
}

/* ---------- RESPONSIVE TABLET ---------- */

@media (max-width: 760px) {
    #pengumuman .pengumuman-wrapper {
        padding: 10px;
    }

    #pengumuman .pengumuman-card {
        width: min(96vw, 620px);
        max-height: 90vh;
    }

    #pengumuman .pengumuman-layout {
        grid-template-columns: 1fr;
    }

    #pengumuman .pengumuman-main-column {
        padding: 8px 8px 0;
    }

    #pengumuman .pengumuman-sub-column {
        padding: 8px 10px 10px;
        border-top: 2px solid rgba(255, 255, 255, 0.12);
    }

    #pengumuman .pengumuman-main-media,
    #pengumuman .pengumuman-sub-media {
        height: min(42vh, 300px);
        min-height: 180px;
    }

    #pengumuman .pengumuman-sub-grid {
        gap: 6px;
    }
}

/* ---------- RESPONSIVE HP ---------- */

@media (max-width: 480px) {
    #pengumuman .pengumuman-wrapper {
        padding: 6px;
    }

    #pengumuman .pengumuman-card {
        width: 97vw;
        max-height: 94vh;
        border-radius: 15px;
    }

    #pengumuman .pengumuman-main-stage {
        grid-template-columns: 30px minmax(0, 1fr) 30px;
        gap: 2px;
        padding: 12px 2px 5px;
    }

    #pengumuman .pengumuman-main-media,
    #pengumuman .pengumuman-sub-media {
        height: 34vh;
        min-height: 150px;
    }

    #pengumuman .pengumuman-nav-samping {
        width: 28px;
        min-width: 28px;
        height: 40px;
        min-height: 40px;
        font-size: 22px;
    }

    #pengumuman .pengumuman-sub-column {
        padding: 6px 7px 8px;
    }

    #pengumuman .pengumuman-sub-grid {
        gap: 5px;
    }

    #pengumuman .pengumuman-sub-count {
        font-size: 9px;
    }

    #pengumuman .pengumuman-judul-bawah {
        font-size: 11px;
    }

    #pengumuman .pengumuman-close {
        width: 30px;
        height: 30px;
        font-size: 20px;
    }
}

.pengumuman-petunjuk {
  text-align: left;
  color: #e9fa03;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.00;
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
/* Petunjuk memunculkan kembali pengumuman setelah F5 */
.pengumuman-f5-petunjuk {
  text-align: left;
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  margin: -4px 8px 10px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}
