/* VdW Member Directory — v2 */

.vdw-directory {
    /* CI-Tokens: Open Sans, Anthrazit #3F444B, Teal #009BB5 */
    --vdw-color-primary:    #3f444b;
    --vdw-color-accent:     #009bb5;
    --vdw-color-accent-dk:  #007a8f;
    --vdw-color-bg-light:   #f0f2f5;
    --vdw-color-border:     #d8dce2;
    --vdw-color-text-muted: #666;
    --vdw-color-map-he:        #bcdde3;
    --vdw-color-map-he-hover:  #8fc4cf;
    --vdw-color-map-rlp:       #d7dade;
    --vdw-color-map-rlp-hover: #b8bdc4;
    --vdw-color-bundesland: #a0a8b4;

    max-width: 1200px;
    margin: 0 auto;
    color: var(--vdw-color-primary);
    font-family: inherit;
}

/* ── Header ───────────────────────────────────────────────── */
.vdw-directory__header { padding: 1.5rem 0 1rem; }
.vdw-directory__title  { font-size: 1.5rem; font-weight: 600; margin: 0 0 .2rem; }
.vdw-directory__count  { color: var(--vdw-color-text-muted); font-size: .9rem; margin: 0; }

/* Skip-link */
.vdw-directory__skiplink { position: absolute; left: -9999px; }
.vdw-directory__skiplink:focus {
    left: 1rem; top: 1rem; z-index: 100;
    background: var(--vdw-color-accent); color: #fff;
    padding: .5rem 1rem; text-decoration: none;
}

/* Screen reader utility */
.screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px; height: 1px; overflow: hidden;
}

/* ── Map ──────────────────────────────────────────────────── */
.vdw-map {
    width: 100%; height: auto;
    background: #fff;
    border: 1px solid var(--vdw-color-border);
    margin-bottom: .5rem;
}

.vdw-map__bundeslaender path {
    fill: none;
    stroke: var(--vdw-color-bundesland);
    stroke-width: 1.5;
    stroke-dasharray: 4 3;
}

.vdw-map__regions path {
    stroke: #fff;
    stroke-width: 1;
    transition: fill .15s ease;
    cursor: pointer;
}
.vdw-map__regions path[data-bundesland="he"]  { fill: var(--vdw-color-map-he); }
.vdw-map__regions path[data-bundesland="rlp"] { fill: var(--vdw-color-map-rlp); }

.vdw-map__regions path[data-bundesland="he"]:hover,
.vdw-map__regions path[data-bundesland="he"].is-hover  { fill: var(--vdw-color-map-he-hover); }
.vdw-map__regions path[data-bundesland="rlp"]:hover,
.vdw-map__regions path[data-bundesland="rlp"].is-hover { fill: var(--vdw-color-map-rlp-hover); }

.vdw-map__regions path.is-active {
    fill: rgba(0, 155, 181, .35);
    stroke: rgba(0, 155, 181, .6);
    stroke-width: 1.5;
}

.vdw-map__bubble { cursor: pointer; }
.vdw-map__bubble circle {
    fill: var(--vdw-color-accent);
    stroke: #fff;
    stroke-width: 1.5;
    transition: fill .15s ease, r .15s ease;
}
.vdw-map__bubble.is-empty circle {
    fill: #b8c0cb;
}
.vdw-map__bubble:hover circle,
.vdw-map__bubble.is-hover circle  {
    fill: var(--vdw-color-accent-dk);
    r: 8;
}
.vdw-map__bubble[aria-pressed="true"] circle {
    fill: var(--vdw-color-accent-dk);
    r: 8;
    stroke-width: 2;
}
.vdw-map__bubble text {
    fill: var(--vdw-color-primary);
    font-weight: 600;
    font-size: 13px;
    pointer-events: none;
    paint-order: stroke;
    stroke: #fff;
    stroke-width: 4.5px;
    stroke-linejoin: round;
}
.vdw-map__bubble[aria-pressed="true"] text { fill: var(--vdw-color-accent-dk); }
.vdw-map__bubble:focus-visible circle {
    stroke: var(--vdw-color-accent);
    stroke-width: 3;
}

.vdw-map__hint {
    font-size: .875rem; color: var(--vdw-color-primary);
    margin: .25rem 0 1.5rem;
    display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center;
}
.vdw-map__legend {
    display: inline-flex; gap: 1rem; align-items: center;
    margin-right: .5rem;
}
.vdw-map__legend-item {
    display: inline-flex; align-items: center; gap: .4rem;
    font-size: .8rem;
}
.vdw-map__legend-item::before {
    content: ''; display: inline-block;
    width: 14px; height: 14px;
    border: 1px solid #fff; box-shadow: 0 0 0 1px var(--vdw-color-border);
}
.vdw-map__legend-item[data-bundesland="he"]::before  { background: var(--vdw-color-map-he); }
.vdw-map__legend-item[data-bundesland="rlp"]::before { background: var(--vdw-color-map-rlp); }

/* ── Controls ─────────────────────────────────────────────── */
.vdw-directory__controls {
    display: flex; align-items: flex-end; flex-wrap: wrap; gap: .75rem;
    padding: 1rem 0;
    border-top: 2px solid var(--vdw-color-accent);
}

.vdw-directory__search {
    flex: 1; min-width: 220px;
    display: flex; flex-direction: column; gap: .3rem;
}
.vdw-directory__search-label { font-size: .8rem; color: var(--vdw-color-text-muted); font-weight: 600; }

.vdw-search {
    padding: .55rem .75rem; font-size: .95rem;
    border: 1px solid #666;
    border-radius: 3px;
    background: var(--vdw-color-bg-light);
    width: 100%;
    font-family: inherit;
}
.vdw-search:focus {
    outline: 2px solid var(--vdw-color-accent);
    outline-offset: 1px;
    background: #fff;
}

.vdw-directory__sort,
.vdw-directory__bundesland { display: flex; flex-direction: column; gap: .3rem; }
.vdw-directory__sort > span,
.vdw-directory__bundesland > span { font-size: .8rem; color: var(--vdw-color-text-muted); font-weight: 600; }
.vdw-sort,
.vdw-bundesland {
    padding: .55rem .75rem; font-size: .95rem;
    border: 1px solid #666;
    border-radius: 3px;
    background: #fff;
    font-family: inherit;
    cursor: pointer;
}

/* Filter pill */
.vdw-directory__pill-host { display: flex; align-items: center; flex: 0 0 100%; width: 100%; }
.vdw-directory__pill-host:empty { display: none; }

.vdw-pill {
    display: inline-flex; align-items: center; gap: .4rem;
    background: var(--vdw-color-accent);
    color: #fff;
    padding: .3rem .5rem .3rem .75rem;
    font-size: .85rem; font-weight: 600;
    border-radius: 3px;
}

.vdw-pill__close {
    appearance: none; -webkit-appearance: none;
    box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.5rem; height: 1.5rem;
    margin: 0; padding: 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #fff !important;
    cursor: pointer;
    font-family: inherit; font-size: 1.1rem; line-height: 1;
    flex-shrink: 0;
    opacity: .75;
}
.vdw-pill__close:hover { opacity: 1 !important; background: transparent !important; }
.vdw-pill__close:focus-visible {
    outline: 2px solid #fff !important;
    outline-offset: 1px !important;
    opacity: 1;
}

/* ── Member List ──────────────────────────────────────────── */
.vdw-list { list-style: none; padding: 0; margin: 0; }

.vdw-member {
    display: flex; align-items: center; gap: 1rem;
    padding: .85rem 0;
    border-bottom: 1px solid var(--vdw-color-border);
    min-height: 44px;
}

.vdw-member__logo {
    width: 64px; height: 64px; flex: 0 0 64px;
    background: var(--vdw-color-bg-light);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    border: 1px solid var(--vdw-color-border);
}
.vdw-member__logo img { width: 100%; height: 100%; object-fit: contain; }
.vdw-member__logo--initials {
    background: var(--vdw-color-accent);
    border-color: var(--vdw-color-accent);
    color: #fff; font-weight: 700; font-size: .85rem; letter-spacing: .03em;
}

.vdw-member__body  { flex: 1; min-width: 0; }
.vdw-member__name  { font-size: .95rem; font-weight: 600; margin: 0 0 .1rem; color: var(--vdw-color-primary); }
.vdw-member__city  { font-size: .82rem; color: var(--vdw-color-text-muted); margin: 0; }
.vdw-member__kreis { font-size: .78rem; color: #6b7280; margin: .1rem 0 0; }

/* CTA: Site-Standard Elementor-Button (Anthrazit-Outline, eckig) */
a.vdw-member__cta {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: 12px 30px; min-height: 44px;
    border: 2px solid var(--vdw-color-primary);
    background: transparent;
    color: var(--vdw-color-primary);
    font-family: inherit; font-size: 15px; font-weight: 600;
    text-decoration: none;
    flex-shrink: 0; white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}
a.vdw-member__cta:hover {
    background: var(--vdw-color-primary);
    color: #fff;
}
a.vdw-member__cta:focus-visible {
    outline: 2px solid var(--vdw-color-accent);
    outline-offset: 2px;
}

/* Empty state */
.vdw-empty { padding: 2rem 0; color: var(--vdw-color-text-muted); }
.vdw-empty__reset {
    color: var(--vdw-color-accent);
    margin-left: .4rem;
    font-weight: 600;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .vdw-directory__controls { flex-direction: column; align-items: stretch; }
    .vdw-directory__search,
    .vdw-directory__sort     { width: 100%; }
    .vdw-member              { flex-wrap: wrap; }
    .vdw-member__body        { flex-basis: calc(100% - 80px); }
    .vdw-member__cta         { margin-left: 80px; margin-top: .4rem; }
    .vdw-map__bubble text    { font-size: 9px; }
}

/* ── 2-Spalten-Layout ab Desktop (nur wenn Karte sichtbar) ── */
@media (min-width: 960px) {
    .vdw-directory:has(.vdw-map) {
        display: grid;
        grid-template-columns: minmax(520px, 600px) 1fr;
        grid-template-areas:
            "header     header"
            "crosslink  crosslink"
            "skiplink   skiplink"
            "map        controls"
            "map        list"
            "map        updated"
            "map        empty";
        column-gap: 2rem;
    }
    .vdw-directory__header     { grid-area: header; }
    .vdw-directory__cross-link { grid-area: crosslink; }
    .vdw-directory__skiplink   { grid-area: skiplink; }
    .vdw-map                   { grid-area: map; position: sticky; top: 1rem; align-self: start; margin-bottom: 0; }
    .vdw-directory__controls   { grid-area: controls; }
    .vdw-list                  { grid-area: list; }
    .vdw-directory__updated    { grid-area: updated; }
    .vdw-empty                 { grid-area: empty; }
}

.vdw-directory :focus-visible,
.vdw-map :focus-visible {
    outline: 2px solid var(--vdw-color-accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .vdw-map__regions path,
    .vdw-map__bubble circle,
    .vdw-member__cta { transition: none !important; }
    html             { scroll-behavior: auto !important; }
}
