/* ==========================================================================
   Website Unit - Fakultas Dakwah dan Komunikasi
   Warna tema per unit diatur lewat CSS variable (--brand, --brand-ink, ...) di layout.
   ========================================================================== */

:root {
    --font-heading: "Lora", Georgia, "Times New Roman", serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --ink: #1f2933;
    --muted: #616e7c;
    --line: #e4e7eb;
    --paper: #fbfaf8;
    --radius: .75rem;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
    --shadow: 0 12px 32px -12px rgba(16, 24, 40, .18);
    --bs-body-font-family: var(--font-body);
    --bs-body-color: var(--ink);
    --bs-border-radius: .5rem;
}

body { font-family: var(--font-body); color: var(--ink); background: #fff; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, .font-heading { font-family: var(--font-heading); font-weight: 700; letter-spacing: -.01em; color: #111827; }
a { text-decoration-thickness: 1px; text-underline-offset: .2em; }
::selection { background: var(--brand-light); }
.text-brand { color: var(--brand-ink) !important; }
.bg-brand { background: var(--brand-ink) !important; }
.bg-brand-soft { background: var(--brand-soft) !important; }
.bg-paper { background: var(--paper); }
.skip-link { position: absolute; left: -999px; top: .5rem; z-index: 2000; background: #fff; padding: .5rem 1rem; border-radius: .5rem; }
.skip-link:focus { left: .5rem; }

/* Tombol bermerk (warna --brand-ink selalu lolos kontras teks putih) */
.btn-brand { --bs-btn-color: #fff; --bs-btn-bg: var(--brand-ink); --bs-btn-border-color: var(--brand-ink);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark); --bs-btn-focus-shadow-rgb: var(--brand-ink-rgb); }
.btn-outline-brand { --bs-btn-color: var(--brand-ink); --bs-btn-border-color: var(--brand-ink);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--brand-ink); --bs-btn-hover-border-color: var(--brand-ink);
    --bs-btn-active-bg: var(--brand-dark); --bs-btn-focus-shadow-rgb: var(--brand-ink-rgb); }
.btn { font-weight: 500; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), .2); }

/* ---------- Header ---------- */
.topbar { background: var(--brand-dark); color: rgba(255, 255, 255, .85); font-size: .8rem; }
.topbar a { color: inherit; text-decoration: none; }
.topbar a:hover { color: #fff; }

.site-header { position: sticky; top: 0; z-index: 1030; background: rgba(255, 255, 255, .96); backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--line); transition: box-shadow .2s; }
.site-header.is-scrolled { box-shadow: var(--shadow-sm); }
.site-header::before { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--brand), var(--brand-ink)); }

.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: inherit; min-width: 0; }
.brand-mark { width: 2.75rem; height: 2.75rem; border-radius: .6rem; flex-shrink: 0; display: grid; place-items: center;
    background: var(--brand-ink); color: #fff; font-family: var(--font-heading); font-weight: 700; font-size: 1.05rem; letter-spacing: .02em; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-mark.has-logo { background: transparent; border-radius: 0; }
.site-footer .brand-mark.has-logo { background: #fff; border-radius: 50%; padding: .3rem; }
.brand-name { font-family: var(--font-heading); font-weight: 700; font-size: 1.05rem; line-height: 1.2; color: #111827; }
.brand-sub { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.main-nav .nav-link { font-weight: 500; font-size: .92rem; color: var(--ink); padding: 1.35rem .8rem !important; position: relative; }
.main-nav .nav-link:hover, .main-nav .nav-link.active, .main-nav .show > .nav-link { color: var(--brand-ink); }
.main-nav .nav-link.active::after { content: ""; position: absolute; left: .8rem; right: .8rem; bottom: .9rem; height: 2px; background: var(--brand); border-radius: 2px; }
.main-nav .dropdown-menu { border: 0; border-top: 3px solid var(--brand); border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow); padding: .5rem; margin-top: 0; min-width: 15rem; }
.main-nav .dropdown-item { border-radius: .4rem; padding: .5rem .75rem; font-size: .9rem; white-space: normal; }
.main-nav .dropdown-item:hover, .main-nav .dropdown-item.active { background: var(--brand-soft); color: var(--brand-ink); }
@media (min-width: 992px) {
    .main-nav .dropdown:hover > .dropdown-menu { display: block; }
}
@media (max-width: 991.98px) {
    .main-nav .nav-link { padding: .65rem 0 !important; }
    .main-nav .nav-link.active::after { display: none; }
    .main-nav .dropdown-menu { box-shadow: none; border-top: 0; padding-left: 1rem; }
    .navbar-collapse { max-height: 75vh; overflow-y: auto; padding-bottom: 1rem; }
}
.btn-icon { width: 2.5rem; height: 2.5rem; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.btn-icon:hover { border-color: var(--brand); color: var(--brand-ink); }

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; background: var(--brand-dark); overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center; transform: scale(1.02); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(105deg, rgba(var(--brand-dark-rgb), .96) 0%, rgba(var(--brand-ink-rgb), .82) 45%, rgba(var(--brand-ink-rgb), .35) 100%); }
.hero h1 { color: #fff; font-size: clamp(2rem, 4.5vw, 3.4rem); line-height: 1.12; }
.hero .lead { color: rgba(255, 255, 255, .88); max-width: 38rem; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .85); }
.hero-eyebrow::before { content: ""; width: 2rem; height: 2px; background: var(--brand-light); }
.hero-card { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); backdrop-filter: blur(6px); border-radius: var(--radius); color: #fff; text-decoration: none; display: block; padding: 1.25rem; transition: background .2s; }
.hero-card:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.hero .btn-light { color: var(--brand-ink); }

.page-hero { background: linear-gradient(135deg, var(--brand-dark), var(--brand-ink)); color: #fff; padding: 3rem 0 2.5rem; position: relative; overflow: hidden; }
.page-hero::after { content: ""; position: absolute; right: -6rem; top: -6rem; width: 22rem; height: 22rem; border-radius: 50%; border: 3.5rem solid rgba(255, 255, 255, .06); }
.page-hero h1 { color: #fff; font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.page-hero .breadcrumb { --bs-breadcrumb-divider-color: rgba(255, 255, 255, .6); --bs-breadcrumb-item-active-color: rgba(255, 255, 255, .85); font-size: .85rem; margin-bottom: .75rem; }
.page-hero .breadcrumb a { color: rgba(255, 255, 255, .75); text-decoration: none; }
.page-hero .breadcrumb a:hover { color: #fff; }

/* ---------- Section ---------- */
.section { padding: 4.5rem 0; }
.section-sm { padding: 3rem 0; }
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: .35rem; }
.section-kicker { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--brand-ink); display: inline-flex; align-items: center; gap: .5rem; }
.section-kicker::before { content: ""; width: 1.5rem; height: 2px; background: var(--brand); }
.link-arrow { font-weight: 600; text-decoration: none; color: var(--brand-ink); white-space: nowrap; }
.link-arrow i { transition: transform .2s; display: inline-block; }
.link-arrow:hover i { transform: translateX(3px); }

/* ---------- Kartu konten ---------- */
.post-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; height: 100%; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post-thumb { aspect-ratio: 16 / 10; background: var(--brand-soft); overflow: hidden; display: block; position: relative; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.post-card:hover .post-thumb img { transform: scale(1.04); }
.post-thumb .placeholder-icon { position: absolute; inset: 0; display: grid; place-items: center; color: var(--brand); font-size: 2.5rem; opacity: .5; }
.post-body { padding: 1.15rem 1.25rem 1.35rem; display: flex; flex-direction: column; flex: 1; }
.post-meta { font-size: .78rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin-bottom: .5rem; }
.post-title { font-size: 1.12rem; line-height: 1.35; margin-bottom: .5rem; }
.post-title a { color: inherit; text-decoration: none; }
.post-title a:hover { color: var(--brand-ink); }
.post-title a::after { content: ""; position: absolute; inset: 0; }
.post-card { position: relative; }
.post-excerpt { color: var(--muted); font-size: .92rem; margin-bottom: 0; }
.badge-brand { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }

.post-feature { border-radius: var(--radius); overflow: hidden; position: relative; min-height: 26rem; display: flex; align-items: flex-end; color: #fff; background: var(--brand-dark); isolation: isolate; }
.post-feature img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .5s; }
.post-feature:hover img { transform: scale(1.03); }
.post-feature::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(0, 0, 0, .85), rgba(0, 0, 0, .1) 65%); }
.post-feature .post-title { font-size: clamp(1.3rem, 2.4vw, 1.75rem); color: #fff; }
.post-feature .post-meta { color: rgba(255, 255, 255, .8); }

.post-row { display: flex; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); position: relative; }
.post-row:last-child { border-bottom: 0; }
.post-row img, .post-row .thumb { width: 6.5rem; height: 4.75rem; border-radius: .5rem; object-fit: cover; flex-shrink: 0; background: var(--brand-soft); }
.post-row .post-title { font-size: 1rem; margin-bottom: .25rem; }

/* ---------- Tentang & statistik ---------- */
.about-figure { position: relative; }
.about-figure img { border-radius: var(--radius); width: 100%; aspect-ratio: 4 / 3; object-fit: cover; box-shadow: var(--shadow); }
.about-figure::before { content: ""; position: absolute; left: -1rem; bottom: -1rem; width: 55%; height: 55%; border-radius: var(--radius); background: var(--brand-soft); z-index: -1; }
.stat { padding: 1.25rem; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); height: 100%; }
.stat-value { font-family: var(--font-heading); font-size: 2rem; font-weight: 700; color: var(--brand-ink); line-height: 1; }
.stat-label { color: var(--muted); font-size: .85rem; margin-top: .35rem; }

/* ---------- Program studi ---------- */
.prodi-card { --unit: var(--brand-ink); display: flex; flex-direction: column; height: 100%; padding: 1.5rem; border-radius: var(--radius); background: #fff;
    border: 1px solid var(--line); border-top: 4px solid var(--unit); text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s; }
.prodi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: inherit; }
.prodi-icon { width: 3rem; height: 3rem; border-radius: .6rem; display: grid; place-items: center; color: #fff; background: var(--unit); font-size: 1.3rem; margin-bottom: 1rem; }
.prodi-card h3 { font-size: 1.15rem; }
.prodi-card .go { margin-top: auto; font-weight: 600; font-size: .88rem; color: var(--unit); }

/* ---------- Info Prodi (beranda fakultas) ---------- */
.prodi-info { border-top: 4px solid var(--unit); }
.prodi-badge { position: absolute; left: .75rem; top: .75rem; background: var(--unit); color: #fff; font-size: .75rem; font-weight: 600;
    padding: .3rem .65rem; border-radius: 2rem; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); max-width: calc(100% - 1.5rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prodi-info .post-title a:hover { color: var(--unit); }
.prodi-link { font-size: .85rem; font-weight: 600; color: var(--unit); }

/* ---------- Dosen ---------- */
.person-card { text-align: center; padding: 1.75rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; height: 100%; position: relative; transition: box-shadow .2s, transform .2s; }
.person-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.avatar { width: 6rem; height: 6rem; border-radius: 50%; margin: 0 auto 1rem; display: grid; place-items: center; overflow: hidden;
    background: linear-gradient(135deg, var(--brand), var(--brand-ink)); color: #fff; font-family: var(--font-heading); font-size: 1.8rem; font-weight: 700; box-shadow: 0 0 0 4px var(--brand-soft); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.person-card h3 { font-size: 1.05rem; margin-bottom: .25rem; }
.person-card h3 a { color: inherit; text-decoration: none; }
.person-card h3 a::after { content: ""; position: absolute; inset: 0; }
.person-meta { font-size: .82rem; color: var(--muted); }

/* ---------- Galeri ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.gallery-item { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; display: block; background: var(--brand-soft); border: 0; padding: 0; width: 100%; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item figcaption { position: absolute; inset: auto 0 0; padding: 2rem .9rem .75rem; color: #fff; font-size: .88rem; text-align: left; background: linear-gradient(to top, rgba(0, 0, 0, .75), transparent); }
.lightbox .modal-content { background: transparent; border: 0; }
.lightbox img { max-height: 82vh; width: auto; max-width: 100%; margin: 0 auto; display: block; border-radius: .5rem; }

/* ---------- Kurikulum ---------- */
.semester-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; height: 100%; }
.semester-card .head { background: var(--brand-soft); padding: .8rem 1.1rem; display: flex; justify-content: space-between; align-items: center; }
.semester-card .head h3 { font-size: 1.05rem; margin: 0; color: var(--brand-ink); }
.semester-card table { margin: 0; font-size: .9rem; }
.semester-card td, .semester-card th { padding: .6rem 1.1rem; }
.semester-card a { color: inherit; text-decoration: none; }
.semester-card a:hover { color: var(--brand-ink); text-decoration: underline; }

/* ---------- Artikel ---------- */
.article { font-size: 1.06rem; line-height: 1.8; color: #27303a; }
.article > *:first-child { margin-top: 0; }
.article h2, .article h3, .article h4 { margin: 2rem 0 .75rem; line-height: 1.3; }
.article h2 { font-size: 1.6rem; } .article h3 { font-size: 1.3rem; }
.article p { margin-bottom: 1.15rem; }
.article a { color: var(--brand-ink); }
.article img { max-width: 100%; height: auto; border-radius: .5rem; margin: .5rem 0; }
.article blockquote { border-left: 4px solid var(--brand); padding: .5rem 1.25rem; color: var(--muted); font-style: italic; background: var(--brand-soft); border-radius: 0 .5rem .5rem 0; }
.article table { width: 100%; margin-bottom: 1.25rem; border-collapse: collapse; font-size: .95rem; }
.article th, .article td { border: 1px solid var(--line); padding: .55rem .75rem; vertical-align: top; }
.article th, .article thead td { background: var(--brand-soft); }
.article iframe { max-width: 100%; border-radius: .5rem; }
.article ul, .article ol { padding-left: 1.4rem; margin-bottom: 1.15rem; }
.article-cover { border-radius: var(--radius); overflow: hidden; margin-bottom: 2rem; box-shadow: var(--shadow); }
.article-cover img { width: 100%; max-height: 32rem; object-fit: cover; }
.table-scroll { overflow-x: auto; }

.info-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.info-list dl { margin: 0; display: grid; grid-template-columns: minmax(8rem, 35%) 1fr; }
.info-list dt, .info-list dd { padding: .75rem 1.1rem; margin: 0; border-bottom: 1px solid var(--line); }
.info-list dt { background: var(--paper); font-weight: 600; font-size: .88rem; color: var(--muted); }
.info-list dl > :nth-last-child(-n+2) { border-bottom: 0; }

.sidebar-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; background: #fff; }
.sidebar-card + .sidebar-card { margin-top: 1.25rem; }
.sidebar-title { font-size: 1rem; font-family: var(--font-body); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 1rem; }
.side-nav a { display: block; padding: .55rem .75rem; border-radius: .5rem; color: var(--ink); text-decoration: none; font-size: .93rem; }
.side-nav a:hover { background: var(--paper); }
.side-nav a.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.share a { width: 2.25rem; height: 2.25rem; border-radius: 50%; display: inline-grid; place-items: center; background: var(--paper); color: var(--ink); border: 1px solid var(--line); text-decoration: none; }
.share a:hover { background: var(--brand-ink); color: #fff; border-color: var(--brand-ink); }
.attachment { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border: 1px dashed var(--brand); border-radius: var(--radius); background: var(--brand-soft); text-decoration: none; color: inherit; }
.attachment i { font-size: 2rem; color: #c62828; }
.attachment:hover { color: inherit; background: #fff; }

/* ---------- Pagination ---------- */
.pagination { --bs-pagination-color: var(--brand-ink); --bs-pagination-active-bg: var(--brand-ink); --bs-pagination-active-border-color: var(--brand-ink);
    --bs-pagination-hover-color: var(--brand-dark); --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), .25); gap: .25rem; }
.pagination .page-link { border-radius: .5rem !important; min-width: 2.4rem; text-align: center; }

/* ---------- CTA & footer ---------- */
.cta { background: linear-gradient(120deg, var(--brand-ink), var(--brand-dark)); color: #fff; border-radius: calc(var(--radius) * 1.5); padding: 2.5rem; position: relative; overflow: hidden; }
.cta::after { content: ""; position: absolute; right: -4rem; bottom: -5rem; width: 16rem; height: 16rem; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.cta h2 { color: #fff; }

.site-footer { background: #111827; color: rgba(255, 255, 255, .7); font-size: .92rem; }
.site-footer h2 { color: #fff; font-family: var(--font-body); font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 1.1rem; }
.site-footer a { color: rgba(255, 255, 255, .7); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer .brand-name { color: #fff; }
.site-footer .footer-links li { margin-bottom: .55rem; }
.unit-dot { width: .6rem; height: .6rem; border-radius: 50%; display: inline-block; margin-right: .5rem; vertical-align: middle; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); font-size: .82rem; }
.back-to-top { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1020; opacity: 0; pointer-events: none; transition: opacity .2s; box-shadow: var(--shadow); }
.back-to-top.show { opacity: 1; pointer-events: auto; }

.preview-bar { background: #fff3cd; color: #664d03; border-bottom: 1px solid #ffe69c; font-size: .9rem; position: sticky; top: 0; z-index: 1040; }

/* Sorotan (konten unggulan) di hero */
.hero-highlights { display: grid; gap: .75rem; }
.hero-card.is-compact { padding: .9rem 1.1rem; }
.hero-card.is-compact h2 { font-size: 1rem; margin: .2rem 0 0; }

.empty-state { text-align: center; padding: 4rem 1rem; color: var(--muted); }
.empty-state i { font-size: 3rem; color: var(--brand); opacity: .6; }
mark { background: var(--brand-light); padding: 0 .15em; border-radius: .2em; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
