/* ==========================================================================
   Screen breakpoints
   All width-based @media rules for the theme live here. This file is
   enqueued after style.css (see functions.php) so breakpoint rules always
   override the base rules they adjust.
   ========================================================================== */

/* ---------- Header and post header image (from assets/css/header.css) ---------- */

/* Smaller screens: reduce overlay padding and center text */
@media (max-width: 700px) {
    .post-header-overlay {
        padding: 1rem;
        text-align: center;
    }
    .post-header-image {
        height: clamp(160px, 30vh, 40vh);
    }
    .post-header-image .post-title {
        font-size: clamp(1.25rem, 5vw, 1.6rem);
    }
}

@media (max-width: 420px) {
    .post-header-overlay {
        padding: 0.75rem;
    }
    .post-header-image {
        height: 140px;
    }
}

/* Hide the main menu on small screens and show when toggled (animated)
   Breakpoint: 768px for tablets/phones */
@media (max-width: 768px) {
    .menu-toggle {
        display: inline-block;
    }
    .main-menu {
        /* prepare for animated reveal */
        display: flex;
        flex-direction: column;
        background: var(--background-color);
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        z-index: 999;
        overflow: hidden;
        max-height: 0; /* collapsed */
        opacity: 0;
        transform: translateY(-8px);
        transition: max-height 360ms cubic-bezier(.2,.8,.2,1), opacity 240ms ease, transform 240ms ease;
    }
    .main-menu.open {
        max-height: 1000px; /* large enough to show menu */
        opacity: 1;
        transform: translateY(0);
    }
    .main-menu li {
        margin: 0;
    }
    .main-menu li a {
        padding: 12px 16px;
        border-bottom: 1px solid #eee;
        color: #000;
    }
}

@media (min-width: 769px) {
    .main-menu {
        display: flex !important;
        position: static;
        max-height: none;
        opacity: 1;
        transform: none;
    }
}

/* ---------- Footer (from assets/css/footer.css) ---------- */

@media (max-width: 900px) {
    footer .footer-widgets-area.footer-columns-4,
    footer .footer-widgets-area.footer-columns-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    footer .footer-widgets-area.footer-columns-4,
    footer .footer-widgets-area.footer-columns-3,
    footer .footer-widgets-area.footer-columns-2 {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    footer .footer-secondary {
        flex-direction: column;
        text-align: center;
    }
}

/* ---------- Page layout: content, sidebars, footer container (from style.css) ---------- */

/* Responsive adjustments for mobile/tablet */
@media (max-width: 900px) {
    #site-content {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem 0.5rem;
    }
    #left-sidebar.sidebar,
    #right-sidebar.sidebar {
        max-width: 100vw;
        width: 100%;
        min-width: 0;
        margin-bottom: 1.5rem;
        border-radius: var(--card-radius);
        /* box-shadow removed for non-fullscreen */
    }
    #main {
        padding: 1.5rem 0.5rem;
        min-height: 40vh;
    }
}

@media (max-width: 600px) {
    #site-content {
        padding: 0.5rem 0.25rem;
        gap: 1rem;
    }
    #main {
        padding: 1rem 0.25rem;
    }
    #colophon {
        padding: 1.2rem 0 0.5rem 0;
        margin-top: 1.2rem;
    }
}
