:root {
    --ddx-page-bg: var(--ddx-surface, #ffffff);
    --ddx-card-radius: var(--ddx-radius, 8px);
}

body {
    background: var(--ddx-page-bg);
    color: var(--ddx-ink, #18181a);
    font-family: var(--ddx-font, "Red Hat Text", Arial, Helvetica, sans-serif);
    -webkit-font-smoothing: antialiased;
}

/*
 * Markers and popups built by directory-map.js. They live here rather than in directory.css
 * because the map component also renders on the marketing landing pages, which do not load the
 * browse stylesheet; without these the pins fall back to bare <button> boxes.
 */

.dir-pin {
    padding: 0;
    cursor: pointer;
    transition: transform 0.12s ease;
}

/* Marketing previews: an unlabelled dot, since those maps are decorative. */
.dir-pin--plain {
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--hs1-bright-white);
    border-radius: 50%;
    background: var(--pin-color, var(--ddx-primary));
    box-shadow: 0 1px 4px rgba(24, 24, 26, 0.35);
}

.dir-pin--plain.is-active {
    transform: scale(1.25);
    z-index: 5;
}

/* Browse: the provider name rides on the pin so the map is readable without the list. */
.dir-pin--label {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    max-width: 11rem;
    padding: 0.25rem 0.625rem 0.25rem 0.5rem;
    border: 1px solid rgba(24, 24, 26, 0.16);
    border-radius: 999px;
    background: var(--hs1-bright-white);
    color: var(--hs1-true-black);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
    box-shadow: 0 1px 6px rgba(24, 24, 26, 0.25);
}

.dir-pin__dot {
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--pin-color, var(--ddx-primary));
}

.dir-pin__text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Invert rather than scale: a wide label growing under the cursor is hard to track. */
.dir-pin--label.is-active {
    background: var(--pin-color, var(--ddx-primary));
    border-color: transparent;
    color: var(--hs1-bright-white);
    z-index: 5;
}

.dir-pin--label.is-active .dir-pin__dot {
    background: var(--hs1-bright-white);
}

.dir-popup__name {
    font-weight: 600;
    margin: 0 0 0.15rem;
}

.dir-popup__place {
    font-size: 0.8125rem;
    color: var(--hs1-aluminum-400);
    margin: 0 0 0.5rem;
}

.dir-popup__action {
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
}

.dir-map__note {
    font-size: 0.75rem;
    color: var(--ddx-muted);
    margin: 0.5rem 0.25rem 0.25rem;
}

@media (prefers-reduced-motion: reduce) {
    .dir-pin {
        transition: none;
    }
}

a {
    text-underline-offset: 0.15em;
}

/* —— Marketing home (/) —— */
.marketing-home {
    --mkt-ink: var(--ddx-ink);
    --mkt-ink-soft: var(--hs1-aluminum-400);
    --mkt-primary: var(--ddx-primary);
    --mkt-primary-hover: var(--ddx-primary-hover);
    --mkt-primary-bright: var(--ddx-primary-bright);
    --mkt-primary-subtle: var(--ddx-primary-subtle);
    --mkt-surface: var(--hs1-bright-white);
    --mkt-card: var(--ddx-card);
    --mkt-font: var(--ddx-font);
    --mkt-display: var(--ddx-font-display);
    font-family: var(--mkt-font);
    background: var(--mkt-surface);
    color: var(--mkt-ink);
}

.marketing-main {
    padding: 0;
}

.skip-link {
    position: fixed;
    left: 0.75rem;
    top: 0.75rem;
    z-index: 200;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: var(--ddx-primary);
    color: var(--hs1-bright-white);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    width: 1px;
    height: 1px;
    overflow: hidden;
    white-space: nowrap;
    border: 0;
}

.skip-link:focus,
.skip-link:focus-visible {
    clip: auto;
    clip-path: none;
    width: auto;
    height: auto;
    overflow: visible;
    white-space: normal;
    outline: 2px solid var(--hs1-bright-white);
    outline-offset: 2px;
}

#directories,
#how-it-works,
#search {
    scroll-margin-top: 5.5rem;
}

/* —— App shell (directory / 404 utilities) —— */
.ddx-app-shell {
    --app-ink: var(--ddx-ink);
    --app-muted: var(--ddx-muted);
    --app-primary: var(--ddx-primary);
    --app-primary-hover: var(--ddx-primary-hover);
    --app-primary-bright: var(--ddx-primary-bright);
    --app-primary-subtle: var(--ddx-primary-subtle);
    --app-lab: var(--ddx-accent-lab);
    --app-lab-dark: var(--ddx-accent-lab-dark);
    --app-specialist: var(--ddx-accent-specialist);
    --app-surface: var(--ddx-surface);
    --app-card: var(--ddx-card);
    --app-font: var(--ddx-font);
    --app-display: var(--ddx-font-display);
    --app-radius: var(--ddx-radius);
    font-family: var(--app-font);
    background: var(--app-surface);
    color: var(--app-ink);
}
.app-btn-primary {
    background: var(--app-primary, var(--ddx-primary));
    border: none;
    color: var(--hs1-bright-white);
    font-weight: 600;
    border-radius: 6px;
    font-size: 0.875rem;
}

.app-btn-primary:hover,
.app-btn-primary:focus {
    background: var(--app-primary-hover, var(--ddx-primary-hover));
    color: var(--hs1-bright-white);
}

.app-btn-primary--violet {
    background: var(--app-lab, var(--ddx-accent-lab));
    color: var(--hs1-bright-white);
}

.app-btn-primary--specialist {
    background: var(--app-specialist, var(--ddx-accent-specialist));
    color: var(--hs1-bright-white);
}

.app-btn-primary--specialist:hover,
.app-btn-primary--specialist:focus {
    background: var(--hs1-celeste-600);
    color: var(--hs1-bright-white);
}

.app-btn-primary--violet:hover,
.app-btn-primary--violet:focus {
    background: var(--app-lab-dark, var(--ddx-accent-lab-dark));
    color: var(--hs1-bright-white);
}

.app-btn-outline {
    border: 1px solid rgba(15, 23, 42, 0.15);
    color: var(--app-ink);
    font-weight: 500;
    background: var(--app-card);
}

.app-btn-outline:hover {
    background: var(--app-surface);
    border-color: var(--app-primary-bright);
    color: var(--app-primary);
}

.app-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.app-chip {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--app-ink);
    text-decoration: none;
    background: var(--app-card);
    border: 1px solid var(--ddx-border);
    border-radius: 6px;
    transition: border-color 0.15s, background 0.15s;
}

.app-chip:hover {
    border-color: var(--ddx-border-strong);
    background: var(--ddx-surface);
    color: var(--app-ink);
}

.ddx-app--lab .app-chip:hover {
    border-color: var(--ddx-border-strong);
    background: var(--ddx-surface);
    color: var(--app-ink);
}

.app-lang-switcher__current {
    font-weight: 600;
    color: inherit;
}

.app-lang-switcher__link {
    text-decoration: none;
    opacity: 0.85;
}

.app-lang-switcher__link:hover {
    opacity: 1;
    text-decoration: underline;
}

.app-empty-page {
    text-align: center;
    max-width: 32rem;
    margin: 3rem auto 4rem;
    padding: 2.5rem 1.5rem;
    background: var(--app-card);
    border-radius: var(--app-radius);
    border: 1px solid var(--ddx-border);
    box-shadow: none;
}

.app-empty-page__code {
    font-family: var(--app-display);
    font-size: 3rem;
    font-weight: 600;
    color: rgba(15, 23, 42, 0.12);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.app-empty-page__title {
    font-family: var(--app-display);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.app-empty-page__text {
    color: var(--app-muted);
    margin-bottom: 1.5rem;
}

.app-code {
    font-size: 0.85em;
    background: var(--app-surface);
    padding: 0.15rem 0.4rem;
    border-radius: 0.35rem;
}

/* --------------------------------------------------------- searchable listbox (browse filters + marketing forms) */

.dir-combo {
    position: relative;
}

.dir-combo__native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.dir-combo__button {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    min-height: 2.375rem;
    background: var(--ddx-card);
    border: 1px solid var(--ddx-border-strong);
    border-radius: 6px;
    font-size: 0.9375rem;
    color: var(--ddx-ink);
    text-align: left;
}

.dir-combo__button:focus-visible {
    outline: none;
    border-color: var(--dir-accent, var(--ddx-primary));
    box-shadow: 0 0 0 3px var(--dir-accent-soft, var(--ddx-primary-subtle));
}

.dir-combo__value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dir-combo__caret {
    display: inline-flex;
    color: var(--ddx-muted);
    font-size: 1.25rem;
}

.dir-combo__pop {
    position: absolute;
    z-index: 40;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    min-width: 14rem;
    background: var(--ddx-card);
    border: 1px solid var(--ddx-border-strong);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(24, 24, 26, 0.14);
    padding: 0.5rem;
}

.dir-combo__search {
    width: 100%;
    padding: 0.35rem 0.5rem;
    margin-bottom: 0.4rem;
    border: 1px solid var(--ddx-border-strong);
    border-radius: 6px;
    font-size: 0.875rem;
}

.dir-combo__list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 15rem;
    overflow-y: auto;
}

.dir-combo__option {
    padding: 0.4rem 0.5rem;
    border-radius: 5px;
    font-size: 0.875rem;
    cursor: pointer;
}

.dir-combo__option.is-active {
    background: var(--ddx-surface);
}

.dir-combo__option.is-selected {
    font-weight: 600;
    color: var(--dir-accent, var(--ddx-primary));
}

.dir-combo__empty {
    margin: 0;
    padding: 0.5rem;
    font-size: 0.8125rem;
    color: var(--ddx-muted);
}
