/* Global Styles */
:root {
    --primary-color: #43A047;
    /* Softer, professional Green */
    --primary-dark: #2E7D32;
    /* Darker shade for contrast */
    --primary-light: #E8F5E9;
    /* Very light green for backgrounds */
    --text-color: #333;
    --white: #ffffff;
    --bg-color: #f4f6f8;
    /* Modern light gray/blueish bg */
    --footer-height: 60px;
}

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

body {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    /* Modern font stack */
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

ul {
    list-style: none;
}

/* Header & Navigation */
header {
    background-color: var(--white);
    /* White header for modern look */
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 50px;
    /* Logo height */
    width: auto;
}

.logo a {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-dark);
    text-decoration: none;
    margin-left: 10px;
}

.nav-links {
    display: flex;
}

.nav-links li {
    margin-left: 20px;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
    font-weight: 700;
    /* Optional: make it bold */
    border-bottom: 2px solid var(--primary-color);
    /* Optional: add underline */
}

/* Login Button in Nav */
.btn-login-nav {
    background-color: var(--primary-color);
    color: var(--white) !important;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600 !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(67, 160, 71, 0.2);
}

.btn-login-nav:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(67, 160, 71, 0.3);
    border-bottom: none !important;
    /* Override active link style */
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Main Content */
main {
    flex: 1;
    margin-top: 70px;
    /* Offset for fixed header */
    margin-bottom: var(--footer-height);
    /* Offset for fixed footer */
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
    align-self: center;
}

.hero {
    text-align: center;
    padding: 4rem 1rem;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

/* Card Styles */
/* Card Styles */
.card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--primary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s ease;
    display: block;
    /* Ensure it works as a link */
    text-decoration: none;
    /* Remove underline */
    color: var(--text-color);
    /* Inherit text color */
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(67, 160, 71, 0.2);
    background-color: var(--white);
    text-decoration: none;
    color: var(--text-color);
}

.card h3 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
    font-weight: 700;
}

/* Carousel */
.carousel {
    position: relative;
    width: 100%;
    /* Remove fixed height to prevent cropping */
    height: auto;
    overflow: hidden;
    margin-top: 0;
    margin-bottom: 2rem;
    /* Reduced spacing */
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.carousel-inner {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: auto;
    /* Allow image to define height */
    max-height: none;
    /* Remove limit */
}

.carousel-item {
    min-width: 100%;
    position: relative;
    height: auto;
}

.carousel-item img {
    width: 100%;
    height: auto;
    /* Natural aspect ratio */
    display: block;
    object-fit: contain;
    /* Ensure full image visibility */
}

.carousel-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    color: var(--white);
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1.5rem;
    transition: background 0.3s;
    border-radius: 50%;
    margin: 0 10px;
}

.carousel-control:hover {
    background: rgba(0, 0, 0, 0.7);
}

.prev {
    left: 0;
}

.next {
    right: 0;
}

/* Enhanced Footer */
footer {
    background-color: var(--primary-dark);
    color: var(--white);
    padding: 2rem 1rem;
    display: block;
    /* Changed from flex to block/grid for multi-column */
    position: relative;
    /* Remove fixed to allow content to grow */
    width: 100%;
    height: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section h3 {
    margin-bottom: 1.2rem;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--primary-light);
    display: inline-block;
    padding-bottom: 5px;
}

.footer-section p,
.footer-section a {
    color: #f1f1f1;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: flex-start;
    /* Align icon to top of text */
    gap: 10px;
    text-decoration: none;
    line-height: 1.5;
}

.footer-section i {
    margin-top: 4px;
    /* Slight optical adjustment */
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.footer-section a:hover {
    color: var(--primary-light);
    transform: translateX(5px);
    transition: transform 0.3s, color 0.3s;
}

/* Responsive Footer Grid */
@media screen and (min-width: 600px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (min-width: 992px) {
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
    }
}

.copyright {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
}

/* Update Main to remove bottom margin since footer is no longer fixed */
main {
    margin-bottom: 0;
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--white);
        /* Match header bg */
        flex-direction: column;
        align-items: center;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        max-height: 500px;
        padding-bottom: 1rem;
    }

    .nav-links li {
        margin: 1rem 0;
    }

    .nav-links a {
        color: var(--text-color);
        /* Ensure visibility on white bg */
    }

    .hamburger {
        display: block;
    }

    .logo a {
        font-size: 1rem;
        /* Smaller text on mobile */
    }

    .carousel-inner {
        height: auto;
        /* Allow auto height on mobile too */
        max-height: 50vh;
        /* Increased from 40vh */
    }

    .navbar {
        padding: 0.5rem;
    }
}

/* Featured News Grid */
.news-grid-featured {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

@media screen and (min-width: 481px) {
    .news-grid-featured {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (min-width: 769px) {
    .news-grid-featured {
        grid-template-columns: repeat(6, 1fr);
        grid-template-rows: auto auto;
    }

    /* 
       Layout for 5 items:
       Row 1: 2 Large items (span 3 cols each) - Half width each
       Row 2: 3 Small items (span 2 cols each) - Third width each
    */

    /* Item 1 & 2: Big Cards */
    .news-card-featured:nth-child(1),
    .news-card-featured:nth-child(2) {
        grid-column: span 3;
        min-height: 400px;
    }

    .news-card-featured:nth-child(1) .news-thumb,
    .news-card-featured:nth-child(2) .news-thumb {
        height: 250px;
        /* Taller images for big cards */
    }

    /* Item 3, 4, 5: Small Cards */
    .news-card-featured:nth-child(3),
    .news-card-featured:nth-child(4),
    .news-card-featured:nth-child(5) {
        grid-column: span 2;
        min-height: 300px;
    }
}

.news-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.news-thumb {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #eee;
}

.news-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-title {
    font-size: 1.25rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-weight: 700;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media screen and (max-width: 768px) {
    .news-title {
        font-size: 1.1rem;
    }
    
    .news-excerpt {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .news-content {
        padding: 1rem;
    }
}

.news-date {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 1rem;
}

.news-excerpt {
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    flex: 1;
}

.read-more {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
    transition: background 0.3s;
    align-self: flex-start;
}

.read-more:hover {
    background-color: var(--primary-dark);
}

/* Ekstrakurikuler Section */
.ekskul-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    padding: 0 20px;
}

.ekskul-card {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.ekskul-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(67, 160, 71, 0.2);
    border-color: var(--primary-color);
}

.ekskul-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 15px rgba(67, 160, 71, 0.3);
}

.ekskul-icon i {
    font-size: 2rem;
    color: var(--white);
}

.ekskul-card h4 {
    color: var(--primary-dark);
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.ekskul-card p {
    color: var(--text-color);
    font-size: 0.9rem;
    margin: 0;
}

/* Responsive Ekstrakurikuler */
@media screen and (max-width: 768px) {
    .ekskul-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }

    .ekskul-card {
        padding: 1.5rem 1rem;
    }

    .ekskul-icon {
        width: 60px;
        height: 60px;
    }

    .ekskul-icon i {
        font-size: 1.5rem;
    }

    .ekskul-card h4 {
        font-size: 1rem;
    }

    .ekskul-card p {
        font-size: 0.85rem;
    }
}