/*
 * Rubriken rails — Veranstaltungen / Stellen / Immobilien.
 *
 * Colours come from the site's own custom.css (--redwa, --darkblue).
 * --taz-rail-accent-text is the one added value: --redwa reads at 2.6:1 on
 * white, below the 4.5:1 small-text requirement, so labels use a darkened
 * cyan instead. Everything else reuses what is already there.
 */
:root {
    --taz-rail-accent-text: #00719c;
    --taz-rail-rule: #d9dee2;
    --taz-rail-tint: #eef1f3;
    --taz-rail-muted: #5a6570;
    --taz-rail-faint: #8a939c;
}

.taz-rail {
    margin: 0 0 3.25rem;
}

.taz-rail__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid #000;
    padding-bottom: 7px;
    margin-bottom: 1rem;
}

.taz-rail__title {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    min-width: 0;
}

.taz-rail__title h2 {
    font-family: "Roboto", Arial, sans-serif;
    font-weight: 900;
    font-size: 1.44rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin: 0;
    color: #000;
}

.taz-rail__count {
    font-size: 0.81rem;
    color: var(--taz-rail-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.taz-rail__nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.taz-rail__pos {
    font-size: 0.81rem;
    color: var(--taz-rail-faint);
    letter-spacing: 0.04em;
    min-width: 70px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.taz-rail__nav button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--taz-rail-rule);
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    color: #000 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: border-color 0.15s;
}

.taz-rail__nav button:hover:not(:disabled) { border-color: #000; }
.taz-rail__nav button:disabled { opacity: 0.3; cursor: default; }

.taz-rail__nav svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.taz-rail__track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.taz-rail__track::-webkit-scrollbar { display: none; }

.taz-rail__nav button:focus-visible,
.taz-rail__track:focus-visible,
.taz-card:focus-visible,
.taz-rail__more:focus-visible {
    outline: 2px solid var(--taz-rail-accent-text);
    outline-offset: 2px;
}

/* Card ------------------------------------------------------------------ */

.taz-card {
    flex: 0 0 246px;
    scroll-snap-align: start;
    background: #fff;
    border: 1px solid var(--taz-rail-rule);
    display: flex;
    flex-direction: column;
    text-align: left;
    padding: 0;
    font: inherit;
    color: #000 !important;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.taz-card:hover {
    border-color: #000;
    box-shadow: 0 1px 0 0 var(--redwa, #00aeef);
}

.taz-card__shot {
    display: block;
    background: var(--taz-rail-tint);
    border-bottom: 1px solid var(--taz-rail-rule);
    overflow: hidden;
    position: relative;
}

/* The advertiser's artwork is never cropped, tinted or overlaid. */
.taz-card__shot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.taz-card__shot-empty {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    text-align: center;
    font-size: 0.69rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--taz-rail-faint);
    font-weight: 700;
}

.taz-card__body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 11px 14px 14px;
    flex: 1;
}

.taz-card__label {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.2;
    font-weight: 700;
}

.taz-card__date { color: #000; }
.taz-card__cat { color: var(--taz-rail-accent-text); }

/* Uniform height comes from the body's min-height, never from padding out
   a missing field. A card with no sub-line stays level with its neighbours. */
.taz-card__title {
    font-size: 0.97rem;
    font-weight: 700;
    line-height: 1.32;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.taz-card__sub {
    font-size: 0.81rem;
    color: var(--taz-rail-muted);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.taz-card__kind { font-size: 0.84rem; color: #000; }

.taz-card__tag {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    line-height: 1.2;
}

.taz-card__tag--miete { color: var(--taz-rail-accent-text); }

/* Sale reads as a filled block rather than a second blue: the difference is
   shape as well as colour, so it survives on a phone and without colour. */
.taz-card__tag--kauf {
    color: #fff;
    background: var(--darkblue, #274472);
    display: inline-block;
    padding: 2px 7px;
    align-self: flex-start;
}

.taz-rail--ev .taz-card__shot { height: 138px; }
.taz-rail--ev .taz-card__body { min-height: 88px; }

.taz-rail--job .taz-card__shot { height: 172px; }
.taz-rail--job .taz-card__title { font-size: 1.03rem; line-height: 1.3; }
.taz-rail--job .taz-card__body { min-height: 93px; }

.taz-rail--im .taz-card__shot { height: 138px; }
.taz-rail--im .taz-card__body { min-height: 92px; }

/* Foot ------------------------------------------------------------------ */

.taz-rail__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.875rem;
}

.taz-rail__progress {
    flex: 1;
    height: 3px;
    background: var(--taz-rail-rule);
    position: relative;
    max-width: 360px;
    overflow: hidden;
}

.taz-rail__progress i {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--redwa, #00aeef);
    transition: width 0.2s, transform 0.2s;
}

.taz-rail__more {
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #000;
    text-decoration: none;
    border-bottom: 2px solid var(--redwa, #00aeef);
    padding-bottom: 2px;
    white-space: nowrap;
}

.taz-rail__more:hover {
    color: var(--taz-rail-accent-text);
    text-decoration: none;
    border-bottom-color: var(--redhover, #83d4fc);
}

@media (max-width: 640px) {
    .taz-rail__title h2 { font-size: 1.2rem; }
    .taz-rail__head { align-items: center; }
    .taz-rail__count,
    .taz-rail__pos,
    .taz-rail__nav button { display: none; }
    .taz-card { flex: 0 0 76%; }
    .taz-rail__progress { display: none; }
    .taz-rail__foot { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
    .taz-rail__track { scroll-behavior: auto; }
    .taz-rail *, .taz-rail { transition: none !important; }
}
