/* ============================================================
   Führungen Matrix – Frontend
   ============================================================ */
:root {
    --fm-primary:    #1B9B98;
    --fm-closed:     #69132F;
    --fm-white:      #FFFFFF;
    --fm-marble:     #E8E8E8;
    --fm-text-dark:  #4c4c4c;
    --fm-text-muted: #555555;
    --fm-open-bg:    rgba(27,155,152,0.12);
    --fm-closed-bg:  rgba(105,19,47,0.12);
}

#fm-matrix-wrap {
    position: relative;
    font-family: inherit;
}

/* Legend */
.fm-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--fm-text-muted);
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.fm-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.fm-dot-yes { background: var(--fm-primary); }
.fm-dot-no  { background: #854F0B; }

/* Grid */
.fm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

/* Card */
.fm-cell {
    background: var(--fm-white);
    border: 1px solid var(--fm-marble);
    border-top: 3px solid var(--fm-primary);
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    min-height: 110px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.fm-cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.fm-cell--closed,
.fm-cell--contact {
    border-top-color: var(--fm-closed);
}

.fm-cell-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
}
.fm-cell-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--fm-text-dark);
    line-height: 1.3;
    flex: 1;
}
.fm-cell-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.5rem;
    flex-shrink: 0;
    white-space: nowrap;
}
.fm-badge--open {
    background: var(--fm-open-bg);
    color: var(--fm-primary);
    border: 1px solid rgba(27,155,152,0.2);
}
.fm-badge--closed {
    background: var(--fm-closed-bg);
    color: var(--fm-closed);
    border: 1px solid rgba(105,19,47,0.2);
}

.fm-cell-sub {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 12px;
    color: var(--fm-text-muted);
    line-height: 1.4;
}
.fm-cell-sub svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--fm-primary);
}
.fm-cell--closed .fm-cell-sub svg,
.fm-cell--contact .fm-cell-sub svg {
    color: var(--fm-closed);
}

/* Overlay */
.fm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.48);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.fm-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Popup card */
.fm-card {
    background: var(--fm-white);
    border-top: 3px solid var(--fm-primary);
    border: 1px solid var(--fm-marble);
    border-top-width: 3px;
    width: 100%;
    max-width: 480px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transform: scale(0.94);
    transition: transform 0.22s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
}
.fm-overlay.active .fm-card {
    transform: scale(1);
}

.fm-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.fm-card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--fm-text-dark);
    line-height: 1.3;
}
.fm-card-sub {
    font-size: 13px;
    color: var(--fm-text-muted);
    line-height: 1.55;
    padding: 0.7rem 1rem;
    background: rgba(182,221,219,0.2);
    border-left: 3px solid var(--fm-primary);
}
.fm-close {
    background: none;
    border: 1px solid var(--fm-marble);
    padding: 4px 10px;
    font-size: 12px;
    color: var(--fm-text-muted);
    cursor: pointer;
    flex-shrink: 0;
}
.fm-close:hover { background: #F0F0F0; }

.fm-tour-list { display: flex; flex-direction: column; }
.fm-tour-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 0;
    border-bottom: 1px solid var(--fm-marble);
}
.fm-tour-item:last-child { border-bottom: none; }

.fm-tour-link {
    font-size: 14px;
    color: var(--fm-primary);
    text-decoration: none;
    flex: 1;
    line-height: 1.35;
}
.fm-tour-link:hover { text-decoration: underline; }

.fm-booking-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    flex-shrink: 0;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.fm-tag-book {
    background: var(--fm-open-bg);
    color: var(--fm-primary);
    border: 1px solid rgba(27,155,152,0.2);
}
.fm-tag-nobook {
    background: rgba(133,79,11,0.12);
    color: #854F0B;
    border: 1px solid rgba(133,79,11,0.2);
}

.fm-no-tours {
    font-size: 13px;
    color: var(--fm-text-muted);
    padding: 0.5rem 0;
}
.fm-no-tours a {
    color: var(--fm-primary);
}

/* Responsive */
@media (max-width: 600px) {
    .fm-grid { grid-template-columns: 1fr; }
    .fm-cell { min-height: auto; flex-direction: row; align-items: center; }
    .fm-cell-sub { display: none; }
}
