/*
Theme Name: Olamaboro Municipal Theme
Theme URI: https://olamaborolga.kg.gov.ng
Author: AVEYAH Projects
Author URI: https://aveyahventures.com
Description: A lightweight, modular theme for the Olamaboro Local Government Area municipal portal. Renders pages in isolated block components (HTML, CSS, JS) with zero redundancy.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: olamaboro-municipal
*/

/* Reset & Global Base styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Approved Color Palette */
    --color-primary-dark: #176B3A;  /* Primary Green representing agriculture & heritage */
    --color-primary: #176B3A;       /* Forest Green representing agriculture & heritage */
    --color-primary-light: #548D56; /* Light Green */
    --color-accent: #B98A28;        /* Muted Gold representing wealth & prosperity */
    --color-accent-light: #DFC42A;  /* Light Gold */
    --color-bg-light: #F4F6F9;      /* Light gray background */
    --color-white: #FFFFFF;
    --color-text-dark: #1E293B;     /* Charcoal slate for body copy */
    --color-text-muted: #64748B;    /* Muted slate */
    --color-border: #E2E8F0;
    
    /* Approved Typography */
    --font-primary: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
    
    /* Spacing & Borders */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 16px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg-light);
    color: var(--color-text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

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

a:hover {
    color: var(--color-primary-dark);
}

/* Base Layout Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Site Header Styling */
.site-header {
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Top Utility Bar */
.header-top {
    background-color: var(--color-primary-dark);
    color: var(--color-white);
    padding: 0.6rem 0;
    font-size: 0.8rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-top-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gov-motto {
    font-size: 0.8rem;
    color: #E2E8F0;
    font-weight: 400;
}

.header-top-contacts {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.top-contact-link {
    color: #E2E8F0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.top-contact-link:hover {
    color: var(--color-accent-light);
}

.contact-icon-svg {
    width: 14px;
    height: 14px;
    color: var(--color-accent);
}

.top-socials {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 1rem;
}

.top-socials a {
    color: #E2E8F0;
    transition: var(--transition-smooth);
}

.top-socials a:hover {
    color: var(--color-accent-light);
}

.social-icon {
    font-size: 0.85rem;
}

.header-main {
    padding: 0.3rem 0;
}

.header-main-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo-img {
    height: 70px;
    display: block;
    width: auto;
    transition: var(--transition-smooth);
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 1.75rem;
}

.nav-menu a {
    color: var(--color-primary-dark);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-menu a:hover {
    color: var(--color-primary);
}

.menu-item-has-children > a {
    position: relative;
}

.dropdown-chevron {
    width: 14px;
    height: 14px;
    transition: var(--transition-smooth);
}

.nav-menu a:hover .dropdown-chevron {
    transform: translateY(2px);
    color: var(--color-primary);
}

.nav-search-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-smooth);
}

.nav-search-btn:hover {
    color: var(--color-primary);
    background-color: var(--color-bg-light);
}

.search-icon-svg {
    width: 20px;
    height: 20px;
}

/* Site Footer Styling */
.site-footer {
    background-color: var(--color-primary-dark);
    color: #E2E8F0;
    margin-top: 4rem;
    border-top: 4px solid var(--color-accent);
}

.footer-widgets {
    padding: 4rem 0 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 3rem;
}

.footer-col h3 {
    color: var(--color-white);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.footer-col h4 {
    color: var(--color-white);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-col h4::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    background-color: var(--color-accent);
}

.footer-col p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.75rem;
}

.footer-col ul li a {
    color: #CBD5E1;
    font-size: 0.9rem;
}

.footer-col ul li a:hover {
    color: var(--color-accent);
    padding-left: 4px;
}

.footer-bottom {
    background-color: #092c18;
    padding: 1.5rem 0;
    font-size: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-bottom-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.footer-links a {
    color: #E2E8F0;
    text-decoration: underline;
    transition: var(--transition-smooth);
}

.footer-links a:hover {
    color: var(--color-accent);
}

/* Mobile Navigation & Spacing Media Queries */
.mobile-nav-toggle {
    display: none;
}

@media (max-width: 991px) {
    .header-top {
        display: none !important;
    }
    
    .mobile-nav-toggle {
        display: block;
        background: none;
        border: none;
        color: var(--color-primary-dark);
        cursor: pointer;
        padding: 0.5rem;
        transition: color 0.3s;
        z-index: 1100;
        outline: none;
    }
    .mobile-nav-toggle:hover {
        color: var(--color-primary);
    }
    
    .header-navigation {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--color-white);
        border-top: 1px solid var(--color-border);
        border-bottom: 3px solid var(--color-primary);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        display: none;
        z-index: 999;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .header-navigation.nav-active {
        display: block;
    }
    
    .nav-menu {
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem;
        gap: 0;
    }
    
    .nav-menu > li {
        border-bottom: 1px solid var(--color-border);
        position: relative;
    }
    
    .nav-menu > li:last-child {
        border-bottom: none;
    }
    
    .nav-menu a {
        padding: 0.85rem 0;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    /* Make parent links fit text and leave chevron separate on mobile */
    .nav-menu li.menu-item-has-children > a {
        padding-right: 55px !important;
    }
    
    .nav-menu li.menu-item-has-children .dropdown-chevron {
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 50px;
        height: 100%;
        display: flex !important;
        align-items: center;
        justify-content: center;
        background-color: var(--color-bg-light);
        border-left: 1px solid var(--color-border);
        cursor: pointer;
        z-index: 10;
        transition: transform 0.3s ease;
    }
    
    .nav-menu li.menu-item-has-children .dropdown-chevron.chevron-rotate {
        transform: rotate(180deg);
        background-color: rgba(23, 107, 58, 0.05);
        color: var(--color-primary);
    }
    
    /* Collapse submenus by default on mobile/tablet */
    .nav-menu .sub-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border-top: none;
        border-radius: 0;
        display: none; /* Collapsed by default */
        opacity: 1;
        visibility: visible;
        padding-left: 1.75rem;
        padding-top: 0.5rem;
        padding-bottom: 0.75rem;
        background-color: var(--color-bg-light);
    }
    
    .nav-menu .sub-menu.sub-menu-open {
        display: block; /* Expanded when toggled */
    }
    
    .nav-menu .sub-menu li {
        border-bottom: none !important;
    }
    
    .nav-menu .sub-menu li a {
        padding: 0.6rem 0 !important;
        font-weight: 550;
        font-size: 0.9rem;
        color: var(--color-text-dark);
        display: block;
    }
    
    .submenu-divider, .submenu-header {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .gov-motto {
        display: none;
    }
    .header-top-flex {
        justify-content: center;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .footer-bottom-flex {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* --- Dropdown Submenus & Accessible Hover Effects --- */
.nav-menu li {
    position: relative;
}

.nav-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: var(--color-white);
    min-width: 280px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.15);
    border-top: 4px solid var(--color-primary);
    border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
    list-style: none;
    display: none;
    padding: 0.75rem 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-menu li.menu-item-has-children:hover .sub-menu,
.nav-menu li.menu-item-has-children.focus-active .sub-menu {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-menu .sub-menu li {
    width: 100%;
}

.nav-menu .sub-menu a {
    display: block;
    padding: 0.65rem 1.5rem;
    color: var(--color-text-dark);
    font-size: 0.875rem;
    font-weight: 550;
    transition: var(--transition-smooth);
    border: none;
    background: transparent;
    text-align: left;
    width: 100%;
}

.nav-menu .sub-menu a:hover {
    background-color: var(--color-bg-light);
    color: var(--color-primary);
    padding-left: 1.75rem;
}

.submenu-divider {
    height: 1px;
    background-color: var(--color-border);
    margin: 0.5rem 0;
}

.submenu-header {
    font-size: 0.725rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    padding: 0.4rem 1.5rem 0.25rem;
}

/* --- Slide-down Search Panel --- */
.header-search-slide {
    background-color: var(--color-white);
    border-top: 1px solid var(--color-border);
    border-bottom: 2px solid var(--color-border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 4px 6px -4px rgba(0,0,0,0.05);
}

.header-search-slide.search-slide-active {
    max-height: 90px;
}

.search-slide-flex {
    display: flex;
    align-items: center;
    height: 90px;
}

.header-search-form-el {
    display: flex;
    width: 100%;
    gap: 1rem;
    align-items: center;
}

.search-field-el {
    flex-grow: 1;
    border: 1.5px solid var(--color-border);
    border-radius: var(--border-radius-md);
    padding: 0.75rem 1.25rem;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
    background-color: var(--color-bg-light);
}

.search-field-el:focus {
    border-color: var(--color-primary);
    background-color: var(--color-white);
    box-shadow: 0 0 0 3px rgba(23, 107, 58, 0.15);
}

.search-submit-el {
    background-color: var(--color-primary);
    color: var(--color-white);
    border: none;
    font-family: var(--font-primary);
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.search-submit-el:hover {
    background-color: var(--color-primary-dark);
}

/* --- SVG Social Icons Top Bar --- */
.top-socials {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.social-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.08);
    color: #E2E8F0 !important;
    transition: var(--transition-smooth);
}

.social-icon-link:hover {
    background-color: var(--color-accent);
    color: var(--color-primary-dark) !important;
    transform: translateY(-2px);
}

.social-icon-svg {
    width: 14px;
    height: 14px;
}

/* --- Global Button Hover Text Colors --- */
a.btn-discover,
a.btn-explore,
a.btn-chairman,
a.btn-discover:link,
a.btn-discover:visited,
.btn-discover,
.btn-explore,
.btn-chairman,
.search-submit-el,
.feedback-form-card button[type="submit"],
.btn-discover a {
    color: var(--color-white) !important;
}

a.btn-discover:hover,
a.btn-explore:hover,
a.btn-chairman:hover,
.btn-discover:hover,
.btn-explore:hover,
.btn-chairman:hover,
.search-submit-el:hover,
.feedback-form-card button[type="submit"]:hover {
    color: var(--color-accent-light) !important;
}

/* Outline/transparent buttons hover background to preserve legibility of yellow text */
a.btn-discover[style*="background: transparent"]:hover,
a.btn-discover[style*="background:transparent"]:hover,
a.btn-discover[style*="background: none"]:hover,
a.btn-discover[style*="background:none"]:hover {
    background-color: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
}

/* --- Accessibility Option Classes --- */

/* Font Size Alterations */
body.font-size-sm {
    font-size: 0.875rem !important;
}
body.font-size-sm p,
body.font-size-sm li,
body.font-size-sm span,
body.font-size-sm td,
body.font-size-sm a {
    font-size: 0.85rem !important;
}

body.font-size-lg {
    font-size: 1.25rem !important;
}
body.font-size-lg p,
body.font-size-lg li,
body.font-size-lg span,
body.font-size-lg td,
body.font-size-lg a {
    font-size: 1.2rem !important;
}
body.font-size-lg h1 {
    font-size: 3.25rem !important;
}
body.font-size-lg h2 {
    font-size: 2.25rem !important;
}
body.font-size-lg h3 {
    font-size: 1.75rem !important;
}

/* High Contrast Mode (WCAG compliant) */
body.high-contrast {
    background-color: #000000 !important;
    color: #ffffff !important;
}
body.high-contrast * {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
    box-shadow: none !important;
}
body.high-contrast a,
body.high-contrast a *,
body.high-contrast button,
body.high-contrast h1,
body.high-contrast h2,
body.high-contrast h3,
body.high-contrast h4,
body.high-contrast strong {
    color: #ffff00 !important;
    border-color: #ffff00 !important;
}
body.high-contrast button:hover,
body.high-contrast a:hover {
    background-color: #ffff00 !important;
    color: #000000 !important;
}

/* Dyslexic Font Option */
body.dyslexic-font,
body.dyslexic-font *,
body.dyslexic-font p,
body.dyslexic-font a,
body.dyslexic-font li,
body.dyslexic-font span {
    font-family: "Comic Sans MS", "Comic Sans", cursive, sans-serif !important;
}

/* Highlight Links Option */
body.highlight-links a {
    text-decoration: underline !important;
    font-weight: 800 !important;
    outline: 2px solid var(--color-accent) !important;
}
body.high-contrast.highlight-links a {
    outline: 2px solid #ffff00 !important;
}

/* Accessibility Widget Panel Toggle */
.accessibility-panel {
    display: none !important;
}
.accessibility-panel.panel-active {
    display: flex !important;
}

/* ==============================================================================
   COMPREHENSIVE RESPONSIVENESS SYSTEM (MOBILE & TABLET OVERRIDES)
   ============================================================================== */

/* 1. Global Table Responsiveness */
table {
    width: 100%;
}

@media (max-width: 768px) {
    table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        margin-top: 1rem;
        margin-bottom: 1rem;
        border: 1px solid var(--color-border);
    }
    
    table th, table td {
        white-space: nowrap !important;
        padding: 0.75rem 1rem !important;
    }
}

/* 2. Responsive Sidebars and General Grid Layouts */
@media (max-width: 991px) {
    .service-layout,
    .gov-layout {
        grid-template-columns: 1fr !important;
        gap: 2.5rem !important;
    }
    
    .gov-sidebar,
    .service-sidebar {
        width: 100% !important;
        margin-top: 2rem;
    }
    
    .profile-intro {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 1.5rem !important;
    }
    
    .profile-body {
        padding: 2rem 1.5rem !important;
    }
    
    .contact-top-row {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
}

/* 3. Accessibility Widget Mobile Rescaling */
@media (max-width: 480px) {
    .accessibility-panel {
        width: calc(100% - 40px) !important;
        right: 20px !important;
        left: 20px !important;
        bottom: 90px !important;
    }
}
