/* ==========================================================================
   Header — Brand bar
   ========================================================================== */

.mgsh-brand-bar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75em 1.5em;
    user-select: none;
    -webkit-user-select: none;
}

.mgsh-brand-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mgsh-brand-bar-logo img {
    max-height: 74px;
    width: auto;
    height: auto;
}

.mgsh-brand-bar-logo a {
    text-decoration: none;
    color: #1e293b;
    font-weight: 700;
    font-size: 1.2em;
}

.mgsh-brand-bar-phone a {
    font-size: 1.25em;
    font-weight: 700;
    color: #1e293b;
    text-decoration: none;
}

/* ==========================================================================
   Trust / guarantee bar
   ========================================================================== */

.mgsh-trust-bar {
    background: #1e40af;
    color: #fff;
    text-align: center;
    padding: 0.65em 1em;
    margin-bottom: 12px;
    font-size: 0.85em;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.mgsh-trust-bar-sep {
    margin: 0 0.6em;
    opacity: 0.5;
}

@media (max-width: 600px) {
    .mgsh-trust-bar {
        font-size: 0.7em;
        padding: 0.4em 0.5em;
    }
    .mgsh-trust-bar-sep {
        margin: 0 0.3em;
    }
}

@media (max-width: 380px) {
    .mgsh-trust-bar {
        font-size: 0.62em;
    }
}

.mgsh-brand-bar-phone a:hover {
    color: #2563eb;
}

/* Hide duplicate logo in all Astra header rows (desktop + mobile) */
#masthead .site-branding {
    display: none !important;
}

/* Hide Astra's default mobile header — we replace it */
#ast-mobile-header .ast-mobile-header-bar {
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
    visibility: hidden !important;
}
/* Collapse the desktop nav bar on mobile but keep toggle functional inside */
#ast-mobile-header > .ast-main-header-wrap {
    height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

/* Prevent Astra mobile-header wrapper from clipping sticky content */
#ast-mobile-header {
    overflow: visible !important;
}

/* Sticky mobile header — #masthead is direct child of #page (full page height) */
#masthead {
    position: sticky;
    top: 0;
    z-index: 99997;
    overflow: visible;
    pointer-events: none;
}

#masthead .mgsh-brand-bar,
#masthead .mgsh-mobile-header,
#masthead #mgsh-mobile-menu,
#ast-desktop-header {
    pointer-events: auto;
}

/* Small gap between sticky header and page content on mobile */
#masthead + #content {
    padding-top: 0.75em;
}

/* Responsive — tablets */
@media (max-width: 768px) {
    .mgsh-brand-bar-logo img {
        max-height: 48px;
    }

    .mgsh-brand-bar-phone a {
        font-size: 1.05em;
    }
}

/* Responsive — phones */
@media (max-width: 480px) {
    .mgsh-brand-bar-inner {
        flex-direction: column;
        gap: 0.4em;
        text-align: center;
    }

    .mgsh-brand-bar-logo img {
        max-height: 44px;
    }

    .mgsh-brand-bar-phone a {
        font-size: 1em;
    }
}

/* ==========================================================================
   Mobile header
   ========================================================================== */

.mgsh-mobile-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75em 1.5em;
    user-select: none;
    -webkit-user-select: none;
}

.mgsh-mobile-header-logo {
    text-align: center;
    margin-bottom: 0.5em;
}

.mgsh-mobile-header-logo img {
    max-height: 48px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.mgsh-mobile-header-logo a {
    text-decoration: none;
    color: #1e293b;
    font-weight: 700;
    font-size: 1.2em;
}

.mgsh-mobile-header-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mgsh-mobile-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.4em;
    background: none;
    border: none;
    padding: 0.5em 1em;
    font-size: 1em;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.mgsh-mobile-menu-toggle:hover {
    color: #2563eb;
}

.mgsh-mobile-menu-toggle:focus,
.mgsh-mobile-menu-toggle:active {
    outline: none;
    background: none;
    color: #1e293b;
}

.mgsh-mobile-header-phone {
    font-size: 1.05em;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.4em 0.8em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
}

.mgsh-mobile-header-phone:hover {
    color: #1d4ed8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   Mobile menu panel
   ========================================================================== */

#mgsh-mobile-menu {
    position: fixed;
    left: 0;
    right: 0;
    background: #fff;
    z-index: 99999;
    max-height: 0;
    visibility: hidden;
    overflow: hidden;
    transition: max-height 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#mgsh-mobile-menu.mgsh-mobile-menu--open {
    max-height: 80vh;
    visibility: visible;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mgsh-mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mgsh-mobile-menu-list li {
    position: relative;
    border-bottom: 1px solid #f1f5f9;
}

.mgsh-mobile-menu-list li:last-child {
    border-bottom: none;
}

.mgsh-mobile-menu-list li a {
    display: block;
    padding: 0.85em 1.5em;
    color: #1e293b;
    text-decoration: none;
    font-size: 1em;
}

.mgsh-mobile-menu-list li a:hover,
.mgsh-mobile-menu-list li a:focus {
    color: #2E7D32;
    background: #f8fafc;
}

.mgsh-mobile-menu-list .current-menu-item > a,
.mgsh-mobile-menu-list .current-menu-ancestor > a {
    color: #2E7D32;
    font-weight: 700;
}

/* Submenu toggle chevron */
.mgsh-mobile-submenu-toggle {
    position: absolute;
    right: 0.5em;
    top: 0;
    height: 48px;
    width: 3em;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none !important;
    border: none !important;
    border-left: 1px solid #f1f5f9 !important;
    cursor: pointer;
    color: #64748b;
    transition: color 0.2s ease;
}

.mgsh-mobile-submenu-toggle:hover {
    color: #2E7D32;
}

.mgsh-mobile-submenu-toggle svg {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    transition: transform 0.3s ease;
}

.mgsh-mobile-submenu--open > .mgsh-mobile-submenu-toggle svg {
    transform: rotate(180deg);
}

/* Sub-menu (children) */
.mgsh-mobile-menu-list .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f8fafc;
}

.mgsh-mobile-submenu--open > .sub-menu {
    max-height: 600px;
}

.mgsh-mobile-menu-list .sub-menu li a {
    padding-left: 2.5em;
    font-size: 0.95em;
    color: #475569;
}

.mgsh-mobile-menu-list .sub-menu li a:hover,
.mgsh-mobile-menu-list .sub-menu li a:focus {
    color: #2E7D32;
}

/* Hide Astra's injected toggle buttons inside our menu */
#mgsh-mobile-menu .ast-menu-toggle {
    display: none !important;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.mgft-footer {
    background: #1e293b;
    color: #cbd5e1;
    padding: 2.5em 1.5em;
}

.mgft-footer-inner {
    max-width: 960px;
    margin: 0 auto;
}

.mgft-footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2em;
    margin-bottom: 2em;
}

.mgft-footer-col-heading {
    font-size: 1.05em;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.85em;
}

.mgft-footer-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mgft-footer-nav li {
    margin-bottom: 0.4em;
}

.mgft-footer-nav a {
    color: #93c5fd;
    text-decoration: none;
    font-size: 0.9em;
}

.mgft-footer-nav a:hover {
    text-decoration: underline;
    color: #bfdbfe;
}

.mgft-footer-brand {
    font-size: 1.2em;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.4em;
}

.mgft-footer-address {
    font-size: 0.9em;
    margin-bottom: 0.75em;
}

.mgft-footer-phones {
    margin-bottom: 0;
}

.mgft-footer-phone-primary {
    font-size: 1.15em;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.mgft-footer-phone-primary:hover {
    text-decoration: underline;
    color: #93c5fd;
}

.mgft-footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 1.25em;
    text-align: center;
}

.mgft-footer-links {
    margin-bottom: 0.5em;
    font-size: 0.9em;
}

.mgft-footer-links a {
    color: #93c5fd;
    text-decoration: none;
}

.mgft-footer-links a:hover {
    text-decoration: underline;
}

.mgft-footer-sep {
    margin: 0 0.5em;
    color: #94a3b8;
}

.mgft-footer-copyright {
    font-size: 0.85em;
    color: #94a3b8;
}

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

@media (max-width: 480px) {
    .mgft-footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5em;
    }
}

/* ==========================================================================
   Blog listing — clean date + title rows
   ========================================================================== */

.wp-block-post-template .wp-block-post {
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75em 0;
}

.wp-block-post-template .wp-block-post:last-child {
    border-bottom: none;
}

.wp-block-post-template .wp-block-post-title {
    font-size: 1.05em;
    font-weight: 400;
    margin: 0;
}

.wp-block-post-template .wp-block-post-title a {
    text-decoration: none;
}

.wp-block-post-template .wp-block-post-title a:hover {
    text-decoration: underline;
}

.wp-block-post-template .wp-block-post-date {
    color: #6b7280;
    font-size: 0.85em;
    margin: 0;
}

.wp-block-post-template .wp-block-post-excerpt {
    display: none;
}

/* ==========================================================================
   Homepage
   ========================================================================== */

.entry-content a[href^="tel:"] {
    color: #2563eb;
    text-decoration: none;
}

.entry-content a[href^="tel:"]:hover {
    text-decoration: underline;
}

.wp-block-columns .wp-block-heading a {
    color: #1e293b;
    text-decoration: none;
}

.wp-block-columns .wp-block-heading a:hover {
    color: #2563eb;
}

.mg-blurb {
    background: #fff;
    padding: 1.5em;
    box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16), 0 2px 10px 0 rgba(0,0,0,0.12);
    border-radius: 4px;
}

/* ==========================================================================
   Services directory — card grid
   ========================================================================== */

.mg-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 1.5em;
}

.mg-service-card {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16), 0 2px 10px 0 rgba(0,0,0,0.12);
    overflow: hidden;
    text-decoration: none;
    color: #1e293b;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: block;
}

.mg-service-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px 0 rgba(0,0,0,0.2), 0 4px 20px 0 rgba(0,0,0,0.15);
}

.mg-service-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.mg-service-card-title {
    padding: 1em;
    text-align: center;
    font-weight: 600;
    font-size: 1.05em;
}

.mg-service-card:hover .mg-service-card-title {
    color: #2563eb;
}

.mg-service-card--no-image .mg-service-card-title {
    padding: 2.5em 1em;
}

@media (max-width: 768px) {
    .mg-services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .mg-services-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Phone CTA shortcode
   ========================================================================== */

.mgsh-phone-cta--inline {
    margin: 0.75em 0 1.5em;
    color: #475569;
    font-size: 1em;
}

.mgsh-phone-cta--inline a {
    color: #2563eb;
    font-weight: 700;
    font-size: 1.15em;
    text-decoration: none;
}

.mgsh-phone-cta--inline a:hover {
    text-decoration: underline;
}

.mgsh-phone-cta--banner {
    text-align: center;
    margin: 2em 0;
    clear: both;
}

.mgsh-phone-cta--banner hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 0;
}

.mgsh-phone-cta--banner h2 {
    font-size: 1.4em;
    margin: 0.75em 0 0.5em;
}

.mgsh-phone-cta--banner p {
    margin: 0 0 0.75em;
}

.mgsh-phone-cta--banner p a {
    color: #2563eb;
    font-weight: 700;
    font-size: 1.25em;
    text-decoration: none;
}

.mgsh-phone-cta--banner p a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .mgsh-phone-cta--inline {
        display: flex;
        flex-direction: column;
        gap: 0.25em;
    }
}

/* ==========================================================================
   Sticky mobile CTA bar
   ========================================================================== */

.mgsh-sticky-cta {
    display: none;
}

@media (max-width: 921px) {
    .mgsh-sticky-cta {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 99996;
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }

    .mgsh-sticky-cta--visible {
        transform: translateY(0);
    }

    .mgsh-sticky-cta a {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.4em;
        padding: 0.9em 1em;
        font-size: 1em;
        font-weight: 700;
        text-decoration: none;
        text-align: center;
    }

    .mgsh-sticky-cta-phone {
        background: #166534;
        color: #fff !important;
    }

    .mgsh-sticky-cta-phone:hover {
        background: #15803d;
        color: #fff !important;
    }

    .mgsh-sticky-cta-phone svg {
        flex-shrink: 0;
    }

    .mgsh-sticky-cta-quote {
        background: #2563eb;
        color: #fff;
    }

    .mgsh-sticky-cta-quote:hover {
        background: #1d4ed8;
        color: #fff;
    }

    /* Prevent content from being hidden behind the sticky bar */
    body:has(.mgsh-sticky-cta--visible) {
        padding-bottom: 4em;
    }

    /* Move scroll-to-top button above the sticky CTA */
    body:has(.mgsh-sticky-cta--visible) #ast-scroll-top {
        bottom: 4.5em;
    }
}

/* ==========================================================================
   Service page — floated thumbnail
   ========================================================================== */

.mg-service-thumb {
    float: right;
    max-width: 350px;
    width: 40%;
    margin: 0 0 1em 1.5em;
    box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16), 0 2px 10px 0 rgba(0,0,0,0.12);
    border-radius: 4px;
    overflow: hidden;
}

.mg-service-thumb img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

@media (max-width: 600px) {
    .mg-service-thumb {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 0 0 1.5em 0;
    }
}
