/* ============================================================
   DIRPM UDI - Frontend CSS
   Palet: Navy #1a202c | Purple #667eea | Gold #f59e0b | #f7fafc
   ============================================================ */
:root {
    --navy: #1a202c;
    --navy-2: #2d3748;
    --purple: #667eea;
    --purple-dark: #5568d8;
    --purple-soft: #eceffd;
    --gold: #f59e0b;
    --gold-dark: #d97706;
    --light: #f7fafc;
    --white: #ffffff;
    --text: #2d3748;
    --muted: #718096;
    --green-bg: #d4edda;
    --green-text: #155724;
    --yellow-bg: #fff3cd;
    --yellow-text: #856404;
    --shadow-sm: 0 2px 10px rgba(26,32,44,.08);
    --shadow-md: 0 10px 30px rgba(26,32,44,.14);
    --shadow-purple: 0 10px 28px rgba(102,126,234,.35);
    --radius: 14px;
    --transition: all .3s ease;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: "Segoe UI", "Poppins", system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--white);
    overflow-x: hidden;
}
::selection { background: var(--gold); color: var(--navy); }

/* ============ TOP BAR ============ */
.topbar { background: var(--navy); color: #cbd5e0; font-size: .82rem; padding: .35rem 0; }
.topbar a { color: #cbd5e0; text-decoration: none; transition: var(--transition); }
.topbar a:hover { color: var(--gold); }
.topbar-social a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; margin-left: 6px; border-radius: 50%;
    background: rgba(255,255,255,.08); font-size: .75rem;
}
.topbar-social a:hover { background: var(--gold); color: var(--navy); }

/* ============ NAVBAR ============ */
.navbar-dirpm {
    background: var(--navy);
    padding: .7rem 0;
    box-shadow: 0 2px 18px rgba(0,0,0,.35);
}
.navbar-dirpm .navbar-brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; color: #fff; font-size: 1.15rem; letter-spacing: .3px; }
.navbar-dirpm .navbar-brand small { display: block; font-size: .62rem; font-weight: 500; color: #a0aec0; letter-spacing: 1px; text-transform: uppercase; }
.navbar-dirpm .navbar-nav { gap: .5rem; align-items: center; }
.navbar-dirpm .nav-link { color: #e2e8f0 !important; font-weight: 500; padding: .5rem 1rem; border-radius: 8px; transition: var(--transition); }
.navbar-dirpm .nav-link:hover, .navbar-dirpm .nav-link.active { color: var(--gold) !important; background: rgba(255,255,255,.06); }
.navbar-dirpm .dropdown-menu { border: none; border-radius: var(--radius); box-shadow: var(--shadow-md); padding: .6rem; }
.navbar-dirpm .dropdown-item { border-radius: 8px; padding: .55rem .8rem; font-weight: 500; }
.navbar-dirpm .dropdown-item:hover { background: var(--purple-soft); color: var(--purple-dark); }
.btn-dirpm { background: var(--gold); color: var(--navy); font-weight: 700; border: none; padding: .65rem 1.5rem; border-radius: 10px; transition: var(--transition); box-shadow: 0 4px 14px rgba(245,158,11,.4); }
.btn-dirpm:hover { background: var(--gold-dark); color: var(--navy); transform: translateY(-2px); }
.btn-dirpm-outline { background: transparent; border: 2px solid #fff; color: #fff; font-weight: 600; padding: .6rem 1.5rem; border-radius: 10px; transition: var(--transition); }
.btn-dirpm-outline:hover { background: #fff; color: var(--navy); }
.btn-purple { background: var(--purple); color: #fff; border: none; font-weight: 600; border-radius: 10px; padding: .6rem 1.4rem; transition: var(--transition); box-shadow: var(--shadow-purple); }
.btn-purple:hover { background: var(--purple-dark); color: #fff; transform: translateY(-2px); }

/* ============ HERO ============ */
.hero {
    position: relative; min-height: 58vh; display: flex; align-items: center;
    background: url('../../storage/dirpm/hero.svg') center/cover no-repeat;
    color: #fff; overflow: hidden;
}
.hero::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(26,32,44,.82) 0%, rgba(26,32,44,.62) 32%, rgba(26,32,44,.18) 65%, rgba(26,32,44,0) 100%);
}
.hero .container { position: relative; z-index: 1; }
.hero-badge { display: inline-flex; align-items: center; gap: .5rem; background: rgba(245,158,11,.18); border: 1px solid rgba(245,158,11,.5); color: #fcd34d; padding: .35rem 1rem; border-radius: 50px; font-size: .8rem; font-weight: 600; letter-spacing: .5px; margin-bottom: 1.2rem; }
.hero h1 { font-size: 2.2rem; line-height: 1.2; font-weight: 800; letter-spacing: -0.5px; text-shadow: 0 2px 12px rgba(0,0,0,.55); }
.hero h1 .text-gold { color: var(--gold); text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.hero p.lead { font-size: 1.1rem; color: #f7fafc; max-width: 560px; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.hero-logos { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.5rem; }
.hero-logos .logo-circle { width: 64px; height: 64px; border-radius: 16px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.hero-stats { display: flex; gap: 2rem; margin-top: 2rem; }
.hero-stats .stat b { display: block; font-size: 1.6rem; color: var(--gold); }
.hero-stats .stat span { font-size: .8rem; color: #a0aec0; text-transform: uppercase; letter-spacing: 1px; }

/* ============ SECTION ============ */
.section { padding: 4.5rem 0; }
.section-light { background: var(--light); }
.section-title { font-weight: 800; font-size: 1.9rem; color: var(--navy); letter-spacing: -0.5px; }
.section-title .accent { color: var(--purple); }
.section-sub { color: var(--muted); max-width: 640px; }
.kicker { display: inline-flex; align-items: center; gap: .5rem; text-transform: uppercase; letter-spacing: 2px; font-size: .72rem; font-weight: 700; color: var(--purple); margin-bottom: .5rem; }
.kicker::before { content: ""; width: 28px; height: 3px; background: var(--gold); border-radius: 2px; }

/* ============ CARDS ============ */
.card-dirpm { border: none; border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; transition: var(--transition); background: #fff; height: 100%; }
.card-dirpm:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.service-card { text-align: center; padding: 2rem 1.5rem; }
.service-icon { width: 72px; height: 72px; margin: 0 auto 1.2rem; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; color: #fff; background: linear-gradient(135deg, var(--purple), var(--purple-dark)); box-shadow: var(--shadow-purple); }
.service-card h4 { font-size: 1.1rem; font-weight: 700; color: var(--navy); }
.service-card p { font-size: .88rem; color: var(--muted); }
.link-more { color: var(--purple-dark); font-weight: 600; text-decoration: none; font-size: .88rem; }
.link-more:hover { color: var(--gold-dark); }

/* News cards */
.news-card .badge-berita { background: var(--navy); color: #fff; }
.news-card .badge-pengumuman { background: var(--gold); color: var(--navy); }
.news-card .card-img-top { height: 200px; object-fit: cover; }
.meta { font-size: .78rem; color: var(--muted); }

/* ============ TIMELINE AGENDA ============ */
.timeline { position: relative; padding-left: 2.2rem; }
.timeline::before { content: ""; position: absolute; left: 10px; top: 6px; bottom: 6px; width: 3px; background: linear-gradient(var(--purple), var(--gold)); border-radius: 2px; }
.timeline-item { position: relative; display: flex; gap: 1.2rem; align-items: flex-start; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1rem 1.2rem; margin-bottom: 1rem; transition: var(--transition); border: 1px solid #edf0f5; }
.timeline-item:hover { transform: translateX(6px); box-shadow: var(--shadow-md); }
.timeline-item::before { content: ""; position: absolute; left: -2.2rem; top: 1.35rem; width: 15px; height: 15px; border-radius: 50%; background: var(--gold); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--purple); }
.date-box { min-width: 66px; text-align: center; background: var(--light); border-radius: 12px; padding: .4rem .2rem; border: 1px solid #e2e8f0; }
.date-box .day { font-size: 1.5rem; font-weight: 800; color: var(--navy); line-height: 1; }
.date-box .month { font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--purple-dark); letter-spacing: 1px; }
.badge-upcoming { background: var(--green-bg); color: var(--green-text); font-weight: 600; }
.badge-done { background: #e2e8f0; color: #4a5568; font-weight: 600; }

/* ============ GALLERY ============ */
.masonry { columns: 3 280px; column-gap: 1rem; }
.masonry-item { break-inside: avoid; margin-bottom: 1rem; position: relative; overflow: hidden; border-radius: var(--radius); cursor: pointer; }
.masonry-item img { width: 100%; display: block; transition: var(--transition); }
.masonry-item:hover img { transform: scale(1.08); filter: brightness(.6); }
.masonry-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 1rem; color: #fff; background: linear-gradient(transparent, rgba(26,32,44,.85)); opacity: 0; transition: var(--transition); }
.masonry-item:hover .masonry-overlay { opacity: 1; }
.filter-btn { border: 1.5px solid var(--purple); color: var(--purple-dark); background: transparent; border-radius: 50px; padding: .35rem 1.3rem; font-weight: 600; font-size: .85rem; transition: var(--transition); }
.filter-btn:hover, .filter-btn.active { background: var(--purple); color: #fff; }

/* ============ CTA ============ */
.cta-section { background: linear-gradient(135deg, var(--navy) 0%, var(--purple-dark) 100%); color: #fff; border-radius: var(--radius); padding: 3rem 2rem; position: relative; overflow: hidden; }
.cta-section::after { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; background: rgba(245,158,11,.15); right: -80px; top: -80px; }
.btn-wa { background: #25D366; color: #0b3d1e; font-weight: 700; border: none; padding: .75rem 1.8rem; border-radius: 50px; transition: var(--transition); box-shadow: 0 6px 20px rgba(37,211,102,.4); }
.btn-wa:hover { transform: translateY(-2px); color: #0b3d1e; }

/* ============ FOOTER ============ */
.footer { background: var(--navy); color: #a0aec0; }
.footer h6 { color: #fff; font-size: .8rem; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: .9rem; }
.footer a { color: #a0aec0; text-decoration: none; transition: var(--transition); }
.footer a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); font-size: .82rem; }
.footer-brand { color: #fff; font-weight: 800; }
.social-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.08); color: #fff; margin-right: .5rem; transition: var(--transition); }
.social-icon:hover { background: var(--gold); color: var(--navy); transform: translateY(-3px); }

/* ============ WHATSAPP FLOAT & TO TOP ============ */
.wa-float { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 1000; width: 58px; height: 58px; border-radius: 50%; background: #25D366; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.7rem; box-shadow: 0 6px 20px rgba(37,211,102,.5); transition: var(--transition); text-decoration: none; }
.wa-float:hover { transform: scale(1.12); color: #fff; }
.to-top { position: fixed; bottom: 6rem; right: 1.65rem; z-index: 1000; width: 46px; height: 46px; border-radius: 12px; background: var(--navy); color: var(--gold); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: var(--transition); text-decoration: none; }
.to-top.show { opacity: 1; pointer-events: auto; }

/* ============ PAGE HEADER ============ */
.page-header { background: linear-gradient(135deg, var(--navy), var(--purple-dark)); color: #fff; padding: 4rem 0 3rem; }
.page-header h1 { font-weight: 800; }
.breadcrumb-dirpm { background: transparent; padding: 0; margin: 0; }
.breadcrumb-dirpm a { color: #cbd5e0; }
.breadcrumb-dirpm .active { color: var(--gold); }

/* ============ DETAIL CONTENT ============ */
.article-content { font-size: 1.02rem; line-height: 1.8; color: var(--text); }
.article-content img { max-width: 100%; border-radius: var(--radius); }
.badge-tipe { font-size: .75rem; padding: .35em .8em; border-radius: 50px; }
.meta-item { display: inline-flex; align-items: center; gap: .4rem; margin-right: 1.2rem; font-size: .85rem; color: var(--muted); }

/* ============ DOWNLOADS ============ */
.download-item { transition: var(--transition); border: 1px solid #edf0f5; }
.download-item:hover { border-color: var(--purple); transform: translateX(6px); box-shadow: var(--shadow-sm); }
.file-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: #fff; }
.file-pdf { background: #e53e3e; } .file-doc { background: #2b6cb0; } .file-zip { background: #d69e2e; } .file-gen { background: var(--muted); }

/* ============ HORIZONTAL SLIDER (Kabar Terbaru / Buku) ============ */
.hscroll { display: flex; gap: 1.5rem; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: .25rem .1rem 1rem; margin: 0 -.1rem; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll-item { flex: 0 0 calc(33.333% - 1rem); scroll-snap-align: start; display: flex; }
.hscroll-item > * { width: 100%; }
.hscroll-item.book { flex-basis: calc(25% - 1.125rem); }
@media (max-width: 991.98px) { .hscroll-item { flex-basis: calc(50% - .75rem); } .hscroll-item.book { flex-basis: calc(33.333% - 1rem); } }
@media (max-width: 575.98px) { .hscroll-item, .hscroll-item.book { flex-basis: calc(100% - .5rem); } }
.hscroll-btn { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--purple); color: var(--purple-dark); background: #fff; display: inline-flex; align-items: center; justify-content: center; transition: var(--transition); cursor: pointer; }
.hscroll-btn:hover { background: var(--purple); color: #fff; }

/* ============ BOOK CARDS (Perpustakaan Digital) ============ */
.book-card { cursor: default; }
.book-cover-wrap { position: relative; overflow: hidden; aspect-ratio: 3/4; }
.book-cover { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); display: block; }
.book-cover-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, rgba(26,32,44,.05), rgba(26,32,44,.55)); opacity: 0; transition: var(--transition); }
.book-card:hover .book-cover { transform: scale(1.06); }
.book-card:hover .book-cover-overlay { opacity: 1; }

/* ============ PAGINATION (Laravel + Bootstrap 5) ============ */
.pagination { gap: .35rem; }
.page-link { border: none !important; border-radius: 10px !important; color: var(--navy) !important; background: var(--light) !important; font-weight: 600; padding: .55rem .85rem; transition: var(--transition); }
.page-link:hover { background: var(--purple-soft) !important; color: var(--purple-dark) !important; }
.page-item.active .page-link { background: var(--purple) !important; color: #fff !important; box-shadow: var(--shadow-purple); }
.page-item.disabled .page-link { background: #edf0f5 !important; color: var(--muted) !important; }

/* ============ AGENDA CARDS ============ */
.agenda-card { display: flex; align-items: stretch; gap: 0; background: #fff; border: 1px solid #edf0f5; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: var(--transition); color: var(--text); }
.agenda-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--purple); color: var(--text); }
.agenda-date { min-width: 86px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; background: linear-gradient(160deg, var(--purple), var(--purple-dark)); color: #fff; padding: 1rem .5rem; text-align: center; }
.agenda-date .d { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.agenda-date .m { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; }
.agenda-date .y { font-size: .72rem; opacity: .85; }
.agenda-date-past { background: linear-gradient(160deg, #e2e8f0, #cbd5e0); color: #4a5568; }
.agenda-card-past { opacity: .88; }
.agenda-card-past:hover { opacity: 1; border-color: #a0aec0; }
.agenda-body { flex: 1; padding: 1rem 1.1rem; display: flex; flex-direction: column; justify-content: center; }
.agenda-title { font-size: 1.05rem; font-weight: 700; color: var(--navy); margin: .1rem 0 .4rem; line-height: 1.4; }
.agenda-title-sm { font-size: .92rem; font-weight: 700; color: var(--navy); margin: .1rem 0 .4rem; line-height: 1.4; }
.agenda-thumb { width: 132px; object-fit: cover; border-left: 1px solid #edf0f5; }
.agenda-empty { display: flex; align-items: center; gap: 1rem; background: var(--light); border: 1px dashed #cbd5e0; border-radius: var(--radius); padding: 1.5rem; color: var(--muted); }

/* ============ AOS FALLBACK: pastikan konten tampil meski JS gagal ============ */
[data-aos] {
    opacity: 1 !important;
    transform: none !important;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 991.98px) {
    .hero { min-height: auto; padding: 5rem 0; }
    .hero h1 { font-size: 1.9rem; }
    .hero-stats { gap: 1.2rem; flex-wrap: wrap; }
}
@media (max-width: 575.98px) {
    .masonry { columns: 2 150px; }
    .section { padding: 3rem 0; }
}
