/* SIMPLE MOBILE FIXES - Direct approach */

/* Mobile Header Fix - Center hamburger menu */
@media (max-width: 767px) {
    /* Header container */
    .page-header {
        width: 100% !important;
        padding: 0.5em 1em !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    /* Header content - proper layout */
    .header-content {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        padding: 0 !important;
    }

    /* Name/heading - left aligned */
    .myname {
        flex: 1 !important;
        text-align: left !important;
        min-width: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    .myname h2, .myname div {
        margin: 0 !important;
        padding: 0 !important;
        text-overflow: ellipsis !important;
        overflow: hidden !important;
        white-space: nowrap !important;
    }

    /* Hamburger menu - CENTERED with proper spacing */
    .nav-toggle {
        display: block !important;
        position: relative !important;
        margin: 0 auto !important;
        padding: 0.5em !important;
        font-size: 1.5em !important;
        border: 2px solid #007bff !important;
        border-radius: 0.3em !important;
        background-color: transparent !important;
        color: #007bff !important;
        z-index: 10 !important;
        flex: 0 0 auto !important;
    }

    /* Logo - right aligned */
    .logo-block {
        flex: 0 0 auto !important;
        margin-left: auto !important;
        padding: 0 !important;
    }

    .logo-block img {
        height: 2.5em !important;
        width: auto !important;
        max-width: 60px !important;
    }
}

/* Very small screens - header adjustments */
@media (max-width: 480px) {
    .page-header {
        padding: 0.5em 0.8em !important;
    }

    .nav-toggle {
        font-size: 1.3em !important;
        padding: 0.4em !important;
    }

    .logo-block img {
        height: 2em !important;
    }
}

/* Tiny screens - header adjustments */
@media (max-width: 360px) {
    .page-header {
        padding: 0.4em 0.6em !important;
    }

    .nav-toggle {
        font-size: 1.2em !important;
        padding: 0.3em !important;
    }

    .logo-block img {
        height: 1.8em !important;
    }
}

/* Dark mode compatibility for header */
body.dark-mode .nav-toggle {
    border-color: #4da6ff !important;
    color: #4da6ff !important;
}

/* Mobile footer: one full-width branding row, one row of links */
@media (max-width: 767px) {
    .page-footer {
        width: 100% !important;
        padding: 0.8em 1em !important;
        box-sizing: border-box !important;
        overflow: visible !important;
        margin: 0 !important;
    }

    .footer-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
        padding: 0 !important;
        gap: 0.45em !important;
        overflow: visible !important;
    }

    .footer-item.footer-name {
        width: 100% !important;
        min-width: 0 !important;
        text-align: center !important;
        display: block !important;
        font-size: 0.9em !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    .footer-links-row {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 0.35em !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        font-size: clamp(0.68rem, 3.1vw, 0.85rem) !important;
    }

    .footer-links-row .footer-item {
        flex: 0 1 auto !important;
        font-size: inherit !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        overflow: visible !important;
        min-width: 0 !important;
        width: auto !important;
        text-align: center !important;
        white-space: nowrap !important;
    }

    .footer-content > .footer-item.footer-name {
        text-align: center !important;
    }

    .footer-item.footer-name .footer-link {
        display: inline !important;
        text-align: center !important;
        line-height: 1.35 !important;
    }

    .footer-item.footer-name .footer-link > span {
        display: inline !important;
        width: auto !important;
        white-space: normal !important;
    }

    .footer-author {
        font-weight: bold !important;
        font-size: 1em !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1.2 !important;
    }

    .footer-subtitle {
        font-size: 0.8em !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1.2 !important;
        opacity: 0.85 !important;
    }

    .footer-link {
        color: #007bff !important;
        text-decoration: none !important;
        display: inline !important;
        white-space: nowrap !important;
        overflow: visible !important;
    }
}

/* Very small screens - adjust spacing */
@media (max-width: 480px) {
    .page-footer {
        padding: 0.6em 0.8em !important;
    }

    .footer-content {
        gap: 0.4em !important;
    }

    .footer-item.footer-name,
    .footer-links-row .footer-item {
        font-size: 0.85em !important;
    }

    .footer-author {
        font-size: 0.9em !important;
    }

    .footer-subtitle {
        font-size: 0.7em !important;
    }

    .footer-item.footer-name {
        min-width: 0 !important;
    }
}

/* Tiny screens - minimal spacing */
@media (max-width: 360px) {
    .page-footer {
        padding: 0.5em 0.6em !important;
    }

    .footer-content {
        gap: 0.3em !important;
    }

    .footer-item.footer-name,
    .footer-links-row .footer-item {
        font-size: 0.8em !important;
    }

    .footer-author {
        font-size: 0.85em !important;
    }

    .footer-subtitle {
        font-size: 0.65em !important;
    }

    .footer-item.footer-name {
        min-width: 0 !important;
    }

    .footer-links-row .footer-item {
        min-width: 0 !important;
    }
}

/* Dark mode compatibility */
body.dark-mode .footer-link {
    color: #4da6ff !important;
}