/* 02-layout.css: page shell, container, sections, header, nav, banners,
   footer, sticky mobile call bar. Structure only; component skins live in
   03-components.css. */

.site-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--white);
}

.site-main {
    flex: 1 0 auto;
    /* No bottom clearance here. The footer, not main, is the last element on the
       page, so .site-footer's margin-bottom is what clears the fixed mobile call
       bar. Reserving the space in both places left a dead 64px band above the
       footer on phones. */
}

@media (min-width: 900px) {
    .site-main {
        padding-bottom: 0;
    }
}

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding-left: var(--section-px);
    padding-right: var(--section-px);
}

.container-narrow {
    max-width: 820px;
}

@media (min-width: 768px) {
    .container {
        padding-left: 32px;
        padding-right: 32px;
    }
}

.section {
    padding: 44px 0;
}

@media (min-width: 768px) {
    .section {
        padding: 64px 0;
    }
}

.section-tight {
    padding: 28px 0;
}

.section-alt {
    background: var(--off-white);
}

.section-warm {
    background: var(--earth-100);
}

.section-dark {
    background: var(--ink-900);
    color: var(--white);
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4 {
    color: var(--white);
}

.section-dark p {
    color: var(--stone-200);
}

.section-dark a {
    color: var(--leaf-300);
}

.section-dark .section-heading::after {
    background: var(--leaf-500);
}

/* ---------- header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: var(--white);
    border-bottom: 1px solid var(--stone-200);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 72px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink-900);
    flex: 0 1 auto;
    min-width: 0;
}

.site-logo:hover {
    text-decoration: none;
}

.site-logo-img {
    height: 48px;
    width: auto;
    flex: 0 0 auto;
}

.site-logo-text {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 1.05rem;
    line-height: 1.1;
    color: var(--ink-900);
    display: none;
}

@media (min-width: 480px) {
    .site-logo-text {
        display: block;
    }
}

.site-logo-text strong {
    display: block;
    font-weight: 400;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    color: var(--bark-600);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-phone {
    display: none;
    align-items: center;
    gap: 8px;
    color: var(--ink-900);
    line-height: 1.15;
}

.header-phone:hover {
    text-decoration: none;
    color: var(--green-800);
}

.header-phone-icon {
    color: var(--leaf-500);
    flex: 0 0 auto;
}

.header-phone-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--stone-600);
}

.header-phone-number {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
}

@media (min-width: 700px) {
    .header-phone {
        display: inline-flex;
    }
}

.header-cta {
    display: none;
}

@media (min-width: 1000px) {
    .header-cta {
        display: inline-flex;
    }
}

/* ---------- primary nav ---------- */

.site-nav {
    border-top: 1px solid var(--stone-200);
    background: var(--white);
    display: none;
}

.site-nav-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 22px;
    padding-top: 2px;
    padding-bottom: 2px;
}

.site-nav-inner a {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--ink-900);
    padding: 12px 0;
    min-height: var(--tap);
    display: inline-flex;
    align-items: center;
    border-bottom: 2px solid transparent;
}

.site-nav-inner a:hover {
    color: var(--green-800);
    border-bottom-color: var(--leaf-500);
    text-decoration: none;
}

@media (min-width: 900px) {
    .site-nav {
        display: block;
    }
}

/* Mobile nav: a details element so it works before the circuit connects. */
.nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--tap);
    min-width: var(--tap);
    padding: 0 12px;
    border: 2px solid var(--stone-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--ink-900);
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.85rem;
    cursor: pointer;
    list-style: none;
}

.nav-toggle::-webkit-details-marker {
    display: none;
}

.mobile-nav {
    border-top: 1px solid var(--stone-200);
}

.mobile-nav[open] .nav-toggle {
    border-color: var(--green-700);
}

.mobile-nav-panel {
    background: var(--white);
    border-top: 1px solid var(--stone-200);
    padding: 8px 0 16px;
}

.mobile-nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 16px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-links a {
    display: flex;
    align-items: center;
    min-height: var(--tap);
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.95rem;
    color: var(--ink-900);
    border-bottom: 1px solid var(--stone-200);
}

@media (min-width: 900px) {
    .mobile-nav {
        display: none;
    }
}

/* ---------- footer ---------- */

.site-footer {
    background: var(--ink-900);
    color: var(--stone-200);
    /* The logo's trunk-into-ground band. */
    border-top: 12px solid var(--bark-800);
    margin-bottom: calc(var(--call-bar-height) + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 900px) {
    .site-footer {
        margin-bottom: 0;
    }
}

/* NOTE: this class sits on a .container element, so it must never use a
   padding shorthand: that would wipe the container's horizontal gutter. */
.footer-top {
    padding-top: 40px;
    padding-bottom: 28px;
}

.footer-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
}

@media (min-width: 640px) {
    .footer-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1000px) {
    .footer-columns {
        grid-template-columns: 1.4fr 1fr 1fr 1fr;
        gap: 36px;
    }
}

.footer-logo {
    height: 54px;
    width: auto;
    margin-bottom: 14px;
}

.footer-heading {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.9rem;
    color: var(--white);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--bark-600);
}

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

.footer-links li {
    margin-bottom: 2px;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    color: var(--stone-200);
    font-size: 0.94rem;
}

.footer-links a:hover {
    color: var(--leaf-300);
}

/* Links in footer prose need the dark-surface color, not the on-white green. */
.site-footer a {
    color: var(--leaf-300);
}

.footer-nap {
    font-style: normal;
    color: var(--stone-200);
    font-size: 0.96rem;
    line-height: 1.7;
}

.footer-nap strong {
    color: var(--white);
}

.footer-phone {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--leaf-300);
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
}

.footer-note {
    color: var(--stone-500);
    font-size: 0.86rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .12);
    padding: 18px 0 26px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    align-items: center;
}

.footer-staff-login {
    margin-left: auto;
}

.footer-staff-login,
.footer-bottom a {
    color: var(--stone-500);
}

.footer-bottom a:hover {
    color: var(--leaf-300);
}

/* ---------- sticky mobile call bar ---------- */

.mobile-call-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    background: var(--ink-900);
    border-top: 1px solid rgba(255, 255, 255, .14);
}

@media (min-width: 900px) {
    .mobile-call-bar {
        display: none;
    }
}

.call-bar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: var(--tap);
    padding: 8px 6px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.1;
}

.call-bar-btn:hover {
    text-decoration: none;
}

.call-bar-call {
    background: var(--green-700);
    color: var(--white);
}

.call-bar-emergency {
    background: var(--danger);
    color: var(--white);
}

.call-bar-text {
    background: var(--white);
    color: var(--ink-900);
}

.call-bar-estimate {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

/* ---------- page hero (interior pages) ---------- */

.page-hero {
    background: var(--ink-900);
    color: var(--white);
    padding: 40px 0 36px;
    position: relative;
}

@media (min-width: 768px) {
    .page-hero {
        padding: 60px 0 52px;
    }
}

.page-hero h1,
.page-hero .page-hero-title {
    color: var(--white);
    max-width: 20ch;
}

.page-hero-sub {
    color: var(--stone-200);
    font-size: 1.08rem;
    max-width: 62ch;
    margin-top: 14px;
}

.page-hero-kicker {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.8rem;
    color: var(--leaf-300);
    margin-bottom: 10px;
}

.page-hero-kicker a {
    color: var(--leaf-300);
}

.page-hero-photo {
    position: relative;
    overflow: hidden;
}

.page-hero-photo::before {
    content: "";
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: .34;
}

.page-hero-photo > * {
    position: relative;
}

.hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.hero-ctas-center {
    justify-content: center;
}

/* Generic content grids */
.grid-2,
.grid-3,
.grid-4 {
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 640px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 980px) {
    .grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .grid-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Body + sidebar layout used by service, town and estimate pages. */
.split-main {
    display: grid;
    gap: 32px;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}

@media (min-width: 980px) {
    .split-main {
        grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
        gap: 48px;
    }

    .split-aside-sticky {
        position: sticky;
        /* Clears the sticky header (logo row plus nav row). */
        top: 140px;
    }
}

/* ---------- Blazor reconnect modal ---------- */

#components-reconnect-modal {
    display: none;
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.reconnect-overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 20, 20, .68);
}

.reconnect-card {
    position: relative;
    margin: 18vh auto 0;
    max-width: 360px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 26px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}

.reconnect-logo {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-900);
}

.reconnect-logo strong {
    color: var(--green-800);
}

.reconnect-title {
    margin: 10px 0 6px;
    font-size: 1.2rem;
    text-transform: none;
}

.reconnect-message,
.reconnect-sub {
    font-size: 0.9rem;
    color: var(--stone-700);
}

.reconnect-rejected-msg {
    display: none;
    font-size: 0.9rem;
}
