:root {
    --nu-green: #008f4c;
    --nu-green-dark: #00703c;
    --nu-green-light: #e6f4ea;
    --text-dark: #333333;
    --text-gray: #666666;
    --text-light: #999999;
    --white: #ffffff;
    --bg-light: #f5f5f5;
    --border-color: #e0e0e0;
    --container-width: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
    padding-left: 0; /* Reset bootstrap padding */
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Top */
.header-top {
    background-color: var(--white);
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.date-display {
    font-size: 0.85rem;
    color: var(--text-gray);
}

.top-links a {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-left: 15px;
}

/* Logo Section */
.logo-section {
    background-color: transparent;
    padding: 20px 0;
}

.logo-section .container {
    display: flex;
    align-items: center;
}

.school-logo {
    max-height: 80px;
    width: auto;
    margin-right: 20px;
}

.logo-text h1 {
    font-size: 2rem;
    color: var(--nu-green);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0; /* Bootstrap override */
}

.logo-text span {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 500;
    display: block;
}

/* Navigation */
.main-nav {
    background-color: var(--nu-green);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.main-nav ul {
    display: flex;
    flex-wrap: wrap;
    position: relative;
    margin-bottom: 0; /* Bootstrap override */
}

.main-nav li {
    position: relative;
}

/* Submenu Styles */
.main-nav ul.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--nu-green);
    min-width: 220px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    flex-direction: column;
    z-index: 1001;
}

.main-nav li:hover > ul.submenu {
    display: flex;
}

.main-nav ul.submenu li {
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.main-nav ul.submenu li:last-child {
    border-bottom: none;
}

/* Nested Submenu (Level 3+) */
.main-nav ul.submenu ul.submenu {
    top: 0;
    left: 100%;
    margin-top: -5px; /* Adjust slightly if needed */
}

/* Ensure arrow rotation or spacing if needed */
.main-nav li.has-submenu > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-nav ul.submenu a {
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.main-nav ul.submenu a:hover {
    background-color: rgba(0,0,0,0.1);
}

.main-nav a {
    display: block;
    color: var(--white);
    padding: 15px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.3s;
}

.main-nav a:hover {
    background-color: var(--nu-green-dark);
    color: var(--white); /* Ensure text stays white on hover */
}

/* Main Content Grid */
.main-content {
    margin-top: 30px;
    margin-bottom: 50px;
}

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

/* Hero Section */
.hero-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.hero-main {
    grid-column: span 2;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.hero-main img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 20px;
    color: var(--white);
}

.hero-overlay h2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    line-height: 1.3;
    max-height: 2.6em; /* Fallback */
}

.hero-sub {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.hero-sub img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.hero-sub-content {
    padding: 15px;
}

.hero-sub-content h4 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    max-height: 3.2em; /* Fallback based on line-height ~1.6 * 2 lines */
    line-height: 1.6; /* Ensure line height is consistent */
}

/* Section Titles */
.section-title {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--nu-green);
    padding-bottom: 10px;
}

.section-title h2 {
    color: var(--nu-green);
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-right: 15px;
    margin-bottom: 0;
}

/* News List */
.news-item {
    display: flex;
    gap: 15px;
    background: var(--white);
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.news-thumb {
    width: 150px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
}

.news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-meta {
    font-size: 0.8rem;
    color: var(--text-gray);
    margin-bottom: 5px;
}

.news-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 2.8em; /* Fallback: 1.4 * 2 */
}

.news-excerpt {
    font-size: 0.9rem;
    color: var(--text-gray);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Sidebar */
.sidebar-widget {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.popular-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.popular-list li:last-child {
    border-bottom: none;
}

.popular-number {
    display: inline-block;
    width: 25px;
    height: 25px;
    background: var(--nu-green);
    color: var(--white);
    text-align: center;
    line-height: 25px;
    border-radius: 50%;
    font-size: 0.8rem;
    margin-right: 10px;
}

.popular-title {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Footer */
footer {
    background-color: #222;
    color: var(--white);
    padding: 50px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    color: var(--nu-green);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #ccc;
    transition: color 0.3s;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--nu-green);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #333;
    color: #888;
    font-size: 0.9rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #333;
    color: #888;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-main {
        grid-column: span 1;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .main-nav {
        overflow-x: auto;
    }
    
    .main-nav ul {
        width: max-content;
    }
}

/* --- PPDB Form Custom Styles --- */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.card-header {
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
    background: linear-gradient(135deg, var(--nu-green) 0%, var(--nu-green-dark) 100%);
}

.form-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    border-radius: 8px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--nu-green);
    box-shadow: 0 0 0 0.2rem rgba(0, 143, 76, 0.25);
}

.form-check-input:checked {
    background-color: var(--nu-green);
    border-color: var(--nu-green);
}

.btn-success {
    background-color: var(--nu-green);
    border-color: var(--nu-green);
    border-radius: 8px;
    padding: 12px 25px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-success:hover {
    background-color: var(--nu-green-dark);
    border-color: var(--nu-green-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 143, 76, 0.3);
}

.form-text {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Header Social Icons */
.header-social {
    display: flex;
    gap: 10px;
}

.social-icon {
    color: var(--nu-green);
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #f0fdf4;
    border: 1px solid rgba(0, 143, 76, 0.1);
}

.social-icon:hover {
    color: var(--white);
    background-color: var(--nu-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
