/**
 * MARK HAACKE — BRANCHE SWITCHER & SELECTOR
 *
 * Styles für Branch-Selector (Startseite Grid) und Branch-Switcher (Chip-Row auf allen Seiten).
 *
 * @package Kadence_Child
 */

/* ============================================
   BRANCH SWITCHER (Chip-Row, auf jeder Seite)
   ============================================ */
.mh-branch-switcher {
    position: sticky;
    top: var(--header-h);
    z-index: 900;
    background: rgba(240, 235, 230, 0.92);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    border-bottom: 1px solid var(--mh-border);
    height: var(--switcher-h);
    display: flex;
    align-items: center;
}

.mh-branch-switcher__inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 clamp(1.5rem, 4vw, 3rem);
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mh-branch-switcher__inner::-webkit-scrollbar { display: none; }

.mh-branch-switcher__label {
    font-size: var(--fs-eyebrow);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mh-text-muted);
    flex-shrink: 0;
}

.mh-branch-switcher__list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.mh-branch-switcher__item a {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.95rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--mh-text-light);
    border: 1px solid var(--mh-border);
    border-radius: var(--radius-pill);
    background: var(--mh-card);
    transition: all 0.25s var(--ease-signature);
    white-space: nowrap;
}

.mh-branch-switcher__item a:hover {
    border-color: var(--mh-accent);
    color: var(--mh-accent);
}

.mh-branch-switcher__item--active a {
    background: var(--mh-accent);
    color: #fff;
    border-color: var(--mh-accent);
    font-weight: 600;
}

/* ============================================
   BRANCH SELECTOR (Homepage 6-Card-Grid)
   ============================================ */
.mh-branch-selector {
    /* Full-bleed breakout aus Kadence Content-Container */
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: var(--space-xl) 0;
    background: var(--mh-bg);
}

.mh-branch-selector__header {
    text-align: center;
    margin-bottom: var(--space-lg);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 clamp(1.5rem, 4vw, 3rem);
}

.mh-branch-selector__title {
    font-family: var(--font-display);
    font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3.6rem);
    font-weight: 600;
    line-height: 1.02;
    letter-spacing: -0.03em;
    color: var(--mh-text);
    margin: 1rem 0 1.25rem;
    text-wrap: balance;
}

.mh-branch-selector__title em,
.mh-branch-selector__title i {
    font-style: italic;
    color: var(--mh-accent);
    font-weight: 400;
}

.mh-branch-selector__subtitle {
    font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.25rem);
    color: var(--mh-text-light);
    line-height: 1.55;
    margin: 0;
    max-width: 56ch;
    margin-left: auto;
    margin-right: auto;
    text-wrap: pretty;
}

.mh-branch-selector__grid {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 clamp(1.5rem, 4vw, 3rem);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

@media (max-width: 900px) {
    .mh-branch-selector__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .mh-branch-selector__grid { grid-template-columns: 1fr; }
}

.mh-branch-card {
    position: relative;
    aspect-ratio: 4 / 5;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--mh-card);
    cursor: pointer;
    transition: transform 0.5s var(--ease-signature), box-shadow 0.5s var(--ease-signature);
    display: block;
}

.mh-branch-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.mh-branch-card__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s var(--ease-signature);
    z-index: 1;
}

.mh-branch-card:hover .mh-branch-card__image {
    transform: scale(1.06);
}

.mh-branch-card__overlay {
    position: absolute;
    inset: 0;
    /* v2-exakt: dunkel von unten nach oben transparent — Lesbarkeit der Karte. */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0.08) 100%);
    z-index: 2;
    transition: background 0.5s var(--ease-signature);
}

.mh-branch-card:hover .mh-branch-card__overlay {
    /* v2-exakt: kräftiges Orange von UNTEN nach oben auslaufend. */
    background: linear-gradient(to top, rgba(255, 59, 0, 0.75) 0%, rgba(0, 0, 0, 0.35) 50%, rgba(0, 0, 0, 0.05) 100%);
}
.mh-branch-card:hover .mh-branch-card__icon {
    background: rgba(255, 255, 255, 0.20);
    transform: scale(1.05);
}

.mh-branch-card__content {
    position: absolute;
    inset: 0;
    z-index: 3;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
}

.mh-branch-card__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.14);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
}

.mh-branch-card__icon svg {
    width: 22px;
    height: 22px;
    stroke: #fff;
    stroke-width: 1.8;
    fill: none;
}

.mh-branch-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.mh-branch-card__title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0;
    color: #fff;
}

.mh-branch-card__tagline {
    font-size: 0.92rem;
    color: rgba(255,255,255,0.85);
    line-height: 1.4;
    max-width: 22ch;
}

.mh-branch-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.02em;
}

.mh-branch-card__cta::after {
    content: '→';
    transition: transform 0.3s var(--ease-signature);
}

.mh-branch-card:hover .mh-branch-card__cta::after {
    transform: translateX(4px);
}

/* ============================================
   BRANCHE FILTER-LEISTE (in-place Filter)
   Bewusst ANDERER Look als Switcher/Selector:
   Pills in einer "Track"-Fläche (Segmented-Control)
   → liest sich klar als Filter, nicht als Navigation.
   ============================================ */
.mh-branche-filter {
    position: sticky;
    top: var(--header-h);
    z-index: 900;
    background: rgba(240, 235, 230, 0.95);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    border-bottom: 1px solid var(--mh-border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); /* analog Sticky-Header */
    min-height: 44px; /* compact */
    display: flex;
    align-items: center;
}

.mh-branche-filter__inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0.3rem clamp(1.25rem, 4vw, 3rem);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
}

.mh-branche-filter__label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: var(--fs-eyebrow);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mh-text-muted);
    flex-shrink: 0;
}

/* Funnel-Glyph → signalisiert "Filter" (kein Nav-Element) */
.mh-branche-filter__label::before {
    content: "";
    width: 12px;
    height: 12px;
    background: currentColor;
    clip-path: polygon(0 0, 100% 0, 62% 46%, 62% 100%, 38% 78%, 38% 46%);
    opacity: 0.75;
}

.mh-branche-filter__list {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    list-style: none;
    margin: 0;
    padding: 0.2rem;
    background: var(--mh-bg-warm, #e8e0d8);
    border: 1px solid var(--mh-border);
    border-radius: var(--radius-pill);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mh-branche-filter__list::-webkit-scrollbar { display: none; }

.mh-branche-filter__pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--mh-text-light);
    border-radius: var(--radius-pill);
    background: transparent;
    white-space: nowrap;
    transition: background 0.25s var(--ease-signature), color 0.25s var(--ease-signature);
}

.mh-branche-filter__pill:hover { color: var(--mh-accent); }

/* Aktiver Filter = "erhabener" Chip in der Track (Segmented-Control-Optik) */
.mh-branche-filter__pill.is-active {
    background: var(--mh-card);
    color: var(--mh-accent);
    font-weight: 650;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
}

.mh-branche-filter__pill--reset:not(.is-active) { color: var(--mh-text-muted); }

/* Einzige Navigations-Affordanz hier — klar sekundär, rechts abgesetzt */
.mh-branche-filter__goto {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--mh-text-light);
    padding-bottom: 1px;
    border-bottom: 1px solid transparent;
    transition: color 0.2s var(--ease-signature), border-color 0.2s var(--ease-signature);
}

.mh-branche-filter__goto:hover {
    color: var(--mh-accent);
    border-bottom-color: var(--mh-accent);
}

.mh-branche-filter__goto svg { transition: transform 0.25s var(--ease-signature); }
.mh-branche-filter__goto:hover svg { transform: translateX(3px); }

/* Dezenter Indikator-Modus (auf /branche/[slug]/) — kein Pill, kein Nav */
.mh-branche-filter--indicator { min-height: 0; }

.mh-branche-filter--indicator .mh-branche-filter__inner {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    gap: 0.75rem;
}

.mh-branche-filter__note {
    font-size: 0.85rem;
    color: var(--mh-text-light);
}

.mh-branche-filter__note strong {
    color: var(--mh-text);
    font-weight: 650;
}

.mh-branche-filter__clear {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--mh-text-muted);
    transition: color 0.2s var(--ease-signature);
}

.mh-branche-filter__clear:hover { color: var(--mh-accent); }

@media (max-width: 700px) {
    .mh-branche-filter__inner { gap: 0.6rem; }
    .mh-branche-filter__label { display: none; }
    .mh-branche-filter__goto { font-size: 0.75rem; }
}
