:root {
    --sp-primary: #003366;
    --sp-primary-dark: #002244;
    --sp-accent: #d90429;
    --sp-accent-hover: #b00320;
    --sp-text: #2b2d42;
    --sp-text-muted: #6c757d;
    --sp-bg-light: #f8f9fa;
    --sp-border: #e5e7eb;
    --bs-primary: #003366;
    --bs-primary-rgb: 0, 51, 102;
    --bs-link-color: #003366;
    --bs-link-color-rgb: 0, 51, 102;
    --bs-link-hover-color: #d90429;
    --bs-link-hover-color-rgb: 217, 4, 41;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: var(--sp-text);
    background-color: #fff;
    line-height: 1.6;
}

.btn-primary {
    --bs-btn-bg: #003366;
    --bs-btn-border-color: #003366;
    --bs-btn-hover-bg: #002244;
    --bs-btn-hover-border-color: #002244;
    --bs-btn-active-bg: #002244;
    --bs-btn-active-border-color: #002244;
    --bs-btn-focus-shadow-rgb: 0, 51, 102;
}

.btn-outline-primary {
    --bs-btn-color: #003366;
    --bs-btn-border-color: #003366;
    --bs-btn-hover-bg: #003366;
    --bs-btn-hover-border-color: #003366;
    --bs-btn-active-bg: #003366;
    --bs-btn-active-border-color: #003366;
    --bs-btn-focus-shadow-rgb: 0, 51, 102;
}

.list-group-item.active.border-primary {
    border-color: #003366 !important;
}

@media (max-width: 767.98px) {
    .row.g-5 {
        --bs-gutter-x: 1.5rem;
    }
}

.topbar {
    background-color: var(--sp-primary-dark);
    color: #d1d5db;
    font-size: 0.82rem;
    padding: 8px 0;
}

.topbar a {
    color: #e5e7eb;
    text-decoration: none;
}

.topbar a:hover {
    color: #fff;
}

.topbar-lang {
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 4px;
    padding: 2px 10px;
    font-weight: 600;
}

.topbar-lang:hover {
    background: rgba(255, 255, 255, 0.1);
}

.navbar-sp {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    padding: 10px 0;
}

.navbar-brand img {
    height: 42px;
    width: auto;
    display: block;
}

.navbar-nav .nav-link {
    font-weight: 600;
    font-size: 0.93rem;
    color: var(--sp-primary);
    padding: 8px 11px;
    border-radius: 6px;
    white-space: nowrap;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active,
.navbar-nav .nav-link.show {
    color: var(--sp-accent);
    background-color: rgba(0, 51, 102, 0.04);
}

@media (max-width: 1199.98px) {
    .navbar-sp .navbar-collapse {
        border-top: 1px solid var(--sp-border);
        margin-top: 10px;
        padding-top: 6px;
    }
}

.dropdown-menu {
    border: 1px solid var(--sp-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    padding: 6px;
    min-width: 230px;
}

.dropdown-item {
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 14px;
    border-radius: 5px;
    color: var(--sp-text);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(0, 51, 102, 0.06);
    color: var(--sp-primary);
}

.page-header-banner {
    background: linear-gradient(135deg, var(--sp-primary) 0%, var(--sp-primary-dark) 100%);
    color: #fff;
    padding: 45px 0;
}

.page-header-banner h1 {
    font-size: 2rem;
}

.page-header-banner .breadcrumb {
    font-size: 0.9rem;
}

.page-header-banner .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.45);
}

.page-header-banner .breadcrumb-item:empty {
    display: none;
}

@media (max-width: 576px) {
    .page-header-banner {
        padding: 32px 0;
    }

    .page-header-banner h1 {
        font-size: 1.6rem;
    }
}

.section-title {
    position: relative;
    margin-bottom: 25px;
    font-weight: 700;
    color: var(--sp-primary);
}

.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--sp-accent);
    margin-top: 8px;
}

.text-center .section-title::after {
    margin-left: auto;
    margin-right: auto;
}

.dept-card {
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dept-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08) !important;
}

.dept-card .card-img-top {
    height: 220px;
    object-fit: cover;
}

.intro-since {
    color: var(--sp-accent);
    font-weight: 600;
    margin-bottom: 8px;
}

.intro-title {
    font-weight: 700;
    color: var(--sp-primary);
    font-size: calc(1.5rem + 1.5vw);
    margin-bottom: 12px;
}

@media (min-width: 1200px) {
    .intro-title {
        font-size: 2.6rem;
    }
}

.intro-lead {
    color: var(--sp-text-muted);
    font-size: 1.2rem;
    margin-bottom: 28px;
}

.news-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--sp-border);
}

.news-date {
    font-size: 0.8rem;
    color: var(--sp-text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.tesis-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.footer-sp {
    background: #111827;
    color: #9ca3af;
    padding: 60px 0 20px;
    font-size: 0.9rem;
}

.footer-sp h5 {
    color: #fff;
    font-weight: 700;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.footer-sp a {
    color: #9ca3af;
    text-decoration: none;
}

.footer-sp a:hover {
    color: #fff;
}

.footer-sp .text-secondary {
    color: #9ca3af !important;
}

.footer-bottom {
    border-top: 1px solid #1f2937;
    padding-top: 20px;
    margin-top: 40px;
    font-size: 0.825rem;
}

.hero-image-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
    background-color: var(--sp-primary-dark);
}

.hero-showcase-img {
    width: 100%;
    height: 560px;
    object-fit: cover;
    object-position: center 35%;
    display: block;
}

@media (max-width: 992px) {
    .hero-showcase-img {
        height: 420px;
    }
}

@media (max-width: 576px) {
    .hero-showcase-img {
        height: 240px;
    }
}

.gallery-thumb-wrapper {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.gallery-thumb-wrapper img {
    transition: transform 0.35s ease;
}

.gallery-thumb-wrapper:hover img {
    transform: scale(1.05);
}

.gallery-thumb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 34, 68, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-thumb-wrapper:hover .gallery-thumb-overlay {
    opacity: 1;
}

.sp-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sp-lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sp-lightbox-container {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sp-lightbox-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    padding: 0 10px 12px 10px;
    font-size: 0.95rem;
}

.sp-lightbox-title {
    font-weight: 600;
    color: #f3f4f6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70vw;
}

.sp-lightbox-counter {
    background: #003366;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-right: 15px;
}

.sp-lightbox-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 5px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.sp-lightbox-close:hover {
    color: #d90429;
    transform: scale(1.15);
}

.sp-lightbox-body {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-lightbox-body img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    background: #0d1117;
}

.sp-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.sp-lightbox-nav:hover {
    background: #d90429;
    border-color: #d90429;
    transform: translateY(-50%) scale(1.1);
}

.sp-lightbox-nav.sp-prev {
    left: -20px;
}

.sp-lightbox-nav.sp-next {
    right: -20px;
}

@media (max-width: 768px) {
    .sp-lightbox-nav.sp-prev { left: 5px; }
    .sp-lightbox-nav.sp-next { right: 5px; }
}
