/* Desktop: keep your current right-aligned dropdowns */
@media (min-width: 992px) {
    .navbar-nav .dropdown-menu {
        right: 0;
        left: auto;
    }
}

/* Mobile/tablet: let dropdowns flow normally so they don't overflow */
@media (max-width: 991.98px) {
    .navbar-nav .dropdown-menu {
        right: auto;
        left: 0;
        position: static;
        float: none;
    }
}

/* Header: scale logo and headings down on small screens */
.header-logo {
    max-width: 320px;
    height: auto;
}

header h1 {
    font-size: 2rem;
    margin-top: .5rem;
}

header h2 {
    font-size: 1.1rem;
    color: #6c757d;
}

@media (max-width: 575.98px) {
    .header-logo {
        max-width: 200px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    header h2 {
        font-size: .95rem;
    }
}

/* Search bar: stack controls on phones */
.search-bar {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-bar select,
.search-bar button {
    height: 38px;
}

@media (max-width: 575.98px) {
    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-bar select,
    .search-bar button {
        width: 100%;
    }
}

/* Resource blocks: add card-like spacing that breathes on mobile */
.topic-block.resource {
    padding: 1.25rem;
    border: 1px solid #e9ecef;
    border-radius: .5rem;
    margin-bottom: 1rem;
    background: #fff;
}

.topic-block.resource h2 {
    font-size: 1.25rem;
}

.topic-block.resource h3 {
    font-size: 1rem;
}

/* Make any images scale nicely */
img,
svg {
    max-width: 100%;
    height: auto;
}

/* Footer: turn into stacked columns on phones */
.footer-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    align-items: start;
    padding: 2rem 1rem;
    background: #0b2239;
    /* or your brand color */
    color: #fff;
}

.footer-container a {
    color: #cfe2ff;
}

.footer-section p,
.footer-connect p {
    margin: 0 0 .25rem;
}

@media (max-width: 991.98px) {
    .footer-container {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 575.98px) {
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-logo img {
        margin: 0 auto;
        max-width: 200px;
    }
}

/* Make header content responsive */
.header-logo {
    max-height: 60px;
    height: auto;
}

.uoe-logo {
    max-height: 60px;
    height: auto;
}

@media (max-width: 575.98px) {
    header .d-flex {
        flex-direction: column;
        text-align: center;
    }

    .header-logo {
        max-height: 50px;
        margin-bottom: .5rem;
    }

    .uoe-logo {
        max-height: 50px;
        margin-top: .75rem;
    }

    header h1 {
        font-size: 1.3rem;
        margin-top: .25rem;
    }

    header h2 {
        font-size: .9rem;
    }
}

/* Keep dropdown fix only for desktop; let mobile flow naturally */
@media (min-width: 992px) {
    .navbar-nav .dropdown-menu {
        right: 0;
        left: auto;
    }
}

@media (max-width: 991.98px) {
    .navbar-nav .dropdown-menu {
        position: static;
        float: none;
        left: 0;
        right: auto;
    }
}

/* Ensure any SVGs shrink properly */
img,
svg {
    max-width: 100%;
    height: auto;
}

/* Optional: give navbar a brand background so the toggler is visible */
.navbar-crc {
    background-color: #0b2239;
}

/* Footer links row: wrap and center on mobile */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1rem;
    justify-content: center;
    padding: .75rem 1rem;
    background: #061629;
}

.footer-links a {
    color: #cfe2ff;
}

header {
    text-align: center;
    /* Center everything on mobile */
    padding: 10px;
}

header img {
    max-width: 120px;
    /* Keeps logo nicely scaled */
    height: auto;
    margin-bottom: 10px;
}

header h1 {
    margin: 5px 0;
}

header h2 {
    margin: 0;
    color: #666;
    /* Subtle text-muted effect */
    font-size: 1.2rem;
}