/* ================================================================
   view_kepengurusan_detail.php — extracted styles
   Source: views/view_kepengurusan_detail.php
   ================================================================ */

/* ── MEDIEVAL COLOR OVERRIDES ── */
.bagan-bph-struktur,.bagan-dept-grid,.bph-card{font-family:'Cinzel',serif;}
.bph-card{background:linear-gradient(160deg,#faf4e4,#f4ead0);border-radius:4px!important;}
.bph-card-ketua{border:2px solid #c9a84c!important;box-shadow:0 6px 26px rgba(201,168,76,.2)!important;}
.bph-card-ketua::before{background:linear-gradient(90deg,#c9a84c,#e0c060)!important;}
.bph-card-glow{background:radial-gradient(ellipse at top center,rgba(201,168,76,.1),transparent 70%)!important;}
.bph-card-wakil{border:2px solid #8a6a9a!important;box-shadow:0 4px 16px rgba(138,106,154,.15)!important;}
.bph-card-wakil::before{background:linear-gradient(90deg,#a07030,#8a6a9a)!important;}
.bph-card-sek{border:2px solid #6a9060!important;}
.bph-card-sek::before{background:linear-gradient(90deg,#8aaa70,#4a7840)!important;}
.bph-card-waksek{border:1.5px solid #9ab890!important;background:#f4f8f0!important;}
.bph-card-waksek::before{background:linear-gradient(90deg,#9ab890,#6a9060)!important;}
.bph-card-bend{border:2px solid #507090!important;}
.bph-card-bend::before{background:linear-gradient(90deg,#7090b8,#3a6080)!important;}
.bph-card-wakbend{border:1.5px solid #90b0d0!important;background:#f0f4f8!important;}
.bph-card-wakbend::before{background:linear-gradient(90deg,#90b0d0,#507090)!important;}
.bph-foto-wrap{border-color:#c9a84c!important;}
.bph-foto-init{background:linear-gradient(135deg,#c9a84c,#a07830)!important;}
.bph-init-wakil{background:linear-gradient(135deg,#8a6a9a,#5a3a7a)!important;}
.bph-init-sek{background:linear-gradient(135deg,#6a9060,#3a6030)!important;}
.bph-init-waksek{background:linear-gradient(135deg,#8aaa70,#6a9060)!important;}
.bph-init-bend{background:linear-gradient(135deg,#507090,#2a5070)!important;}
.bph-init-wakbend{background:linear-gradient(135deg,#7090b8,#507090)!important;}
.bph-badge-ketua{background:linear-gradient(90deg,#c9a84c,#e0c060)!important;color:#06112a!important;}
.bph-badge-wakil{background:#e8e0f0!important;color:#4a2a6a!important;}
.bph-badge-sek{background:#d8ead0!important;color:#2a5020!important;}
.bph-badge-waksek{background:#e4f0d8!important;color:#4a7030!important;}
.bph-badge-bend{background:#d0dff0!important;color:#1a3a60!important;}
.bph-badge-wakbend{background:#dce8f4!important;color:#2a5080!important;}
.bph-role-sek{background:#d8ead0!important;color:#2a5020!important;}
.bph-role-bend{background:#d0dff0!important;color:#1a3a60!important;}
.bph-nama{font-family:'Cinzel',serif;color:#06112a!important;}
.bph-nim{font-family:'IM Fell English',Georgia,serif;font-style:italic;}
.bagan-vline,.bph-vline{background:linear-gradient(to bottom,#c9a84c,#a07830)!important;}
.bagan-hline{background:linear-gradient(to right,transparent,#c9a84c 8%,#c9a84c 92%,transparent)!important;}
.sekbend-col::before,.sekbend-col::after{background:#c9a84c!important;}
.dept-card{background:linear-gradient(160deg,#faf4e4,#f4ead0)!important;border-radius:4px!important;border:1px solid #d4b87a!important;border-top:3px solid #d4b87a!important;}
.dept-card:hover{border-color:#c9a84c!important;background:#f0e8d4!important;box-shadow:0 8px 22px rgba(201,168,76,.18)!important;}
.dept-abbr{background:linear-gradient(135deg,#c9a84c,#e0c060)!important;border-radius:3px!important;font-family:'Cinzel',serif!important;}
.dept-nama{font-family:'Cinzel',serif!important;color:#06112a!important;}
.dept-kadep-badge{background:#e8e0d0!important;color:#5a3a10!important;}
.dept-kadep-nama{font-family:'IM Fell English',Georgia,serif!important;font-style:italic!important;}
.dept-hint{color:#a07830!important;font-family:'Cinzel',serif!important;}
.dept-page-link{border-radius:2px!important;font-family:'Cinzel',serif!important;font-size:9.5px!important;}
.dept-page-link:hover{color:#a07830!important;border-color:#c9a84c!important;background:#f0e8d0!important;}
.dep-modal{background:linear-gradient(160deg,#faf4e4,#f4ead0)!important;border-radius:4px!important;}
.dep-modal-head{border-bottom:1px solid #d4b87a!important;}
.dep-modal-abbr{color:#c9a84c!important;font-family:'Cinzel',serif!important;}
.dep-modal-title{font-family:'Cinzel',serif!important;color:#06112a!important;}
.dep-modal-sub{font-family:'IM Fell English',Georgia,serif!important;font-style:italic!important;}
.dep-modal-close{background:#f0e8d0!important;color:#06112a!important;}
.dep-anggota-row{background:#f4ead0!important;border:1px solid #d4b87a!important;border-radius:3px!important;}
.dep-anggota-row:hover{background:#f0e0b8!important;border-color:#c9a84c!important;}
.dep-anggota-foto-wrap{border-color:#c9a84c!important;}
.dep-anggota-init{background:linear-gradient(135deg,#c9a84c,#6a3a90)!important;}
.dep-anggota-nama{font-family:'Cinzel',serif!important;color:#06112a!important;}
.dep-anggota-jabatan{font-family:'Cinzel',serif!important;}
.jab-kadep{background:#e8e0d0!important;color:#5a3a10!important;}
.jab-anggota{background:#d8ead0!important;color:#2a5020!important;}
.dep-anggota-bio{font-family:'IM Fell English',Georgia,serif!important;font-style:italic!important;}

/* ════ WRAPPER ════ */
.bagan-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0 60px;
}

/* ════ BPH STRUKTUR HIERARKI ════ */
.bagan-bph-struktur {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 960px;
}
.bph-row { display: flex; justify-content: center; width: 100%; }
.bph-row-single { justify-content: center; }
.bph-row-sekbend {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 500px;
}
.sekbend-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 210px;
    max-width: 210px;
    position: relative;
    padding-top: 28px;
}
/* Vertical drop from T-junction to each card */
.sekbend-col::before {
    content: '';
    position: absolute;
    top: 0; left: 50%; transform: translateX(-50%);
    width: 2px; height: 28px;
    background: linear-gradient(to bottom, var(--amber), #c97c00);
}
/* Horizontal half-bar: first col extends rightward */
.sekbend-col:not(:only-child):first-child::after {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    width: calc(50% + 20px); /* to center of gap */
    height: 2px;
    background: var(--amber);
}
/* Horizontal half-bar: last col extends leftward */
.sekbend-col:not(:only-child):last-child::after {
    content: '';
    position: absolute;
    top: 0; right: 50%;
    width: calc(50% + 20px); /* to center of gap */
    height: 2px;
    background: var(--amber);
}

/* ── Konektor BPH ── */
.bph-vline {
    width: 2px; height: 30px;
    background: linear-gradient(to bottom, var(--amber), #c97c00);
    flex-shrink: 0;
}
.bph-vline-sub { height: 20px; }

/* ── Kartu BPH Base ── */
.bph-card {
    background: white;
    border-radius: 18px;
    padding: 20px 16px 16px;
    text-align: center;
    width: 100%;
    box-shadow: 0 4px 18px rgba(0,0,0,.08);
    transition: transform .2s, box-shadow .2s;
    position: relative;
    overflow: hidden;
}
.bph-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 4px;
    border-radius: 18px 18px 0 0;
}
.bph-card:hover { transform: translateY(-4px); }

/* Ketua */
.bph-card-ketua {
    border: 2.5px solid #f59e0b;
    box-shadow: 0 6px 28px rgba(245,158,11,.22);
    max-width: 210px;
}
.bph-card-ketua::before { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.bph-card-glow {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at top center, rgba(251,191,36,.12), transparent 70%);
    pointer-events: none;
}

/* Wakil Ketua */
.bph-card-wakil {
    border: 2px solid #a78bfa;
    box-shadow: 0 4px 18px rgba(167,139,250,.15);
    max-width: 200px;
}
.bph-card-wakil::before { background: linear-gradient(90deg, #a78bfa, #7c3aed); }

/* Sekretaris */
.bph-card-sek {
    border: 2px solid #34d399;
    box-shadow: 0 4px 14px rgba(52,211,153,.15);
}
.bph-card-sek::before { background: linear-gradient(90deg, #6ee7b7, #10b981); }

/* Wakil Sekretaris */
.bph-card-waksek {
    border: 1.5px solid #a7f3d0;
    box-shadow: 0 2px 10px rgba(52,211,153,.1);
    background: #f0fdf9;
}
.bph-card-waksek::before { background: linear-gradient(90deg, #a7f3d0, #34d399); }

/* Bendahara */
.bph-card-bend {
    border: 2px solid #60a5fa;
    box-shadow: 0 4px 14px rgba(96,165,250,.15);
}
.bph-card-bend::before { background: linear-gradient(90deg, #93c5fd, #3b82f6); }

/* Wakil Bendahara */
.bph-card-wakbend {
    border: 1.5px solid #bfdbfe;
    box-shadow: 0 2px 10px rgba(96,165,250,.1);
    background: #eff6ff;
}
.bph-card-wakbend::before { background: linear-gradient(90deg, #bfdbfe, #60a5fa); }

/* ── Role icon (Sek/Bend) ── */
.bph-role-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 8px; margin-bottom: 8px;
}
.bph-role-sek  { background: #d1fae5; color: #059669; }
.bph-role-bend { background: #dbeafe; color: #2563eb; }

/* ── Foto ── */
.bph-foto-wrap {
    width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 10px;
    overflow: hidden; border: 3px solid var(--amber);
}
.bph-foto-sm { width: 64px; height: 64px; }
.bph-foto-xs { width: 52px; height: 52px; border-width: 2px; }
.bph-foto      { width:100%; height:100%; object-fit:cover; object-position:top; }
.bph-foto-init {
    width:100%; height:100%; display:flex; align-items:center; justify-content:center;
    font-size:22px; font-weight:700; color:white;
    background: linear-gradient(135deg, var(--amber), #f59e0b);
}
.bph-init-wakil  { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.bph-init-sek    { background: linear-gradient(135deg, #34d399, #059669); font-size:18px; }
.bph-init-waksek { background: linear-gradient(135deg, #6ee7b7, #34d399); }
.bph-init-bend   { background: linear-gradient(135deg, #60a5fa, #3b82f6); font-size:18px; }
.bph-init-wakbend{ background: linear-gradient(135deg, #93c5fd, #60a5fa); }

/* ── Text ── */
.bph-nama     { font-weight:700; font-size:13px; color:var(--dark); line-height:1.3; margin-bottom:6px; }
.bph-nama-sm  { font-size:12px; }
.bph-nama-xs  { font-size:11px; }
.bph-nim      { font-size:10px; color:var(--muted); margin-top:4px; letter-spacing:.3px; }
.bph-info-text{ font-size:10px; color:var(--muted); margin-top:5px; line-height:1.45; font-style:italic; }

/* ── Badge per jabatan ── */
.bph-badge {
    display:inline-block; font-size:11px; font-weight:700;
    padding:3px 10px; border-radius:20px;
}
.bph-badge-ketua  { background:linear-gradient(90deg,#fbbf24,#f59e0b); color:var(--dark); }
.bph-badge-wakil  { background:#ede9fe; color:#6d28d9; }
.bph-badge-sek    { background:#d1fae5; color:#065f46; }
.bph-badge-waksek { background:#ecfdf5; color:#059669; font-size:10px; }
.bph-badge-bend   { background:#dbeafe; color:#1e40af; }
.bph-badge-wakbend{ background:#eff6ff; color:#2563eb; font-size:10px; }

/* ════ CONNECTORS ════ */
.bagan-vline {
    width: 2px; height: 36px;
    background: linear-gradient(to bottom, var(--amber), #c97c00);
    margin: 0 auto; flex-shrink: 0;
}
.bagan-vline-sm { height: 22px; }
.bagan-hline-wrap {
    display: flex; justify-content: center; width: 100%;
}
.bagan-hline {
    height: 2px; width: 75%; max-width: 900px; min-width: 60px;
    background: linear-gradient(to right, transparent, var(--amber) 8%, var(--amber) 92%, transparent);
}

/* ════ DEPARTEMEN GRID ════ */
/* Wrapper untuk horizontal scroll di layar kecil */
.bagan-dept-scroll-outer {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
    /* Sembunyikan scrollbar tapi tetap bisa scroll */
    scrollbar-width: thin;
    scrollbar-color: rgba(201,168,76,.4) transparent;
}
.bagan-dept-scroll-outer::-webkit-scrollbar {
    height: 5px;
}
.bagan-dept-scroll-outer::-webkit-scrollbar-track {
    background: transparent;
}
.bagan-dept-scroll-outer::-webkit-scrollbar-thumb {
    background: rgba(201,168,76,.4);
    border-radius: 3px;
}
.bagan-dept-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;       /* SELALU ke samping, tidak wrap */
    gap: 14px;
    width: max-content;      /* Melebar sesuai konten */
    min-width: 100%;
    padding: 4px 2px;
}
.dept-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 150px;         /* Lebar tetap per departemen */
    width: 150px;
}
.dept-card {
    background: white;
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 14px 10px 10px;
    text-align: center;
    width: 100%;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.dept-card:hover {
    border-color: var(--amber);
    background: #fffbf0;
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(255,140,0,.15);
}
.dept-abbr {
    width: 40px; height: 40px; border-radius: 10px;
    background: linear-gradient(135deg, var(--yellow), #ffaa00);
    font-size: 10px; font-weight: 800; letter-spacing: .5px;
    color: var(--dark);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 8px;
}
.dept-nama         { font-weight: 700; font-size: 12px; color: var(--dark); line-height: 1.35; margin-bottom: 6px; }
.dept-kadep-badge  { font-size: 10px; font-weight: 700; background: #ede9fe; color: #6d28d9; display: inline-block; padding: 2px 8px; border-radius: 10px; margin-bottom: 4px; }
.dept-kadep-nama   { font-size: 10px; color: var(--muted); margin-bottom: 4px; line-height: 1.3; }
.dept-hint         { font-size: 10px; color: var(--amber); font-weight: 600; margin-top: 4px; }
.dept-page-link {
    display: inline-flex;
    align-items: center;
    margin-top: 6px;
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: white;
    transition: all .2s;
    letter-spacing: .3px;
}
.dept-page-link:hover {
    color: var(--amber);
    border-color: var(--amber);
    background: #fffbf0;
}

/* Tombol pilih halaman departemen */
.dept-pilih-btn {
    display: inline-flex;
    align-items: center;
    padding: 13px 32px;
    background: linear-gradient(135deg, #c9a84c, #e0c060);
    color: #18181b;
    font-family: 'Cinzel', serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-decoration: none;
    border-radius: 3px;
    border: 2px solid #c9a84c;
    box-shadow: 0 4px 18px rgba(201,168,76,.3);
    transition: all .25s;
}
.dept-pilih-btn:hover {
    background: linear-gradient(135deg, #b8932e, #d4b040);
    box-shadow: 0 6px 24px rgba(201,168,76,.45);
    transform: translateY(-2px);
}

/* ════ MODAL ════ */
.dep-modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 900;
    backdrop-filter: blur(2px);
}
.dep-modal-overlay.show { display: block; }

.dep-modal {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    z-index: 901;
    max-height: 80vh;
    overflow: hidden;
    flex-direction: column;
    box-shadow: 0 -8px 40px rgba(0,0,0,.2);
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.32,1,.48,1);
}
.dep-modal.show {
    display: flex;
    transform: translateY(0);
}

/* On larger screens: centered modal box */
@media (min-width: 640px) {
    .dep-modal {
top: 50%; left: 50%; right: auto; bottom: auto;
width: 480px; max-width: 92vw;
border-radius: 20px;
transform: translate(-50%, -40%) scale(.95);
transition: opacity .25s, transform .25s;
opacity: 0;
max-height: 85vh;
    }
    .dep-modal.show {
transform: translate(-50%, -50%) scale(1);
opacity: 1;
    }
}

.dep-modal-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 2px solid #f3f4f6;
    flex-shrink: 0;
}
.dep-modal-abbr  { font-size: 10px; font-weight: 800; color: var(--amber); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 3px; }
.dep-modal-title { font-size: 17px; font-weight: 800; color: var(--dark); line-height: 1.2; }
.dep-modal-sub   { font-size: 12px; color: var(--muted); margin-top: 3px; }
.dep-modal-close {
    background: #f3f4f6; border: none; border-radius: 50%;
    width: 32px; height: 32px; cursor: pointer; font-size: 14px;
    flex-shrink: 0; transition: background .15s; color: var(--dark);
}
.dep-modal-close:hover { background: #e5e7eb; }

.dep-modal-body {
    overflow-y: auto; padding: 16px 20px 24px;
    display: flex; flex-direction: column; gap: 10px;
}
.dep-modal-body::-webkit-scrollbar { width: 4px; }
.dep-modal-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

.dep-anggota-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    background: #fafafa; border: 1px solid #f0f0f0;
    border-radius: 12px; transition: background .15s;
}
.dep-anggota-row:hover { background: #fffbf0; border-color: #ffe08a; }
.dep-anggota-foto-wrap {
    width: 48px; height: 48px; border-radius: 50%;
    overflow: hidden; flex-shrink: 0;
    border: 2px solid var(--amber);
}
.dep-anggota-foto { width:100%; height:100%; object-fit:cover; object-position:top; }
.dep-anggota-init {
    width:100%; height:100%; display:flex; align-items:center; justify-content:center;
    font-size: 15px; font-weight: 700; color: white;
    background: linear-gradient(135deg, var(--amber), #7c3aed);
}
.dep-anggota-nama    { font-weight: 700; font-size: 14px; color: var(--dark); line-height: 1.3; }
.dep-anggota-jabatan { font-size: 11px; font-weight: 600; display: inline-block; margin-top: 3px; padding: 2px 8px; border-radius: 10px; }
.jab-kadep   { background: #ede9fe; color: #6d28d9; }
.jab-anggota { background: #f0fdf4; color: #15803d; }
.dep-anggota-bio { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.5; }

/* ── Foto clickable ── */
.bph-foto-wrap { cursor: pointer; position: relative; }
.bph-foto-wrap:hover::after {
    content: '🔍';
    position: absolute; inset: 0;
    background: rgba(0,0,0,.35);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.dep-anggota-foto-wrap { cursor: pointer; position: relative; }
.dep-anggota-foto-wrap:hover::after {
    content: '🔍';
    position: absolute; inset: 0;
    background: rgba(0,0,0,.35);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
}

/* ── Lightbox Foto ── */
#foto-lightbox {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,.85);
    align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
    animation: lbFadeIn .2s ease;
    flex-direction: column; gap: 14px;
    padding: 20px;
}
#foto-lightbox.show { display: flex; }
@keyframes lbFadeIn { from { opacity:0; } to { opacity:1; } }
#foto-lightbox img {
    max-width: min(480px, 90vw);
    max-height: 70vh;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 8px 48px rgba(0,0,0,.6);
    border: 3px solid rgba(255,255,255,.15);
}
#foto-lightbox .lb-info {
    text-align: center; color: white;
}
#foto-lightbox .lb-nama {
    font-size: 18px; font-weight: 800; margin-bottom: 4px;
}
#foto-lightbox .lb-jabatan {
    font-size: 13px; opacity: .7;
}
#foto-lightbox .lb-nim {
    font-size: 11px; opacity: .5; margin-top: 3px;
}
#foto-lightbox .lb-close {
    position: absolute; top: 16px; right: 20px;
    background: rgba(255,255,255,.15); border: none;
    width: 36px; height: 36px; border-radius: 50%;
    color: white; font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
#foto-lightbox .lb-close:hover { background: rgba(255,255,255,.3); }

@media (max-width: 600px) {
    .bagan-hline-wrap { display: none; }
    .bph-row-sekbend { gap: 16px; max-width: 380px; }
    .sekbend-col { flex: 0 0 175px; max-width: 175px; }
    .sekbend-col:not(:only-child):first-child::after,
    .sekbend-col:not(:only-child):last-child::after { width: calc(50% + 8px); }
    .bph-card-ketua, .bph-card-wakil { max-width: 180px; }
    .bph-foto-wrap { width: 62px; height: 62px; }
    .bph-foto-sm   { width: 54px; height: 54px; }
    .bph-foto-xs   { width: 44px; height: 44px; }
    .bph-foto-init { font-size: 18px; }
    .bph-nama  { font-size: 12px; }
    .bph-nama-sm { font-size: 11px; }
    .bph-nama-xs { font-size: 10px; }
    .bph-badge { font-size: 10px; }
    .bagan-dept-grid {
        gap: 10px;
    }
    .dept-col {
        flex: 0 0 130px;
        width: 130px;
    }
    .dept-abbr { width: 34px; height: 34px; font-size: 9px; border-radius: 8px; }
    .dept-nama { font-size: 11px; }
}
@media (max-width: 380px) {
    .bph-row-sekbend { gap: 10px; max-width: 320px; }
    .sekbend-col { flex: 0 0 150px; max-width: 150px; }
    .bagan-dept-grid { gap: 8px; }
    .dept-col { flex: 0 0 120px; width: 120px; }
}
