/* Reset & Base Variables */
:root {
    --primary-color: #2c3e50;
    /* Deep Blue */
    --accent-color: #27ae60;
    /* Village Green */
    --text-color: #333;
    --light-bg: #f4f7f6;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Container */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Header & Navbar */
header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand span {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 10px 15px;
    border-radius: 5px;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--white);
    background-color: var(--accent-color);
}

/* Mobile Menu Toggle (Hidden by default on desktop) */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Main Content Area */
main {
    flex: 1;
    padding: 40px 0;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 40px 0 20px;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: inline-block;
}

.footer-section p,
.footer-section a {
    color: #ecf0f1;
    text-decoration: none;
    margin-bottom: 10px;
    display: block;
}

.footer-section a:hover {
    color: var(--accent-color);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        /* JS will toggle this */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        text-align: center;
    }

    .nav-links.active {
        display: flex;
    }
}

/* Hero Banner */
/* Hero Banner with Slider */
.hero-banner {
    /* Background static removed/overridden */
    background: #333;
    height: 600px;
    position: relative;
    display: flex;
    align-items: center;
    color: var(--white);
    text-align: center;
    overflow: hidden;
}

.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.slide-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    background-size: cover;
    background-position: center;
}

.slide-item.active {
    opacity: 1;
}

.hero-banner .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    /* Sedikit lebih gelap agar teks terbaca */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    /* Di atas overlay */
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 10px;
}

.hero-content h2 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--accent-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.hero-content p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    line-height: 1.6;
}

.btn-hero {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--accent-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-hero:hover {
    background-color: #219150;
}

/* Sambutan Section */
.section-sambutan {
    padding: 60px 0;
    background-color: var(--white);
}

.sambutan-wrapper {
    display: flex;
    gap: 40px;
    align-items: center;
}

.sambutan-img {
    flex: 1;
}

.sambutan-img img {
    width: 100%;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.sambutan-text {
    flex: 2;
}

.sambutan-text h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    border-left: 5px solid var(--accent-color);
    padding-left: 15px;
}

.sambutan-text p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #555;
}

.sambutan-text cite {
    font-weight: bold;
    color: var(--primary-color);
    font-style: normal;
}

/* Statistik Section */
.section-stats {
    padding: 60px 0;
    background-color: var(--light-bg);
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.stat-card {
    background: var(--white);
    padding: 30px;
    text-align: center;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card i {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.stat-card h3 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-card p {
    color: #777;
    font-weight: 500;
}

/* Responsive Index */
@media (max-width: 768px) {
    .sambutan-wrapper {
        flex-direction: column;
    }

    .hero-content h2 {
        font-size: 2rem;
    }
}

/* Page Header (Generic for inner pages) */
.page-header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 40px 0;
    margin-bottom: 40px;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
}

/* Profil Styling */
.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.section-header i {
    font-size: 1.8rem;
    color: var(--accent-color);
}

.section-header h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.content-box {
    margin-bottom: 40px;
    line-height: 1.8;
    color: #444;
    text-align: justify;
}

.row-visi-misi {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
}

.col-half {
    flex: 1;
}

.card-visi,
.card-misi {
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    height: 100%;
    overflow: hidden;
}

.card-header {
    padding: 20px;
    text-align: center;
    color: var(--white);
}

.card-visi .card-header {
    background-color: var(--primary-color);
}

.card-misi .card-header {
    background-color: var(--accent-color);
}

.card-header i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.card-body {
    padding: 25px;
    text-align: center;
}

.alamat-box {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-left: 4px solid var(--accent-color);
}

@media (max-width: 768px) {
    .row-visi-misi {
        flex-direction: column;
    }
}

/* Struktur Pemerintahan Styling */
/* .struktur-grid removed, replaced with hierarchy logic */

.struktur-wrapper {
    display: flex;
    flex-direction: column;
    gap: 40px;
    align-items: center;
    /* Center everything */
    margin-top: 40px;
}

.struktur-level {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

.level-grid {
    display: flex;
    flex-wrap: nowrap;
    /* Forces single line on desktop */
    gap: 20px;
    justify-content: center;
    width: 100%;
}

@media (max-width: 992px) {
    .level-grid {
        flex-wrap: wrap;
        /* Wrap on smaller screens */
    }
}

.card-pamong {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    text-align: center;
    border-bottom: 4px solid var(--accent-color);
    width: 280px;
    flex-shrink: 1;
    /* Allow shrinking */
    min-width: 200px;
    /* Minimum width before breaking layout */
}


.card-pamong {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    text-align: center;
    border-bottom: 4px solid var(--accent-color);
}

.card-pamong:hover {
    transform: translateY(-5px);
}

.pamong-img {
    height: 300px;
    overflow: hidden;
    background-color: #eee;
}

.pamong-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.pamong-info {
    padding: 20px;
}

.pamong-info h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.pamong-info .jabatan {
    display: inline-block;
    background-color: #e8f5e9;
    color: var(--accent-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.pamong-info .nip {
    font-size: 0.85rem;
    color: #777;
}

.alert-info {
    padding: 20px;
    background-color: #d1ecf1;
    background-color: #d1ecf1;
    color: #0c5460;
    border-radius: 5px;
}

/* Potensi Page Styles */
.filter-bar {
    margin-bottom: 30px;
}

.btn-filter {
    display: inline-block;
    padding: 8px 20px;
    margin: 5px;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.3s;
}

.btn-filter:hover,
.btn-filter.active {
    background-color: var(--accent-color);
    color: var(--white);
}

.potensi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.card-potensi {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.card-potensi:hover {
    transform: translateY(-5px);
}

.potensi-img {
    height: 200px;
    position: relative;
    overflow: hidden;
}

.potensi-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.card-potensi:hover .potensi-img img {
    transform: scale(1.1);
}

.badge-kategori {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--accent-color);
    color: var(--white);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: bold;
}

.potensi-info {
    padding: 20px;
}

.potensi-info h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.potensi-info p {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.read-more {
    text-decoration: none;
    color: var(--accent-color);
    font-weight: bold;
    font-size: 0.9rem;
}

.read-more:hover {
    text-decoration: underline;
}

/* Berita Page Styles */
.berita-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.card-berita {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.card-berita:hover {
    transform: translateY(-5px);
}

.berita-img {
    height: 200px;
    position: relative;
    overflow: hidden;
}

.berita-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tanggal-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--white);
    padding: 5px 10px;
    font-size: 0.8rem;
    border-top-right-radius: 5px;
}

.berita-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.berita-body h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    line-height: 1.4;
}

.berita-body h3 a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s;
}

.berita-body h3 a:hover {
    color: var(--accent-color);
}

.berita-body p {
    color: #666;
    margin-bottom: 20px;
    flex: 1;
    font-size: 0.95rem;
}

.btn-read {
    align-self: flex-start;
    text-decoration: none;
    color: var(--white);
    background-color: var(--primary-color);
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.btn-read:hover {
    background-color: var(--accent-color);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 50px;
}

.pagination a {
    display: inline-block;
    padding: 8px 16px;
    text-decoration: none;
    color: var(--primary-color);
    background-color: var(--white);
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s;
}

.pagination a.active,
.pagination a:hover {
    background-color: var(--accent-color);
    color: var(--white);
    border-color: var(--accent-color);
}

/* Detail Berita Styles */
.detail-berita-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.berita-header h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.meta-info {
    color: #777;
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
}

.meta-info span i {
    color: var(--accent-color);
    margin-right: 5px;
}

.berita-image-full {
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
}

.berita-image-full img {
    width: 100%;
    height: auto;
    display: block;
}

.berita-content {
    line-height: 1.8;
    color: #333;
    font-size: 1.05rem;
    margin-bottom: 40px;
}

.berita-content p {
    margin-bottom: 20px;
}

.berita-footer {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.btn-back {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}

.btn-back:hover {
    color: var(--accent-color);
}

/* Galeri Page Styles */
.galeri-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.card-galeri {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: #000;
    aspect-ratio: 1 / 1;
    /* Kotak sempurana */
}

.galeri-item {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.galeri-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s, opacity 0.3s;
    opacity: 0.9;
}

.galeri-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: var(--white);
    transform: translateY(100%);
    transition: transform 0.3s;
}

.card-galeri:hover img {
    transform: scale(1.1);
    opacity: 0.7;
}

.card-galeri:hover .galeri-overlay {
    transform: translateY(0);
}

.galeri-overlay h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.galeri-overlay h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.galeri-overlay p {
    font-size: 0.85rem;
    color: #ddd;
}

/* Kontak Page Styles */
.contact-wrapper {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 50px;
}

.contact-info-card {
    background: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
    flex: 1;
    min-width: 250px;
    transition: transform 0.3s;
    border-top: 5px solid var(--accent-color);
}

.contact-info-card:hover {
    transform: translateY(-10px);
}

.icon-box {
    width: 70px;
    height: 70px;
    background-color: #e8f5e9;
    color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.8rem;
}

.contact-info-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.contact-info-card p {
    color: #555;
    font-size: 1rem;
}

.map-section {
    margin-top: 50px;
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.map-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.map-placeholder {
    background-color: #eee;
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #777;
    border-radius: 5px;
}

/* Login Page Styles */
.login-body {
    background-color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-container {
    background: var(--white);
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.login-header h2 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.login-header p {
    color: #777;
    font-size: 0.9rem;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

.input-icon input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border 0.3s;
}

.input-icon input:focus {
    border-color: var(--accent-color);
    outline: none;
}

.btn-login-full {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-login-full:hover {
    background-color: var(--accent-color);
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    text-decoration: none;
    color: #777;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.login-footer a:hover {
    color: var(--accent-color);
}