/* ════════════════════════════════════════════════════════
   Metro Detroit Home Inspections — layout.css
   Header · Navigation · Footer · Breakpoints
   ════════════════════════════════════════════════════════ */

/* ── Top Info Bar ── */
.mdhi-top-bar {
    background: var(--mdhi-navy-soft);
    color: rgba(255,255,255,.85);
    font-size: .8125rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(200,155,60,.3);
}
.mdhi-top-bar__inner {
    max-width: var(--mdhi-max-w);
    margin: 0 auto;
    padding: .4375rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.mdhi-top-bar__badge {
    background: var(--mdhi-gold);
    color: var(--mdhi-navy);
    font-weight: 700;
    padding: .25rem .875rem;
    border-radius: 100px;
    text-decoration: none;
    font-size: .8rem;
    white-space: nowrap;
    transition: background .12s;
}
.mdhi-top-bar__badge:hover { background: var(--mdhi-gold-dark); color: var(--mdhi-navy); }

/* ── Site Header ── */
.site-header {
    background: var(--mdhi-navy);
    border-bottom: 3px solid var(--mdhi-gold);
    position: sticky;
    top: 0;
    z-index: 9000;
    box-shadow: 0 2px 16px rgba(26,39,68,.45);
}
.admin-bar .site-header { top: 32px; }

.mdhi-header-inner {
    max-width: var(--mdhi-max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 72px;
    flex-wrap: nowrap; /* CRITICAL — never wrap on desktop */
}

/* ── Site Branding ── */
.mdhi-title-link {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}
.mdhi-site-title {
    font-size: 1.1875rem;
    font-weight: 800;
    color: var(--mdhi-white);
    letter-spacing: -.01em;
    white-space: nowrap;
}
.mdhi-site-title span { color: var(--mdhi-gold); }
.mdhi-site-tagline {
    font-size: .7rem;
    font-weight: 500;
    color: rgba(255,255,255,.6);
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}
.site-branding .custom-logo { max-height: 56px; width: auto; }

/* ── Primary Nav ── */
#primary-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    flex-wrap: nowrap; /* CRITICAL — all items on one row */
    gap: 0;
}
#primary-menu > li {
    position: relative;
    flex-shrink: 0;
}
#primary-menu > li > a {
    display: block;
    padding: .5rem .75rem;
    color: rgba(255,255,255,.88);
    font-weight: 600;
    font-size: .875rem;
    text-decoration: none;
    border-radius: var(--mdhi-radius);
    transition: background .12s, color .12s;
    white-space: nowrap;
}
#primary-menu > li > a:hover,
#primary-menu > li.current-menu-item > a,
#primary-menu > li.current-menu-ancestor > a {
    background: rgba(200,155,60,.18);
    color: var(--mdhi-gold-light);
}

/* ── Dropdown ── */
#primary-menu .sub-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 99999;
    background: var(--mdhi-navy-soft);
    border: 1px solid rgba(200,155,60,.25);
    border-top: 3px solid var(--mdhi-gold);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 32px rgba(26,39,68,.55);
    min-width: 260px;
    list-style: none;
    padding: .5rem 0;
}
#primary-menu li:hover > .sub-menu,
#primary-menu li:focus-within > .sub-menu { display: block; }
#primary-menu .sub-menu li a {
    display: block;
    padding: .625rem 1.25rem;
    color: rgba(255,255,255,.82);
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .1s, color .1s;
    border-left: 3px solid transparent;
}
#primary-menu .sub-menu li a:hover {
    background: rgba(200,155,60,.15);
    color: var(--mdhi-gold-light);
    border-left-color: var(--mdhi-gold);
}

/* Services parent arrow indicator */
#primary-menu > li.menu-item-has-children > a::after {
    content: ' ▾';
    font-size: .7em;
    opacity: .7;
}

/* ── Header CTA ── */
.mdhi-header-cta a {
    display: inline-block;
    background: var(--mdhi-gold);
    color: var(--mdhi-navy);
    font-weight: 700;
    font-size: .875rem;
    padding: .5625rem 1.25rem;
    border-radius: var(--mdhi-radius);
    text-decoration: none;
    white-space: nowrap;
    transition: background .12s, box-shadow .12s;
    letter-spacing: .01em;
}
.mdhi-header-cta a:hover {
    background: var(--mdhi-gold-dark);
    color: var(--mdhi-navy);
    box-shadow: 0 2px 8px rgba(200,155,60,.4);
}

/* ── Hamburger Toggle ── */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: var(--mdhi-radius);
    cursor: pointer;
    padding: .5rem .625rem;
    width: 44px;
    height: 44px;
}
.menu-toggle__bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--mdhi-white);
    border-radius: 2px;
    transition: transform .2s, opacity .2s;
}
.menu-toggle.is-open .menu-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.is-open .menu-toggle__bar:nth-child(2) { opacity: 0; }
.menu-toggle.is-open .menu-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Breakpoints ── */
/* 1100px: tighten nav before hamburger */
@media (max-width: 1100px) and (min-width: 921px) {
    #primary-menu > li > a { padding: .5rem .55rem; font-size: .82rem; }
    .mdhi-header-cta a    { padding: .5rem .875rem; font-size: .82rem; }
    .mdhi-site-title      { font-size: 1rem; }
}

/* 920px: hamburger menu */
@media (max-width: 920px) {
    .menu-toggle       { display: flex; }
    .mdhi-header-cta   { display: none; }
    .main-navigation   { flex: none; margin-left: auto; position: static; }
    .mdhi-top-bar      { display: none; }

    #primary-menu {
        display: none;
        flex-direction: column;
        align-items: stretch;
        position: fixed;             /* viewport-attached — cannot be clipped */
        top: 72px;
        left: 0;
        right: 0;
        width: 100%;
        background: var(--mdhi-navy-soft);
        border-top: 3px solid var(--mdhi-gold);
        box-shadow: 0 8px 24px rgba(26,39,68,.6);
        z-index: 99998;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        flex-wrap: wrap;
    }
    #primary-menu.is-open { display: flex; }

    #primary-menu > li > a {
        padding: .875rem 1.25rem;
        border-radius: 0;
        border-bottom: 1px solid rgba(255,255,255,.08);
        font-size: .9375rem;
    }
    #primary-menu > li.menu-item-has-children > a::after { content: ' ▾'; }

    /* Mobile sub-menu: static inline */
    #primary-menu .sub-menu {
        display: none;
        position: static;
        box-shadow: none;
        border: none;
        border-top: none;
        z-index: auto;
        background: rgba(0,0,0,.2);
        border-radius: 0;
        min-width: 0;
        padding: 0;
    }
    #primary-menu li.is-open > .sub-menu { display: block; }
    #primary-menu li:hover > .sub-menu   { display: none; } /* disable hover on mobile */

    #primary-menu .sub-menu li a {
        padding-left: 2rem;
        font-size: .875rem;
        border-left: 3px solid transparent;
    }
}

/* ══════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════ */

/* ── Footer CTA Band ── */
.mdhi-footer-cta {
    background: var(--mdhi-navy);
    border-top: 4px solid var(--mdhi-gold);
    padding: 3.5rem 1.5rem;
    text-align: center;
}
.mdhi-footer-cta__inner {
    max-width: 800px;
    margin: 0 auto;
}
.mdhi-footer-cta h2 {
    color: var(--mdhi-white);
    font-size: clamp(1.375rem, 3vw, 2rem);
    margin-bottom: .75rem;
}
.mdhi-footer-cta p {
    color: rgba(255,255,255,.78);
    font-size: 1.0625rem;
    margin-bottom: 2rem;
}
.mdhi-btn-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Footer Body Grid ── */
.mdhi-footer-body {
    background: #111827;
    padding: 3.5rem 1.5rem 2rem;
}
.mdhi-footer-grid {
    max-width: var(--mdhi-max-w);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 1.75fr;
    gap: 2.5rem;
}
.mdhi-footer-col h4 {
    color: var(--mdhi-gold);
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 1.125rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid rgba(200,155,60,.2);
}
.mdhi-footer-col p,
.mdhi-footer-col address { color: rgba(255,255,255,.65); font-size: .875rem; line-height: 1.75; font-style: normal; }
.mdhi-footer-col ul { list-style: none; margin: 0; padding: 0; }
.mdhi-footer-col ul li { margin-bottom: .375rem; }
.mdhi-footer-col ul li a {
    color: rgba(255,255,255,.65);
    text-decoration: none;
    font-size: .875rem;
    transition: color .12s;
}
.mdhi-footer-col ul li a:hover { color: var(--mdhi-gold-light); }
.mdhi-footer-col ul li a::before { content: '› '; color: var(--mdhi-gold); opacity: .7; }
.mdhi-footer-brand p { color: rgba(255,255,255,.6); font-size: .875rem; line-height: 1.75; margin-bottom: 1rem; }
.mdhi-footer-brand-name { font-size: 1rem; font-weight: 700; color: var(--mdhi-white); margin-bottom: .5rem; }
.mdhi-footer-brand-name span { color: var(--mdhi-gold); }
.mdhi-footer-hours { color: rgba(255,255,255,.65); font-size: .8125rem; margin-top: .75rem; line-height: 1.7; }
.mdhi-footer-phone a {
    display: inline-block;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--mdhi-gold);
    text-decoration: none;
    margin-bottom: .375rem;
}
.mdhi-footer-phone a:hover { color: var(--mdhi-gold-light); }

/* ── Copyright Bar ── */
.mdhi-footer-bar {
    background: #0d1320;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,.06);
}
.mdhi-footer-bar__inner {
    max-width: var(--mdhi-max-w);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: .8125rem;
    color: rgba(255,255,255,.45);
}
.mdhi-footer-bar__inner a {
    color: rgba(255,255,255,.45);
    text-decoration: none;
    transition: color .12s;
}
.mdhi-footer-bar__inner a:hover { color: var(--mdhi-gold-light); }

/* ── Footer Responsive ── */
@media (max-width: 920px) {
    .mdhi-footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 600px) {
    .mdhi-footer-grid { grid-template-columns: 1fr; gap: 1.75rem; }
    .mdhi-footer-cta  { padding: 2.5rem 1.25rem; }
    .mdhi-footer-body { padding: 2.5rem 1.25rem 1.5rem; }
}
