/* Custom Header and Footer styling for Govt. Polytechnic Dhamlawas */

/* Colors */
:root {
    --college-blue: #001e57;
    --college-yellow: #ffc107;
}

/* Top bar with logos */
.college-top-bar {
    background-color: #ffffff;
    padding: 12px 0;
    border-bottom: 2px solid #eaeaea;
}

.college-logo-link {
    display: inline-block;
}

.college-main-logo {
    max-height: 90px;
    width: auto;
}

.college-top-emblems {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.college-emblem-img {
    height: 85px;
    width: auto;
    object-fit: contain;
}

/* Responsive top bar logos */
@media (max-width: 768px) {
    .college-top-emblems {
        justify-content: center;
        margin-top: 10px;
    }
    .college-emblem-img {
        height: 60px;
    }
    .college-main-logo {
        max-height: 70px;
    }
}

/* Navigation bar */
.college-nav-bar {
    background-color: var(--college-blue) !important;
    position: relative;
    z-index: 99;
}

/* Main Menu text overrides */
.college-nav-bar .main-menu nav > ul > li > a {
    color: #ffffff !important;
    line-height: 80px; /* Thinner header area for a more professional look */
    font-size: 14px !important; /* Slightly smaller to fit on one line */
    padding: 0 10px !important; /* Reduced padding to fit more menu items */
}

.college-nav-bar .main-menu nav > ul > li:hover > a {
    color: var(--college-yellow) !important;
}

.college-nav-bar .main-menu nav > ul > li > ul {
    top: 100%;
}

/* Sticky menu behavior */
.header-sticky.sticky.college-nav-bar {
    background-color: var(--college-blue) !important;
    position: fixed;
    top: 0;
    width: 100%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.header-sticky.sticky.college-nav-bar .main-menu nav > ul > li > a {
    line-height: 60px !important;
}

/* Search button white icon */
.college-search-btn .search-menu i {
    color: #ffffff !important;
}

.college-search-btn .search-menu:hover i {
    color: var(--college-yellow) !important;
}

/* Mobile menu toggle button color */
.college-nav-bar .mean-container a.meanmenu-reveal {
    color: #ffffff !important;
    border: 1px solid #ffffff !important;
}

.college-nav-bar .mean-container a.meanmenu-reveal span {
    background-color: #ffffff !important;
}

/* Footer styling */
.college-footer {
    background-color: var(--college-blue) !important;
    color: #eaeaea;
}

.college-footer .single-widget h3 {
    color: #ffffff !important;
    border-bottom: 2px solid var(--college-yellow);
    padding-bottom: 10px;
    text-transform: uppercase;
}

.college-footer .single-widget ul li a {
    color: #cccccc !important;
    transition: all 0.3s ease;
}

.college-footer .single-widget ul li a:hover {
    color: var(--college-yellow) !important;
    padding-left: 5px;
}

.college-footer p {
    color: #cccccc !important;
}

.college-footer-logo {
    max-height: 65px;
    width: auto;
}

.college-footer .footer-bottom {
    background-color: #001337 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
}

.college-footer .footer-bottom p {
    color: #999999 !important;
}

.college-footer .footer-bottom p a {
    color: var(--college-yellow) !important;
}

.college-footer .footer-social ul li a {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    line-height: 40px;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
}

.college-footer .footer-social ul li a:hover {
    background-color: var(--college-yellow);
    color: var(--college-blue) !important;
}

/* Gallery Styles */
.single-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.single-gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.single-gallery-item:hover img {
    transform: scale(1.1);
}

.single-gallery-item .gallery-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 30, 87, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.single-gallery-item:hover .gallery-hover {
    opacity: 1 !important;
}

.single-gallery-item .gallery-hover i {
    color: #ffffff;
    font-size: 30px;
}

/* Responsive / Mobile styles (up to 991px screen width) */
@media (max-width: 991px) {
    /* Center the mobile menu container bar */
    .college-nav-bar .mean-container {
        position: relative;
        min-height: 80px;
    }
    
    /* Position the mobile menu reveal button cleanly */
    .college-nav-bar .mean-container a.meanmenu-reveal {
        margin-top: 0 !important;
        top: 24px !important; /* Centered vertically inside the 80px bar */
        right: 15px !important;
        border-color: #ffffff !important;
        color: #ffffff !important;
        padding: 6px 8px !important;
        display: block !important;
    }
    
    .college-nav-bar .mean-container a.meanmenu-reveal span {
        background-color: #ffffff !important;
    }
    
    /* Position the search button cleanly in mobile view next to the menu button */
    .college-nav-bar .college-search-btn {
        margin-top: 0 !important;
        position: absolute !important;
        top: 24px !important;
        right: 70px !important; /* Positioned to the left of the menu button */
        z-index: 9999;
    }
    
    .college-nav-bar .college-search-btn .search-menu {
        width: 32px !important;
        height: 32px !important;
        line-height: 32px !important;
        border-radius: 50% !important;
        background: transparent !important; /* Transparent background to look flat like mean-menu button */
        border: 1px solid #ffffff !important; /* Matching white border */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 21px !important;
        padding: 16px !important;
    }
    
    .college-nav-bar .college-search-btn .search-menu i {
        font-size: 14px !important;
        color: #ffffff !important;
    }

    /* Position the search overlay form nicely when opened in mobile */
    .college-nav-bar .search {
        right: 15px !important;
        top: 65px !important;
        width: 280px !important;
        z-index: 99999;
    }
}

/* Staff Table Centering & Auto Avatar Formatting */
.staff-table td {
    vertical-align: middle !important;
}

.staff-table td img {
    border-radius: 50% !important;
    object-fit: cover !important;
    width: 70px !important;
    height: 70px !important;
    border: 2.5px solid #e31e24 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    margin: 0 auto !important;
    display: block !important;
}

/* CMS Content List Formatting (Bullets & Numbering Fix) */
.about-text-content ul,
.event-description ul,
.course-description ul,
.cms-content ul,
.page-content ul,
.about-content ul {
    list-style-type: disc !important;
    padding-left: 30px !important;
    margin-bottom: 20px !important;
}

.about-text-content ul li,
.event-description ul li,
.course-description ul li,
.cms-content ul li,
.page-content ul li,
.about-content ul li {
    list-style-type: disc !important;
    margin-bottom: 8px !important;
    line-height: 26px !important;
}

.about-text-content ol,
.event-description ol,
.course-description ol,
.cms-content ol,
.page-content ol,
.about-content ol {
    list-style-type: decimal !important;
    padding-left: 30px !important;
    margin-bottom: 20px !important;
}

.about-text-content ol li,
.event-description ol li,
.course-description ol li,
.cms-content ol li,
.page-content ol li,
.about-content ol li {
    list-style-type: decimal !important;
    margin-bottom: 8px !important;
    line-height: 26px !important;
}

/* Auto Image Styling (Border, Radius & Shadow for photos in CMS pages) */
.about-text-content img,
.course-description img,
.event-description img {
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.about-text-content img[style*="float: left"],
.about-text-content img[style*="float:left"],
.course-description img[style*="float: left"],
.course-description img[style*="float:left"] {
    border: 2.5px solid #e31e24 !important;
    margin-right: 18px !important;
    margin-bottom: 12px !important;
}

/*----------------------------------------*/
/* Mobile View Refinements & Fixes (<= 767px)
/*----------------------------------------*/
@media (max-width: 767px) {
    /* Prevent horizontal page overflow */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
    }

    /* Top bar emblem images scale cleanly */
    .college-emblem-img {
        height: 48px !important;
        width: auto !important;
    }
    
    .college-top-emblems {
        gap: 8px !important;
        justify-content: center !important;
    }

    .college-main-logo {
        max-height: 60px !important;
    }

    /* Event cards stack vertically on mobile */
    .single-event {
        flex-direction: column !important;
    }

    .single-event .event-img {
        width: 100% !important;
        height: 200px !important;
    }

    .single-event .event-content {
        width: 100% !important;
    }

    /* CMS Content images fit responsive width on mobile */
    .page-description img,
    .event-description img,
    .blog-description img,
    .cms-content img,
    .azadi-event-details img,
    .page-content img {
        max-width: 100% !important;
        height: auto !important;
    }

    .page-description a.image-popup,
    .event-description a.image-popup,
    .blog-description a.image-popup,
    .cms-content a.image-popup,
    .azadi-event-details a.image-popup,
    .page-content a.image-popup {
        max-width: 100% !important;
        width: 100% !important;
    }

    .page-description a.image-popup img,
    .event-description a.image-popup img,
    .blog-description a.image-popup img,
    .cms-content a.image-popup img,
    .azadi-event-details a.image-popup img,
    .page-content a.image-popup img {
        max-width: 100% !important;
        width: 100% !important;
        height: 200px !important;
    }

    /* Responsive Tables */
    .table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Footer widgets margin */
    .college-footer .single-widget {
        margin-bottom: 25px !important;
    }
}

/*----------------------------------------*/
/* Mobile Menu Smooth Vertical Scroll Fix
/*----------------------------------------*/
.mean-container .mean-nav {
    max-height: calc(100vh - 90px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin;
    scrollbar-color: #ffc107 #001e57;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
    border-bottom: 3px solid #ffc107 !important;
    background: #001e57 !important;
    margin-top: 0 !important;
    position: absolute !important;
    left: 0;
    top: 80px;
    z-index: 999999 !important;
}

.mean-container .mean-nav::-webkit-scrollbar {
    width: 5px;
}

.mean-container .mean-nav::-webkit-scrollbar-track {
    background: #001e57;
}

.mean-container .mean-nav::-webkit-scrollbar-thumb {
    background: #ffc107;
    border-radius: 4px;
}

.mean-container .mean-nav ul li a {
    color: #ffffff !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-left: none !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 12px 20px !important;
    width: 100% !important;
    text-transform: uppercase !important;
}

.mean-container .mean-nav ul li a:hover {
    color: #ffc107 !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.mean-container .mean-nav ul li a.mean-expand {
    color: #ffffff !important;
    border: none !important;
    background: rgba(255, 255, 255, 0.15) !important;
    height: 32px !important;
    line-height: 32px !important;
    width: 36px !important;
    top: 6px !important;
    right: 15px !important;
    border-radius: 4px !important;
    padding: 0 !important;
    text-align: center !important;
}

.mean-container .mean-nav ul li a.mean-expand:hover {
    background: #ffc107 !important;
    color: #001e57 !important;
}

.mean-container .mean-nav ul li ul li a {
    background: #001337 !important;
    padding-left: 35px !important;
    font-size: 12px !important;
}
