/* =========================================================
   TSG Salach · Seite „Mitglied werden“ (Layout mitglied-werden)
   Wird nur vom Beitragslayout geladen, nicht von index.php.
   Alle Regeln beginnen mit .tsg-mb. Ausnahme: drei Regeln für
   Inhaltskarte und Sidebar, die über :has(.tsg-mb) nur auf dieser
   Seite greifen. Farben und Schrift kommen aus dem Template.
   ========================================================= */

/* ---------- Nur diese Seite: volle Breite, keine Sidebar, keine weiße Inhaltskarte ---------- */
.content-grid.content-grid:has(.tsg-mb) {
    grid-template-columns: minmax(0, 1fr);
}
.content-grid:has(.tsg-mb) > .sidebar {
    display: none;
}
.main-content.main-content:has(.tsg-mb) {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

/* ---------- Grundgerüst ---------- */
.tsg-mb {
    --mb-blue: var(--blue, #086bb2);
    --mb-navy: var(--navy, #092d4d);
    --mb-ink: var(--ink, #132d43);
    --mb-muted: var(--muted, #59748a);
    --mb-bg: var(--bg, #f3f7fb);
    --mb-line: var(--line, #dce8f1);
    --mb-surface: #fff;
    --mb-r-md: 12px;
    --mb-r-lg: 20px;
    --mb-fast: 150ms;
    --mb-base: 300ms;
    --mb-slow: 500ms;
    --mb-ease: cubic-bezier(.4, 0, .2, 1);
    --mb-ease-out: cubic-bezier(0, 0, .2, 1);
    --mb-ease-reveal: cubic-bezier(.16, 0, .13, 1);
    --mb-pad: 24px;

    container-type: inline-size;
    container-name: tsgmb;
    display: flex;
    flex-direction: column;
    gap: 72px;
    color: var(--mb-ink);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
}
.tsg-mb *,
.tsg-mb *::before,
.tsg-mb *::after {
    box-sizing: border-box;
}
@container tsgmb (min-width: 1150px) {
    .tsg-mb .tsg-mb-fees { --mb-pad: 32px; }
}
@container tsgmb (min-width: 1000px) and (max-width: 1149px) {
    .tsg-mb .tsg-mb-fees .tsg-mb-h3 { font-size: 18px; line-height: 24px; }
}

/* Typografie (alle mit Klasse, damit Template-Regeln für h1, p, a nicht hineinwirken) */
.tsg-mb .tsg-mb-eyebrow {
    margin: 0;
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mb-muted);
}
.tsg-mb .tsg-mb-h1 {
    margin: 0;
    font-family: inherit;
    font-size: clamp(34px, 5.4vw, 52px);
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--mb-ink);
    text-wrap: balance;
}
.tsg-mb .tsg-mb-h2 {
    margin: 0;
    font-family: inherit;
    font-size: clamp(26px, 4vw, 32px);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.015em;
    color: var(--mb-ink);
    text-wrap: balance;
}
.tsg-mb .tsg-mb-h3 {
    margin: 0;
    font-family: inherit;
    font-size: 20px;
    line-height: 26px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--mb-ink);
    hyphens: manual;
    -webkit-hyphens: manual;
    overflow-wrap: break-word;
}
.tsg-mb .tsg-mb-lnk {
    color: var(--mb-navy);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.tsg-mb .tsg-mb-lnk:hover {
    color: var(--mb-blue);
}
.tsg-mb :focus-visible {
    outline: 2px solid var(--mb-navy);
    outline-offset: 3px;
}
.tsg-mb .tsg-mb-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Buttons ---------- */
.tsg-mb .tsg-mb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 24px;
    border: 2px solid transparent;
    border-radius: 9999px;
    background: none;
    color: var(--mb-ink);
    font: inherit;
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    letter-spacing: .01em;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--mb-base) var(--mb-ease-out), border-color var(--mb-base) var(--mb-ease-out), color var(--mb-base) var(--mb-ease-out), transform var(--mb-fast) var(--mb-ease);
}
.tsg-mb .tsg-mb-btn:hover,
.tsg-mb .tsg-mb-btn:focus {
    text-decoration: none;
}
.tsg-mb .tsg-mb-btn:active {
    transform: scale(.97);
}
.tsg-mb .tsg-mb-btn[hidden] {
    display: none;
}
.tsg-mb .tsg-mb-btn-ico {
    width: 18px;
    height: 18px;
    flex: none;
}
.tsg-mb .tsg-mb-btn--secondary {
    width: 100%;
    margin-top: 24px;
    padding-inline: 16px;
    border-color: var(--mb-muted);
    color: var(--mb-ink);
}
.tsg-mb .tsg-mb-btn--secondary:hover {
    border-color: var(--mb-ink);
    color: var(--mb-ink);
}
.tsg-mb .tsg-mb-btn--light {
    background: var(--mb-surface);
    color: var(--mb-navy);
}
.tsg-mb .tsg-mb-btn--light:hover {
    background: var(--mb-bg);
    color: var(--mb-navy);
}
.tsg-mb .tsg-mb-btn--line {
    border-color: var(--mb-surface);
    color: var(--mb-surface);
}
.tsg-mb .tsg-mb-btn--line:hover {
    background: rgba(255, 255, 255, .14);
    color: var(--mb-surface);
}

/* ---------- 1 · Einstieg ---------- */
.tsg-mb .tsg-mb-hero {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 680px;
    padding-top: 8px;
}
.tsg-mb .tsg-mb-lead,
.tsg-mb .tsg-mb-lead p {
    margin: 0;
    font-size: 18px;
    line-height: 28px;
    color: var(--mb-muted);
    max-width: 56ch;
}
.tsg-mb .tsg-mb-lead p + p {
    margin-top: 12px;
}

/* ---------- Abschnittsköpfe ---------- */
.tsg-mb .tsg-mb-sec-head {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 680px;
    margin-bottom: 32px;
}
.tsg-mb .tsg-mb-sec-lead {
    margin: 0;
    font-size: 18px;
    line-height: 28px;
    color: var(--mb-muted);
}

/* ---------- 2 · Hauptverein: fünf Karten immer in einer Reihe ---------- */
.tsg-mb .tsg-mb-fees {
    display: grid;
    grid-template-columns: repeat(5, minmax(212px, 1fr));
    gap: 16px;
    margin: 0;
    padding: 4px 0 12px;
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}
.tsg-mb .tsg-mb-fees > .tsg-mb-card {
    scroll-snap-align: start;
}
@container tsgmb (min-width: 1000px) {
    .tsg-mb .tsg-mb-fees {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        overflow: visible;
        padding-bottom: 0;
    }
}

.tsg-mb .tsg-mb-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 0;
    padding: var(--mb-pad);
    background: var(--mb-surface);
    border: 1px solid var(--mb-line);
    border-radius: var(--mb-r-md);
    transition: border-color var(--mb-base) var(--mb-ease-out), transform var(--mb-base) var(--mb-ease-out), opacity var(--mb-slow) var(--mb-ease-reveal);
}
.tsg-mb .tsg-mb-card:hover {
    border-color: var(--mb-muted);
    transform: translateY(-2px);
}
.tsg-mb .tsg-mb-card-head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.tsg-mb .tsg-mb-card-text {
    margin: 0;
    font-size: 14px;
    line-height: 20px;
    color: var(--mb-muted);
}
.tsg-mb .tsg-mb-price {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 32px 0 0;
}
.tsg-mb .tsg-mb-amount {
    font-size: 48px;
    line-height: 52px;
    font-weight: 700;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    color: var(--mb-ink);
}
.tsg-mb .tsg-mb-amount--na {
    font-size: 24px;
    line-height: 30px;
}
.tsg-mb .tsg-mb-unit {
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    color: var(--mb-muted);
}

/* Hinweisleiste unter den Karten */
.tsg-mb .tsg-mb-note {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 4px 16px;
    align-items: start;
    margin-top: 24px;
    padding: 24px 32px;
    background: var(--mb-bg);
    border-radius: var(--mb-r-md);
}
.tsg-mb .tsg-mb-note-ico {
    width: 24px;
    height: 24px;
    grid-row: span 2;
    color: var(--mb-blue);
}
.tsg-mb .tsg-mb-note-title {
    margin: 0;
    font-size: 20px;
    line-height: 26px;
    font-weight: 700;
    color: var(--mb-ink);
}
.tsg-mb .tsg-mb-note-text {
    margin: 0;
    max-width: 80ch;
    font-size: 14px;
    line-height: 20px;
    color: var(--mb-muted);
}
.tsg-mb .tsg-mb-foot {
    margin: 24px 0 0;
    font-size: 14px;
    line-height: 20px;
    color: var(--mb-muted);
}

/* ---------- 3 · TSG-Fit ---------- */
.tsg-mb .tsg-mb-fit-head {
    display: grid;
    gap: 24px;
    align-items: end;
    margin-bottom: 32px;
}
.tsg-mb .tsg-mb-fit-head .tsg-mb-sec-head {
    margin-bottom: 0;
}
@container tsgmb (min-width: 860px) {
    .tsg-mb .tsg-mb-fit-head { grid-template-columns: 1fr auto; }
}

.tsg-mb .tsg-mb-seg {
    position: relative;
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    justify-self: start;
    padding: 4px;
    background: var(--mb-bg);
    border: 1px solid var(--mb-line);
    border-radius: 9999px;
}
.tsg-mb .tsg-mb-seg button {
    position: relative;
    z-index: 1;
    min-height: 40px;
    margin: 0;
    padding: 0 20px;
    background: none;
    border: 0;
    border-radius: 9999px;
    color: var(--mb-muted);
    font: inherit;
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    letter-spacing: .01em;
    cursor: pointer;
    transition: color var(--mb-base) var(--mb-ease-out);
}
.tsg-mb .tsg-mb-seg button[aria-checked="true"],
.tsg-mb .tsg-mb-seg button:hover {
    color: var(--mb-ink);
}
.tsg-mb .tsg-mb-seg-thumb {
    position: absolute;
    z-index: 0;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc((100% - 8px) / 2);
    background: var(--mb-surface);
    border: 1px solid var(--mb-line);
    border-radius: 9999px;
    transform: translateX(calc(100% * var(--pos, 0)));
    transition: transform var(--mb-base) var(--mb-ease);
}

.tsg-mb .tsg-mb-fit {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}
@container tsgmb (min-width: 600px) {
    .tsg-mb .tsg-mb-fit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tsg-mb .tsg-mb-once { grid-column: 1 / -1; }
}
@container tsgmb (min-width: 960px) {
    .tsg-mb .tsg-mb-fit { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .tsg-mb .tsg-mb-once { grid-column: auto; }
}
.tsg-mb .tsg-mb-card--fit {
    --mb-pad: 32px;
}
.tsg-mb .tsg-mb-card--fit .tsg-mb-h3,
.tsg-mb .tsg-mb-once .tsg-mb-h3 {
    font-size: 24px;
    line-height: 30px;
}
.tsg-mb .tsg-mb-card--fit .tsg-mb-price {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}
.tsg-mb .tsg-mb-card--fit .tsg-mb-amount {
    font-size: 56px;
    line-height: 60px;
}
.tsg-mb .tsg-mb-fit-note {
    min-height: 40px;
    margin: 4px 0 0;
    font-size: 14px;
    line-height: 20px;
    color: var(--mb-muted);
}
.tsg-mb .tsg-mb-swap {
    transition: opacity var(--mb-fast) var(--mb-ease);
}
.tsg-mb .tsg-mb-swap.is-out {
    opacity: 0;
}

/* Ohne JavaScript: Umschalter aus, beide Varianten untereinander mit Beschriftung */
.tsg-mb .tsg-mb-mode {
    display: none;
    margin: 32px 0 0;
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mb-muted);
}
.tsg-mb .tsg-mb-mode + .tsg-mb-price {
    margin-top: 8px;
}
.tsg-mb.tsg-mb--nojs .tsg-mb-seg {
    display: none;
}
.tsg-mb.tsg-mb--nojs .tsg-mb-mode {
    display: block;
}
.tsg-mb.tsg-mb--js .tsg-mb-alt {
    display: none;
}

/* Einmalige Kosten */
.tsg-mb .tsg-mb-once {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 32px;
    background: var(--mb-bg);
    border-radius: var(--mb-r-md);
    transition: opacity var(--mb-slow) var(--mb-ease-reveal), transform var(--mb-slow) var(--mb-ease-reveal);
}
.tsg-mb .tsg-mb-once-text {
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 20px;
    color: var(--mb-muted);
}
.tsg-mb .tsg-mb-dl {
    display: flex;
    flex-direction: column;
    margin: 24px 0 0;
    padding: 0;
}
.tsg-mb .tsg-mb-dl-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 16px;
    padding: 16px 0;
    border-top: 1px solid var(--mb-line);
}
.tsg-mb .tsg-mb-dt {
    margin: 0;
    font-size: 16px;
    line-height: 24px;
    font-weight: 500;
}
.tsg-mb .tsg-mb-dd {
    margin: 0;
    font-size: 24px;
    line-height: 30px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.tsg-mb .tsg-mb-dd-sub {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 14px;
    line-height: 20px;
    color: var(--mb-muted);
}

/* ---------- 4 · Gut zu wissen ---------- */
.tsg-mb .tsg-mb-know {
    display: grid;
    gap: 32px;
}
@container tsgmb (min-width: 860px) {
    .tsg-mb .tsg-mb-know {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
        gap: 48px;
    }
}
.tsg-mb .tsg-mb-know .tsg-mb-sec-head {
    margin-bottom: 24px;
}
.tsg-mb .tsg-mb-contact {
    margin: 0;
    font-size: 14px;
    line-height: 20px;
    color: var(--mb-muted);
}
.tsg-mb .tsg-mb-facts {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--mb-line);
}
.tsg-mb .tsg-mb-fact {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 16px;
    margin: 0;
    padding: 24px 0;
    border-bottom: 1px solid var(--mb-line);
}
.tsg-mb .tsg-mb-fact::before,
.tsg-mb .tsg-mb-fact::marker {
    content: none;
}
.tsg-mb .tsg-mb-fact-ico {
    width: 22px;
    height: 22px;
    margin-top: 1px;
    color: var(--mb-blue);
}
.tsg-mb .tsg-mb-fact-title {
    margin: 0 0 4px;
    font-size: 16px;
    line-height: 24px;
    font-weight: 600;
    color: var(--mb-ink);
}
.tsg-mb .tsg-mb-fact-text {
    margin: 0;
    max-width: 62ch;
    color: var(--mb-muted);
}

/* ---------- 5 · Abschluss (blaue Fläche, ohne Wappenmotiv: das Template zeigt das Wappen bereits) ---------- */
.tsg-mb .tsg-mb-end {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 48px 32px;
    background: var(--mb-blue);
    border-radius: var(--mb-r-lg);
    color: #fff;
}
@container tsgmb (min-width: 720px) {
    .tsg-mb .tsg-mb-end { padding: 72px 48px; }
}
.tsg-mb .tsg-mb-end .tsg-mb-eyebrow,
.tsg-mb .tsg-mb-end .tsg-mb-end-title {
    color: #fff;
}
.tsg-mb .tsg-mb-end-title {
    max-width: 560px;
    font-size: clamp(30px, 4.4vw, 44px);
    line-height: 1.12;
}
.tsg-mb .tsg-mb-end-text {
    margin: 0;
    max-width: 520px;
    font-size: 18px;
    line-height: 28px;
    color: #fff;
}
.tsg-mb .tsg-mb-end-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

/* ---------- Bewegung ---------- */
@keyframes tsg-mb-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}
.tsg-mb .tsg-mb-rise {
    animation: tsg-mb-rise var(--mb-slow) var(--mb-ease-reveal) both;
    animation-delay: calc(var(--i, 0) * 80ms + 60ms);
}
.tsg-mb .tsg-mb-reveal {
    transition-property: opacity, transform, border-color;
    transition-duration: var(--mb-slow), var(--mb-slow), var(--mb-base);
    transition-timing-function: var(--mb-ease-reveal), var(--mb-ease-reveal), var(--mb-ease-out);
    transition-delay: calc(var(--i, 0) * 70ms), calc(var(--i, 0) * 70ms), 0ms;
}
.tsg-mb .tsg-mb-reveal.is-pre {
    opacity: 0;
    transform: translateY(14px);
}
@media (prefers-reduced-motion: reduce) {
    .tsg-mb *,
    .tsg-mb *::before,
    .tsg-mb *::after {
        animation: none !important;
        transition: none !important;
    }
    .tsg-mb .tsg-mb-reveal.is-pre {
        opacity: 1;
        transform: none;
    }
}

/* ---------- Schmale Bildschirme ---------- */
@container tsgmb (max-width: 560px) {
    .tsg-mb .tsg-mb-note { padding: 20px; }
    .tsg-mb .tsg-mb-card--fit,
    .tsg-mb .tsg-mb-once { --mb-pad: 24px; padding: 24px; }
    .tsg-mb .tsg-mb-card--fit .tsg-mb-amount { font-size: 48px; line-height: 52px; }
}

/* ---------- Diagnose (nur angemeldete Super User mit ?tsgmb_debug=1) ---------- */
.tsg-mb .tsg-mb-diag {
    padding: 16px 20px;
    border: 2px dashed var(--mb-muted);
    border-radius: var(--mb-r-md);
    background: var(--mb-surface);
    font-size: 13px;
    line-height: 18px;
}
.tsg-mb .tsg-mb-diag-title {
    margin: 0 0 8px;
    font-weight: 600;
}
.tsg-mb .tsg-mb-diag-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}
.tsg-mb .tsg-mb-diag-table th,
.tsg-mb .tsg-mb-diag-table td {
    padding: 4px 8px;
    border-top: 1px solid var(--mb-line);
    text-align: left;
    font-weight: 400;
    vertical-align: top;
}
.tsg-mb .tsg-mb-diag-table th {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    width: 40%;
}
.tsg-mb .tsg-mb-diag-table .is-warn td {
    color: var(--mb-navy);
    font-weight: 600;
}
