/*
 * UNTAN DETAIL / BROWSE / CONTACT BACKGROUND
 * One fixed viewport background.
 * Does not target homepage, OPAC or Statistics.
 */

/* Foto kampus memenuhi viewport dan tetap diam */
html body:has(main.untan-page) {
    background-color: #e9ecef !important;

    background-image:
        linear-gradient(
            rgba(245, 247, 249, .65),
            rgba(245, 247, 249, .65)
        ),
        url('/hero-ai-2.webp') !important;

    background-position: center center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
}

/*
 * Hapus background yang dipasang pada main.
 * Selector dibuat lebih spesifik daripada
 * aturan lama pada untan-pages-v19.css.
 */
html body main.untan-page,
html body.untan-browse-page main.untan-page,
html body.untan-browse-home main.untan-page,
html body.untan-contact-page main.untan-page {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    background-attachment: scroll !important;
}

/* Kontainer artikel tetap seperti sebelumnya */
html body main.untan-page .untan-page-card {
    background-color: rgba(255, 255, 255, .96) !important;
}

/* Mobile: fallback untuk browser yang tidak stabil dengan fixed */
@media (max-width: 900px) {
    html body:has(main.untan-page) {
        background-attachment: scroll !important;
        background-size: cover !important;
    }
}

/* ====================================================
   UNTAN HTML FIXED BACKGROUND FINAL V1
   DETAIL / BROWSE / CONTACT
   ==================================================== */

/* Background utama dipasang pada HTML */
html:has(body main.untan-page) {
    background-color: #e9ecef !important;

    background-image:
        linear-gradient(
            rgba(245,247,249,.65),
            rgba(245,247,249,.65)
        ),
        url('/hero-ai-2.webp') !important;

    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
}

/* Body tidak boleh menutupi background HTML */
html body:has(main.untan-page) {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
}

/* Main tidak boleh menggambar background kedua */
html body:has(main.untan-page)
main.untan-page:not(#__untan_bg_unused__) {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
}

/* Pertahankan kartu konten agar mudah dibaca */
html body main.untan-page .untan-page-card {
    background-color: rgba(255,255,255,.96) !important;
}

/* END UNTAN HTML FIXED BACKGROUND FINAL V1 */

/* =====================================================
   UNTAN UNIFIED BG V1
   OPAC / STATS / BROWSE / CONTACT / DETAIL
   ===================================================== */

/* Satu foto dan overlay untuk seluruh halaman internal */
html:has(body main.untan-page),
html:has(body main.opac-v23),
html:has(body main.stats-v23) {
    background-color: #e9ecef !important;

    background-image:
        linear-gradient(
            rgba(245, 247, 249, 0.65),
            rgba(245, 247, 249, 0.65)
        ),
        url('/hero-ai-2.webp') !important;

    background-position: center center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
}

/* Body transparan agar foto HTML terlihat penuh */
html:has(body main.untan-page) body,
html:has(body main.opac-v23) body,
html:has(body main.stats-v23) body {
    background: transparent !important;
}

/* Hilangkan foto duplikat dari area main */
html:has(body main.untan-page)
body main.untan-page:not(#__untan_bg_unused__),

html:has(body main.opac-v23)
body main.opac-v23:not(#__untan_bg_unused__),

html:has(body main.stats-v23)
body main.stats-v23:not(#__untan_bg_unused__) {
    background: transparent !important;
}

/* END UNTAN UNIFIED BG V1 */

/* UNTAN TEXT CLARITY GLOBAL V2 — INTERNAL */

/*
 * Selector spesifik untuk mengatasi
 * prioritas aturan lama EPrints.
 */

html body main.untan-page:not(#__text_v2__) {
  color: #09263a !important;
}

/* Teks utama dan metadata */
html body main.untan-page:not(#__text_v2__) p,
html body main.untan-page:not(#__text_v2__) li,
html body main.untan-page:not(#__text_v2__) span,
html body main.untan-page:not(#__text_v2__) small,
html body main.untan-page:not(#__text_v2__) td,
html body main.untan-page:not(#__text_v2__) th,
html body main.untan-page:not(#__text_v2__) dd,
html body main.untan-page:not(#__text_v2__) dt,
html body main.untan-page:not(#__text_v2__) cite,
html body main.untan-page:not(#__text_v2__) em,
html body main.untan-page:not(#__text_v2__) .ep_citation,
html body main.untan-page:not(#__text_v2__) .ep_summary_content {
  color: #09263a !important;
  font-weight: 500 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/* Heading tetap sesuai hierarki */
html body main.untan-page:not(#__text_v2__) h1,
html body main.untan-page:not(#__text_v2__) h2,
html body main.untan-page:not(#__text_v2__) h3,
html body main.untan-page:not(#__text_v2__) h4 {
  color: #041b2b !important;
  font-weight: 700 !important;
  opacity: 1 !important;
}

/*
 * Seluruh tautan tetap biru,
 * termasuk Browse Author.
 */
html body main.untan-page:not(#__text_v2__) a,
html body main.untan-page:not(#__text_v2__) a:link,
html body main.untan-page:not(#__text_v2__) a:visited,
html body main.untan-page:not(#__text_v2__) li a {
  color: #064c91 !important;
  font-weight: 600 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/*
 * Anak elemen di dalam tautan
 * harus mengikuti warna biru tautan.
 */
html body main.untan-page:not(#__text_v2__) a span,
html body main.untan-page:not(#__text_v2__) a em,
html body main.untan-page:not(#__text_v2__) a i,
html body main.untan-page:not(#__text_v2__) a strong {
  color: inherit !important;
}

/* Jumlah koleksi dan teks sekunder */
html body main.untan-page:not(#__text_v2__) .muted,
html body main.untan-page:not(#__text_v2__) .text-muted,
html body main.untan-page:not(#__text_v2__) .ep_view_browse_list,
html body main.untan-page:not(#__text_v2__) .ep_view_page {
  color: #17364a !important;
  opacity: 1 !important;
}

/* Metadata pada tabel EPrints */
html body main.untan-page:not(#__text_v2__) td {
  color: #09263a !important;
  font-weight: 500 !important;
}

html body main.untan-page:not(#__text_v2__) th {
  color: #09263a !important;
  font-weight: 700 !important;
}

/* Form dan pilihan ekspor */
html body main.untan-page:not(#__text_v2__) label,
html body main.untan-page:not(#__text_v2__) select,
html body main.untan-page:not(#__text_v2__) input {
  color: #09263a !important;
}

/* Hover */
html body main.untan-page:not(#__text_v2__) a:hover {
  color: #003b76 !important;
}

/* END UNTAN TEXT CLARITY GLOBAL V2 */
