/* =========================================================
   AGCZ CMS - PUBLIC WEBSITE CSS
   File: public/css/style.css
   ========================================================= */

/* Google Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* =========================================================
   1. GLOBAL / BASE
   ========================================================= */

:root {
    --agcz-primary: #0b3d91;
    --agcz-primary-dark: #032257;
    --agcz-primary-deep: #031257;
    --agcz-accent: #f0b429;
    --agcz-accent-dark: #d69a00;
    --agcz-green: #198754;
    --agcz-muted: #6c757d;
    --agcz-light: #f8f9fa;
    --agcz-white: #ffffff;
    --agcz-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #1f2937;
    background: #ffffff;
}

main {
    flex: 1 0 auto;
}

a {
    transition: all 0.3s ease;
}

img {
    max-width: 100%;
}

.text-gradient {
    background: linear-gradient(90deg, var(--agcz-primary), var(--agcz-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.transition-all {
    transition: all 0.3s ease;
}

.hover-scale {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.03);
}

.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.hover-shadow:hover {
    box-shadow: var(--agcz-shadow);
}

.glass-card {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
}

/* =========================================================
   2. TOPBAR
   ========================================================= */

.topbar {
    font-size: 0.85rem;
    letter-spacing: 0.3px;
}

.hover-link {
    transition: all 0.3s ease;
}

.hover-link:hover {
    color: #ffc107;
    text-decoration: underline;
}

.topbar .btn-outline-light {
    border-color: rgba(255,255,255,0.25);
    transition: all 0.3s ease;
}

.topbar .btn-outline-light:hover {
    background: #fff;
    color: #000;
}

/* =========================================================
   3. LOGO BAR
   ========================================================= */

.logo-bar {
    background: linear-gradient(90deg, #eaf4ff, #cde1ff);
    border-bottom: 3px solid #0d6efd;
}

.logo-bar h5 {
    font-size: 0.95rem;
    letter-spacing: 0.6px;
}

.logo-bar h3,
.logo-bar h4 {
    font-size: 1.6rem;
    letter-spacing: 1px;
}

.logo-bar img {
    max-height: 65px;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.logo-bar img:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.heading-official {
    background: linear-gradient(90deg, #0d47a1, #1976d2, #42a5f5);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.15);
}

/* =========================================================
   4. NAVBAR / MEGA MENU
   ========================================================= */

.navbar {
    z-index: 1040;
}

.navbar .nav-link {
    font-weight: 500;
    position: relative;
    padding: 0.6rem 1rem;
    color: #02265f;
    transition: color 0.3s ease;
}

/*
   Use ::before for underline.
   Bootstrap uses ::after for dropdown caret, so do not override ::after.
*/
.navbar .nav-link::before {
    content: "";
    position: absolute;
    left: 20%;
    right: 20%;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--agcz-primary), var(--agcz-accent));
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
}

.navbar .nav-link:hover::before,
.navbar .nav-link.active::before {
    transform: scaleX(1);
}

/* Keep Bootstrap caret working */
.navbar .dropdown-toggle::after {
    margin-left: 0.35rem;
    vertical-align: middle;
}

/* Dropdown layer */
.navbar .dropdown-menu {
    z-index: 1055;
}

/* Mega menu */
.mega-menu {
    min-width: 600px;
    border-radius: 1rem;
    overflow: visible !important;
}

.mega-menu h6 {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Dropdown items */
.dropdown-menu .dropdown-item {
    font-weight: 500;
    padding: 0.5rem 0.8rem;
    border-radius: 0.4rem;
    color: #02265f;
    transition: background 0.3s ease, color 0.2s ease, transform 0.2s ease;
}

.dropdown-menu .dropdown-item:hover {
    background: rgba(13, 110, 253, 0.08);
    color: var(--agcz-primary);
    transform: translateX(2px);
}

/* =========================================================
   DROPDOWN SUBMENU - OPEN BELOW, NOT SIDE
   ========================================================= */

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Submenu opens below parent item */
.dropdown-submenu > .dropdown-menu {
    position: static !important;
    display: none;
    float: none;
    width: 100%;
    margin-top: 0.35rem;
    margin-left: 0.75rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border: none;
    box-shadow: none !important;
}

/* JS toggle class */
.dropdown-submenu > .dropdown-menu.show {
    display: block;
}

/* Desktop hover support */
@media (min-width: 992px) {
    .dropdown-submenu:hover > .dropdown-menu {
        display: block;
    }
}

/* Mobile / tablet */
@media (max-width: 991px) {
    .mega-menu {
        min-width: 100%;
        width: 100%;
        border-radius: 0.75rem;
        padding: 1rem !important;
    }

    .dropdown-submenu > .dropdown-menu {
        margin-left: 1rem;
        margin-top: 0.25rem;
        background: #f8f9fa;
    }

    .navbar .nav-link::before {
        display: none;
    }
}

/* Icons inside dropdown */
.icon-hover {
    transition: transform 0.3s ease, color 0.3s ease;
}

.dropdown-item:hover .icon-hover {
    transform: scale(1.2) rotate(5deg);
    color: var(--agcz-primary) !important;
}
/* =========================================================
   5. BREADCRUMB
   ========================================================= */

.breadcrumb .breadcrumb-link {
    font-weight: 500;
    position: relative;
    padding: 0.6rem 1rem;
    color: #00008B !important;
    transition: color 0.3s ease, background 0.3s ease;
}

.breadcrumb .breadcrumb-link:hover {
    color: var(--agcz-accent) !important;
    background-color: rgba(240, 180, 41, 0.1);
    text-decoration: none;
}

/* =========================================================
   6. BUTTONS
   ========================================================= */

.btn-theme {
    background: linear-gradient(90deg, var(--agcz-primary), #6e6c09);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-theme:hover {
    background: linear-gradient(90deg, var(--agcz-accent), var(--agcz-accent-dark));
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.btn-gradient {
    background: linear-gradient(90deg, var(--agcz-primary), var(--agcz-accent));
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 0.45rem 1.2rem;
    transition: all 0.3s ease;
}

.btn-gradient:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    color: #fff;
}

.btn-outline-theme,
.btn-theme-outline {
    border: 2px solid var(--agcz-primary);
    color: var(--agcz-primary);
    border-radius: 50px;
    padding: 0.5rem 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-theme:hover,
.btn-theme-outline:hover {
    background: var(--agcz-primary);
    color: #fff;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* =========================================================
   7. SECTION TITLES
   ========================================================= */

.section-title h1,
.section-title h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--agcz-primary);
    position: relative;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.section-title h1::after,
.section-title h2::after {
    content: "";
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--agcz-primary), var(--agcz-accent));
    display: block;
    margin: 0.5rem auto 0;
    border-radius: 4px;
}

.section-title p {
    color: var(--agcz-muted);
    font-size: 0.95rem;
}

.section-marker {
    width: 8px;
    height: 36px;
    border-radius: 6px;
    background: linear-gradient(180deg, var(--agcz-primary), var(--agcz-accent));
}

.section-title-text {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--agcz-primary);
}

.title-underline {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--agcz-primary-dark), var(--agcz-accent));
    border-radius: 2px;
}
/* =========================================================
   8. HERO SECTION - FINAL CLEAN REFERENCE CAPTION
   ========================================================= */

.hero-section,
#hero {
    background:
        radial-gradient(circle at top left, rgba(240, 180, 41, .14), transparent 30%),
        linear-gradient(180deg, #f8fbff, #ffffff);
    position: relative;
}

.hero-copy {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: clamp(1.85rem, 3.5vw, 3rem);
    line-height: 1.15;
    color: var(--agcz-primary-dark);
}

.hero-subtitle {
    font-size: clamp(.98rem, 1.3vw, 1.15rem);
    line-height: 1.75;
}

/* Image container */
#hero .hero-media-card {
    position: relative;
    height: 430px;
    overflow: hidden;
    background: #eef3fc;
}

#heroCarousel,
#heroCarousel .carousel-inner,
#heroCarousel .carousel-item {
    height: 100%;
}

#heroCarousel .carousel-item {
    position: relative;
}

#hero .hero-image {
    width: 100%;
    height: 430px;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Light bottom overlay over image */
#heroCarousel .carousel-item::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(3, 34, 87, 0.00) 0%,
        rgba(3, 34, 87, 0.04) 50%,
        rgba(3, 34, 87, 0.25) 100%
    );
}

/* Reference-style caption box */
#hero .agcz-hero-caption-box {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    z-index: 10;

    width: 72%;
    min-height: 118px;
    padding: 1.25rem 2rem;

    background: rgba(3, 34, 87, 0.76);
    color: #ffffff;

    border-radius: 0;
    border: none;
    box-shadow: none;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;
}

#hero .agcz-hero-caption-title {
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: .25px;

    margin: 0 0 .75rem 0;
    padding: 0;

    position: relative;
    display: inline-block;
    text-align: center;

    text-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}

#hero .agcz-hero-caption-title::after {
    content: "";
    display: block;
    width: 240px;
    max-width: 80%;
    height: 4px;
    margin: .45rem auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #198754, #00c6ff);
}

#hero .agcz-hero-caption-text {
    color: rgba(255, 255, 255, .95);
    font-size: 1.18rem;
    font-weight: 500;
    line-height: 1.45;
    margin: 0;
    text-align: center;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}

.hero-indicators {
    margin-bottom: .75rem;
}

.hero-indicators [data-bs-target] {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

#heroCarousel .carousel-control-prev,
#heroCarousel .carousel-control-next,
#heroCarousel .carousel-indicators {
    z-index: 20;
}

#heroCarousel .carousel-control-prev-icon,
#heroCarousel .carousel-control-next-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: rgba(3, 34, 87, .35);
    background-size: 55%;
}

.hero-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: .16;
    z-index: 1;
}

.hero-glow-1 {
    width: 220px;
    height: 220px;
    background: var(--agcz-primary);
    top: 10%;
    left: -80px;
}

.hero-glow-2 {
    width: 180px;
    height: 180px;
    background: var(--agcz-accent);
    right: -60px;
    bottom: 15%;
}

#hero .btn {
    font-weight: 700;
    border-radius: 999px;
    transition: all .25s ease;
}

#hero .btn:hover {
    transform: translateY(-2px);
}

#hero .btn-primary {
    background-color: var(--agcz-primary-dark);
    border-color: var(--agcz-primary-dark);
}

#hero .btn-primary:hover {
    background-color: var(--agcz-primary);
    border-color: var(--agcz-primary);
}

@media(max-width: 991px) {
    #hero .hero-media-card,
    #hero .hero-image {
        height: 360px;
    }

    .hero-title {
        font-size: 2rem;
    }

    #hero .agcz-hero-caption-box {
        width: 82%;
        min-height: 105px;
        bottom: 10px;
        padding: 1rem 1.5rem;
    }

    #hero .agcz-hero-caption-title {
        font-size: 1.05rem;
    }

    #hero .agcz-hero-caption-text {
        font-size: .95rem;
    }
}

@media(max-width: 575px) {
    .hero-section .container,
    #hero .container {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .hero-copy {
        padding: 1.25rem !important;
    }

    .hero-title {
        font-size: 1.65rem;
    }

    .hero-subtitle {
        font-size: .95rem;
    }

    #hero .hero-media-card,
    #hero .hero-image {
        height: 285px;
    }

    #hero .agcz-hero-caption-box {
        width: calc(100% - 1.5rem);
        min-height: 82px;
        bottom: 8px;
        padding: .75rem 1rem;
       
    }

    #hero .agcz-hero-caption-title {
        font-size: .85rem;
        margin-bottom: .35rem;
    }

    #hero .agcz-hero-caption-title::after {
        width: 135px;
        height: 3px;
        margin-top: .35rem;
    }

    #hero .agcz-hero-caption-text {
        font-size: .76rem;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    #heroCarousel .carousel-control-prev-icon,
    #heroCarousel .carousel-control-next-icon {
        width: 1.8rem;
        height: 1.8rem;
    }
    
}


/* =========================================================
   9. HUDUMA / SERVICE CARDS
   ========================================================= */

.service-card {
    border-radius: 1rem;
    transition: all 0.35s ease;
    position: relative;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 1rem 2rem rgba(0,0,0,0.15);
}

.service-list li {
    line-height: 1.7;
}

.service-check {
    color: var(--agcz-primary);
    font-size: 1.1rem;
    line-height: 1.7;
}

/* =========================================================
   10. MWANGAZA WA SHERIA / LAWS
   ========================================================= */

.card-premium {
    background: #fff;
    border-radius: 1.5rem;
    padding: 2rem 1.5rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.shadow-hover:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.card-premium::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, var(--agcz-primary), var(--agcz-accent), var(--agcz-accent-dark));
    background-size: 200% 200%;
    animation: borderFlow 6s ease infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

@keyframes borderFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.icon-wrapper {
    width: 70px;
    height: 70px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    background: linear-gradient(135deg, var(--agcz-primary), #092f6e);
    box-shadow: 0 8px 20px rgba(11,61,145,0.35);
    transition: all 0.4s ease;
}

.icon-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 12px;
    background: #f9fafc;
    padding: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.card-premium:hover .icon-wrapper {
    background: linear-gradient(135deg, var(--agcz-accent), var(--agcz-accent-dark));
    transform: scale(1.2) rotate(-6deg);
}

.image-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    transition: all 0.5s ease;
}

.law-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: all 0.5s ease;
}

.card-premium:hover .image-wrapper {
    width: 100%;
    height: 200px;
    border-radius: 0;
}

.card-premium:hover .law-image {
    border-radius: 0;
    object-fit: cover;
}

.scrollable-laws {
    max-height: 350px;
    overflow-y: auto;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: #007bff #f1f1f1;
}

.scrollable-laws::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35px;
    background: linear-gradient(to top, #ffffff, transparent);
    pointer-events: none;
}

.scrollable-laws::-webkit-scrollbar {
    width: 6px;
}

.scrollable-laws::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #007bff, #00c6ff);
    border-radius: 4px;
}

.scrollable-laws::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #0056b3, #00aaff);
}

.hover-bg-light:hover {
    background-color: rgba(0,0,0,0.03);
    transition: background-color 0.3s ease;
}

.bg-gradient-theme {
    background: linear-gradient(90deg, var(--agcz-primary), var(--agcz-accent));
}

.link-arrow {
    color: var(--agcz-primary);
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
}

.link-arrow::after {
    content: " →";
    transition: transform 0.3s ease;
}

.link-arrow:hover {
    color: var(--agcz-accent-dark);
}

.link-arrow:hover::after {
    transform: translateX(6px);
}

/* =========================================================
   11. HABARI / NEWS
   ========================================================= */

.news-card {
    background: #ffffff;
    border: none;
    border-radius: 1.25rem;
    overflow: hidden;
    transition: all 0.35s ease;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 18px 45px rgba(3,34,87,0.14) !important;
}

.news-img-wrapper {
    position: relative;
    width: 100%;
    height: 230px;
    background: #eef3fc;
    overflow: hidden;
}

.news-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.news-card:hover .news-img-wrapper img {
    transform: scale(1.08);
}

.news-date-badge {
    position: absolute;
    left: 14px;
    bottom: 14px;
    background: rgba(3,34,87,0.88);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.news-title {
    font-size: 1rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--agcz-primary);
}

.news-summary {
    line-height: 1.65;
    text-align: justify;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--agcz-muted);
}

.news-card small i {
    color: var(--agcz-primary);
}

@media (max-width: 991px) {
    .news-img-wrapper {
        height: 220px;
    }
}

@media (max-width: 575px) {
    .news-img-wrapper {
        height: 240px;
    }
}
/* =========================================================
   12. VIDEOS / TANGAZO
   ========================================================= */

.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 1rem;
}

.card-hover:hover {
    transform: translateY(-6px);
    box-shadow: 0 1rem 1.5rem rgba(0,0,0,0.12);
}

.empty-state .icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0,0,0,0.04);
    transition: 0.3s;
}

.empty-state:hover .icon-wrapper {
    background: rgba(0,0,0,0.07);
}

/* =========================================================
   13. CONTACT PAGE
   ========================================================= */

.social-icons a {
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 0 6px currentColor);
}

.social-icons .facebook {
    color: #1877f2;
}

.social-icons .twitter {
    color: #000000;
}

.social-icons .linkedin {
    color: #0a66c2;
}

.social-icons .youtube {
    color: #ff0000;
}

.office-card {
    border-left: 5px solid #0d6efd;
    transition: all 0.35s ease;
    position: relative;
}

.office-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-left-color: #004aad;
}

.icon-circle {
    background: #e8f0ff;
    color: #004aad;
    border-radius: 50%;
    padding: 6px;
    font-size: 0.9rem;
    margin-right: 8px;
    transition: all 0.3s ease;
}

.office-card:hover .icon-circle {
    background: #004aad;
    color: #fff;
}

@media (max-width: 767px) {
    .office-card {
        padding: 1.5rem;
    }

    .icon-circle {
        padding: 5px;
        font-size: 0.85rem;
    }
}

/* =========================================================
   14. PROFILE / CV PAGES
   ========================================================= */

.timeline {
    border-left: 2px solid var(--agcz-primary);
    padding-left: 20px;
}

.timeline-item {
    position: relative;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.timeline-number {
    background: var(--agcz-primary);
    color: #fff;
    font-weight: bold;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    margin-right: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.education-item:hover {
    background: #eef3fc;
    transition: 0.2s;
}

.profile-photo {
    width: 160px;
    max-width: 100%;
    height: auto;
    border-radius: 50%;
    box-shadow: 0 8px 30px rgba(3,34,87,0.08);
    object-fit: cover;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease, filter .3s ease;
}

.profile-img:hover {
    transform: scale(1.05);
    filter: brightness(1.05);
}

.profile-card {
    backdrop-filter: blur(6px);
    border: 1px solid rgba(3,34,87,0.08);
    transition: all 0.3s ease-in-out;
}

.profile-card:hover {
    box-shadow: 0 12px 35px rgba(3,34,87,0.15);
    transform: translateY(-4px);
}

.text-justify {
    text-align: justify;
}

@media (max-width: 768px) {
    aside {
        padding: 2rem !important;
    }

    .profile-card {
        max-width: 100%;
    }
}

.caption-subtitle {
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.85;
    margin-bottom: 0;
}

.border-gradient {
    border-image-slice: 1;
    border-width: 4px;
    border-image-source: linear-gradient(180deg, var(--agcz-primary-dark), var(--agcz-accent));
}

blockquote p {
    line-height: 1.8;
    text-align: justify;
}

.ag-image-wrapper {
    position: relative;
    display: inline-block;
}

.pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 160px;
    height: 160px;
    background: rgba(13,110,253,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.3;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
}

.small-footer {
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* =========================================================
   15. HISTORIA PAGE
   ========================================================= */

.history-card {
    transition: all 0.4s ease;
    position: relative;
}

.history-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 40px rgba(3, 34, 87, 0.15);
}

.history-img {
    transition: transform 0.5s ease, filter 0.5s ease;
}

.history-card:hover .history-img {
    transform: scale(1.05);
    filter: brightness(1.05);
}

.history-card p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #555;
}

/* =========================================================
   16. AFISI KWA UFUPI / TREE
   ========================================================= */

.accordion .timeline {
    position: relative;
    padding-left: 20px;
    border-left: 3px solid #0d6efd;
}

.accordion .timeline .timeline-item {
    position: relative;
    padding-left: 20px;
    margin-bottom: 1rem;
    background: #f8f9fa;
    border-radius: .75rem;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.accordion .timeline .timeline-item.show {
    opacity: 1;
    transform: translateY(0);
}

.accordion .timeline .timeline-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.accordion .timeline .timeline-item::before {
    content: '';
    position: absolute;
    left: -9px;
    top: 15px;
    width: 16px;
    height: 16px;
    background-color: #0d6efd;
    border-radius: 50%;
}

.accordion .timeline .timeline-number {
    position: absolute;
    left: -35px;
    top: 10px;
    width: 25px;
    height: 25px;
    background: #0d6efd;
    color: white;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: 0.3s ease;
}

.tree,
.tree ul {
    list-style: none;
    padding-left: 20px;
    position: relative;
}

.tree ul {
    margin-left: 15px;
    border-left: 2px dashed #ccd3e0;
}

.tree li {
    margin: 15px 0;
}

.tree-node {
    background: #f7faff;
    padding: 8px 14px;
    border-left: 4px solid #0d6efd;
    border-radius: 6px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 10px;
    transition: .2s;
}

.tree-node:hover {
    background: #e9f2ff;
}

.director-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e4e8ef;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: .2s;
}

.director-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.director-img {
    width: 120px;
    height: 140px;
    border-radius: 12px;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 3px 8px rgba(0,0,0,.1);
}

.sidebar-card ul li a:hover {
    background: #0d6efd;
    color: #fff !important;
    border-radius: .5rem;
    padding-left: .75rem;
}

/* =========================================================
   17. MUUNDO WA AFISI / ORG CHART
   ========================================================= */

.org-wrapper {
    background: linear-gradient(180deg, #fbfdff, #f7fbff);
    border: 1px solid rgba(9,30,66,0.06);
}

.org-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    gap: 20px;
    align-items: start;
    transform-origin: top left;
    transition: transform .15s ease;
    padding: 12px;
}

.org-column {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
    min-height: 60px;
    position: relative;
}

.org-level-title {
    font-weight: 600;
    color: var(--agcz-primary);
    margin-bottom: 6px;
    text-align: center;
    font-size: .95rem;
}

.org-column::after {
    content: "";
    width: 2px;
    background: linear-gradient(180deg, rgba(3,34,87,0.06), rgba(240,180,41,0.03));
    display: block;
    margin: 6px auto 0;
    height: 16px;
    border-radius: 2px;
    opacity: .7;
}

.org-card {
    width: 100%;
    max-width: 320px;
    background: linear-gradient(135deg, #fff, #fbfdff);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 8px 22px rgba(11,61,145,0.06);
    border: 1px solid rgba(9,30,66,0.06);
    transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease;
    cursor: pointer;
    position: relative;
}

.org-card .card-title {
    font-weight: 700;
    color: var(--agcz-primary-dark);
    font-size: .98rem;
}

.org-card .card-sub {
    color: var(--agcz-muted);
    font-size: .85rem;
    margin-top: 6px;
}

.org-card .badge-pos {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(90deg, var(--agcz-primary), var(--agcz-primary-dark));
    color: #fff;
    padding: 4px 8px;
    font-size: .72rem;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(11,61,145,0.12);
}

.org-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 18px 40px rgba(3,34,87,0.12);
}

.org-card.selected {
    box-shadow: 0 22px 48px rgba(3,34,87,0.22);
    outline: 3px solid rgba(0,180,216,0.12);
}

.hidden {
    display: none !important;
}

@media (max-width: 900px) {
    .org-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .org-column::after {
        display: none;
    }

    .org-card {
        max-width: 100%;
        padding: 12px;
    }
}

/* =========================================================
   18. WANASHERIA WAKUU WALI0PITA
   ========================================================= */

.sort-wrapper {
    background: #fff;
    border: 1px solid var(--agcz-primary);
}

.sort-select {
    padding: 1px 27px;
    font-size: 0.7rem;
    box-shadow: none !important;
}

.sort-select:focus {
    outline: none !important;
    box-shadow: none !important;
}

.current-ag-img-container {
    position: relative;
    display: inline-block;
}

.current-ag-img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--agcz-primary);
}

.current-ag-img-container .pulse {
    width: 180px;
    height: 180px;
}

.timeline-modern {
    position: relative;
    max-width: 900px;
    margin: 60px auto;
    padding: 0;
}

.timeline-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, var(--agcz-primary), var(--agcz-accent));
    transform: translateX(-50%);
    border-radius: 50px;
}

.timeline-modern-item {
    position: relative;
    width: 50%;
    padding: 70px 40px;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.timeline-modern-item.show {
    opacity: 1;
    transform: translateY(0);
}

.timeline-modern-item.left {
    left: 0;
    text-align: right;
}

.timeline-modern-item.right {
    left: 50%;
    text-align: left;
}

.timeline-modern-content {
    display: flex;
    align-items: center;
    gap: 30px;
    position: relative;
}

.timeline-modern-item.left .timeline-modern-content {
    flex-direction: row-reverse;
}

.timeline-modern-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    background: #f1f1f1;
    box-shadow: 0 0 0 6px #fff, 0 0 0 10px rgba(13,110,253,0.25);
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all .3s ease;
}

.timeline-modern-img:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(3,34,87,0.4);
}

.timeline-modern-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform .3s ease;
}

.timeline-modern-img:hover img {
    transform: scale(1.2);
}

.timeline-modern-text h4 {
    font-size: 1rem;
    color: var(--agcz-primary);
}

.timeline-modern-text p {
    font-size: 0.8rem;
    color: #555;
}

.timeline-year {
    position: absolute;
    font-size: 4rem;
    font-weight: 700;
    color: rgba(0,0,0,0.05);
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    pointer-events: none;
}

.timeline-modern-item.left .timeline-year {
    left: 125%;
    margin-right: 20px;
}

.timeline-modern-item.right .timeline-year {
    right: 125%;
    margin-left: 20px;
}

@media(max-width: 767px) {
    .timeline-modern::before {
        left: 20px;
    }

    .timeline-modern-item,
    .timeline-modern-item.left,
    .timeline-modern-item.right {
        width: 100%;
        left: 0;
        text-align: left;
        padding: 35px 0 35px 50px;
    }

    .timeline-modern-content,
    .timeline-modern-item.left .timeline-modern-content {
        flex-direction: row;
        gap: 18px;
    }

    .timeline-modern-img {
        width: 120px !important;
        height: 120px !important;
    }

    .timeline-year {
        display: none;
    }
}

/* =========================================================
   19. FOOTER
   ========================================================= */

footer {
    flex-shrink: 0;
}

.footer-bg {
    background: url('../img/jengo.JPG') no-repeat center center;
    background-size: cover;
    position: relative;
}

.footer-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(2, 16, 76, 0.7);
    z-index: 1;
}

.footer-bg .container {
    position: relative;
    z-index: 2;
}

.glow-icon {
    text-shadow: 0 0 8px #ffc107aa, 0 0 16px #ffc10766;
}

.social-icon {
    font-size: 1.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-icon:hover {
    transform: scale(1.2);
    color: #fff;
}

.social-icon.facebook:hover {
    background-color: #1877f2;
    box-shadow: 0 0 12px #1877f2;
}

.social-icon.twitter:hover {
    background-color: #000;
    box-shadow: 0 0 12px #000;
}

.social-icon.instagram:hover {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
    box-shadow: 0 0 12px #fd5949;
}

.social-icon.linkedin:hover {
    background-color: #0a66c2;
    box-shadow: 0 0 12px #0a66c2;
}

.social-icon.youtube:hover {
    background-color: #ff0000;
    box-shadow: 0 0 12px #ff0000;
}

.link-glow:hover {
    color: #ffc107 !important;
    text-shadow: 0 0 8px #ffc10755;
    transition: all 0.3s;
}

.form-control-dark {
    background-color: #2c2c2c;
    border: 1px solid #444;
    color: #f8f9fa;
}

.form-control-dark:focus {
    border-color: #ffc107;
    box-shadow: 0 0 6px #ffc107aa;
}

.glow-btn {
    box-shadow: 0 0 8px #ffc10766;
    transition: all 0.3s;
}

.glow-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 16px #ffc107aa, 0 0 24px #ffc10755;
}

.footer-glow-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    z-index: 1;
}

.circle1 {
    width: 200px;
    height: 200px;
    background: #ffc107;
    top: -50px;
    left: -50px;
    animation: floatCircle 8s ease-in-out infinite alternate;
}

.circle2 {
    width: 300px;
    height: 300px;
    background: #ff9800;
    bottom: -100px;
    right: -100px;
    animation: floatCircle 10s ease-in-out infinite alternate-reverse;
}

@keyframes floatCircle {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(20px) rotate(45deg); }
    100% { transform: translateY(0) rotate(90deg); }
}

/* =========================================================
   20. FLOATING SHAPES
   ========================================================= */

.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
    animation: float 15s linear infinite;
    z-index: 1;
    pointer-events: none;
}

.shape1 {
    width: 200px;
    height: 200px;
    background: #0d6efd;
    top: 10%;
    left: 5%;
    animation-duration: 20s;
}

.shape2 {
    width: 150px;
    height: 150px;
    background: #6fa8dc;
    top: 30%;
    right: 10%;
    animation-duration: 25s;
}

.shape3 {
    width: 100px;
    height: 100px;
    background: #0d6efd;
    bottom: 15%;
    left: 15%;
    animation-duration: 18s;
}

.shape4 {
    width: 180px;
    height: 180px;
    background: #6fa8dc;
    bottom: 10%;
    right: 20%;
    animation-duration: 22s;
}

@keyframes float {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
    100% { transform: translateY(0) rotate(360deg); }
}

/* =========================================================
   21. ANIMATION HELPERS
   ========================================================= */

.fade-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================================
   22. FINAL RESPONSIVE FIXES
   ========================================================= */

@media (max-width: 991px) {
    .col-lg-8,
    .col-lg-4 {
        max-width: 100%;
    }

    .sticky-lg-top {
        position: static !important;
        margin-top: 0;
    }
}

@media (max-width: 576px) {
    .logo-bar h3,
    .logo-bar h4 {
        font-size: 1rem;
    }

    .logo-bar h5 {
        font-size: 0.75rem;
    }

    .navbar-brand img {
        height: 26px;
    }

    .section-title h1,
    .section-title h2 {
        font-size: 1.5rem;
    }

    .breadcrumb {
        border-radius: 1rem !important;
    }
}


/* =========================================================
   FLOATING SETTINGS PANEL
   ========================================================= */

.floating-settings {
    position: fixed;
    bottom: 155px;
    right: 24px;
    z-index: 1100;
}

.settings-icon-btn {
    background: linear-gradient(135deg, var(--agcz-primary), var(--agcz-primary-dark));
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(3, 34, 87, 0.25);
    font-size: 1.1rem;
    transition: all 0.35s ease;
}

.settings-icon-btn:hover {
    transform: rotate(45deg) scale(1.08);
    background: linear-gradient(135deg, var(--agcz-accent), var(--agcz-accent-dark));
    color: #111;
}

.settings-panel {
    position: fixed;
    top: 0;
    right: -390px;
    width: 360px;
    max-width: calc(100vw - 24px);
    height: 100vh;
    padding: 24px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    border-left: 1px solid rgba(11, 61, 145, 0.12);
    box-shadow: -14px 0 40px rgba(3, 34, 87, 0.18);
    transition: right 0.35s ease;
    z-index: 2000;
    overflow-y: auto;
}

.settings-panel.open {
    right: 0;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 18px;
    padding: 14px 16px;
    color: #fff;
}

.settings-header h4 {
    font-size: 1rem;
}

.close-btn {
    background: rgba(255,255,255,0.16);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.close-btn:hover {
    background: #fff;
    color: var(--agcz-primary);
}

.settings-card {
    background: #ffffff;
    padding: 16px;
    margin-top: 18px;
    border-radius: 18px;
    border: 1px solid rgba(11, 61, 145, 0.08);
    box-shadow: 0 8px 24px rgba(3, 34, 87, 0.06);
    transition: all 0.25s ease;
}

.settings-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(3, 34, 87, 0.1);
}

.settings-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}

.settings-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0;
    color: var(--agcz-primary-dark);
}

.settings-card-icon {
    font-size: 1.2rem;
}

.settings-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.settings-option {
    flex: 1;
    background: #f8f9fa;
    border: 1px solid #dbe3ef;
    padding: 10px 8px;
    border-radius: 14px;
    cursor: pointer;
    text-align: center;
    transition: all 0.25s ease;
    font-size: 0.85rem;
    color: #1f2937;
}

.settings-option.active {
    background: linear-gradient(135deg, var(--agcz-primary), var(--agcz-primary-dark));
    color: #fff;
    font-weight: 700;
    border-color: transparent;
}

.settings-option:hover {
    transform: translateY(-2px);
}

/* Theme classes */
body.theme-dark {
    background: #121212;
    color: #e8e8e8;
}

body.theme-dark .bg-light {
    background-color: #181818 !important;
}

body.theme-dark .bg-white,
body.theme-dark .card,
body.theme-dark .settings-card {
    background-color: #1f1f1f !important;
    color: #e8e8e8;
}

body.theme-dark .text-muted,
body.theme-dark .text-secondary {
    color: #b9b9b9 !important;
}

/* Font size classes */
body.font-small {
    font-size: 14px;
}

body.font-normal {
    font-size: 16px;
}

body.font-large {
    font-size: 18px;
}

@media (max-width: 576px) {
    .floating-settings {
        bottom: 90px;
        right: 16px;
    }

    .settings-panel {
        width: 100%;
        max-width: 100%;
        right: -100%;
    }

    .settings-panel.open {
        right: 0;
    }
}
/* =========================================================
   FLOATING MAP + BACK TO TOP BUTTONS
   ========================================================= */

.floating-buttons {
    position: fixed;
    right: 24px;
    bottom: 35px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 1090;
}

.floating-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: linear-gradient(135deg, var(--agcz-primary), var(--agcz-primary-dark));
    box-shadow: 0 8px 24px rgba(3, 34, 87, 0.25);
    transition: all 0.3s ease;
}

.floating-btn i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.floating-btn:hover {
    transform: translateY(-4px) scale(1.06);
    background: linear-gradient(135deg, var(--agcz-accent), var(--agcz-accent-dark));
    color: #111111;
    box-shadow: 0 12px 30px rgba(3, 34, 87, 0.35);
}

.floating-btn:hover i {
    transform: rotate(-10deg) scale(1.15);
}

.top-btn {
    display: none;
}

.top-btn.show {
    display: inline-flex;
}

.map-modal-header {
    background: linear-gradient(90deg, var(--agcz-primary), #6e6c09);
}

#mapModalLabel {
    font-size: 1rem;
    letter-spacing: 0.4px;
}

@media (max-width: 576px) {
    .floating-buttons {
        right: 16px;
        bottom: 24px;
        gap: 12px;
    }

    .floating-btn {
        width: 42px;
        height: 42px;
    }

    #mapModalLabel {
        font-size: 0.85rem;
    }
}
.section-title h2 {
    color: #032257;
    line-height: 1.25;
}

.section-underline {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #032257, #f0b429);
    border-radius: 999px;
}

.empty-state {
    border-color: #e8eef7 !important;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f2f6ff;
    color: #6c757d;
    font-size: 2rem;
}

.public-card {
    border: 1px solid #e8eef7 !important;
    transition: all .25s ease;
}

.public-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(3, 34, 87, .10) !important;
}

.public-title-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.public-title-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.public-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    object-position: center;
}

.public-img-placeholder {
    height: 180px;
    background: #f2f6ff;
    color: #adb5bd;
}

.btn-theme-light {
    background: #ffffff;
    color: #032257;
    border: 1px solid #dbe4f0;
    box-shadow: 0 6px 16px rgba(3, 34, 87, 0.08);
    transition: all 0.25s ease;
}

.btn-theme-light:hover {
    background: #f6f9ff;
    color: #032257;
    border-color: #032257;
    transform: translateY(-2px);
}

@media(max-width: 575px) {
    .section-title h2 {
        font-size: 1.45rem;
    }

    .public-img,
    .public-img-placeholder {
        height: 160px;
    }

    .empty-state-icon {
        width: 56px;
        height: 56px;
        font-size: 1.6rem;
    }
}
/* =========================================================
   23. PHASE 12D FINAL OVERRIDES / RESPONSIVE POLISH
   AGCZ Public Website
   Place this block at the VERY END of public/css/style.css
   ========================================================= */

/* ---------------------------------------------------------
   Global overflow protection
   --------------------------------------------------------- */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
video,
iframe {
    max-width: 100%;
}

.container,
.container-fluid,
.row,
[class*="col-"],
.card {
    min-width: 0;
}

/* ---------------------------------------------------------
   Official logo bar / header consistency
   --------------------------------------------------------- */
.official-header {
    position: relative;
    z-index: 1031;
}

.official-header .logo-bar,
.logo-bar.bg-white {
    background: #ffffff !important;
    border-bottom: 1px solid #eef2f7 !important;
}

.logo-left,
.logo-right {
    max-height: 74px;
    object-fit: contain;
}

.official-government-title {
    font-size: .82rem;
    letter-spacing: .06em;
}

.official-office-title {
    font-size: clamp(1rem, 2vw, 1.65rem);
    line-height: 1.25;
    color: var(--agcz-primary-dark);
}

/* ---------------------------------------------------------
   Navbar final polish
   --------------------------------------------------------- */
.main-navbar.sticky-top,
.navbar.main-navbar.sticky-top {
    position: sticky !important;
    top: 0;
    z-index: 1040;
}

.main-navbar .navbar-collapse {
    min-width: 0;
}

.main-navbar .nav-link {
    color: #23364f;
}

.main-navbar .nav-link:hover,
.main-navbar .nav-link.active {
    color: var(--agcz-primary-dark) !important;
    background: #f2f6ff;
}

/* Disable old underline animation for final navbar */
.main-navbar .nav-link::before {
    display: none !important;
}

.main-navbar .mega-menu {
    overflow: visible !important;
}

.main-navbar .dropdown-menu {
    z-index: 1055;
}

/* ---------------------------------------------------------
   Dropdown submenu support
   Works with submenu JS in layouts.public.blade.php
   --------------------------------------------------------- */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .submenu-menu,
.dropdown-submenu > .dropdown-menu {
    display: none;
}

.dropdown-submenu.show > .submenu-menu,
.dropdown-submenu.show > .dropdown-menu,
.dropdown-submenu > .submenu-menu.show,
.dropdown-submenu > .dropdown-menu.show {
    display: block;
}

/* ---------------------------------------------------------
   Afisi kwa Ufupi timeline visibility fix
   Prevent hidden Majukumu / Utekelezaji content
   --------------------------------------------------------- */
.about-accordion .timeline-item,
.accordion .timeline .timeline-item {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

.about-accordion .timeline-item:hover,
.accordion .timeline .timeline-item:hover {
    transform: translateY(-3px) !important;
}

/* ---------------------------------------------------------
   Director cards mobile size
   --------------------------------------------------------- */
.director-img {
    width: 90px;
    height: 105px;
    object-fit: cover;
}

/* ---------------------------------------------------------
   Public card consistency
   --------------------------------------------------------- */
.public-card,
.card-hover {
    transition: all .25s ease;
}

.public-card:hover,
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(3, 34, 87, .10) !important;
}

/* ---------------------------------------------------------
   Empty state consistency
   --------------------------------------------------------- */
.empty-state {
    border: 1px solid #e8eef7 !important;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f2f6ff;
    color: #6c757d;
    font-size: 2rem;
}

/* ---------------------------------------------------------
   Section title consistency
   --------------------------------------------------------- */
.section-title h1,
.section-title h2 {
    line-height: 1.25;
}

.section-title p {
    line-height: 1.65;
}

.section-underline {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--agcz-primary-dark), var(--agcz-accent));
    border-radius: 999px;
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */
.btn-theme-light {
    background: #ffffff;
    color: var(--agcz-primary-dark);
    border: 1px solid #dbe4f0;
    box-shadow: 0 6px 16px rgba(3, 34, 87, 0.08);
    transition: all 0.25s ease;
}

.btn-theme-light:hover {
    background: #f6f9ff;
    color: var(--agcz-primary-dark);
    border-color: var(--agcz-primary-dark);
    transform: translateY(-2px);
}

/* ---------------------------------------------------------
   Video cards
   --------------------------------------------------------- */
.video-preview-card {
    cursor: pointer;
}

.video-thumb {
    width: 100%;
    object-fit: cover;
    display: block;
}

/* ---------------------------------------------------------
   Hero mobile safety
   --------------------------------------------------------- */
#hero,
.hero-section {
    overflow: hidden;
}

#hero .hero-media-card,
#hero .hero-image {
    max-width: 100%;
}

/* ---------------------------------------------------------
   Footer safety
   --------------------------------------------------------- */
.newsletter-form {
    min-width: 0;
}

.footer-bg {
    overflow: hidden;
}

/* If footer image filename is lowercase on server */
.footer-bg {
    background-position: center center;
    background-size: cover;
}

/* ---------------------------------------------------------
   Accessibility focus
   --------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
.form-control:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible {
    outline: 3px solid rgba(240, 180, 41, .65);
    outline-offset: 3px;
}

/* ---------------------------------------------------------
   Tablet / Mobile
   --------------------------------------------------------- */
@media (max-width: 991px) {
    .main-navbar .navbar-collapse {
        max-height: 80vh;
        overflow-y: auto;
        padding-top: 1rem;
    }

    .main-navbar .mega-menu {
        min-width: 100% !important;
        width: 100% !important;
        box-shadow: none !important;
        border: 1px solid #eef2f7 !important;
        margin-top: .35rem;
    }

    .main-navbar .nav-link {
        border-radius: .75rem;
        margin-bottom: .25rem;
    }

    .dropdown-submenu > .submenu-menu,
    .dropdown-submenu > .dropdown-menu {
        position: static !important;
        width: 100%;
        margin-left: 1rem;
        margin-top: .25rem;
        background: #f8f9fa;
        box-shadow: none !important;
        border: none !important;
    }

    .section-title {
        text-align: center !important;
    }

    .sticky-lg-top {
        position: static !important;
    }
}

/* ---------------------------------------------------------
   Small mobile
   --------------------------------------------------------- */
@media (max-width: 575px) {
    main {
        padding-top: 1.25rem !important;
    }

    .logo-bar {
        padding-top: .75rem !important;
        padding-bottom: .75rem !important;
    }

    .logo-left,
    .logo-right {
        max-height: 48px;
    }

    .official-government-title {
        font-size: .62rem;
        letter-spacing: .03em;
    }

    .official-office-title {
        font-size: .78rem;
        line-height: 1.25;
    }

    .section-title h1,
    .section-title h2 {
        font-size: 1.45rem;
        line-height: 1.25;
    }

    .section-title p {
        font-size: .9rem;
    }

    .btn,
    .form-control {
        font-size: .9rem;
    }

    .breadcrumb {
        font-size: .82rem;
        border-radius: 1rem !important;
    }

    .breadcrumb .breadcrumb-item a,
    .breadcrumb .breadcrumb-item.active {
        padding: .4rem .6rem !important;
    }

    .director-card {
        align-items: flex-start;
    }

    .director-img {
        width: 72px !important;
        height: 86px !important;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form .btn {
        width: 100%;
    }

    footer {
        text-align: center;
    }

    footer .d-flex {
        justify-content: center;
    }

    .floating-settings {
        bottom: 90px;
        right: 16px;
    }

    .floating-buttons {
        right: 16px;
        bottom: 24px;
    }
}

/* ---------------------------------------------------------
   Reduced motion support
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
/* =========================================================
   NAVBAR STICKY FINAL FIX
   ========================================================= */

.main-navbar.sticky-top,
.navbar.main-navbar.sticky-top {
    position: sticky !important;
    top: 0 !important;
    z-index: 1045 !important;
}

/* Keep navbar sticky even on tablet/mobile */
@media (max-width: 991px) {
    .main-navbar.sticky-top,
    .navbar.main-navbar.sticky-top {
        position: sticky !important;
        top: 0 !important;
        z-index: 1045 !important;
        margin-top: 0 !important;
    }

    .main-navbar .navbar-collapse {
        max-height: 80vh;
        overflow-y: auto;
    }
}



@keyframes navbarSlideDown {
    from {
        transform: translateY(-8px);
        opacity: .95;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

body.contrast-high {
    filter: contrast(1.12);
}

body.contrast-high .text-muted,
body.contrast-high .text-secondary {
    color: #2f3b4a !important;
}

body.contrast-high a {
    text-decoration-thickness: 2px;
}

/* =========================================================
   NAVBAR FIXED-ON-SCROLL FINAL SOLUTION
   ========================================================= */

.main-navbar {
    position: relative !important;
    z-index: 1045 !important;
    width: 100%;
    background: #ffffff !important;
}

.main-navbar.is-fixed {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1045 !important;
    width: 100% !important;
    box-shadow: 0 8px 24px rgba(3, 34, 87, 0.12) !important;
    animation: navbarSlideDown .2s ease;
}

.main-navbar-spacer {
    display: none;
    height: 0;
}

.main-navbar-spacer.active {
    display: block;
}

/* =========================================================
   HERO CAPTION FINAL - CLEAN VERSION
   ========================================================= */

#hero .carousel-item {
    position: relative;
}

#hero .agcz-hero-caption-box {
    position: absolute !important;
    left: 50% !important;
    right: auto !important;
    bottom: 1rem !important;
    transform: translateX(-50%) !important;
    z-index: 30 !important;

    width: 72% !important;
    max-width: 780px !important;
    min-height: auto !important;
    padding: .75rem 1.1rem !important;

    background: rgba(3, 34, 87, 0.42) !important;
    color: #ffffff !important;

    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;

    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);

    text-align: center !important;
}

#hero .agcz-hero-caption-badge {
    display: none !important;
}

#hero .agcz-hero-caption-title {
    color: #ffffff !important;
    font-size: clamp(.66rem, .95vw, .88rem) !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    margin: 0 0 .3rem 0 !important;
    padding: 0 !important;
    text-align: center !important;
    text-transform: uppercase !important;
    letter-spacing: .04em !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .35) !important;

    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#hero .agcz-hero-caption-title::after {
    content: "" !important;
    display: block !important;
    width: 95px !important;
    height: 2px !important;
    margin: .3rem auto 0 !important;
    border-radius: 999px !important;
    background: linear-gradient(90deg, #198754, #00c6ff) !important;
}

#hero .agcz-hero-caption-text {
    color: rgba(255, 255, 255, .94) !important;
    font-size: clamp(.56rem, .75vw, .72rem) !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
    margin: 0 !important;
    text-align: center !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .30) !important;

    display: -webkit-box !important;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media(max-width: 991px) {
    #hero .agcz-hero-caption-box {
        width: 82% !important;
        bottom: .85rem !important;
        padding: .65rem .9rem !important;
    }

    #hero .agcz-hero-caption-title {
        font-size: .68rem !important;
        line-height: 1.2 !important;
    }

    #hero .agcz-hero-caption-text {
        font-size: .58rem !important;
        line-height: 1.25 !important;
        -webkit-line-clamp: 4;
    }
}

@media(max-width: 575px) {
    #hero .agcz-hero-caption-box {
        width: calc(100% - 1.5rem) !important;
        bottom: .55rem !important;
        padding: .5rem .7rem !important;
    }

    #hero .agcz-hero-caption-title {
        font-size: .56rem !important;
        line-height: 1.18 !important;
        margin-bottom: .22rem !important;
        -webkit-line-clamp: 2;
    }

    #hero .agcz-hero-caption-title::after {
        width: 65px !important;
        height: 2px !important;
        margin-top: .22rem !important;
    }

    #hero .agcz-hero-caption-text {
        font-size: .48rem !important;
        line-height: 1.22 !important;
        -webkit-line-clamp: 4;
    }
}

/* =========================================================
   NEWS DETAIL PAGE TITLE FINAL FIX
   ========================================================= */

.news-detail-title {
    font-size: clamp(1.8rem, 3.2vw, 2.8rem);
    line-height: 1.15;
    font-weight: 800;
    color: var(--agcz-primary-dark);
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
    text-transform: none;
}

.news-detail-title.text-uppercase {
    letter-spacing: -0.015em;
}

.related-news-title {
    font-size: .95rem;
    line-height: 1.35;
    font-weight: 700;
    color: var(--agcz-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
