/*
 * STAI DDI Kota Makassar — dropdown responsif v3
 * HANYA website publik. Dashboard Admin dan SILAPT tidak terpengaruh.
 * Menggunakan <details>/<summary> yang sudah ada di index.php.
 * Urutan menu, tautan, dan logo tetap sama.
 */

/* Header dan item tidak boleh mendorong halaman melebar. */
.stai-uin-theme .site-header.uin-header {
  position: relative;
  z-index: 110;
}
.stai-uin-theme .uin-header-inner,
.stai-uin-theme .uin-nav,
.stai-uin-theme .uin-nav-dropdown { box-sizing: border-box; }
.stai-uin-theme .uin-nav { gap: clamp(9px, 1vw, 15px); }
.stai-uin-theme .uin-nav > a,
.stai-uin-theme .uin-nav-dropdown > summary {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0;
  -webkit-tap-highlight-color: transparent;
}
.stai-uin-theme .uin-nav-dropdown > summary {
  list-style: none;
  user-select: none;
}
.stai-uin-theme .uin-nav-dropdown > summary::-webkit-details-marker { display: none; }
/* Tidak menampilkan tanda tambah atau panah pada judul menu. */
.stai-uin-theme .uin-nav-dropdown > summary::after { content: none !important; display: none !important; }
.stai-uin-theme .uin-nav-dropdown > summary > .caret { display: none !important; }

/* Dropdown desktop: selalu di atas konten; teks tidak terpotong. */
.stai-uin-theme .uin-nav-dropdown { min-width: 0; }
.stai-uin-theme .uin-nav-dropdown-menu {
  box-sizing: border-box;
  top: calc(100% - 2px);
  left: -12px;
  right: auto;
  width: max-content;
  min-width: 225px;
  max-width: min(325px, calc(100vw - 32px));
  padding: 8px;
  border-top: 3px solid #087846;
  border-radius: 0 0 8px 8px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(0, 32, 17, .16);
  z-index: 200;
}
.stai-uin-theme .uin-nav-dropdown-last .uin-nav-dropdown-menu {
  left: auto;
  right: 0;
}
.stai-uin-theme .uin-nav-dropdown-menu a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 11px 13px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.45;
  border-radius: 5px;
  font-size: 12px;
  text-decoration: none;
}
.stai-uin-theme .uin-nav-dropdown-menu a:hover,
.stai-uin-theme .uin-nav-dropdown-menu a:focus-visible {
  background: #edf7f1;
  color: #07693e;
}
.stai-uin-theme .uin-nav-dropdown > summary:focus-visible,
.stai-uin-theme .uin-nav > a:focus-visible,
.stai-uin-theme .uin-nav-dropdown-menu a:focus-visible,
.stai-uin-theme .uin-menu-toggle:focus-visible {
  outline: 2px solid #098049;
  outline-offset: 3px;
}
.stai-uin-theme .uin-nav-dropdown.is-current > summary { color: #086d3a; }

/* Mouse desktop: dropdown bisa dilihat saat hover maupun klik. */
@media (min-width: 1291px) and (hover: hover) and (pointer: fine) {
  .stai-uin-theme .uin-nav-dropdown:hover > .uin-nav-dropdown-menu,
  .stai-uin-theme .uin-nav-dropdown:focus-within > .uin-nav-dropdown-menu {
    display: flex;
    flex-direction: column;
  }
}

/* Tablet & ponsel: menu hamburger, dropdown menjadi accordion satu kolom. */
@media (max-width: 1290px) {
  .stai-uin-theme .uin-header-inner { height: 78px; min-height: 78px; gap: 12px; }
  .stai-uin-theme .uin-brand { min-width: 0; max-width: calc(100% - 60px); }
  .stai-uin-theme .uin-brand-name { min-width: 0; white-space: normal; }
  .stai-uin-theme .uin-menu-toggle {
    display: flex;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: auto;
  }
  .stai-uin-theme .uin-nav {
    display: none;
    box-sizing: border-box;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 78px);
    max-height: calc(100dvh - 78px);
    padding: 10px clamp(16px, 4vw, 36px) 22px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-top: 1px solid #e1ebe3;
    box-shadow: 0 18px 30px rgba(3, 44, 26, .16);
    z-index: 200;
  }
  .stai-uin-theme .uin-nav.open { display: flex; }
  .stai-uin-theme .uin-nav > a,
  .stai-uin-theme .uin-nav-dropdown > summary {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 49px;
    height: auto;
    padding: 13px 8px;
    font-size: 12px;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
    border-bottom: 1px solid #edf1ed;
  }
  .stai-uin-theme .uin-nav-dropdown {
    display: block;
    height: auto;
    width: 100%;
  }
  .stai-uin-theme .uin-nav-dropdown[open] > summary {
    color: #077344;
    background: #f0f8f3;
    border-bottom-color: #e4efe7;
  }
  .stai-uin-theme .uin-nav-dropdown-menu,
  .stai-uin-theme .uin-nav-dropdown-last .uin-nav-dropdown-menu {
    position: static;
    left: auto;
    right: auto;
    top: auto;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 4px 8px 9px 12px;
    margin: 0 0 6px;
    background: #f7faf8;
    border: 0;
    border-left: 3px solid #0b804b;
    border-radius: 0 0 6px 6px;
    box-shadow: none;
  }
  .stai-uin-theme .uin-nav-dropdown[open] > .uin-nav-dropdown-menu {
    display: flex;
    flex-direction: column;
  }
  .stai-uin-theme .uin-nav-dropdown-menu a {
    display: flex;
    align-items: center;
    min-height: 43px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    border-bottom: 1px solid #eaf1ec;
    white-space: normal;
  }
  .stai-uin-theme .uin-nav-dropdown-menu a:last-child { border-bottom: 0; }
  .stai-uin-theme .uin-nav > a.current::after,
  .stai-uin-theme .uin-nav-dropdown > summary::before,
  .stai-uin-theme .uin-nav-dropdown.is-current > summary::before { display: none !important; }
}

/* Layar HP kecil: logo dan judul tidak bertabrakan dengan hamburger. */
@media (max-width: 640px) {
  .stai-uin-theme .uin-header-inner { height: 68px; min-height: 68px; }
  .stai-uin-theme .uin-nav {
    max-height: calc(100vh - 68px);
    max-height: calc(100dvh - 68px);
    padding: 8px 15px 18px;
  }
  .stai-uin-theme .uin-logo { width: 43px; height: 48px; }
  .stai-uin-theme .uin-brand { gap: 8px; }
  .stai-uin-theme .uin-brand-name strong { font-size: 13px; }
  .stai-uin-theme .uin-brand-name small { font-size: 8px; }
  .stai-uin-theme .uin-nav > a,
  .stai-uin-theme .uin-nav-dropdown > summary { min-height: 47px; padding: 12px 8px; }
}
@media (max-width: 360px) {
  .stai-uin-theme .uin-brand-name strong { font-size: 12px; }
  .stai-uin-theme .uin-brand-name small { font-size: 7px; }
  .stai-uin-theme .uin-menu-toggle { flex-basis: 42px; width: 42px; }
}
/*
 * STAI DDI Kota Makassar — penyempurnaan navbar publik v4
 * PENTING: hanya mengatur menu publik; tidak mengubah tautan, PHP, slide, admin.
 * File ini digabungkan di bagian akhir menu-dropdown.css asli.
 */
.stai-uin-theme .uin-nav > a,
.stai-uin-theme .uin-nav-dropdown > summary,
.stai-uin-theme .uin-nav-dropdown-menu a {
  -webkit-tap-highlight-color: transparent;
  transition: color .2s ease, background-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.stai-uin-theme .uin-nav-dropdown > summary::after,
.stai-uin-theme .uin-nav-dropdown > summary > .caret {
  display: none !important;
  content: none !important;
}

@media (min-width: 1291px) {
  /* Lebih luas dan seimbang dibanding navigasi sempit sebelumnya. */
  .stai-uin-theme .uin-header-inner.container {
    width: min(1480px, calc(100% - 52px));
    gap: clamp(12px, 1.6vw, 25px);
  }
  .stai-uin-theme .uin-header-inner { min-height: 82px; height: 82px; }
  .stai-uin-theme .uin-brand { flex-shrink: 0; gap: 10px; }
  .stai-uin-theme .uin-brand-name strong { font-size: clamp(13px, 1.12vw, 16px); }
  .stai-uin-theme .uin-brand-name small { font-size: 9px; letter-spacing: .09em; }
  .stai-uin-theme .uin-logo { width: 53px; height: 59px; }
  .stai-uin-theme .uin-nav {
    height: 100%;
    flex: 1 1 auto;
    min-width: 0;
    gap: clamp(2px, .35vw, 7px);
    justify-content: flex-end;
  }
  .stai-uin-theme .uin-nav > a,
  .stai-uin-theme .uin-nav-dropdown > summary {
    height: 42px;
    padding: 0 clamp(7px, .72vw, 13px);
    font-size: clamp(10.6px, .79vw, 12.3px);
    line-height: 1.35;
    font-weight: 780;
    letter-spacing: .005em;
    text-transform: none;
    border-radius: 11px;
    color: #26362e;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .stai-uin-theme .uin-nav-dropdown { height: auto; }
  .stai-uin-theme .uin-nav > a.current,
  .stai-uin-theme .uin-nav-dropdown.is-current > summary,
  .stai-uin-theme .uin-nav-dropdown[open] > summary {
    background: #e8f4ec;
    color: #09653b;
  }
  .stai-uin-theme .uin-nav > a:hover,
  .stai-uin-theme .uin-nav-dropdown > summary:hover {
    background: #f0f7f1;
    color: #086e42;
    transform: translateY(-1px);
  }
  /* Hilangkan garis keras, ganti aksen lembut di bawah menu aktif. */
  .stai-uin-theme .uin-nav > a.current::after,
  .stai-uin-theme .uin-nav > a:hover::after,
  .stai-uin-theme .uin-nav-dropdown > summary:hover::before,
  .stai-uin-theme .uin-nav-dropdown.is-current > summary::before {
    display: none !important;
    content: none !important;
  }
  .stai-uin-theme .uin-nav-dropdown-menu,
  .stai-uin-theme .uin-nav-dropdown-last .uin-nav-dropdown-menu {
    top: calc(100% + 13px);
    left: 0;
    right: auto;
    min-width: 250px;
    max-width: min(330px, calc(100vw - 30px));
    padding: 9px;
    background: #fff;
    border: 1px solid #e0ece4;
    border-top: 3px solid #10804d;
    border-radius: 11px;
    box-shadow: 0 17px 40px rgba(2, 43, 24, .16);
    animation: staiMenuReveal .18s ease-out both;
  }
  .stai-uin-theme .uin-nav-dropdown-menu::before {
    content: '';
    position: absolute;
    height: 16px;
    bottom: 100%;
    left: 0;
    right: 0;
  }
  .stai-uin-theme .uin-nav-dropdown-last .uin-nav-dropdown-menu { left: auto; right: 0; }
  .stai-uin-theme .uin-nav-dropdown-menu a {
    min-height: 43px;
    padding: 11px 13px;
    border-radius: 7px;
    font-size: 12.5px;
    line-height: 1.45;
    font-weight: 650;
  }
  .stai-uin-theme .uin-nav-dropdown-menu a:hover,
  .stai-uin-theme .uin-nav-dropdown-menu a:focus-visible {
    background: #edf7f1;
    color: #075b36;
    transform: translateX(3px);
  }
  /* Ruang penghubung agar dropdown tidak berkedip saat kursor bergerak. */
  .stai-uin-theme .uin-nav-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 16px;
  }
}
@keyframes staiMenuReveal {
  from { opacity: 0; transform: translateY(-7px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Navigasi tablet / HP adalah menu yang dapat disentuh, bukan diperkecil terus. */
@media (max-width: 1290px) {
  .stai-uin-theme .uin-header-inner.container {
    width: min(100% - 32px, 1190px);
  }
  .stai-uin-theme .uin-menu-toggle {
    background: #f1f8f3;
    border: 1px solid #d4e7da;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(2, 42, 25, .05);
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
  }
  .stai-uin-theme .uin-menu-toggle:hover {
    background: #e6f3ea;
    border-color: #a6d0b4;
  }
  .stai-uin-theme .uin-menu-toggle[aria-expanded="true"] {
    background: #e3f3e9;
    border-color: #8bbfa1;
  }
  .stai-uin-theme .uin-nav.open {
    display: flex;
    animation: staiMobileOpen .2s ease-out both;
  }
  .stai-uin-theme .uin-nav {
    padding: 12px clamp(14px, 3.5vw, 30px) 24px;
    box-shadow: 0 18px 40px rgba(4, 49, 30, .15);
  }
  .stai-uin-theme .uin-nav > a,
  .stai-uin-theme .uin-nav-dropdown > summary {
    display: flex;
    width: 100%;
    padding: 14px 13px;
    min-height: 50px;
    border: 0;
    border-radius: 9px;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 750;
    color: #244436;
    transition: color .2s ease, background-color .2s ease;
  }
  .stai-uin-theme .uin-nav > a + a,
  .stai-uin-theme .uin-nav-dropdown,
  .stai-uin-theme .uin-nav-dropdown + a { margin-top: 3px; }
  .stai-uin-theme .uin-nav > a:hover,
  .stai-uin-theme .uin-nav > a.current,
  .stai-uin-theme .uin-nav-dropdown > summary:hover,
  .stai-uin-theme .uin-nav-dropdown[open] > summary,
  .stai-uin-theme .uin-nav-dropdown.is-current > summary {
    background: #ecf6ef;
    color: #086c3f;
  }
  .stai-uin-theme .uin-nav-dropdown-menu,
  .stai-uin-theme .uin-nav-dropdown-last .uin-nav-dropdown-menu {
    padding: 5px 8px 7px 10px;
    margin: 2px 0 9px 12px;
    width: calc(100% - 12px);
    max-width: calc(100% - 12px);
    border: 0;
    border-left: 3px solid #0b8651;
    border-radius: 0 8px 8px 0;
    background: #f7fbf8;
    box-shadow: none;
  }
  .stai-uin-theme .uin-nav-dropdown-menu a {
    min-height: 45px;
    padding: 11px 12px;
    border-radius: 7px;
    border-bottom: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
  }
  .stai-uin-theme .uin-nav-dropdown-menu a:hover,
  .stai-uin-theme .uin-nav-dropdown-menu a:focus-visible {
    background: #e4f2e9;
    color: #07663b;
  }
  .stai-uin-theme .uin-nav-dropdown > summary::before,
  .stai-uin-theme .uin-nav > a.current::after { display: none !important; }
}
@keyframes staiMobileOpen {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 640px) {
  .stai-uin-theme .uin-header-inner.container { width: calc(100% - 24px); }
  .stai-uin-theme .uin-brand-name strong { font-size: 12.5px; }
  .stai-uin-theme .uin-nav { padding: 10px 12px 22px; }
  .stai-uin-theme .uin-nav > a,
  .stai-uin-theme .uin-nav-dropdown > summary { font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .stai-uin-theme .uin-nav *,
  .stai-uin-theme .uin-menu-toggle { animation: none !important; transition: none !important; }
}

/* Samakan tinggi klik dengan kotak yang terlihat (hindari padding menambah tinggi). */
.stai-uin-theme .uin-nav-dropdown-menu a,
.stai-uin-theme .uin-nav-dropdown > summary,
.stai-uin-theme .uin-nav > a {
  box-sizing: border-box;
}
