/*
 * Shared header and footer shell for Source Motion Physical Therapy.
 *
 * This stylesheet deliberately uses the `site-shell-` namespace so it can sit
 * alongside page-specific styles without changing their layout rules.
 */

:root {
    --site-shell-brand: var(--brand, #d90429);
    --site-shell-brand-dark: var(--brand-dark, #b70423);
    --site-shell-ink: var(--ink, #2b2d42);
    --site-shell-ink-soft: var(--ink-soft, #4b5563);
    --site-shell-muted: var(--muted, #6c757d);
    --site-shell-surface: var(--surface, #ffffff);
    --site-shell-surface-alt: var(--surface-alt, #f8f9fa);
    --site-shell-line: var(--line, #e5e5e5);
    --site-shell-navy: #0f172a;
    --site-shell-footer: #111111;
    --site-shell-footer-bottom: #080808;
    --site-shell-footer-muted: #a0aec0;
    --site-shell-radius: var(--radius, 4px);
    --site-shell-max-width: 1240px;
    --site-shell-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --site-shell-focus: #d90429;
}

.site-shell-container {
    width: min(calc(100% - 2.5rem), var(--site-shell-max-width));
    margin-inline: auto;
}

.site-shell-header *,
.site-shell-footer * {
    box-sizing: border-box;
}

.site-shell-header a,
.site-shell-footer a {
    color: inherit;
}

.site-shell-header a:focus-visible,
.site-shell-header button:focus-visible,
.site-shell-footer a:focus-visible {
    outline: 3px solid var(--site-shell-focus);
    outline-offset: 3px;
}

/* Header */
.site-shell-utility {
    color: #fff;
    background: var(--site-shell-footer);
    border-bottom: 2px solid var(--site-shell-brand);
    font-size: 0.86rem;
}

.site-shell-utility .site-shell-container,
.site-shell-utility-content {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    min-height: 2.5rem;
    padding-block: 0.2rem;
}

.site-shell-utility a {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

.site-shell-utility a:hover {
    color: #ffb1bf;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.site-shell-top-social {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-shell-top-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    min-height: 1.8rem;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    text-decoration: none;
}

.site-shell-top-social a:hover,
.site-shell-top-social a:focus-visible {
    color: #fff;
    border-color: var(--site-shell-brand);
    background: var(--site-shell-brand);
    text-decoration: none;
}

.site-shell-top-social svg {
    width: 0.84rem;
    height: 0.84rem;
}

.site-shell-header {
    position: sticky;
    z-index: 50;
    top: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--site-shell-ink);
    background: var(--site-shell-surface);
    border-bottom: 1px solid var(--site-shell-line);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.site-shell-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    min-height: 7.25rem;
    padding-block: 0.45rem;
}

.site-shell-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    color: var(--site-shell-ink);
    font-weight: 800;
    line-height: 1.1;
    text-decoration: none;
}

.site-shell-brand:hover { opacity: 0.86; }

.site-shell-brand-logo {
    display: block;
    width: auto;
    height: 5.75rem;
    max-width: none;
    max-height: none;
    object-fit: contain;
}

.site-shell-brand-copy {
    display: grid;
    gap: 0.08rem;
}

.site-shell-brand-name {
    color: var(--site-shell-brand);
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    font-weight: 850;
    letter-spacing: -0.025em;
}

.site-shell-brand-tagline {
    color: var(--site-shell-ink-soft);
    font-size: 0.7rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.site-shell-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.8rem;
    min-height: 2.8rem;
    padding: 0.5rem;
    color: var(--site-shell-ink);
    border: 1px solid var(--site-shell-ink);
    border-radius: var(--site-shell-radius);
    background: var(--site-shell-surface);
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.site-shell-menu-toggle:hover,
.site-shell-menu-toggle[aria-expanded="true"] {
    color: #fff;
    border-color: var(--site-shell-brand);
    background: var(--site-shell-brand);
}

.site-shell-menu-toggle-icon,
.site-shell-menu-toggle-icon::before,
.site-shell-menu-toggle-icon::after {
    display: block;
    width: 1.15rem;
    height: 2px;
    border-radius: 99px;
    background: currentColor;
    content: "";
    transition: transform 160ms ease, opacity 160ms ease;
}

.site-shell-menu-toggle-icon {
    position: relative;
}

.site-shell-menu-toggle-icon::before,
.site-shell-menu-toggle-icon::after {
    position: absolute;
    left: 0;
}

.site-shell-menu-toggle-icon::before { transform: translateY(-0.34rem); }
.site-shell-menu-toggle-icon::after { transform: translateY(0.34rem); }

.site-shell-menu-toggle[aria-expanded="true"] .site-shell-menu-toggle-icon {
    background: transparent;
}

.site-shell-menu-toggle[aria-expanded="true"] .site-shell-menu-toggle-icon::before {
    transform: rotate(45deg);
}

.site-shell-menu-toggle[aria-expanded="true"] .site-shell-menu-toggle-icon::after {
    transform: rotate(-45deg);
}

.site-shell-nav { min-width: 0; }
.site-shell-nav[hidden],
.site-shell-more-menu[hidden] { display: none; }

.site-shell-nav-list,
.site-shell-more-menu,
.site-shell-footer-list,
.site-shell-footer-social {
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-shell-nav-list {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.12rem;
}

.site-shell-nav-item,
.site-shell-more { position: relative; }

.site-shell-nav-link,
.site-shell-more-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.8rem;
    padding: 0.62rem 0.6rem;
    color: var(--site-shell-ink);
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.site-shell-nav-link::after {
    position: absolute;
    right: 0.6rem;
    bottom: 0.35rem;
    left: 0.6rem;
    height: 2px;
    background: var(--site-shell-brand);
    content: "";
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 180ms ease;
}

.site-shell-nav-link:hover,
.site-shell-nav-link[aria-current="page"],
.site-shell-more-toggle:hover,
.site-shell-more-toggle[aria-expanded="true"] {
    color: var(--site-shell-brand);
}

.site-shell-nav-link:hover::after,
.site-shell-nav-link[aria-current="page"]::after {
    transform: scaleX(1);
}

.site-shell-more-toggle {
    box-shadow: inset 0 -2px 0 transparent;
    transition: box-shadow 180ms ease, color 180ms ease;
}

.site-shell-more-toggle:hover,
.site-shell-more-toggle[aria-expanded="true"] {
    box-shadow: inset 0 -2px 0 var(--site-shell-brand);
}

.site-shell-more-toggle::after {
    width: 0.45rem;
    height: 0.45rem;
    margin: -0.22rem 0 0 0.38rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    content: "";
    transform: rotate(45deg);
    transition: transform 160ms ease;
}

.site-shell-more-toggle[aria-expanded="true"]::after {
    margin-top: 0.18rem;
    transform: rotate(225deg);
}

.site-shell-nav-cta,
.site-shell-footer-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.8rem;
    padding: 0.72rem 1rem;
    color: #fff;
    border: 1px solid var(--site-shell-brand);
    border-radius: var(--site-shell-radius);
    background: var(--site-shell-brand);
    box-shadow: 0 2px 0 rgba(118, 0, 20, 0.18);
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.site-shell-nav-cta { margin-left: 0.45rem; }

.site-shell-nav-cta:hover,
.site-shell-footer-cta:hover {
    color: #fff;
    border-color: var(--site-shell-brand-dark);
    background: var(--site-shell-brand-dark);
    transform: translateY(-1px);
}

.site-shell-more-menu {
    position: absolute;
    z-index: 60;
    top: calc(100% + 0.35rem);
    right: 0;
    display: grid;
    min-width: 15rem;
    padding: 0.45rem;
    background: var(--site-shell-surface);
    border: 1px solid var(--site-shell-line);
    border-top: 3px solid var(--site-shell-brand);
    border-radius: var(--site-shell-radius);
    box-shadow: var(--site-shell-shadow);
}

.site-shell-more-menu a {
    display: block;
    padding: 0.72rem 0.8rem;
    color: var(--site-shell-ink);
    border-radius: 2px;
    font-size: 0.9rem;
    font-weight: 650;
    line-height: 1.25;
    text-decoration: none;
}

.site-shell-more-menu a:hover,
.site-shell-more-menu a:focus-visible,
.site-shell-more-menu a[aria-current="page"] {
    color: var(--site-shell-brand);
    background: #fff1f4;
}

/* Footer */
.site-shell-footer {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--site-shell-footer-muted);
    background: var(--site-shell-footer);
    border-top: 4px solid var(--site-shell-brand);
}

.site-shell-footer-grid {
    display: grid;
    grid-template-columns: minmax(15rem, 1.5fr) repeat(2, minmax(11rem, 1fr));
    gap: clamp(2rem, 4vw, 2.5rem);
    padding: clamp(3rem, 6vw, 4rem) 0 clamp(2.5rem, 5vw, 3.2rem);
}

.site-shell-footer-brand {
    display: inline-flex;
    align-items: center;
    max-width: max-content;
    padding: 0.2rem;
    color: #fff;
    border-radius: var(--site-shell-radius);
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
    font-size: 1.05rem;
    font-weight: 850;
    line-height: 1.15;
    text-decoration: none;
}

.site-shell-footer-brand:hover { opacity: 0.88; }

.site-shell-footer-logo {
    display: block;
    width: auto;
    height: 4.15rem;
    max-width: none;
    max-height: none;
    object-fit: contain;
}

.site-shell-footer-description {
    max-width: 28rem;
    margin: 1rem 0 0;
    color: var(--site-shell-footer-muted);
    font-size: 0.94rem;
    line-height: 1.7;
}

.site-shell-footer-heading {
    display: inline-block;
    margin: 0;
    padding-bottom: 0.42rem;
    color: #fff;
    border-bottom: 2px solid var(--site-shell-brand);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    line-height: 1.25;
    text-transform: uppercase;
}

.site-shell-footer-list {
    display: grid;
    gap: 0.56rem;
    margin-top: 1rem;
}

.site-shell-footer-list a,
.site-shell-footer-contact a {
    color: var(--site-shell-footer-muted);
    font-size: 0.93rem;
    text-decoration: none;
}

.site-shell-footer-list a:hover,
.site-shell-footer-contact a:hover {
    color: var(--site-shell-brand);
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.site-shell-footer-contact {
    display: grid;
    gap: 0.68rem;
    margin: 1rem 0 0;
    padding: 1rem 1.05rem;
    background: var(--site-shell-navy);
    border-top: 2px solid var(--site-shell-brand);
    border-radius: var(--site-shell-radius);
}

.site-shell-footer-contact p {
    margin: 0;
    color: var(--site-shell-footer-muted);
    font-size: 0.93rem;
    line-height: 1.55;
}

.site-shell-footer-contact > p:first-child a,
.site-shell-footer-contact > p:nth-child(2) a {
    color: #fff;
    font-weight: 700;
}

.site-shell-footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.35rem;
}

.site-shell-footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    color: var(--site-shell-brand);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    text-decoration: none;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.site-shell-footer-social a:hover {
    color: #fff;
    border-color: var(--site-shell-brand);
    background: var(--site-shell-brand);
    transform: translateY(-1px);
}

.site-shell-footer-social svg { width: 1.06rem; height: 1.06rem; }

.site-shell-footer-bottom {
    padding: 1.15rem 0;
    background: var(--site-shell-footer-bottom);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.site-shell-footer-bottom-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.site-shell-footer-bottom p,
.site-shell-footer-bottom a {
    margin: 0;
    color: var(--site-shell-muted);
    font-size: 0.84rem;
}

.site-shell-footer-bottom a {
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.site-shell-footer-bottom a:hover { color: var(--site-shell-brand); }

@media (max-width: 1050px) {
    .site-shell-header-row { gap: 0.65rem; min-height: 5.5rem; }
    .site-shell-brand-logo { height: 4.35rem; }
    .site-shell-nav-list { gap: 0; }
    .site-shell-nav-link,
    .site-shell-more-toggle { padding-inline: 0.46rem; font-size: 0.84rem; }
    .site-shell-nav-cta { margin-left: 0.2rem; padding-inline: 0.72rem; font-size: 0.82rem; }
}

@media (max-width: 900px) and (min-width: 769px) {
    .site-shell-header-row { min-height: 5rem; }
    .site-shell-brand-logo { height: 3.9rem; }
    .site-shell-nav-link,
    .site-shell-more-toggle { min-height: 2.55rem; padding-inline: 0.38rem; font-size: 0.78rem; }
    .site-shell-nav-cta { min-height: 2.55rem; padding-inline: 0.62rem; font-size: 0.76rem; }
    .site-shell-footer-grid { grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
}

@media (max-width: 768px) {
    .site-shell-container { width: min(calc(100% - 1.5rem), var(--site-shell-max-width)); }
    .site-shell-utility { display: none; }
    .site-shell-header { padding-top: env(safe-area-inset-top, 0px); }
    .site-shell-header-row { flex-wrap: wrap; min-height: 5.25rem; padding-block: 0.35rem; }
    .site-shell-brand-logo { height: clamp(3.85rem, 16vw, 4.6rem); }
    .site-shell-menu-toggle { display: inline-flex; margin-left: auto; }
    .site-shell-nav { flex-basis: 100%; width: 100%; padding: 0.1rem 0 0.9rem; }
    .site-shell-nav-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; width: 100%; }
    .site-shell-nav-item,
    .site-shell-more { min-width: 0; }
    .site-shell-more { grid-column: 1 / -1; }
    .site-shell-nav-link,
    .site-shell-more-toggle {
        width: 100%;
        min-height: 2.9rem;
        padding: 0.65rem 0.45rem;
        border: 1px solid var(--site-shell-line);
        border-radius: var(--site-shell-radius);
        background: var(--site-shell-surface-alt);
        font-size: 0.9rem;
    }
    .site-shell-nav-link::after { right: 0.55rem; bottom: 0.32rem; left: 0.55rem; }
    .site-shell-more-toggle { box-shadow: none; }
    .site-shell-more-toggle:hover,
    .site-shell-more-toggle[aria-expanded="true"] { box-shadow: inset 0 -2px 0 var(--site-shell-brand); }
    .site-shell-nav-cta { grid-column: 1 / -1; width: 100%; min-height: 3rem; margin-left: 0; font-size: 0.92rem; }
    .site-shell-more-menu { position: static; min-width: 0; margin-top: 0.45rem; box-shadow: none; }
    .site-shell-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.8rem 1.25rem; padding-block: 3rem 2.4rem; }
    .site-shell-footer-brand-block { grid-column: 1 / -1; }

    /* Preserve the requested mobile privacy treatment while leaving the CTA visible. */
    .site-shell-phone,
    .site-shell-email,
    .site-shell-social,
    .site-shell-footer-phone,
    .site-shell-footer-email,
    .site-shell-footer-social,
    .site-shell-header a[href^="tel:"],
    .site-shell-header a[href^="mailto:"],
    .site-shell-footer a[href^="tel:"],
    .site-shell-footer a[href^="mailto:"] { display: none !important; }
}

@media (max-width: 480px) {
    .site-shell-brand-logo { height: 3.65rem; }
    .site-shell-nav-list { grid-template-columns: 1fr; }
    .site-shell-nav-cta { grid-column: auto; }
    .site-shell-footer-grid { grid-template-columns: 1fr; gap: 1.75rem; }
    .site-shell-footer-brand-block { grid-column: auto; }
    .site-shell-footer-logo { height: 3.85rem; }
    .site-shell-footer-contact { padding: 0.95rem; }
    .site-shell-footer-bottom { padding-bottom: calc(1.15rem + env(safe-area-inset-bottom, 0px)); }
    .site-shell-footer-bottom-content { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    .site-shell-menu-toggle,
    .site-shell-menu-toggle-icon,
    .site-shell-menu-toggle-icon::before,
    .site-shell-menu-toggle-icon::after,
    .site-shell-nav-link::after,
    .site-shell-more-toggle,
    .site-shell-more-toggle::after,
    .site-shell-nav-cta,
    .site-shell-footer-cta,
    .site-shell-footer-social a { transition: none; }
}

/* Legacy declarations below are intentionally replaced by this homepage-aligned shell. */
