html, body {
    font-family: 'Montserrat', sans-serif;
    background: #F5F6F8;
}

body {
    letter-spacing: -0.01em;
}

.site-appbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 4px 20px rgba(0, 27, 84, 0.14) !important;
}

.site-appbar__brand {
    display: inline-flex;
    align-items: center;
    gap: .85rem;
    margin-left: .5rem;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.site-appbar__logo {
    display: block;
    height: 36px;
    width: auto;
    max-width: 96px;
    flex: 0 0 auto;
    object-fit: contain;
    object-position: left center;
}

.site-appbar__title {
    font-weight: 700;
    letter-spacing: -0.03em;
    font-size: 1.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 600px) {
    .site-appbar__logo { height: 30px; max-width: 78px; }
    .site-appbar__title { font-size: 1rem; }
}
.site-drawer { border-right: 1px solid var(--mud-palette-divider-light) !important; }
.site-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Let short routes fill the available height so the shared footer rests at the page bottom. */
.site-main > main { flex: 1 0 auto; }

/* Shared footer, aligned with the primary thencc.org.uk site. */
.ncc-footer {
    margin: 3rem -8px -8px;
    color: #fff;
    background: #182851;
    letter-spacing: 0;
}

.ncc-footer__main { background: #182851; }
.ncc-footer__content {
    width: min(100% - 3rem, 1160px);
    margin: 0 auto;
}

.ncc-footer__main .ncc-footer__content {
    display: grid;
    grid-template-columns: minmax(220px, 1.25fr) minmax(150px, .7fr) minmax(240px, 1fr);
    gap: 3rem;
    padding: 3rem 0 2.7rem;
}

.ncc-footer__identity { display: flex; flex-direction: column; align-items: flex-start; }
.ncc-footer__logo-link { display: block; width: min(270px, 100%); }
.ncc-footer__logo { display: block; width: 100%; height: auto; }
.ncc-footer a { color: #fff; text-decoration: none; }
.ncc-footer a:hover, .ncc-footer a:focus-visible { color: #9fd04a; text-decoration: underline; }
.ncc-footer a:focus-visible { outline: 2px solid #9fd04a; outline-offset: 4px; }

.ncc-footer__email { margin-top: 1.4rem; font-weight: 600; }
.ncc-footer__socials { display: flex; gap: .7rem; margin-top: 1.25rem; }
.ncc-footer__socials a {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 50%;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1;
}
.ncc-footer__socials .mud-icon-root { font-size: 1rem; }

.ncc-footer__links, .ncc-footer__sites nav { display: flex; flex-direction: column; align-items: flex-start; gap: .8rem; }
.ncc-footer__links { padding-top: .45rem; }
.ncc-footer__links a, .ncc-footer__sites a { font-size: .92rem; }
.ncc-footer__sites h2 {
    margin: 0 0 1rem;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
}

.ncc-footer__legal { background: #001b54; }
.ncc-footer__legal-content {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    padding: 1rem 0;
    color: rgba(255, 255, 255, .85);
    font-size: .75rem;
}
.ncc-footer__legal a { color: inherit; }

@media (max-width: 960px) {
    .ncc-footer__main .ncc-footer__content { grid-template-columns: 1fr 1fr; }
    .ncc-footer__identity { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
    .ncc-footer { margin-top: 2rem; }
    .ncc-footer__content { width: min(100% - 2rem, 1160px); }
    .ncc-footer__main .ncc-footer__content { grid-template-columns: 1fr; gap: 2rem; padding: 2.25rem 0; }
    .ncc-footer__identity { grid-column: auto; }
    .ncc-footer__legal-content { padding: .9rem 0; }
}

@media (min-width: 1280px) {
    .ncc-footer { margin-right: 0; margin-left: 0; }
}

.site-nav { padding: 1rem .7rem; }
.site-nav .mud-nav-link {
    border-radius: 10px;
    margin: .22rem 0;
    font-weight: 600;
    transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}
.site-nav .mud-nav-link:hover { transform: translateX(2px); }
.site-nav .mud-nav-link.active {
    background: rgba(24, 40, 81, .09);
    color: var(--mud-palette-primary);
}

.page-header-title {
    font-size: clamp(1.75rem, 3.4vw, 2.5rem) !important;
    letter-spacing: -.045em;
    line-height: 1.15;
}

.directory-page {
    --directory-panel-gap: 1.25rem; /* matches MudBlazor mb-5 (20px) */
    max-width: 1160px;
}
.directory-page .filter-panels.mb-5,
.directory-page .featured-members-panels.mb-5 {
    margin-bottom: var(--directory-panel-gap) !important;
}
.featured-results-stack {
    display: flex;
    flex-direction: column;
    gap: var(--directory-panel-gap);
    margin-bottom: var(--directory-panel-gap);
}
.results-section__body.featured-results-stack {
    margin-bottom: 0;
}
.featured-results-stack__item { width: 100%; }
.featured-results-stack .featured-members-panels.mb-5 {
    margin-bottom: 0 !important;
}
.results-banner { padding: 1rem 3.25rem; text-align: center; background: var(--mud-palette-primary); color: #fff; }
.results-banner h5 { color: #fff; font-weight: 700; margin: 0; }
.results-banner p { color: rgba(255, 255, 255, .78); font-size: .8rem; margin: .2rem 0 0; }
.results-section__body { padding: clamp(1.25rem, 2.5vw, 2rem); }
.member-results-chips {
    gap: 0.2rem !important;
}
.member-results-chips .mud-chip {
    margin: 0 !important;
}
.results-panels .mud-expand-panel {
    border: 1px solid var(--mud-palette-divider-light);
    border-radius: 14px !important;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(24, 40, 81, .045);
}
.results-panels .mud-expand-panel-header { padding: 0; background: var(--mud-palette-primary); color: #fff; }
.results-panels .mud-expand-panel-header .mud-icon-root { color: #fff; margin-right: .5rem; }
.results-panels .mud-expand-panel-content { padding: 0; }
.results-banner { position: relative; width: 100%; }
.results-banner__report { position: absolute; right: .85rem; top: 50%; transform: translateY(-50%); }
.results-banner__report .mud-button-icon-start { margin: 0 !important; }

.filter-panels .mud-expand-panels { gap: var(--directory-panel-gap, 1.25rem); background: transparent; }
.filter-panels .mud-expand-panel {
    border: 1px solid var(--mud-palette-divider-light);
    border-radius: 14px !important;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(24, 40, 81, .045);
}
.filter-panels .mud-expand-panel-header { padding: 0; background: var(--mud-palette-primary); color: #fff; }
.filter-panels .mud-expand-panel-header .mud-icon-root { color: #fff; margin-right: .5rem; }
.filter-panels .mud-expand-panel-content { padding: 1.25rem 1.5rem 1.5rem; }
.filter-banner { position: relative; width: 100%; padding: 1rem 3.25rem; text-align: center; }
.filter-banner h5 { color: #fff; font-weight: 700; margin: 0; }
.filter-banner p { color: rgba(255, 255, 255, .78); font-size: .8rem; margin: .2rem 0 0; }
.filter-banner__step {
    position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
    display: grid; place-items: center; width: 1.8rem; height: 1.8rem;
    border-radius: 50%; background: var(--mud-palette-tertiary); color: var(--mud-palette-primary);
    font-size: .7rem; font-weight: 700;
}
.filter-panels .mud-chip { border-radius: 999px; font-weight: 600; min-height: 2.35rem; }

/* Product / service search — mirrors findmyleisurevehicle.co.uk SearchInput */
.product-search {
    display: block !important;
    max-width: 1400px !important;
    width: 100% !important;
}

@media (min-width: 1280px) {
    .product-search,
    .product-search.mud-input-control {
        max-width: 720px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

.product-search.mud-input-control,
.product-search .mud-input-control-input-container {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.product-search .mud-input,
.product-search .mud-input-outlined,
.product-search .mud-input-slot,
.product-search input.mud-input-slot {
    background-color: #ffffff !important;
    background: #ffffff !important;
}

.product-search .mud-input-outlined {
    border-radius: 10px !important;
    box-shadow: none !important;
    overflow: hidden;
}

.product-search .mud-input-slot,
.product-search input.mud-input-slot {
    min-height: 50px !important;
    height: 50px !important;
    padding: 1rem 3.25rem 1rem 1rem !important;
    font-size: 1.2rem !important;
    line-height: 1.4 !important;
    color: #19191b !important;
}

.product-search .mud-input-slot::placeholder,
.product-search input.mud-input-slot::placeholder {
    color: #8b8e97 !important;
    opacity: 1 !important;
    font-size: 1.2rem !important;
}

.product-search .mud-input-adornment-end {
    margin: 0 .5rem 0 0 !important;
}

.product-search .mud-input-adornment-end .mud-icon-root {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px !important;
    height: 32px !important;
    border-radius: 999px !important;
    background: #edf4d7 !important;
    color: #628015 !important;
    font-size: 1.15rem !important;
    padding: .35rem !important;
    box-sizing: border-box;
    transition: transform 500ms ease-in-out;
}

.product-search .mud-input-adornment-end:hover .mud-icon-root {
    transform: scale(1.1);
}

.product-search .mud-input-clear-button {
    color: #8b8e97 !important;
}

.product-search .mud-input-outlined-border,
.product-search fieldset.mud-input-outlined-border {
    border-radius: 10px !important;
    border-width: 1px !important;
    border-color: #e0e1e7 !important;
}

.product-search .mud-input:focus-within .mud-input-outlined-border,
.product-search .mud-input-outlined:focus-within .mud-input-outlined-border,
.product-search .mud-input:focus-within fieldset.mud-input-outlined-border {
    border-color: #94c01f !important;
    border-width: 2px !important;
    box-shadow: 0 0 0 2px rgba(148, 192, 31, .35) !important;
}

@media (max-width: 600px) {
    .site-main { padding-inline: .5rem !important; }
    .directory-page { padding-inline: .45rem !important; }
    .results-panels .mud-expand-panel { border-radius: 13px !important; }
    .filter-panels .mud-expand-panel { border-radius: 13px !important; }
    .filter-panels .mud-expand-panel-content { padding: 1rem; }
    .results-section__body { padding: .5rem; }
    .featured-results-stack { gap: .75rem; }
}

/* Keep large screens compact: content has room to breathe without excessive framing. */
@media (min-width: 1280px) {
    .site-main {
        padding: 4rem 0 0 !important;
    }

    .site-main .mud-container {
        width: 100%;
        max-width: none;
        padding-left: 16px;
        padding-right: 16px;
    }

    .home-page {
        padding-top: .75rem !important;
        padding-bottom: .75rem !important;
    }

    .directory-page {
        padding-top: .5rem !important;
        padding-bottom: .5rem !important;
    }
}

#blazor-error-ui {
    background: #182851;
    color: #fff;
    padding: 0.6rem 1.25rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    display: none;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
}

#blazor-error-ui .reload {
    color: #8FC73E;
    font-weight: 600;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.6rem;
}

/* Member details dialog — themed to match featured cards */
.mud-dialog.member-details-dialog {
    background: color-mix(in srgb, var(--mud-palette-primary) 8%, var(--mud-palette-surface)) !important;
    color: var(--mud-palette-primary);
    overflow: hidden;
    border: 1px solid #616161;
    border-radius: var(--mud-default-borderradius, 4px);
}

.mud-dialog.member-details-dialog .mud-dialog-title {
    background: var(--mud-palette-primary);
    color: #fff;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid color-mix(in srgb, #000 18%, var(--mud-palette-primary));
}

.mud-dialog.member-details-dialog .mud-dialog-title .mud-button-root,
.mud-dialog.member-details-dialog .mud-dialog-title .mud-icon-button-root,
.mud-dialog.member-details-dialog .mud-dialog-title .mud-icon-root {
    color: #fff !important;
}

.mud-dialog.member-details-dialog .mud-dialog-content {
    background: color-mix(in srgb, var(--mud-palette-primary) 8%, var(--mud-palette-surface));
    color: var(--mud-palette-primary);
    padding: 1.25rem 1.5rem;
}

.mud-dialog.member-details-dialog .mud-dialog-actions {
    background: var(--mud-palette-primary) !important;
    color: #fff;
    border-top: 1px solid color-mix(in srgb, #000 18%, var(--mud-palette-primary));
    padding: .75rem 1.25rem;
}

.mud-dialog.member-details-dialog .mud-dialog-actions .mud-button-root {
    color: #fff !important;
    border-color: #fff !important;
}

.mud-dialog.member-details-dialog .mud-dialog-actions .mud-button-root .mud-icon-root {
    color: #fff !important;
}

.mud-dialog.member-details-dialog .member-details-dialog__title .mud-typography {
    color: #fff;
}

.mud-dialog.member-details-dialog .member-details-dialog__title .mud-typography-overline {
    color: rgba(255, 255, 255, .82);
}

.mud-dialog.member-details-dialog .member-details-dialog__contact {
    background: color-mix(in srgb, var(--mud-palette-primary) 8%, var(--mud-palette-surface));
    border-color: color-mix(in srgb, var(--mud-palette-primary) 18%, var(--mud-palette-divider-light));
    color: var(--mud-palette-primary);
}

.mud-dialog.member-details-dialog .member-details-dialog__contact .mud-typography,
.mud-dialog.member-details-dialog .member-details-dialog__contact .mud-link {
    color: var(--mud-palette-primary);
}

.mud-dialog.member-details-dialog .member-details-dialog__contact .mud-link:hover {
    color: var(--mud-palette-secondary);
}

.mud-dialog.member-details-dialog .member-details-dialog__description .mud-typography-subtitle1,
.mud-dialog.member-details-dialog .member-details-dialog__social .mud-typography-subtitle1 {
    color: var(--mud-palette-primary);
}

.mud-dialog.member-details-dialog .member-details-dialog__description .mud-typography-body2 {
    color: var(--mud-palette-text-secondary);
}
.featured-members-panel .mud-expand-panel-header {
    background: #707070 !important;
    color: #fff !important;
}

.featured-members-panel .mud-expand-panel-header .mud-icon-root {
    color: #fff !important;
}

.featured-members-panel .mud-expand-panel-content,
.featured-members-panel .mud-expand-panel-content .mud-expand-panel-content-body {
    background: #707070 !important;
}
