/**
 * Shell: page frame, top bar, header, navigation, mobile drawer, search
 * dialog, interior page hero and footer. Components shared by every page
 * live in style.css; page specific styles live in their bundles.
 *
 * Breakpoints: 480px small phones, 768px tablets, 1024px small laptops,
 * 1200px full header navigation.
 *
 * @package CustomMobileCarts
 */

/* ==========================================================================
   Page frame
   ========================================================================== */

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    /* Safety net against stray horizontal scroll. clip, unlike hidden,
       does not create a scroll container, so the sticky header keeps working. */
    overflow-x: clip;
}

.site-main {
    flex: 1 0 auto;
}

/* Page scroll is locked while a dialog is open. theme.js sets the
   scrollbar width so the layout does not jump. */
html.has-modal {
    overflow: hidden;
    padding-right: var(--scrollbar-width, 0px);
}

/* ==========================================================================
   Top bar
   ========================================================================== */

.site-topbar {
    display: none;
    font-size: 0.8125rem;
    line-height: 1.4;
    background-color: var(--color-bg-brand);
}

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

.site-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
    min-height: 2.5rem;
}

.site-topbar__text {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-topbar__contact {
    display: flex;
    flex: none;
    align-items: center;
    gap: var(--spacing-lg);
    margin-left: auto;
}

.site-topbar__link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding-block: 0.25rem;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-white);
    white-space: nowrap;
    text-decoration: none;
}

.site-topbar__link svg {
    color: var(--color-primary-on-dark);
}

.site-topbar__link:hover {
    color: var(--color-text-white);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

/* ==========================================================================
   Header
   ========================================================================== */

/* theme.js watches this to know when the page has scrolled under the header */
.site-header-sentinel {
    height: 1px;
    margin-bottom: -1px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    transition:
        background-color var(--transition-base),
        box-shadow var(--transition-base);
}

/* Stay below the WordPress toolbar for logged in users */
.admin-bar .site-header {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
}

@media (max-width: 600px) {
    .admin-bar .site-header {
        top: 0;
    }
}

.site-header.is-scrolled {
    box-shadow: var(--shadow-sm);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .site-header.is-scrolled {
        background-color: rgba(251, 248, 242, 0.86);
        -webkit-backdrop-filter: saturate(1.8) blur(14px);
        backdrop-filter: saturate(1.8) blur(14px);
    }
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: var(--header-height);
}

/* The brand is the only part of the row allowed to shrink, so a wide
   uploaded logo or long nav labels squeeze the logo, never the menu
   button or the Start your build button. */
.site-header__brand {
    display: inline-flex;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
    color: inherit;
    border-radius: var(--radius-sm);
}

/* The logo shrinks as a flex item (min-width 0) rather than through a
   percentage max-width, which resolves to zero inside a shrink-to-fit box. */
.site-header__brand .site-logo {
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    height: 28px;
}

.site-header__brand .site-logo--custom {
    height: auto;
    max-height: 40px;
    max-width: 180px;
    object-fit: contain;
    object-position: left center;
}

/* Below 480px the cart, the button and the menu leave the brand too little
   room for the wordmark, so only the mark is shown. An uploaded custom logo
   is shown at both sizes because it has no separate mark. */
.site-header__logo {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.site-header__logo--full {
    display: none;
}

.site-header__logo--full:has(.site-logo--custom) {
    display: inline-flex;
}

.site-header__logo--full:has(.site-logo--custom) + .site-header__logo--mark {
    display: none;
}

@media (min-width: 480px) {
    .site-header__inner {
        gap: var(--spacing-md);
    }

    .site-header__brand .site-logo {
        height: 32px;
    }

    .site-header__logo--full {
        display: inline-flex;
    }

    .site-header__logo--mark {
        display: none;
    }
}

@media (min-width: 1200px) {
    .site-header__brand .site-logo {
        height: 34px;
    }

    .site-header__brand .site-logo--custom {
        max-height: 48px;
        max-width: 220px;
    }
}

/* ==========================================================================
   Primary navigation (desktop)
   ========================================================================== */

.primary-nav {
    display: none;
}

@media (min-width: 1200px) {
    .primary-nav {
        display: block;
        margin-left: var(--spacing-xl);
    }
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.125rem;
}

.nav-menu > li {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-menu > li > a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 0.75rem;
    font-size: 0.9375rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.2;
    color: var(--color-heading);
    white-space: nowrap;
    text-decoration: none;
    border-radius: var(--radius-sm);
}

.nav-menu > li > a:has(+ .submenu-toggle) {
    padding-right: 0.125rem;
}

.nav-menu > li > a:hover,
.nav-menu > li:is(.current-menu-item, .current-menu-ancestor, .current-menu-parent, .current_page_item, .current_page_ancestor) > a {
    color: var(--color-link);
}

/* Chevron button next to every parent item, for keyboard and touch */
.submenu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 1.75rem;
    height: 44px;
    padding: 0;
    color: var(--color-text-light);
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

.submenu-toggle:hover {
    color: var(--color-heading);
}

.submenu-toggle svg {
    transition: transform var(--transition-base);
}

.submenu-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.nav-menu > li > .submenu-toggle {
    margin-right: 0.375rem;
}

/* Dropdown panel */
.primary-nav .sub-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    z-index: 10;
    min-width: 15rem;
    max-width: 20rem;
    padding: 0.5rem;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition:
        opacity var(--transition-fast),
        transform var(--transition-fast),
        visibility 0s linear 150ms;
}

/* Invisible bridge so the pointer can cross the gap into the panel */
.primary-nav .sub-menu::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: calc(0.5rem + 2px);
}

.primary-nav .submenu-toggle[aria-expanded="true"] + .sub-menu,
.no-js .primary-nav li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0s;
}

/* Esc adds .is-dismissed to the hovered item (theme.js) so a hover panel
   can be closed without moving the pointer (WCAG 1.4.13). */
@media (hover: hover) and (pointer: fine) {
    .primary-nav .nav-menu > li:not(.is-dismissed):hover > .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: none;
        transition-delay: 0s;
    }

    .primary-nav .nav-menu > li:not(.is-dismissed):hover > .submenu-toggle svg {
        transform: rotate(180deg);
    }
}

.primary-nav .sub-menu a {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.4;
    color: var(--color-heading);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.primary-nav .sub-menu a:hover,
.primary-nav .sub-menu :is(.current-menu-item, .current_page_item) > a {
    color: var(--color-link);
    background-color: var(--color-bg-light);
}

/* Third level items sit inside the same panel, always expanded */
.primary-nav .sub-menu .sub-menu {
    position: static;
    min-width: 0;
    padding: 0 0 0 0.75rem;
    border: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
}

.primary-nav .sub-menu .sub-menu::before,
.primary-nav .sub-menu .submenu-toggle {
    display: none;
}

/* ==========================================================================
   Header actions
   ========================================================================== */

.site-header__actions {
    display: flex;
    flex: none;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.site-header__icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    color: var(--color-heading);
    background: none;
    border: 0;
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.site-header__icon-btn:hover {
    color: var(--color-link);
    background-color: var(--color-surface-hover);
}

.site-header__search {
    display: none;
}

/* Cart, checkout and account pages render through page.php. Their blocks
   want the full width, not the reading column. */
.woocommerce-cart .page-body .container--narrow,
.woocommerce-checkout .page-body .container--narrow,
.woocommerce-account .page-body .container--narrow {
    max-width: var(--container-max);
}

/* Cart link (WooCommerce only): icon with a count badge that the
   WooCommerce fragments refresh after an add to cart. */
.site-header__cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    color: var(--color-heading);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.site-header__cart:hover,
.site-header__cart[aria-current="page"] {
    color: var(--color-link);
}

.site-header__cart:hover {
    background-color: var(--color-surface-hover);
}

.site-header__cart-count {
    position: absolute;
    top: 4px;
    right: 2px;
    min-width: 1.125rem;
    height: 1.125rem;
    padding-inline: 0.3rem;
    font-size: 0.6875rem;
    font-weight: var(--font-weight-bold);
    line-height: 1.125rem;
    text-align: center;
    color: var(--color-text-white);
    background-color: var(--color-primary);
    border-radius: var(--radius-full);
    box-shadow: 0 0 0 2px var(--color-bg);
}

.site-header__cart-count[hidden] {
    display: none;
}

.site-header__cta {
    padding-inline: 0.75rem;
    font-size: var(--font-size-sm);
    white-space: nowrap;
}

.site-header__menu-toggle {
    margin-right: -0.625rem;
}

@media (max-width: 359.98px) {
    .site-header__cta {
        display: none;
    }
}

@media (min-width: 480px) {
    .site-header__cta {
        padding-inline: 1.125rem;
        font-size: 0.9375rem;
    }
}

@media (min-width: 768px) {
    .site-header__search {
        display: inline-flex;
    }

    .site-header__cta {
        margin-left: 0.5rem;
    }
}

@media (min-width: 1200px) {
    .site-header__menu-toggle {
        display: none;
    }
}

/* ==========================================================================
   Dialogs: mobile drawer and search
   --------------------------------------------------------------------------
   Native <dialog> opened with showModal(): the rest of the page becomes
   inert, Esc closes it and focus returns to the button that opened it.
   theme.js adds .is-open after opening so the entrance can animate.
   ::backdrop does not inherit custom properties in older browsers, so its
   values are written out.
   ========================================================================== */

.drawer::backdrop,
.search-dialog::backdrop {
    background-color: rgba(15, 31, 27, 0.55);
    opacity: 0;
    transition: opacity 300ms ease;
}

.drawer.is-open::backdrop,
.search-dialog.is-open::backdrop {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .drawer::backdrop,
    .search-dialog::backdrop {
        transition: none;
    }
}

/* Mobile drawer. The z-index only matters if a browser ever shows the
   dialog without the top layer. */
.drawer {
    position: fixed;
    z-index: 1000;
    inset: 0 0 0 auto;
    width: min(25rem, 100%);
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    color: var(--color-text);
    background-color: var(--color-bg);
    border: 0;
    box-shadow: var(--shadow-xl);
    transform: translateX(100%);
    transition: transform var(--transition-slow);
}

.drawer.is-open {
    transform: none;
}

.drawer__panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: none;
    height: var(--header-height);
    padding-inline: 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.drawer__brand {
    display: inline-flex;
    border-radius: var(--radius-sm);
}

.drawer__brand .site-logo {
    width: auto;
    height: 28px;
}

.drawer__brand .site-logo--custom {
    height: auto;
    max-height: 36px;
    max-width: 160px;
}

.drawer__close,
.search-dialog__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    color: var(--color-heading);
    background: none;
    border: 0;
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast);
}

.drawer__close {
    margin-right: -0.625rem;
}

.drawer__close:hover,
.search-dialog__close:hover {
    background-color: var(--color-surface-hover);
}

.drawer__body {
    flex: 1 1 auto;
    padding: 1.25rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.drawer__search {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.drawer__search-input {
    flex: 1 1 auto;
    min-width: 0;
}

.drawer__search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 48px;
    height: 48px;
    padding: 0;
    color: var(--color-text-white);
    background-color: var(--color-secondary);
    border: 0;
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast);
}

.drawer__search-submit:hover {
    background-color: var(--color-secondary-hover);
}

.drawer-nav > li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
}

.drawer-nav > li > a {
    display: flex;
    align-items: center;
    flex: 1 1 0;
    min-width: 0;
    min-height: 52px;
    padding-block: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.0625rem;
    font-weight: var(--font-weight-semibold);
    line-height: 1.3;
    color: var(--color-heading);
    text-decoration: none;
}

.drawer-nav .submenu-toggle {
    width: 44px;
    height: 44px;
    margin-right: -0.625rem;
}

.drawer-nav .sub-menu {
    display: none;
    flex-basis: 100%;
    padding-bottom: 0.75rem;
}

.drawer-nav .submenu-toggle[aria-expanded="true"] + .sub-menu {
    display: block;
}

.drawer-nav .sub-menu li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.drawer-nav .sub-menu a {
    display: flex;
    align-items: center;
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding: 0.25rem 0.75rem;
    font-size: 1rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.35;
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
}

.drawer-nav .sub-menu a:hover {
    color: var(--color-link);
    background-color: var(--color-bg-light);
}

.drawer-nav .sub-menu .sub-menu {
    padding: 0 0 0.25rem 0.75rem;
}

.drawer-nav a[aria-current="page"],
.drawer-nav :is(.current-menu-item, .current_page_item) > a {
    color: var(--color-link);
}

.drawer__footer {
    display: grid;
    flex: none;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
    background-color: var(--color-bg-light);
    border-top: 1px solid var(--color-border);
}

.drawer__contact {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.25rem;
}

.drawer__contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    font-size: 0.9375rem;
    font-weight: var(--font-weight-medium);
    color: var(--color-heading);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.drawer__contact-link svg {
    color: var(--color-primary);
}

.drawer__contact-link:hover {
    color: var(--color-link);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

/* Search dialog */
.search-dialog {
    z-index: 1000;
    width: min(40rem, calc(100% - 1.5rem));
    max-width: none;
    max-height: calc(100% - 2rem);
    margin: 1rem auto auto;
    padding: 0;
    color: var(--color-text);
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    transform: translateY(-0.5rem) scale(0.98);
    transition:
        opacity var(--transition-base),
        transform var(--transition-base);
}

.search-dialog.is-open {
    opacity: 1;
    transform: none;
}

.search-dialog__inner {
    padding: 1.25rem;
}

.search-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.search-dialog__title {
    margin: 0;
    font-size: var(--font-size-xl);
}

.search-dialog__close {
    margin: -0.5rem -0.5rem -0.5rem 0;
}

.search-dialog__form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.search-dialog__field {
    position: relative;
    flex: 1 1 16rem;
    min-width: 0;
}

.search-dialog__field svg {
    position: absolute;
    top: 50%;
    left: 0.875rem;
    color: var(--color-text-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.search-dialog__input {
    padding-left: 2.75rem;
}

.search-dialog__form .btn {
    flex: 1 0 auto;
    min-height: 48px;
}

.search-dialog__popular {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border);
}

.search-dialog__label {
    margin-bottom: 0.75rem;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--letter-spacing-eyebrow);
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.search-dialog__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.search-dialog__chip {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0.375rem 0.875rem;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-heading);
    text-decoration: none;
    background-color: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.search-dialog__chip:hover {
    color: var(--color-link);
    background-color: var(--color-bg-tint);
    border-color: var(--color-primary-30);
}

@media (pointer: coarse) {
    .search-dialog__chip {
        min-height: 44px;
    }
}

@media (min-width: 480px) {
    .search-dialog__form .btn {
        flex-grow: 0;
    }
}

@media (min-width: 768px) {
    .search-dialog {
        margin-top: 12vh;
    }

    .search-dialog__inner {
        padding: 1.5rem 1.75rem 1.75rem;
    }
}

/* ==========================================================================
   Interior page hero (template-parts/page-hero.php)
   ========================================================================== */

.page-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-block: clamp(3rem, 2.2rem + 3.6vw, 5.5rem);
    background-color: var(--color-bg-brand);
}

.page-hero--compact {
    padding-block: clamp(2.25rem, 1.8rem + 2vw, 3.5rem);
}

.page-hero__media {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.page-hero__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Dark overlay keeps the text above 4.5:1 whatever the photo. The lighter
   right side waits until 1024px, where the lead text ends well before it. */
.page-hero__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--color-overlay);
}

@media (min-width: 1024px) {
    .page-hero__media::after {
        background-color: transparent;
        background-image: linear-gradient(90deg, var(--color-overlay) 0%, var(--color-overlay) 45%, var(--color-overlay-light) 100%);
    }
}

.page-hero__inner > :last-child {
    margin-bottom: 0;
}

.page-hero .breadcrumbs {
    margin-bottom: var(--spacing-lg);
}

.page-hero .eyebrow {
    margin-bottom: 0.75rem;
}

.page-hero__title {
    max-width: 20ch;
    margin-bottom: 0;
    font-size: var(--font-size-5xl);
    line-height: 1.1;
    color: var(--color-text-white);
}

.page-hero--compact .page-hero__title {
    font-size: var(--font-size-4xl);
}

.page-hero__lead {
    max-width: 40rem;
    margin-top: var(--spacing-md);
    margin-bottom: 0;
    font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
    line-height: 1.6;
    color: var(--color-text-on-dark);
}

.page-hero__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-top: var(--spacing-xl);
}

@media (min-width: 480px) {
    .page-hero__actions {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
}

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

.site-footer {
    padding-top: var(--spacing-3xl);
    font-size: 0.9375rem;
    background-color: var(--color-bg-dark);
}

/* Closing call to action */
.site-footer__cta {
    display: grid;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-3xl);
    padding-bottom: var(--spacing-3xl);
    border-bottom: 1px solid var(--color-border);
}

.site-footer__cta-title {
    max-width: 20ch;
    margin-bottom: 0.75rem;
    font-size: var(--font-size-4xl);
}

.site-footer__cta-text {
    max-width: 34rem;
    margin: 0;
    font-size: var(--font-size-lg);
    line-height: 1.6;
}

.site-footer__cta-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 480px) {
    .site-footer__cta-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

@media (min-width: 1024px) {
    .site-footer__cta {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        gap: var(--spacing-2xl);
    }
}

/* Brand and link columns */
.site-footer__main {
    display: grid;
    gap: var(--spacing-2xl);
    padding-bottom: var(--spacing-3xl);
}

@media (min-width: 1024px) {
    .site-footer__main {
        grid-template-columns: minmax(0, 1fr) minmax(0, 2.5fr);
        column-gap: clamp(2.5rem, 5vw, 5rem);
    }
}

.site-footer__brand {
    max-width: 24rem;
}

.site-footer__logo {
    display: inline-flex;
    border-radius: var(--radius-sm);
}

.site-footer__logo .site-logo {
    width: auto;
    height: 36px;
}

.site-footer__logo .site-logo--custom {
    height: auto;
    max-height: 48px;
    max-width: 200px;
}

.site-footer__about {
    margin: 1.25rem 0 1.5rem;
    line-height: 1.65;
}

.site-footer__contact {
    display: grid;
    gap: 0.5rem;
}

.site-footer__contact-item {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.625rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

p.site-footer__contact-item {
    margin: 0;
}

.site-footer__contact-item svg {
    flex: none;
    margin-top: 0.1875rem;
    color: var(--color-primary-on-dark);
}

a.site-footer__contact-item {
    padding-block: 0.125rem;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-white);
    text-decoration: none;
}

a.site-footer__contact-item:hover {
    color: var(--color-text-white);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.site-footer__social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: var(--spacing-lg);
}

.site-footer__social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--color-text-white);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.site-footer__social-link:hover {
    color: var(--color-text-white);
    background-color: var(--color-surface-hover);
    border-color: rgba(255, 255, 255, 0.5);
}

.site-footer__newsletter {
    display: grid;
    gap: 0.5rem;
    margin-top: var(--spacing-xl);
}

.site-footer__newsletter-row {
    display: flex;
    gap: 0.5rem;
}

.site-footer__newsletter-row .form__input {
    flex: 1 1 auto;
    min-width: 0;
}

.site-footer__newsletter-row .btn {
    flex: none;
    min-height: 48px;
}

.site-footer__nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-xl) var(--spacing-lg);
}

@media (min-width: 768px) {
    .site-footer__nav {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.site-footer__title {
    margin-bottom: var(--spacing-md);
    font-size: 0.9375rem;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0;
}

.site-footer__links {
    display: grid;
    gap: 0.5rem;
}

.site-footer__links a {
    display: inline-block;
    padding-block: 0.1875rem;
    line-height: 1.45;
    color: var(--color-text);
    text-decoration: none;
}

.site-footer__links a:hover,
.site-footer__links a[aria-current="page"] {
    color: var(--color-text-white);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

/* Bottom row */
.site-footer__bottom {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    padding-block: var(--spacing-lg) calc(var(--spacing-lg) + env(safe-area-inset-bottom));
    font-size: var(--font-size-sm);
    border-top: 1px solid var(--color-border);
}

@media (min-width: 768px) {
    .site-footer__bottom {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: var(--spacing-lg);
    }
}

.site-footer__copyright {
    margin: 0;
    color: var(--color-text-muted);
}

.site-footer__legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
}

.site-footer__legal a {
    display: inline-block;
    padding-block: 0.25rem;
    color: var(--color-text-muted);
    text-decoration: none;
}

.site-footer__legal a:hover,
.site-footer__legal a[aria-current="page"] {
    color: var(--color-text-white);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
    .site-topbar,
    .site-header,
    .drawer,
    .search-dialog,
    .site-footer__cta,
    .site-footer__nav,
    .site-footer__social,
    .site-footer__newsletter,
    .page-hero__actions {
        display: none !important;
    }

    /* Browsers drop dark backgrounds when printing, so every dark surface
       goes back to dark text, including the "white" token used by links
       and the light logo. */
    .page-hero,
    .site-footer,
    .section--dark,
    .surface-dark {
        --color-heading: #000000;
        --color-text: #333333;
        --color-text-light: #333333;
        --color-text-muted: #555555;
        --color-text-white: #000000;
        --color-primary-on-dark: #000000;
        --color-eyebrow: #000000;
        --color-link: #000000;
        color: #333333;
        background: none;
    }

    .page-hero__media {
        display: none;
    }

    .page-hero__title,
    .page-hero__lead {
        color: #000000;
    }

    /* The white filter only makes sense on a dark footer, which print drops */
    .site-logo--custom.site-logo--light {
        filter: none;
    }

    /* Solid buttons lose their fill on paper, so print them as outlined text */
    .btn {
        --btn-bg: transparent;
        --btn-fg: #000000;
        --btn-border: currentColor;
    }
}
