@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;700&family=Inter:wght@400;600&display=swap');

:root {
    --primary-color: #003366; /* Navy Official */
    --secondary-color: #2E7D32; /* Green Nature */
    --accent-color: #FFB300; /* Gold Accent */
    --bg-light: #F8F9FA;
    --text-dark: #212529;
    --text-muted: #6C757D;
    --white: #ffffff;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

main.content-page {
    padding: 0;
}

h1, h2, h3, h4, .brand {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

li {
    list-style: none;
}

/* Header & Navbar */
.top-bar {
    background: var(--primary-color);
    color: var(--white);
    padding: 8px 5%;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
}

header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    gap: 16px;
}

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

.logo-area img {
    height: 50px;
}

.brand-text h1 {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.brand-text p {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav-links a:hover {
    color: var(--secondary-color);
}

.dropdown {
    position: relative;
    cursor: pointer;
}

.nav-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item-row > a {
    white-space: nowrap;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 10px 0;
    min-width: 200px;
    display: none;
    border-top: 3px solid var(--primary-color);
}

.menu-toggle {
    display: none;
    border: 0;
    background: transparent;
    color: var(--primary-color);
    font-size: 1.35rem;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 8px;
}

.menu-toggle:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

.dropdown-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    padding: 6px 4px;
    font-size: 0.95rem;
}

.dropdown-toggle-btn:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
    border-radius: 6px;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li a {
    padding: 8px 20px;
    display: block;
    font-size: 0.9rem;
}

.dropdown-menu li a:hover {
    background: #f0f0f0;
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    height: 70vh;
    background:
        linear-gradient(180deg, rgba(0, 51, 102, 0.40), rgba(0, 51, 102, 0.56)),
        url('/images/desa-illustration.svg') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    padding: 0 5%;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    inset: auto -10% -16% -10%;
    height: 38%;
    background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,0.18));
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 920px;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
}

.btn-primary {
    background: var(--accent-color);
    color: var(--text-dark);
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 600;
}

/* Section Common */
section {
    padding: 80px 5%;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2rem;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--secondary-color);
}

/* Cards & Grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

@media (max-width: 1200px) {
    .grid-5 { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 992px) {
    .grid-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .grid-5 { grid-template-columns: repeat(2, 1fr); gap: 15px; }
}
@media (max-width: 480px) {
    .grid-5 { grid-template-columns: 1fr; }
}

.card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: var(--transition);
}

.leader-card {
    display: grid;
    grid-template-columns: minmax(220px, 320px) 1fr;
    gap: 0;
    overflow: hidden;
    margin-bottom: 30px;
}

.leader-image-container {
    background: #f4f4f4;
    min-height: 320px;
}

@media (max-width: 768px) {
    .leader-card {
        grid-template-columns: 1fr;
    }
    
    .leader-image-container {
        min-height: 280px;
    }
}


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

.card-img-placeholder {
    height: 200px;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-style: italic;
}

.card-content {
    padding: 20px;
}

.card-content h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.card-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Publikasi Table */
.table-container {
    overflow-x: auto;
}

.page-intro {
    max-width: 900px;
    color: var(--text-muted);
    line-height: 1.8;
    margin-top: 12px;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--secondary-color);
}

.form-control {
    width: 100%;
    border: 1px solid rgba(0, 51, 102, 0.15);
    border-radius: 12px;
    background: var(--white);
    color: var(--text-dark);
    padding: 13px 15px;
    font: inherit;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

.form-control::placeholder {
    color: #9aa2ad;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: var(--primary-color);
    color: var(--white);
    font-weight: 600;
}

tr:hover {
    background: #f9f9f9;
}

.label-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-done { background: #E8F5E9; color: #2E7D32; }
.status-progress { background: #FFF3E0; color: #EF6C00; }

/* Statistics Visual */
.stat-card {
    text-align: center;
    padding: 40px 20px;
    border: 1px solid #eee;
}

.stat-number {
    font-size: 2.5rem;
    color: var(--secondary-color);
    display: block;
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
}

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

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 40px;
}

.footer-col h4 {
    margin-bottom: 20px;
    border-left: 3px solid var(--accent-color);
    padding-left: 10px;
}

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

/* Mobile Responsiveness Extra */
@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        gap: 6px;
        align-items: flex-start;
        font-size: 0.78rem;
    }

    nav {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 16px;
    }

    .menu-toggle {
        display: inline-flex;
        align-self: flex-end;
        align-items: center;
        justify-content: center;
    }

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

    .logo-area img {
        height: 42px;
        flex-shrink: 0;
    }

    .brand-text h1 {
        font-size: 1rem;
        line-height: 1.2;
    }

    .brand-text p {
        font-size: 0.7rem;
        line-height: 1.3;
        letter-spacing: 0.5px;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0;
        padding-top: 8px;
        border-top: 1px solid #e9ecef;
    }

    nav.nav-open .nav-links {
        display: flex;
    }

    .nav-links > li {
        width: 100%;
        border-bottom: 1px solid #f1f3f5;
    }

    .nav-links > li > a,
    .nav-item-row > a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 2px;
        width: 100%;
        font-size: 0.98rem;
    }

    .nav-item-row {
        width: 100%;
    }

    .dropdown-toggle-btn {
        display: inline-flex;
        padding: 12px 8px;
    }

    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        border-top: 0;
        padding: 0 0 0 12px;
        min-width: 0;
        background: transparent;
    }

    .dropdown:hover .dropdown-menu {
        display: none;
    }

    .dropdown.open .dropdown-menu {
        display: block;
        padding-bottom: 8px;
    }

    .dropdown-menu li a {
        padding: 8px 0;
        font-size: 0.92rem;
    }

    .hero {
        height: auto;
        min-height: 420px;
        padding: 60px 16px;
        background-position: center center;
    }

    .hero-content h2 {
        font-size: 1.85rem;
        line-height: 1.15;
    }

    .hero-content p {
        font-size: 1rem;
        margin-bottom: 22px;
    }

    .btn-primary {
        display: inline-block;
        width: 100%;
        max-width: 320px;
        text-align: center;
    }

    section {
        padding: 48px 16px;
    }

    main.content-page,
    main[style*="padding: 100px 10%"],
    main[style*="padding:100px 10%"] {
        padding: 48px 16px !important;
    }

    main[style*="padding: 0 10%"],
    main[style*="padding:0 10%"] {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .section-title {
        margin-bottom: 28px;
    }

    .section-title h2 {
        font-size: 1.5rem;
    }

    .grid-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card-content {
        padding: 18px;
    }

    .stat-card {
        padding: 26px 18px;
    }

    .stat-number {
        font-size: 2rem;
    }

    .table-container {
        margin: 0 -16px;
        padding: 0 16px;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 12px 10px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 18px;
        margin-bottom: 28px;
    }

    .footer-col h4 {
        margin-bottom: 12px;
    }

    .footer-bottom {
        text-align: left;
        line-height: 1.6;
    }
}

@media (max-width: 480px) {
    .hero-content h2 {
        font-size: 1.55rem;
    }

    .hero-content p {
        font-size: 0.95rem;
    }

    .brand-text h1 {
        font-size: 0.95rem;
    }

    .brand-text p {
        font-size: 0.65rem;
    }

    .nav-links > li > a {
        font-size: 0.92rem;
    }

    .section-title h2 {
        font-size: 1.35rem;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .card-img-placeholder {
        height: 160px;
    }
}
