* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    color: #172033;
    background: #f5f7fb;
    min-width: 100%;
}

html {
    scroll-behavior: smooth;
}

body .department-topbar,
body .department-shell,
body .department-hero,
body .site-footer {
    margin-left: 0;
}

main {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

a {
    text-decoration: none;
}

.department-topbar {
    min-height: 72px;
    padding: 14px clamp(18px, 4vw, 56px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: #061a33;
    border-bottom: 4px solid #d8a31a;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    animation: slideDown 0.55s ease both;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-weight: 800;
    transition: transform 0.25s ease;
}

.brand:hover {
    transform: translateY(-1px);
}

.brand img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.22));
}

.department-topbar nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

.department-topbar nav a {
    color: #ffffff;
    font-weight: 900;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 8px 18px rgba(3,18,37,0.18);
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.department-topbar nav a:hover {
    background: #0067d6;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0,103,214,0.28);
}

.department-hero {
    min-height: 420px;
    display: flex;
    align-items: center;
    padding: 70px clamp(18px, 6vw, 80px);
    color: white;
    background: linear-gradient(120deg, rgba(0, 31, 63, 0.94), rgba(139, 0, 0, 0.78)), url("../images/slide1.jpg") center/cover;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.65s ease both;
}

.department-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
    transform: translateX(-100%);
    animation: heroSheen 5s ease-in-out infinite;
    pointer-events: none;
}

.department-hero.engineering,
.department-hero.planning,
.department-hero.lands {
    background-image: linear-gradient(120deg, rgba(0, 31, 63, 0.92), rgba(27, 94, 32, 0.72)), url("../images/slide3.jpg");
}

.department-hero.health,
.department-hero.housing,
.department-hero.mhangura {
    background-image: linear-gradient(120deg, rgba(0, 31, 63, 0.92), rgba(0, 105, 92, 0.72)), url("../images/img2.jpg");
}

.department-hero.procurement,
.department-hero.finance,
.department-hero.admin,
.department-hero.directory {
    background-image: linear-gradient(120deg, rgba(0, 31, 63, 0.93), rgba(139, 0, 0, 0.76)), url("../images/img1.jpg");
}

.hero-inner {
    max-width: 820px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    animation: riseIn 0.8s ease both;
}

.eyebrow,
.section-kicker {
    margin: 0 0 10px;
    color: #8b0000;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.department-hero .eyebrow {
    color: #ffd15c;
}

.department-hero h1 {
    margin: 0;
    font-size: clamp(2.25rem, 6vw, 4.65rem);
    line-height: 1;
    letter-spacing: 0;
    font-weight: 850;
}

.department-hero p:not(.eyebrow) {
    max-width: 680px;
    margin: 18px auto 0;
    font-size: 1.08rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
    justify-content: center;
}

.btn-dept {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 18px;
    border-radius: 6px;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn-dept:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(0,0,0,0.18);
}

.btn-dept.primary {
    background: #ffd15c;
    color: #1f2937;
}

.btn-dept.light {
    background: rgba(255, 255, 255, 0.95);
    color: #001f3f;
}

.department-shell {
    width: min(1280px, calc(100vw - 72px));
    max-width: 1280px;
    margin: 52px auto !important;
    align-self: center;
    text-align: center;
    animation: riseIn 0.75s ease both;
}

.intro-grid,
.two-column {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
    gap: 24px;
    align-items: start;
    justify-content: center;
}

.intro-copy,
.quick-panel,
.two-column article,
.directory-card,
.service-card {
    background: #ffffff;
    border: 1px solid #e4e9f2;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.intro-copy:hover,
.quick-panel:hover,
.two-column article:hover,
.directory-card:hover,
.service-card:hover {
    transform: translateY(-6px);
    border-color: rgba(139, 0, 0, 0.25);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.12);
}

.intro-copy,
.quick-panel,
.two-column article {
    padding: clamp(22px, 4vw, 34px);
}

.intro-copy h2,
.section-heading h2,
.two-column h2 {
    margin: 0 0 14px;
    color: #001f3f;
    font-weight: 820;
    letter-spacing: 0;
}

.intro-copy p:last-child,
.service-card p,
.directory-card p {
    color: #526174;
    line-height: 1.65;
    margin-left: auto;
    margin-right: auto;
}

.quick-panel h3 {
    margin: 0 0 14px;
    color: #001f3f;
    font-size: 1.05rem;
    font-weight: 800;
}

.contact-row {
    padding: 12px 0;
    border-top: 1px solid #e8edf4;
    font-weight: 700;
    color: #334155;
    transition: color 0.2s ease, transform 0.2s ease;
}

.contact-row:hover {
    color: #8b0000;
    transform: translateX(4px);
}

.section-heading {
    margin-bottom: 22px;
}

.service-grid,
.directory-grid,
.department-link-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    justify-content: center;
}

.service-card,
.directory-card {
    padding: 22px;
    min-height: 190px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.service-card span {
    display: block;
    width: 42px;
    height: 5px;
    border-radius: 4px;
    background: #8b0000;
    margin: 0 auto 18px;
    transition: width 0.25s ease, background 0.25s ease;
}

.service-card:hover span {
    width: 66px;
    background: #001f3f;
}

.service-card h3,
.directory-card h3 {
    color: #001f3f;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 10px;
}

.directory-card a {
    display: inline-flex;
    margin-top: 8px;
    color: #8b0000;
    font-weight: 800;
    transition: color 0.2s ease, transform 0.2s ease;
}

.directory-card a:hover {
    color: #001f3f;
    transform: translateY(-2px);
}

.steps,
.requirements ul {
    margin: 18px 0 0;
    padding-left: 0;
    color: #46566d;
    line-height: 1.8;
    list-style-position: inside;
}

.steps li,
.requirements li {
    padding-left: 0;
    margin-bottom: 8px;
}

.department-link-grid a {
    display: block;
    padding: 18px;
    border: 1px solid #e4e9f2;
    border-radius: 8px;
    background: white;
    color: #223047;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.department-link-grid a strong {
    display: block;
    color: #001f3f;
    margin-bottom: 6px;
}

.department-link-grid a span {
    display: block;
    color: #66758a;
    line-height: 1.5;
}

.department-link-grid a.active,
.department-link-grid a:hover {
    border-color: #8b0000;
    box-shadow: 0 10px 24px rgba(139, 0, 0, 0.1);
    transform: translateY(-4px);
}

.communication-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.8fr);
    gap: 24px;
    align-items: center;
    background: linear-gradient(to right, #001f3f, #8B0000);
    color: white;
    border-radius: 8px;
    padding: clamp(24px, 4vw, 36px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    text-align: center;
    position: relative;
    overflow: hidden;
    width: min(1280px, calc(100vw - 72px));
}

.communication-panel::before {
    content: "";
    position: absolute;
    inset: -1px;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 8px;
    pointer-events: none;
}

.communication-panel h2 {
    margin: 0 0 12px;
    color: white;
}

.communication-panel p:not(.section-kicker) {
    margin: 0;
    color: rgba(255,255,255,0.88);
    line-height: 1.7;
}

.communication-panel .section-kicker {
    color: #ffd15c;
}

.communication-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.communication-panel > div {
    position: relative;
    z-index: 1;
}

.directory-grid .directory-card:nth-child(2),
.service-grid .service-card:nth-child(2),
.department-link-grid a:nth-child(2) {
    animation-delay: 0.08s;
}

.directory-grid .directory-card:nth-child(3),
.service-grid .service-card:nth-child(3),
.department-link-grid a:nth-child(3) {
    animation-delay: 0.16s;
}

.directory-grid .directory-card:nth-child(4),
.service-grid .service-card:nth-child(4),
.department-link-grid a:nth-child(4) {
    animation-delay: 0.24s;
}

.directory-card,
.service-card,
.department-link-grid a {
    animation: riseIn 0.65s ease both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroSheen {
    0%, 55% { transform: translateX(-100%); }
    80%, 100% { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}

@media (max-width: 760px) {
    .department-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .department-topbar nav {
        justify-content: center;
        margin-left: 0;
    }

    .department-hero {
        min-height: 470px;
        padding-top: 56px;
    }

    .department-shell,
    .communication-panel {
        width: min(100% - 24px, 1280px);
    }

    .intro-grid,
    .two-column,
    .communication-panel {
        grid-template-columns: 1fr;
    }

    .communication-actions {
        justify-content: stretch;
    }

    .btn-dept {
        width: 100%;
    }
}

@media (max-width: 560px) {
    html, body {
        width: 100%;
        overflow-x: hidden;
    }

    .department-topbar {
        position: static;
        padding: 12px;
    }

    .brand {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .department-topbar nav {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .department-topbar nav a,
    .hero-actions a,
    .communication-actions a,
    .btn-dept {
        width: 100%;
        text-align: center;
    }

    .department-hero {
        min-height: 360px;
        padding: 36px 16px;
    }

    .department-shell,
    .communication-panel {
        width: calc(100% - 24px);
        margin: 28px auto !important;
    }

    .intro-copy,
    .quick-panel,
    .two-column article,
    .directory-card,
    .service-card {
        padding: 18px;
    }
}
