/* =============================================
   Map block — taubenloft/map  (Figma node 81:7536)
   Light section (#EAEBE6), text #333A42.
   ============================================= */

.tl-map {
    background: #eaebe6;
    color: #333a42;
    font-family: 'Nunito Sans', 'Nunito Sans Fallback', system-ui, -apple-system, sans-serif;
    padding: 0 24px 80px;            /* top space comes from the Map Intro block above */
}
.tl-map *, .tl-map *::before, .tl-map *::after { box-sizing: border-box; }

/* Map Intro block — the title row above the map (shares .tl-map__head styles) */
.tl-map-intro {
    background: #eaebe6;
    color: #333a42;
    font-family: 'Nunito Sans', 'Nunito Sans Fallback', system-ui, -apple-system, sans-serif;
    padding: 80px 24px 48px;
}
.tl-map-intro *, .tl-map-intro *::before, .tl-map-intro *::after { box-sizing: border-box; }
.tl-map-intro .tl-map__head { margin-bottom: 0; }

.tl-map__container { max-width: 1200px; margin: 0 auto; }

/* ── Head ─────────────────────────────────────────── */
.tl-map__head {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 80px;
    margin-bottom: 56px;
}
.tl-map__head-left { max-width: 540px; }
.tl-map__eyebrow {
    display: inline-block;
    font-size: 16px; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: #333a42; margin-bottom: 16px;
}
.tl-map__heading {
    margin: 0;
    font-size: 36px; font-weight: 500; line-height: 1.2;
    color: #333a42;
}
.tl-map__intro {
    max-width: 520px; margin: 0; align-self: center;
    font-size: 16px; font-weight: 400; line-height: 1.6; color: #333a42;
}

/* ── Area: card · map · legend ───────────────────── */
.tl-map__area {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
}
.tl-map__cards-wrap { flex: 0 0 342px; max-width: 342px; min-width: 0; position: relative; }
.tl-map__cards  { width: 100%; overflow: hidden; }

.tl-map__map    { flex: 1 1 auto; display: flex; justify-content: center; }
.tl-map__legend { flex: 0 0 258px; max-width: 258px; display: none; flex-direction: column; gap: 24px; }
.tl-map__legend.is-active { display: flex; }

/* ── Detail card ──────────────────────────────────── */
.tl-map__card { border: 1px dashed #9aa0a8; border-radius: 4px; padding: 24px; height: auto; box-sizing: border-box; }
/* Before Swiper initialises, show only the active card (avoid a flash of stacked cards). */
.tl-map__cards:not(.swiper-initialized) .tl-map__card:not(.is-active) { display: none; }

.tl-map__card-title {
    display: flex; align-items: center; gap: 12px;
    margin: 0 0 24px; font-size: 20px; font-weight: 600; color: #333a42;
}
.tl-map__dot { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; }
.tl-map__dot--betrieb { background: #333a42; }
.tl-map__dot--planung { background: #f29903; }

.tl-map__rows { display: flex; flex-direction: column; gap: 24px; margin-bottom: 24px; }
.tl-map__row  { display: flex; flex-direction: column; gap: 8px; }
.tl-map__label { font-size: 16px; font-weight: 600; color: #333a42; }
.tl-map__val   { font-size: 14px; font-weight: 400; line-height: 1.5; color: #333a42; }

/* Gallery slider */
.tl-map__gallery { margin-bottom: 20px; }
.tl-map__swiper { overflow: hidden; border-radius: 8px; }
.tl-map__slide { position: relative; margin: 0; }
.tl-map__slide img { -webkit-user-drag: none; user-select: none; }
.tl-map__slide img { display: block; width: 100%; height: 161px; object-fit: cover; }
.tl-map__play {
    position: absolute; inset: 0; margin: auto;
    width: 56px; height: 56px; border: 0; border-radius: 50%;
    background: rgba( 255, 255, 255, 0.92 ); color: #333a42;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    padding-left: 3px; transition: background 0.2s;
}
.tl-map__play:hover { background: #fff; }
.tl-map__slide--video { cursor: pointer; }
.tl-map__gallery-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 14px; }

/* ── Lightbox (full-screen, navigable: image or video) ───────────────── */
.tl-map__lightbox {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba( 0, 0, 0, 0.9 );
    display: none; align-items: center; justify-content: center;
    padding: 56px 88px;
}
.tl-map__lightbox[aria-hidden="false"] { display: flex; }
.tl-map__lb-stage {
    width: 100%; max-width: 1100px; max-height: 85vh;
    display: flex; align-items: center; justify-content: center;
}
.tl-map__lb-stage img { max-width: 100%; max-height: 85vh; object-fit: contain; display: block; }
.tl-map__lb-stage iframe,
.tl-map__lb-stage video { width: 100%; aspect-ratio: 16 / 9; max-height: 85vh; border: 0; background: #000; }
.tl-map__lb-close {
    position: absolute; top: 20px; right: 28px;
    width: 44px; height: 44px; border: 0; background: transparent;
    color: #fff; font-size: 34px; line-height: 1; cursor: pointer; transition: opacity 0.15s;
}
.tl-map__lb-close:hover, .tl-map__lb-close:focus { opacity: 0.7; }
.tl-map__lb-nav {
    position: absolute; top: 50%; transform: translateY( -50% );
    width: 48px; height: 48px; border-radius: 50%;
    border: 1px solid rgba( 255, 255, 255, 0.5 ); background: rgba( 0, 0, 0, 0.3 );
    color: #fff; display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background 0.2s, border-color 0.2s;
}
.tl-map__lb-nav:hover, .tl-map__lb-nav:focus { background: rgba( 255, 255, 255, 0.15 ); border-color: #fff; }
.tl-map__lb-nav--prev { left: 20px; }
.tl-map__lb-nav--prev svg { transform: rotate( 180deg ); }
.tl-map__lb-nav--next { right: 20px; }
.tl-map__lb-counter { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; color: #fff; font-size: 14px; }
.tl-map__lightbox--single .tl-map__lb-nav,
.tl-map__lightbox--single .tl-map__lb-counter { display: none; }
html.tl-map-modal-open, html.tl-map-modal-open body { overflow: hidden; }
.tl-map__nav {
    width: 34px; height: 34px; border: 1px solid #9aa0a8; border-radius: 50%;
    background: transparent; color: #333a42; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; transition: background 0.2s, color 0.2s;
}
.tl-map__nav:hover { background: #333a42; color: #eaebe6; }
.tl-map__nav--prev svg { transform: rotate( 180deg ); }
.tl-map__counter { font-size: 14px; color: #333a42; min-width: 48px; text-align: center; }

.tl-map__case {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 14px; color: #333a42; text-decoration: none;
}
.tl-map__case[href]:hover { opacity: 0.7; }
.tl-map__case svg { display: block; }

/* ── Map + pins ───────────────────────────────────── */
.tl-map__svg { position: relative; width: 100%; max-width: 600px; }
.tl-map__svg > svg { display: block; width: 100%; height: auto; overflow: visible; }
.tl-map__svg svg #features > path { fill: #fff; stroke: #333a42; stroke-width: 1; }
/* Active location's Bundesland gets a fill (Figma: selected state shaded) */
.tl-map__svg svg #features > path.is-active-state { fill: #c6cacd; }
/* Static dashed connector that ships inside the SVG — hidden (selection is dynamic) */
.tl-map__svg svg line { display: none; }

.tl-map__pin {
    position: absolute; transform: translate( -50%, -100% );
    width: 28px; height: 28px; border: 0; padding: 0; cursor: pointer;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s ease;
    filter: drop-shadow( 0 2px 3px rgba( 0, 0, 0, 0.25 ) );
}
.tl-map__pin::after {
    content: ''; position: absolute; bottom: -5px; left: 50%; transform: translateX( -50% );
    border-left: 6px solid transparent; border-right: 6px solid transparent;
    border-top: 9px solid currentColor;
}
.tl-map__pin--betrieb { background: #333a42; color: #333a42; }
.tl-map__pin--planung { background: #f29903; color: #f29903; }
.tl-map__pin-badge {
    width: 18px; height: 18px; border-radius: 50%; background: #fff; color: #333a42;
    font-size: 11px; font-weight: 700; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.tl-map__pin.is-active { transform: translate( -50%, -100% ) scale( 1.18 ); z-index: 3; }
.tl-map__pin:hover { transform: translate( -50%, -100% ) scale( 1.12 ); z-index: 2; }

/* ── Legend ───────────────────────────────────────── */
.tl-map__legend-card { border: 1px solid #d6d7d2; border-radius: 12px; padding: 24px; }
.tl-map__legend-title {
    display: flex; align-items: center; gap: 16px;
    margin: 0 0 16px; font-size: 20px; font-weight: 600; color: #333a42;
}
.tl-map__legend-text { margin: 0; font-size: 16px; font-weight: 400; line-height: 1.5; color: #333a42; }
.tl-map__legend-location { margin: 14px 0 0; font-size: 14px; font-weight: 600; line-height: 1.4; color: #333a42; }

/* ── City pills ───────────────────────────────────── */
.tl-map__pills {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 16px; margin-top: 56px;
}
.tl-map__pill {
    border: 1px solid #333a42; border-radius: 999px; background: transparent;
    padding: 10px 24px; font-family: inherit; font-size: 16px; color: #333a42;
    cursor: pointer; transition: background 0.2s, color 0.2s; white-space: nowrap;
}
.tl-map__pill:hover { background: rgba( 51, 58, 66, 0.08 ); }
.tl-map__pill.is-active { background: #333a42; color: #eaebe6; }

/* ── Tablet / mobile ≤980 ─────────────────────────── */
@media (max-width: 980px) {
    .tl-map__head { flex-direction: column; gap: 24px; margin-bottom: 40px; }
    .tl-map__heading { font-size: 28px; }
    .tl-map__intro { align-self: flex-start; }
    .tl-map__area { flex-direction: column; align-items: stretch; gap: 28px; }
    .tl-map__cards-wrap, .tl-map__legend { flex: 1 1 auto; max-width: none; }
    .tl-map__cards-wrap { width: 100%; }   /* definite width so the cards Swiper measures correctly */
    .tl-map__svg { max-width: 100%; margin: 0 auto; }   /* fill the column on mobile/tablet — no side whitespace */
    .tl-map__pills { display: none; }      /* swiping the cards replaces the pill selector */

    /* Order: compact legend (labels above the map) → map → cards */
    .tl-map__legend     { order: 1; flex-direction: column; gap: 10px; }
    .tl-map__map        { order: 2; }
    .tl-map__cards-wrap { order: 3; }

    /* Legend = plain key labels on mobile (no card box, no description) */
    .tl-map__legend-card  { border: 0; border-radius: 0; padding: 0; flex: none; }
    .tl-map__legend-text  { display: none; }
    .tl-map__legend-location { display: none; }
    .tl-map__legend-title { margin: 0; font-size: 16px; gap: 12px; }

    /* Lightbox: drop the big side arrows (navigate by swipe) so the media
       can use the full screen width instead of being squeezed by the gutters. */
    .tl-map__lightbox { padding: 56px 12px; }
    .tl-map__lb-nav   { display: none; }
    .tl-map__lb-stage { max-width: none; }
    .tl-map__lb-counter { bottom: 16px; }
}

/* ── Phone ≤599 ──────────────────────────────────── */
@media (max-width: 599px) {
    .tl-map { padding: 0 16px 48px; }
    .tl-map-intro { padding: 48px 16px 28px; }
}
