/* =========================================
   1. BASE & VARIABLES
   ========================================= */
:root {
    --color-primary: #0056b3;
    --color-secondary: #003d82;
    --color-accent: #fbc02d; /* Warna aksen kuning khas UB */
    --color-bg: #ffffff;
    --color-text: #333333;
    --color-card-bg: #f8f9fa;
    --spacing-md: 2rem;
}

[data-theme="dark"] {
    --color-primary: #4da3ff;
    --color-accent: #ffd54f;
    --color-bg: #121212;
    --color-text: #e0e0e0;
    --color-card-bg: #1e1e1e;
}

html { 
    scroll-behavior: smooth; 
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    margin: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* =========================================
   2. LAYOUT UTILITIES
   ========================================= */
.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 1rem; 
}
.grid { 
    display: grid; 
    gap: var(--spacing-md); 
}
.grid--3 { 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
}
.section-title { 
    margin-bottom: 2rem; 
    text-align: center; 
    color: var(--color-primary); 
}

/* =========================================
   3. BUTTONS
   ========================================= */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}
.btn--primary {
    background-color: var(--color-accent);
    color: #121212;
    border: none;
    cursor: pointer;
}
.btn--primary:hover {
    background-color: #f9a825;
}
.btn--outline {
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    background-color: transparent;
}
.btn--outline:hover {
    background-color: var(--color-primary);
    color: white;
}

/* =========================================
   4. HEADER & NAVIGATION STANDARD
   ========================================= */
.site-header { 
    background: var(--color-bg); 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
    position: sticky; 
    top: 0; 
    z-index: 999; 
}
.site-header__inner { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0 1rem; 
    position: relative;
    min-height: 80px;
}
.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-menu { 
    display: flex; 
    gap: 2rem; 
    align-items: center; 
    height: 100%;
}
.nav-menu > li {
    height: 100%;
    display: flex;
    align-items: center;
}
.nav-menu a { 
    text-decoration: none; 
    color: var(--color-text); 
    font-weight: 600; 
    transition: color 0.3s ease;
    padding: 1.5rem 0; 
}
.nav-menu a:hover { 
    color: var(--color-primary); 
}

.menu-item-has-children > a::after {
    content: ' \25BE'; 
    font-size: 0.8em;
    margin-left: 5px;
}

/* =========================================
   5. MEGA MENU STYLING (DESKTOP)
   ========================================= */
@media (min-width: 769px) {
    .nav-menu .menu-item-has-children {
        position: static; 
    }

    .nav-menu .sub-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        background-color: var(--color-bg);
        box-shadow: 0 10px 30px rgba(0,0,0,0.15);
        border-top: 3px solid var(--color-accent);
        padding: 2rem;
        
        opacity: 0;
        visibility: hidden;
        transform: translateY(15px);
        transition: all 0.3s ease-in-out;
        z-index: 1000;
        
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 2rem;
    }

    .nav-menu .menu-item-has-children:hover .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-menu .sub-menu li {
        display: block;
        width: 100%;
    }
    .nav-menu .sub-menu a {
        padding: 0.5rem 0;
        font-weight: 400;
        font-size: 0.95rem;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        display: block;
    }
    
    .nav-menu .sub-menu .menu-item-has-children > a::after {
        content: '';
    }
    .nav-menu .sub-menu a:hover {
        color: var(--color-primary);
        padding-left: 8px;
        border-bottom-color: var(--color-primary);
    }
}

/* =========================================
   6. HERO SLIDER
   ========================================= */
.hero-slider {
    width: 100%;
    position: relative;
    background-color: #000;
}
.slider-container {
    position: relative;
    width: 100%;
    height: 500px; 
    overflow: hidden;
}
.slider-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}
.slider-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
}
.slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.slide-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to right, rgba(0, 32, 96, 0.8), rgba(0, 32, 96, 0.4)); 
}
.slide-caption {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: left;
    width: 100%;
}
.hero__title { 
    font-size: 3rem; 
    margin-bottom: 0.5rem; 
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5); 
}
.hero__subtitle { 
    font-size: 1.25rem; 
    margin-bottom: 1.5rem; 
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5); 
}

/* Slider Controls */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.5);
    color: white;
    border: none;
    font-size: 24px;
    padding: 15px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s;
}
.slider-btn:hover { 
    background-color: var(--color-accent); 
    color: #000; 
}
.slider-btn.prev { 
    left: 0; 
    border-radius: 0 4px 4px 0; 
}
.slider-btn.next { 
    right: 0; 
    border-radius: 4px 0 0 4px; 
}

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}
.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.3s;
}
.dot.active, .dot:hover {
    background-color: var(--color-accent);
}

/* =========================================
   7. AGENDA CARDS
   ========================================= */
.agenda-section {
    padding: 4rem 1rem 2rem 1rem;
}
.agenda-card {
    display: flex;
    background: var(--color-card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}
.agenda-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}
.agenda-card__date-box {
    background-color: var(--color-primary);
    color: white;
    min-width: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    text-align: center;
}
.date-day {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}
.date-month {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}
.agenda-card__content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.agenda-card__title {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    line-height: 1.4;
}
.agenda-card__title a {
    color: var(--color-text);
    text-decoration: none;
}
.agenda-card__title a:hover {
    color: var(--color-primary);
}
.agenda-card__meta {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
}

/* =========================================
   8. LATEST NEWS CARDS
   ========================================= */
.latest-news { 
    padding: 2rem 1rem 4rem 1rem; 
}
.card {
    background: var(--color-card-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 15px rgba(0,0,0,0.1); 
}
.card__img { 
    width: 100%; 
    height: 200px; 
    object-fit: cover; 
    display: block; 
}
.card__content { 
    padding: 1.5rem; 
}
.card__title {
    margin-top: 0;
}
.card__title a { 
    color: var(--color-text); 
    text-decoration: none; 
}
.card__title a:hover { 
    color: var(--color-primary); 
}

/* =========================================
   9. PAGE & SINGLE LAYOUT (WITH SIDEBAR)
   ========================================= */
.page-wrapper {
    padding: 3rem 1rem;
}

.layout-with-sidebar {
    display: grid;
    grid-template-columns: 1fr; /* Default 1 kolom untuk Mobile */
    gap: 2rem;
}

/* Breakpoint di 769px agar Tablet/Laptop langsung 2 kolom */
@media (min-width: 769px) {
    .layout-with-sidebar {
        /* Kiri (Konten) 70%, Kanan (Sidebar) 30% */
        grid-template-columns: 2.5fr 1fr; 
        gap: 2.5rem;
        align-items: start;
    }
}

.content-area {
    background: var(--color-card-bg);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    min-width: 0; /* Mencegah konten meluber (overflow) dari grid */
}

.entry-title {
    color: var(--color-primary);
    margin-top: 0;
    font-size: 2.2rem;
    line-height: 1.3;
}

.entry-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 2rem;
    object-fit: cover;
}

.entry-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.agenda-meta-info {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: rgba(251, 192, 45, 0.1);
    border-left: 4px solid var(--color-accent);
    border-radius: 0 4px 4px 0;
    line-height: 1.8;
}

/* =========================================
   10. SIDEBAR & WIDGET STYLING
   ========================================= */
.sidebar-area {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-width: 0; 
}

.sidebar-area > * {
    background: var(--color-card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    margin: 0; /* Reset margin bawaan blok Gutenberg */
}

.sidebar-area h2,
.sidebar-area h3,
.widget__title {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: var(--color-primary);
    border-bottom: 3px solid var(--color-accent);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.sidebar-area ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-area ul li {
    padding: 0.5rem 0;
    border-bottom: 1px dashed rgba(0,0,0,0.1);
}

.sidebar-area ul li:last-child {
    border-bottom: none;
}

.sidebar-area a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
}

.sidebar-area a:hover {
    color: var(--color-primary);
    padding-left: 5px;
}

/* Form Pencarian */
.search-form {
    display: flex;
    gap: 0.5rem;
}
.search-field {
    flex: 1;
    padding: 10px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 4px;
    background: var(--color-bg);
    color: var(--color-text);
}
.search-submit {
    padding: 10px 15px;
}

/* Penyesuaian Dark Mode */
[data-theme="dark"] .entry-meta,
[data-theme="dark"] .sidebar-area ul li {
    border-bottom-color: rgba(255,255,255,0.1);
    color: #aaa;
}
[data-theme="dark"] .agenda-card__meta,
[data-theme="dark"] .agenda-meta-info {
    color: #e0e0e0;
}
[data-theme="dark"] .agenda-card {
    border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .agenda-meta-info {
    background-color: rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .search-field {
    border-color: rgba(255,255,255,0.2);
}

/* =========================================
   11. ANIMATIONS
   ========================================= */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in.is-visible { 
    opacity: 1; 
    transform: translateY(0); 
}

/* =========================================
   12. MOBILE MENU ADJUSTMENT & ACCORDION
   ========================================= */
.menu-toggle { display: none; }

@media (max-width: 768px) {
    .menu-toggle { 
        display: block; 
        background: none; 
        border: none; 
        font-size: 1.5rem; 
        cursor: pointer; 
        color: var(--color-text); 
    }
    
    .main-navigation { 
        display: none; 
        width: 100%; 
        position: absolute;
        top: 100%;
        left: 0;
        background: var(--color-bg);
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        padding: 0 1rem 1rem 1rem;
        max-height: calc(100vh - 80px);
        overflow-y: auto; 
    }
    
    .main-navigation.toggled { 
        display: block; 
    }
    
    .nav-menu { 
        flex-direction: column; 
        gap: 0;
        align-items: flex-start;
    }
    
    .nav-menu > li {
        width: 100%;
        position: relative;
        display: flex;
        flex-wrap: wrap; 
        align-items: center;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    
    .nav-menu a {
        padding: 1rem 0;
        width: calc(100% - 50px);
        border-bottom: none;
    }
    
    .menu-item-has-children > a::after {
        content: ''; 
    }

    .dropdown-toggle-btn {
        background: transparent;
        border: none;
        color: var(--color-text);
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.3s ease;
    }

    .menu-item-has-children.is-open > .dropdown-toggle-btn {
        transform: rotate(180deg);
        color: var(--color-primary);
    }
    
    .nav-menu .sub-menu {
        width: 100%;
        display: none; 
        padding-left: 1rem;
        background-color: var(--color-card-bg);
        border-radius: 4px;
        margin-bottom: 0.5rem;
    }
    
    .nav-menu .menu-item-has-children.is-open > .sub-menu {
        display: block; 
    }

    .nav-menu .sub-menu a {
        width: 100%;
        padding: 0.75rem 0.5rem;
        border-bottom: 1px solid rgba(0,0,0,0.03);
    }
    
    .nav-menu .sub-menu li:last-child a {
        border-bottom: none;
    }

    /* Penyesuaian Hero Slider di Mobile */
    .hero__title { 
        font-size: 2rem; 
    }
    .slider-container { 
        height: 400px; 
    }
    .slide-caption { 
        padding: 0 2rem; 
        text-align: center; 
    }
}