/* --- override.css (Updated & Corrected) --- */
/* For Jay Nand Group of Institutions Website */

/* ======================================= */
/*  1. Header: Logo and Menu Restructure   */
/* ======================================= */

/* Hide the new full-width logo on mobile/tablet by default */
.rd-navbar-brand .full-width-logo {
    display: none;
}

/* On mobile/tablet, the original logo structure is used */
.rd-navbar-brand .mobile-logo-container {
    display: flex;
    /* Using flex to align original logo parts */
    align-items: center;
}

/* Desktop Styles (lg breakpoint from template is 992px) */
@media (min-width: 992px) {

    /* Main navbar container */
    .rd-navbar-static .rd-navbar-inner {
        display: block;
        /* Change from flex to block to handle children better */
    }

    /* This is the main container for both logo and nav */
    .rd-navbar-static .rd-navbar-menu-wrap {
        display: flex;
        flex-direction: column;
        /* Stack items vertically */
        align-items: center;
        /* Center them horizontally */
        width: 100%;
    }

    /* Brand (logo) container */
    .rd-navbar-static .rd-navbar-brand {
        float: none;
        /* IMPORTANT: Remove float */
        width: 100%;
        max-width: 800px;
        /* Control logo's max width */
        padding: 20px 15px;
        order: 1;
        /* Logo comes first */
        text-align: center;
        /* Center the logo image */
    }

    /* Ensure the link inside the brand is a block */
    .rd-navbar-static .rd-navbar-brand a {
        display: block;
    }

    /* Hide the original mobile logo structure on desktop */
    .rd-navbar-brand .mobile-logo-container {
        display: none;
    }

    /* Show the new full-width logo on desktop */
    .rd-navbar-brand .full-width-logo {
        display: block;
        width: 100%;
        height: auto;
    }

    /* Navigation menu container */
    .rd-navbar-static .rd-navbar-nav-wrap {
        float: none;
        /* IMPORTANT: Remove float */
        display: flex;
        justify-content: center;
        width: 100%;
        order: 2;
        /* Menu comes after logo */
        padding-top: 10px;
        padding-bottom: 10px;
        border-top: 1px solid #e5e5e5;
        /* Add a separator line */
    }

    /* Top panel (contacts) alignment */
    .rd-navbar-static .rd-navbar-top-panel {
        width: 100%;
    }
}


/* ======================================= */
/*  2. "Our Institutions" Section Styles   */
/* ======================================= */

.institutions-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* 1 column on mobile */
    gap: 30px;
}

.institution-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: left;
    color: #2d2e2e;
    /* From template's h tag color */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 180px;
}

.institution-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: #b80924;
    /* From template's primary color */
}

.institution-card h3 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    color: #0d2d62;
    /* From template's default color */
    transition: color 0.3s ease;
}

.institution-card:hover h3 {
    color: #b80924;
    /* Primary color on hover */
}

.institution-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    font-weight: 700;
    color: #888888;
    /* From template's body color */
    transition: color 0.3s ease;
}

.institution-card:hover .card-footer {
    color: #b80924;
}

.institution-card .card-footer .icon {
    transition: transform 0.3s ease;
}

.institution-card:hover .card-footer .icon {
    transform: translateX(5px);
}

/* Tablet and Desktop Styles */
@media (min-width: 768px) {
    .institutions-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns */
    }
}

@media (min-width: 992px) {

    /* Center the last item if there are an odd number of cards */
    .institutions-grid a.institution-card:last-child:nth-child(odd) {
        grid-column: span 2;
        max-width: 50%;
        margin-left: auto;
        margin-right: auto;
    }
}


/* ======================================= */
/*  3. Minor Footer Adjustments            */
/* ======================================= */

.page-footer p {
    line-height: 1.7;
}

.page-footer a:hover {
    color: #fff;
    text-decoration: underline;
}