/* Responsive containment and accessible target sizing. */

/* The homepage is itself #content. The generic centered 1200px shell caused
   its fixed 130px rail to overlap content at common laptop widths. */
#content.ph-home {
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-right: 0;
    padding-bottom: 0;
    padding-left: 154px;
}

/* WordPress retains legacy width attributes on editor-authored media. */
body.single-market-report .phoenix-center-content figure,
body.single-market-report .phoenix-center-content .wp-caption,
body.single-market-report .phoenix-center-content figcaption,
body.single-market-report .phoenix-center-content img,
body.single-market-report .phoenix-center-content iframe,
body.single-market-report .phoenix-center-content video,
.phoenix-segment .phi-content figure,
.phoenix-segment .phi-content .wp-caption,
.phoenix-segment .phi-content figcaption,
.phoenix-segment .phi-content img,
.phoenix-segment .phi-content iframe,
.phoenix-segment .phi-content video {
    max-width: 100% !important;
}

body.single-market-report .phoenix-center-content figure.wp-caption,
body.single-market-report .phoenix-center-content figcaption.wp-caption-text,
.phoenix-segment .phi-content figure.wp-caption,
.phoenix-segment .phi-content figcaption.wp-caption-text {
    width: 100% !important;
}

body.single-market-report .phoenix-center-content table,
.phoenix-segment .phi-content table {
    display: block;
    width: 100% !important;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

body.single-market-report .phoenix-center-content p,
body.single-market-report .phoenix-center-content li,
body.single-market-report .phoenix-center-content strong,
.phoenix-segment .phi-content p,
.phoenix-segment .phi-content li,
.phoenix-segment .phi-content strong {
    overflow-wrap: anywhere;
}

/* Some legacy table descendants retain cell widths/padding that protrude from
   their scroll container. Bound that paint overflow at the content column. */
body.single-market-report .phoenix-center-content {
    max-width: 100% !important;
    overflow-x: hidden;
}

.phoenix-footer a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
}

.phoenix-panel-close {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1100px) {
    #content.ph-home { padding-left: 0; }
    .phoenix-nav { display: none !important; }
    .phoenix-hamburger {
        display: flex !important;
        margin-left: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    .phoenix-mobile-menu { max-width: 100vw; }
    .phoenix-mega-menu { display: none !important; }
}

/* Extend the existing mobile-header architecture through the range where the
   desktop mega menu cannot reflow at enlarged browser zoom. */
@media (min-width: 901px) and (max-width: 1100px) {
    .phoenix-header-inner {
        width: 100%;
        max-width: 100%;
        height: 68px;
        padding: 0 20px;
        gap: 16px;
        justify-content: flex-start;
    }
    .phoenix-logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
    .phoenix-logo img { height: 38px; }
    .ph-theme-toggle {
        order: 0 !important;
        width: 36px;
        height: 36px;
    }
    .phoenix-hamburger {
        flex-direction: column;
        gap: 5px;
        padding: 10px;
        background: none;
        border: 0;
    }
    .phoenix-hamburger span {
        display: block !important;
        width: 24px !important;
        height: 2px;
        background: var(--ph-text) !important;
    }
    body.mobile-menu-open .phoenix-hamburger span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    body.mobile-menu-open .phoenix-hamburger span:nth-child(2) { opacity: 0; }
    body.mobile-menu-open .phoenix-hamburger span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
    .phoenix-mobile-menu {
        display: block !important;
        position: fixed;
        top: 100%;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1300;
        padding: 24px 24px 40px;
        overflow-y: auto;
        background: var(--ph-surface);
        border-top: 1px solid var(--ph-border);
        transition: top .3s ease;
    }
    body.mobile-menu-open .phoenix-mobile-menu { top: 68px; }
    .phoenix-mobile-nav > a,
    .mobile-submenu-toggle {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        padding: 18px 4px;
        color: var(--ph-text);
        background: none;
        border: 0;
        border-bottom: 1px solid var(--ph-border);
        font-size: 16px;
        text-align: left;
    }
    .mobile-submenu { display: none; }
    .mobile-nav-item.open .mobile-submenu {
        display: block;
        max-height: 62vh;
        overflow: auto;
    }
}

@media (max-width: 768px) {
    body.single-market-report .phoenix-left-nav { max-width: 100%; }
    body.single-market-report .phoenix-left-nav ul {
        width: max-content;
        min-width: 100%;
    }
    body.single-market-report .phoenix-sidebar-cta {
        width: 100vw;
        max-width: 100vw;
    }
    body.single-market-report .phoenix-sidebar-cta .sidebar-button { min-width: 0; }
}

@media (max-width: 640px) {
    #phoenix-segment-panel {
        width: 100vw;
        max-width: 100vw;
    }
}
