/* =======================
   AGUDASCO – Global Styles
   ======================= */

/* ===== Theme Vars ===== */
:root {
  --navy: #0f1a2b;      /* dominan */
  --navy-2: #14233a;
  --blue: #1f3f7f;      /* tombol/nav aktif */
  --red: #e63946;       /* aksen */
  --text: #e7eefc;      /* putih kebiruan */
  --muted: #a9b7d1;
  --card: #14233a;
  --border: #233756;

  /* Lebar konten maksimum */
  --wrap: min(1120px, 92vw);

  /* Gutter seragam (ikut layar + safe area) */
  --gutter: clamp(12px, 3vw, 24px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  --header-h: 64px;
}

/* ===== Base ===== */
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
html, body {
  margin: 0; padding: 0;
  background: var(--navy); color: var(--text);
  font-family: ui-sans-serif, system-ui, Segoe UI, Roboto, Helvetica, Arial;
}
body { overflow-x: hidden; }
a { color: #9ec1ff; text-decoration: none; }
a:hover { color: #cfe0ff; text-decoration: underline; }

/* ===== Layout umum ===== */
.container {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: calc(var(--gutter) + var(--safe-l));
  padding-right: calc(var(--gutter) + var(--safe-r));
  padding-top: 24px; padding-bottom: 24px;
}

/* [FIX] Khusus Halaman Home: Pepetin Container ke Atas */
body.page-home main > .container {
  padding-top: 8px !important;
}

/* ===== Header Sticky ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(20,35,58,.92);
  backdrop-filter: saturate(160%) blur(6px);
  border-bottom: 1px solid var(--border);
}
.header .container { display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .title { font-weight: 700; letter-spacing: .5px; }

/* Nav (desktop) */
.nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 14px; }
.nav a { padding: 10px 12px; border-radius: 10px; }
.nav a.active, .nav a:hover { background: var(--blue); color: #fff; }

/* ===== Hero & spacing dekat header ===== */
main { 
  padding-top: 0; 
  scroll-margin-top: var(--header-h); 
}
.hero { text-align: center; margin-top: 0; padding: 0 0 8px; }

.hero-title {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: clamp(1.6rem, 2.2vw + 1rem, 2.4rem);
  font-weight: 800;
}

/* ===== Slider banner ===== */
.banner-outer {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: calc(var(--gutter) + var(--safe-l));
  padding-right: calc(var(--gutter) + var(--safe-r));
}

.banner-wrapper {
  position: relative;
  
  /* --- FULL WIDTH SETUP --- */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: .25rem;
  margin-bottom: .75rem;

  /* Border putih */
  border: 2px solid #ffffff; 
  border-radius: 12px;          
  
  /* Tinggi banner & background */
  height: clamp(300px, 45vw, 550px); 
  overflow: hidden;
  background: var(--navy-2); /* DULU coklat, sekarang navy senada tema */
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}

.banner-track {
  display: flex;
  height: 100%;
  transition: transform .55s ease-in-out;
  will-change: transform;
}

.banner-slide {
  flex: 0 0 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* Overlay navy supaya warna banner senada */
.banner-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    rgba(8, 21, 38, 0.25),
    rgba(8, 21, 38, 0.35)
  );
  pointer-events: none;
}

/* Gambar tetap utuh (tidak kepotong), tapi tone sedikit digelapkan */
.banner-slide img { 
  width: 100%; 
  height: 100%; 
  object-fit: contain; 
  display: block;
  filter: none; /* biar warna asli tetap terang */
}

/* Caption di bawah slider */
.hero-caption { opacity: .85; margin-top: .25rem; }

/* Tombol prev/next */
.banner-wrapper .nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.45); color: #fff; font-size: 28px; line-height: 42px;
  cursor: pointer; transition: background .2s;
  z-index: 5;
}
.banner-wrapper .nav:hover { background: rgba(0,0,0,.65); }
.banner-wrapper .prev { left: 10px; }
.banner-wrapper .next { right: 10px; }
@media (max-width:600px) { .banner-wrapper .nav { display: none; } }

/* ===== Section ===== */
.section {
  width: 100%;
  max-width: var(--wrap);
  margin: 28px auto 0;
  padding-left: calc(var(--gutter) + var(--safe-l));
  padding-right: calc(var(--gutter) + var(--safe-r));
}
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px;
}
.section-head h2 { margin: 0; }
.link-more { opacity: .85; }
.link-more:hover { opacity: 1; text-decoration: underline; }

.grid { display: grid; gap: 16px; }
.grid.cards { grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); }

.card {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px; overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.25); }
.card img { width: 100%; height: 180px; object-fit: cover; display: block; }
.card .pad { padding: 14px 14px 16px; }
.card h3 { margin: 0 0 6px; font-size: 18px; }
.meta { color: var(--muted); font-size: 13px; margin: 0 0 12px; }

.btn {
  display: inline-block; padding: 8px 12px;
  border-radius: 10px; background: #2b72ff; color: #fff; border: 1px solid var(--border);
}
.btn:hover { filter: brightness(1.08); }
.btn.red { background: var(--red); }
.muted { opacity: .65; }

/* ===== Footer ===== */
.site-footer {
  padding: 20px 0;
  background: #0f2236;
  color: var(--text);
  border-top: 1px solid rgba(255,255,255,.06);
}
.site-footer .container {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: calc(var(--gutter) + var(--safe-l));
  padding-right: calc(var(--gutter) + var(--safe-r));
  padding-top: 24px; padding-bottom: 24px;
}
.site-footer .footer-grid {
  display: grid; gap: 16px;
  grid-template-columns: 1fr; align-items: start;
}
@media (min-width:880px) {
  .site-footer .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; }
}
.site-footer .footer-col { min-width: 0; }
.site-footer .footer-heading { margin: 0 0 6px; font-size: 1rem; }
.site-footer a { color: #cfe0ff; text-decoration: none; border-bottom: 1px dashed transparent; }
.site-footer a:hover { border-color: #cfe0ff; }
.site-footer p { margin: .15rem 0; line-height: 1.45; }
.site-footer .footer-links { list-style: none; margin: 0; padding: 0; }
.site-footer .footer-links li { margin: .25rem 0; }
.site-footer .footer-bottom {
  margin-top: 8px; padding-top: 12px;
  border-top: 1px solid var(--border); color: var(--muted); font-size: .95rem;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
@media (max-width:640px) {
  .site-footer { padding: 16px 0; }
  .site-footer .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ===== Lightbox ===== */
.lightbox-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.8);
  display: none; align-items: center; justify-content: center;
  z-index: 50;
}
.lightbox-backdrop.active { display: flex; }
.lightbox-img {
  max-width: 92vw; max-height: 90vh;
  border-radius: 12px; border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.lightbox-caption {
  color: #fff; margin-top: 8px; text-align: center;
}

/* ===== Admin Modern ===== */
.admin-wrap { padding-top: 8px; }
.admin-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin: 6px 0 14px;
}
.admin-title { margin: 0; font-size: clamp(22px,2.2vw,28px); }

.form-modern { padding: 16px; }
.form-grid-2 {
  display: grid; grid-template-columns: 1.3fr .9fr; gap: 18px;
}
@media (max-width:900px) { .form-grid-2 { grid-template-columns: 1fr; } }

.label { display: block; margin: 8px 0 6px; font-weight: 600; }
.input, .textarea {
  width: 100%; padding: 12px 12px;
  border-radius: 12px; border: 1px solid var(--border);
  background: #0b1322; color: var(--text); outline: none;
}
.input:focus, .textarea:focus {
  border-color: #2b72ff; box-shadow: 0 0 0 3px rgba(43,114,255,.15);
}
.textarea { resize: vertical; min-height: 120px; }

.form-bar {
  position: sticky; bottom: 12px; margin-top: 12px; padding: 10px 12px;
  background: rgba(20,35,58,.85); border: 1px solid var(--border); border-radius: 12px;
  display: flex; align-items: center; justify-content: space-between;
  backdrop-filter: blur(6px);
}

.btn.ghost { background: transparent; border: 1px solid var(--border); }
.btn.ghost:hover { background: rgba(255,255,255,.05); }

/* Dropzone */
.dropzone {
  position: relative; border: 1px dashed #35527a; border-radius: 14px; min-height: 230px;
  display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.02);
  transition: border-color .2s, background .2s; cursor: pointer; overflow: hidden;
}
.dropzone.is-drag {
  border-color: #2b72ff; background: rgba(43,114,255,.06);
}
.dropzone .dz-empty {
  display: flex; flex-direction: column; gap: 6px;
  align-items: center; color: #bcd1ff;
}
.dropzone .dz-empty svg { opacity: .85; }
.dz-preview { position: absolute; inset: 0; display: none; }
.dz-preview img { width: 100%; height: 100%; object-fit: cover; }
.dz-preview .dz-remove {
  position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.45); color: #fff;
}

/* Table wrapper */
.table-wrap { overflow: auto; }
.rowlink { color: #e7eefc; }
.rowlink:hover { text-decoration: underline; }

/* ===== Header Responsive (Mobile Nav) ===== */
.header-wrap { display: flex; align-items: center; gap: 16px; }
.nav-toggle {
  display: none; position: relative; width: 44px; height: 38px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--card);
  cursor: pointer;
}
.nav-toggle span {
  position: absolute; left: 9px; right: 9px; height: 2px; background: #cfe0ff; border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease, top .25s ease;
}
.nav-toggle span:nth-child(1){ top:11px }
.nav-toggle span:nth-child(2){ top:18px }
.nav-toggle span:nth-child(3){ top:25px }
.nav-toggle.is-open span:nth-child(1){ top:18px; transform:rotate(45deg) }
.nav-toggle.is-open span:nth-child(2){ opacity:0 }
.nav-toggle.is-open span:nth-child(3){ top:18px; transform:rotate(-45deg) }

@media (max-width:860px){
  .nav-toggle{ display:inline-block; margin-left:auto }
  .nav{
    position:absolute; left:0; right:0; top:calc(100% + 1px);
    display:none; flex-direction:column; gap:8px;
    margin:0; padding:10px 16px 16px;
    background:rgba(20,35,58,.96);
    border-bottom:1px solid var(--border);
    box-shadow:0 12px 24px rgba(0,0,0,.25);
    z-index:40;
  }
  .nav.is-open{ display:flex }
  .nav a{
    display:block; width:100%;
    padding:12px 14px; border-radius:12px;
    background:rgba(255,255,255,.02);
  }
  .nav a.active,.nav a:hover{ background:var(--blue); color:#fff }

  .header .container,
  .banner-outer,
  .section,
  .site-footer .container{
    padding-left: calc(var(--gutter) + var(--safe-l));
    padding-right: calc(var(--gutter) + var(--safe-r));
  }

  .no-scroll, .no-scroll body{ overflow:hidden; }
}

/* ========== Detail page media preview (lihat-utuh) ========== */
.media-preview {
  width: 100%;
  max-width: var(--wrap);
  margin: 12px auto 14px;
  padding: clamp(8px,1.6vw,14px);
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
  cursor: zoom-in;
}
.media-preview .media-fit {
  display: block;
  width: 100%;
  height: clamp(260px,72vh,820px);
  object-fit: contain;
  object-position: center;
  background: #0e1726;
  border-radius: 12px;
}
.media-caption {
  color: var(--muted);
  font-size: .95rem;
  margin-top: 8px;
  text-align: center;
}

/* =========================
   ANGGOTA – PUBLIK & ADMIN
   ========================= */

/* ====== Anggota: Modern Grid ====== */

/* UL pembungkus */
.members-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* Ganti grid fix 3 kolom jadi responsif.
     Di HP dia bakal 1 atau 2 kolom, di PC 3 kolom otomatis. Lebih aman. */
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; /* Jarak antar kartu lebih lega */
}

/* tiap LI */
.members-grid > li {
  min-width: 0;
}

/* link kartu anggota (publik) - UPGRADED */
.member-link {
  display: flex;
  align-items: center;
  gap: 12px; /* Jarak antara foto ke teks lebih jauh dikit */
  width: 100%;
  padding: 12px 16px; /* Padding lebih besar biar gak sesak */
  border-radius: 16px; /* Sudut lebih bulat (modern standard) */
  
  /* GLASSMORPHISM EFFECT */
  background: rgba(255, 255, 255, 0.03); /* Transparan dikit */
  backdrop-filter: blur(10px); /* Efek kaca buram di belakangnya */
  border: 1px solid rgba(255, 255, 255, 0.08); /* Border super tipis & halus */
  
  color: inherit;
  text-decoration: none;
  min-height: 70px; /* Tinggi kartu ditambah */
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Animasi lebih smooth */
  position: relative;
  overflow: hidden;
}

/* Efek Hover Mewah */
.member-link:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2); /* Border menyala dikit pas hover */
  transform: translateY(-4px); /* Naik ke atas dikit */
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5); /* Shadow lembut di bawah */
}

/* Kilau (Glow) Tambahan pas Hover */
.member-link:hover .avatar {
  transform: scale(1.1); /* Foto membesar dikit */
  border-color: #3b82f6; /* Ring warna biru (sesuaikan brand) muncul */
}

/* NOMOR URUT - Sembunyikan aja biar bersih */
.member-index,
.member-no {
  display: none; 
}

/* FOTO PROFILE - Diperbesar */
.avatar {
  display: block;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid transparent; /* Siapin tempat buat border hover */
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.avatar--sm {
  width: 48px; /* Naik dari 34px ke 48px */
  height: 48px;
}

/* TEXT WRAPPER */
.member-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* NAMA MEMBER - Lebih tegas */
.member-name {
  font-weight: 600;
  font-size: 15px; /* Naik dari 12px */
  color: #f3f4f6; /* Warna putih terang */
  line-height: 1.4;
  margin-bottom: 2px;
}

/* JABATAN / INFO TAMBAHAN */
.member-date {
  color: #9ca3af; /* Abu-abu soft */
  font-size: 12px;
  font-weight: 400;
}

/* OPTIONAL: Tambah panah kecil di kanan biar user tau bisa diklik */
.member-link::after {
  content: "›";
  margin-left: auto; /* Dorong ke paling kanan */
  font-size: 20px;
  color: rgba(255,255,255, 0.2);
  font-weight: 300;
  transition: transform 0.3s ease, color 0.3s ease;
}

.member-link:hover::after {
  color: #fff;
  transform: translateX(4px);
}

/* --- CSS BARU BUAT HEADER & BADGE --- */

/* Bikin Judul & Badge sejajar ke samping */
.title-wrapper {
  display: flex;
  align-items: center; /* Biar vertikal tengah */
  gap: 12px; /* Jarak judul ke badge */
  margin-bottom: 8px; /* Jarak ke tulisan "Klik nama..." */
}

/* Judul Anggota */
.section-head h1 {
  margin: 0; /* Reset margin bawaan biar rapi */
  font-size: 28px; /* Ukuran font judul */
}

/* Badge Kapsul Glowing */
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  height: 28px;
  border-radius: 99px; /* Bentuk kapsul */
  
  /* Warna Biru Transparan (Glassy) */
  background: rgba(59, 130, 246, 0.15); 
  color: #60a5fa; /* Biru muda */
  border: 1px solid rgba(59, 130, 246, 0.3);
  
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.1); /* Efek cahaya dikit */
}

/* --- PERBAIKAN RESPONSIF UNTUK HP --- */

/* 1. Pastikan teks di dalam Badge TIDAK turun ke bawah (wrap) */
.count-badge {
  white-space: nowrap; /* Wajib: biar teks '54 Members' tetep satu baris */
  flex-shrink: 0; /* Biar badge gak penyok kegencet */
}

/* 2. Styling Khusus Layar Kecil (HP) */
@media (max-width: 640px) {
  
  /* Container Header jadi susun ke bawah */
  .section-head {
    flex-direction: column; /* Ubah arah jadi vertikal */
    align-items: flex-start; /* Rata kiri */
    gap: 8px; /* Jarak antara judul & keterangan */
  }

  /* Judul & Badge tetep sebelahan, tapi font disesuaikan dikit */
  .title-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .section-head h1 {
    font-size: 24px; /* Kecilin dikit font judul di HP biar proporsional */
  }

  /* Opsional: Sembunyikan tulisan 'Klik nama...' di HP biar BERSIH */
  /* Karena card member udah ada panahnya, user udah tau itu bisa diklik */
  .section-head .muted {
    display: none; 
  }
}

/* ====== Anggota: daftar admin (mirip publik) ====== */
.admin-members-grid {
  display: grid;
  gap: 10px 16px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.member-pill--admin {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  background: #111827;
  border: 1px solid rgba(255,255,255,.06);
}

.member-main {
  min-width: 0;
  flex: 1;
}

.member-admin-actions {
  margin-left: auto;
}

/* tombol kecil untuk admin */
.btn-sm {
  padding: 6px 10px;
  font-size: .86rem;
  border-radius: 999px;
}

/* ====== Detail anggota ====== */

/* --- UPDATE FOTO DETAIL MEMBER --- */
.media-preview.member .media-fit {
  display: block;
  width: 100%;
  border-radius: 12px;
  
  /* TAMPILAN HP (Tetap Crop rapi) */
  height: clamp(350px, 50vh, 550px); 
  object-fit: cover;
  /* Ganti 'top' jadi 'center 20%' biar fokusnya turun dikit (pas ke wajah), bukan ke lampu atas */
  object-position: center 20%; 
}

/* TAMPILAN LAPTOP / PC (Wajib Full Body) */
@media (min-width: 768px) {
  .media-preview.member .media-fit {
    /* Paksa reset tinggi biar ngikutin tinggi asli foto */
    height: auto !important;
    max-height: 85vh !important; /* Batas maksimal biar gak kegedean seleayar penuh */
    
    /* Paksa gambar utuh, jangan di-crop/zoom */
    object-fit: contain !important; 
    
    /* Posisikan di tengah */
    margin: 0 auto;
    
    /* Background gelap buat ngisi sisa ruang kiri-kanan */
    background: #0b1322;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  }
}

/* dua kolom pada desktop */
.grid--2{
  display:grid; gap:18px; margin-top: 14px;
  grid-template-columns: 1.2fr 1fr;
}
@media (max-width: 860px){ .grid--2{ grid-template-columns: 1fr } }

.fam-list{ margin: 6px 0 0; padding-left: 1.1rem; }
.fam-list li{ margin:.35rem 0 }

/* galeri foto kecil */
.photo-grid{
  display:grid; gap:10px;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}
.photo-grid img{
  width:100%; height:110px; object-fit:cover; display:block;
  border-radius:10px; border:1px solid rgba(255,255,255,.08);
}

/* Tombol kembali di halaman detail */
.page-actions{
  display:flex; align-items:center; gap:10px;
  margin: 6px 0 10px;
}
.btn.back{
  line-height:1; padding:8px 12px;
}

/* ===== [Fix] Spasi judul aman di bawah header sticky (Anggota & Kontak) ===== */
:root { --page-top-gap: 24px; }
@media (max-width: 768px){ :root { --page-top-gap: 16px; } }

/* Halaman yang kontennya langsung di dalam .container */
body.page-anggota main > .container,
body.page-kontak  main > .container {
  padding-top: var(--page-top-gap);
}

/* Halaman yang pakai .section */
body.page-anggota .section,
body.page-kontak  .section {
  padding-top: var(--page-top-gap);
}

/* Pastikan H1 pertama tidak nabrak karena margin-collapsing */
.container > h1:first-child,
.section   > h1:first-child {
  margin-top: 0;
}
