:root {
    --brand: #14653d;
    --brand-dark: #0c3f25;
    --brand-soft: #e9f5ee;
    --ink: #17221c;
    --ink-soft: #4a5a51;
    --line: #d9e2dd;
    --bg: #f4f6f5;
}

body {
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--ink);
}

/* ===== Navigation ===== */
.site-nav {
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 8px rgba(0, 0, 0, .04);
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--brand-dark);
    text-decoration: none;
}
.brand img { width: 38px; height: 38px; object-fit: contain; }
.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .9rem;
}

/* ===== Buttons (high contrast) ===== */
.btn { border-radius: 8px; font-weight: 600; }

.btn-brgy {
    background: var(--brand);
    border: 2px solid var(--brand);
    color: #fff;
}
.btn-brgy:hover, .btn-brgy:focus {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}

.btn-brgy-outline {
    background: #fff;
    border: 2px solid var(--brand);
    color: var(--brand);
}
.btn-brgy-outline:hover {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.btn-back {
    background: #fff;
    border: 2px solid var(--ink);
    color: var(--ink);
}
.btn-back:hover {
    background: var(--ink);
    color: #fff;
}

.btn-hero {
    background: #fff;
    border: 2px solid #fff;
    color: var(--brand-dark);
}
.btn-hero:hover { background: var(--brand-soft); color: var(--brand-dark); }

.btn-hero-outline {
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
}
.btn-hero-outline:hover { background: #fff; color: var(--brand-dark); }

/* ===== Hero ===== */
.hero {
    background-color: var(--brand);
    background-image: linear-gradient(135deg, var(--brand-dark), var(--brand));
    background-size: cover;
    background-position: center;
    border-radius: 18px;
    padding: 64px 44px;
    color: #fff;
    box-shadow: 0 10px 30px rgba(12, 63, 37, .18);
}
.hero-kicker {
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #bfe8cf;
}
.hero h1 {
    font-size: clamp(1.9rem, 3.6vw, 2.9rem);
    font-weight: 700;
    line-height: 1.2;
    max-width: 720px;
}
.hero p {
    font-size: 1.05rem;
    opacity: .92;
    max-width: 620px;
}

/* ===== Stats ===== */
.stat {
    background: #fff;
    border: 1px solid var(--line);
    border-left: 5px solid var(--brand);
    border-radius: 12px;
    padding: 18px 20px;
    height: 100%;
}
.stat-num {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--brand-dark);
    line-height: 1;
}
.stat-label {
    font-size: .88rem;
    color: var(--ink-soft);
    margin-top: 4px;
}

/* ===== Search ===== */
.search-wrap .form-control {
    border: 2px solid #c3d0c8;
    border-radius: 10px 0 0 10px;
}
.search-wrap .form-control:focus {
    border-color: var(--brand);
    box-shadow: none;
}
.search-wrap .btn {
    border-radius: 0 10px 10px 0;
}

/* ===== Filter chips ===== */
.chip {
    display: inline-block;
    background: #fff;
    border: 2px solid #c3d0c8;
    color: var(--ink);
    border-radius: 999px;
    padding: .4rem 1rem;
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
}
.chip:hover {
    border-color: var(--brand);
    color: var(--brand);
}
.chip.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

/* ===== Section title ===== */
.section-title {
    font-weight: 700;
    color: var(--brand-dark);
    margin: 0;
}

/* ===== Announcement cards ===== */
.ann-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease;
    animation: fadeUp .45s ease both;
}
.ann-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .08);
}
.ann-bar { height: 6px; background: var(--brand); }
.ann-body {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.ann-date { font-size: .82rem; color: var(--ink-soft); }
.ann-title { font-weight: 600; font-size: 1.08rem; line-height: 1.35; }
.ann-excerpt { color: #3d4d44; font-size: .93rem; }

.cat-general       { background: #14653d; }
.cat-health        { background: #0b7285; }
.cat-emergency     { background: #c92a2a; }
.cat-events        { background: #6741d9; }
.cat-public-notice { background: #c2410c; }
.cat-programs      { background: #0ca678; }

/* ===== Tags ===== */
.tag {
    font-size: .75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
}
.tag-cat { background: var(--brand-soft); color: var(--brand-dark); }
.tag-pin { background: #fff3cd; color: #664d03; }
.tag-src { background: #e0f2f7; color: #055160; }

/* ===== Detail page ===== */
.detail-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
}
.detail-title {
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    line-height: 1.25;
    color: var(--brand-dark);
}
.info-box {
    background: var(--bg);
    border-radius: 12px;
    padding: 14px 16px;
    height: 100%;
}
.info-label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--ink-soft);
    font-weight: 600;
}
.info-value { font-weight: 600; }
.detail-content {
    white-space: pre-line;
    font-size: 1.02rem;
    line-height: 1.75;
    color: #2b3a32;
}

/* ===== Admin pages ===== */
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}
.page-head h2 {
    font-weight: 700;
    color: var(--brand-dark);
}
.table-card,
.form-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}
.table thead th {
    background: #f0f5f2;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-soft);
    border-bottom: 1px solid var(--line);
}
.table td { vertical-align: middle; }
.form-label { font-weight: 600; margin-bottom: .35rem; }
.form-control,
.form-select {
    border: 2px solid #c3d0c8;
    border-radius: 10px;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(20, 101, 61, .15);
}

/* ===== Footer ===== */
.brgy-footer {
    background: var(--brand-dark);
    color: rgba(255, 255, 255, .8);
    font-size: .9rem;
}

/* ===== Animations ===== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

@media (max-width: 768px) {
    .hero { padding: 36px 24px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
/* ===== MOBILE RESPONSIVE ===== */

/* Tablet and below */
@media (max-width: 991px) {
    .hero { padding: 40px 28px; }
}

/* Phones */
@media (max-width: 767px) {
    .hero {
        padding: 32px 20px;
        border-radius: 14px;
    }
    .hero h1 { font-size: 1.7rem; }
    .hero p { font-size: .98rem; }

    /* Full-width buttons in the hero */
    .hero .btn { width: 100%; }

    .page-head h2 { font-size: 1.4rem; }
    .detail-title { font-size: 1.4rem; }

    /* Compact stat cards */
    .stat { padding: 12px 14px; }
    .stat-num { font-size: 1.4rem; }
    .stat-label { font-size: .78rem; }

    /* Category chips scroll sideways instead of wrapping */
    .chips {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
    }
    .chip { white-space: nowrap; }

    /* Admin table: let action buttons wrap */
    .table td.text-nowrap { white-space: normal; }
    .table td, .table th { padding: .6rem .5rem; font-size: .9rem; }

    /* Footer centered */
    .brgy-footer { text-align: center; }
    .brgy-footer .container { justify-content: center !important; }
}

/* Small phones */
@media (max-width: 420px) {
    .brand span:last-child { font-size: .95rem; }
    .site-nav .btn { font-size: .8rem; padding: .3rem .6rem; }
}