/*
 * Gestaltung des Markt-Moduls: Standanmeldung (Formular, Statusseite) und interaktiver Marktplan.
 * Farben der Marke kommen als Variablen aus sv-basis (inc/design.php); die Werte nach dem Komma sind nur Rueckfall.
 * Linien, Rundungen und Toenungen kommen aus sv-basis/assets/portal.css (--sv-linie, --sv-radius ...).
 * Keine fremden Schriften oder Bilder. Klassen beginnen mit sv-.
 */

/* Allgemeine Bausteine (.sv-hinweis, .sv-knopf, .sv-form, .sv-gruppe, .sv-feld, .sv-daten, .sv-nur-leser ...) stehen in sv-basis/assets/portal.css */

.sv-markt-name {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* ---- Fragebogen: Titel einer Gruppe aus Radioknoepfen oder Haken, Wahlfelder im Feld ---- */
.sv-feld-titel {
    display: block;
    margin-bottom: .25rem;
    font-weight: 500;
}
.sv-feld .sv-wahl {
    display: flex;   /* .sv-feld label (portal.css) ist spezifischer als .sv-wahl und machte sie sonst zu Blockelementen */
}

/* ---- Statusseite der Anmeldung -------------------------------------------- */
.sv-anmeldung-status {
    max-width: 40rem;
    padding: 1.1rem 1.25rem;
    background: #fff;
    border: 1px solid var(--sv-linie, rgba(0, 0, 0, .08));
    border-radius: var(--sv-radius, 12px);
}
.sv-anmeldung-status h3 {
    margin-top: 0;
}
.sv-status-marke {
    display: inline-block;
    padding: .15rem .7rem;
    border-radius: 999px;
    background: #e8e8ef;
    color: #2a2a40;
    font-size: .875rem;
    font-weight: 600;
}
.sv-status-zugesagt .sv-status-marke {
    background: #d3f0da;
    color: #0b3d1a;
}
.sv-status-neu .sv-status-marke {
    background: #fdf0c4;
    color: #4a3b00;
}
.sv-status-warteliste .sv-status-marke {
    background: #dbe7fb;
    color: #12306a;
}
.sv-status-abgesagt .sv-status-marke {
    background: #f6d5d3;
    color: #5c0f0a;
}
.sv-stand-zeile {
    font-size: 1.1rem;
}
.sv-zurueckziehen {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--sv-linie, rgba(0, 0, 0, .08));
}

/* ---- Marktplan -------------------------------------------------------------- */
.sv-plan {
    margin: 1rem 0;
}
.sv-plan-werkzeuge {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .5rem;
}
.sv-plan-werkzeuge[hidden] {
    display: none;
}
.sv-plan-suche {
    flex: 1 1 14rem;
}
.sv-plan-suche input,
.sv-plan-filter select {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    padding: .5rem .7rem;
    font: inherit;
    color: inherit;
    background: #fff;
    border: 1px solid #767676;
    border-radius: var(--sv-radius-klein, 8px);
}
.sv-plan-buehne {
    position: relative;
    height: min(72vh, 680px);
    min-height: 320px;
    overflow: hidden;
    background: #e9ecef;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: var(--sv-radius, 12px);
}
.sv-plan-svg {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
}
.sv-plan-svg.ist-am-ziehen {
    cursor: grabbing;
}
.sv-plan-svg:focus-visible {
    outline: 2px solid var(--sv-primaer-text, #7a1b3c);
    outline-offset: -2px;
}
.sv-stand {
    cursor: pointer;
    outline: none;
}
.sv-stand-flaeche {
    fill: var(--sv-stand-farbe, #888);
    stroke: rgba(0, 0, 0, .55);
    stroke-width: 1px;
    vector-effect: non-scaling-stroke;
}
.sv-st-frei .sv-stand-flaeche,
.sv-st-reserviert .sv-stand-flaeche {
    fill-opacity: .3;
    stroke-dasharray: 4 3;
}
.sv-st-frei .sv-stand-nr,
.sv-st-reserviert .sv-stand-nr {
    fill: #111 !important;
}
.sv-stand:focus-visible .sv-stand-flaeche,
.sv-stand.ist-gewaehlt .sv-stand-flaeche {
    stroke: #000;
    stroke-width: 3px;
    stroke-dasharray: none;
}
.sv-stand-nr {
    font-family: inherit;
    font-weight: 700;
    pointer-events: none;
}
/* Name einer Einrichtung neben dem Stand (zu lang fuer den Stand): dunkle Schrift mit hellem Rand, Randbreite setzt plan-kern.js */
.sv-stand-nr.ist-aussen {
    fill: #111 !important;
    stroke: #fff;
    stroke-linejoin: round;
    paint-order: stroke;
}
.sv-stand.ist-gedimmt {
    opacity: .15;
    pointer-events: none;
}
.sv-plan-knoepfe {
    position: absolute;
    top: .5rem;
    right: .5rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.sv-plan-knoepfe[hidden] {
    display: none;
}
.sv-plan-knopf {
    width: 44px;
    height: 44px;
    padding: 0;
    font: inherit;
    font-size: 1.35rem;
    line-height: 1;
    color: #111;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .2);
    border-radius: var(--sv-radius-klein, 8px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
    cursor: pointer;
}
.sv-plan-knopf:hover,
.sv-plan-knopf:focus-visible {
    background: #f1f1f1;
}
/* Handy: Angaben als Karte ueber der App-Leiste (sonst verdeckt sie die Leiste, wenn der Plan unten ueber den Rand ragt) */
.sv-plan-info {
    position: fixed;
    left: .5rem;
    right: .5rem;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px) + .5rem);
    z-index: 70;
    max-height: 40vh;
    overflow: auto;
    padding: .75rem 1rem;
    color: #111;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: var(--sv-radius, 12px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .16);
}
.sv-plan-info[hidden] {
    display: none;
}
.sv-plan-info p {
    margin: .25rem 0 0;
}
.sv-plan-info-kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}
.sv-plan-info-name {
    font-size: 1.1rem;
    font-weight: 600;
}
.sv-plan-info-kat {
    font-size: .875rem;
    opacity: .75;
}
.sv-plan-info-zu {
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 1.5rem;
    line-height: 1;
    color: #111;
    background: #f1f1f1;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}
@media (min-width: 700px) {
    .sv-plan-info {
        position: absolute;
        left: auto;
        right: .75rem;
        bottom: .75rem;
        z-index: auto;
        width: 320px;
        max-height: 48%;
    }
}
.sv-plan.ist-gross .sv-plan-info {
    bottom: .75rem;
}
.sv-plan-legende {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1.1rem;
    margin: .7rem 0 .3rem;
    padding: 0;
    list-style: none;
    font-size: .875rem;
}
.sv-legende-feld {
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-right: .4em;
    border: 1px solid rgba(0, 0, 0, .55);
    border-radius: 3px;
    vertical-align: -.15em;
}
.sv-legende-frei {
    background: transparent;
    border-style: dashed;
}
.sv-plan-hinweis,
.sv-plan-quelle {
    margin: .25rem 0;
    font-size: .8125rem;
    opacity: .8;
}
.sv-plan-hinweis[hidden] {
    display: none;
}
.sv-plan-liste h3 {
    margin: 1.5rem 0 .5rem;
}
.sv-tabelle-rahmen {
    overflow-x: auto;
}
.sv-tabelle {
    width: 100%;
    border-collapse: collapse;
    font-size: .9375rem;
}
.sv-tabelle th,
.sv-tabelle td {
    padding: .5rem .6rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--sv-linie, rgba(0, 0, 0, .08));
}
.sv-tab-nr {
    white-space: nowrap;
}
.sv-plan-zeigen {
    min-width: 2.5rem;
    padding: .25rem .6rem;
    font: inherit;
    font-weight: 600;
    color: var(--sv-primaer-flaeche-kontrast, #fff);
    background: var(--sv-primaer-flaeche, #7a1b3c);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}
.sv-plan-zeigen[hidden],
.sv-tab-nr-text[hidden] {
    display: none;
}

/* Vollbild (ohne die Vollbild-Schnittstelle des Browsers: laeuft auch auf dem iPhone) */
.sv-plan.ist-gross {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: .5rem;
    background: var(--sv-hintergrund, #f6f7f8);
}
.sv-plan.ist-gross .sv-plan-buehne {
    flex: 1;
    height: auto;
    min-height: 0;
}
.sv-plan.ist-gross .sv-plan-liste,
.sv-plan.ist-gross .sv-plan-hinweis {
    display: none;
}
html.sv-plan-gross-offen {
    overflow: hidden;
}

/* ---- Markt-Kasten mit Plakat (Startseite) --------------------------------- */
.sv-mk {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid var(--sv-linie, rgba(0, 0, 0, .08));
    border-radius: var(--sv-radius, 12px);
}
/* Handy: erst das Wichtigste (Name, Tag, Knoepfe), das Plakat darunter. Es ist hoch und schoebe sonst alles unter den Bildschirmrand. */
.sv-mk-plakat {
    order: 2;
    align-self: center;
    display: block;
    width: min(100%, 280px);
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .14);
}
.sv-mk-plakat:focus-visible {
    outline: 2px solid var(--sv-primaer-text, #7a1b3c);
    outline-offset: 3px;
}
.sv-mk-bild {
    display: block;
    width: 100%;
    height: auto;
}
.sv-mk-text {
    order: 1;
    min-width: 0;
}
.sv-mk-titel {
    margin: 0 0 .35rem;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -.015em;
    line-height: 1.2;
}
.sv-mk-wann {
    margin: 0 0 .15rem;
    font-size: 1.025rem;
}
.sv-mk-wann strong {
    font-weight: 600;
}
.sv-mk-ort {
    margin: 0 0 .6rem;
    opacity: .8;
}
.sv-mk-beschreibung {
    margin: 0 0 .6rem;
}
.sv-mk-beschreibung p {
    margin: 0 0 .5rem;   /* die Absaetze des Editors */
}
.sv-mk-beschreibung p:last-child {
    margin-bottom: 0;
}
.sv-mk-beschreibung ul,
.sv-mk-beschreibung ol {
    margin: 0 0 .5rem;
    padding-left: 1.25rem;   /* Listen aus dem Editor */
}
.sv-mk-beschreibung blockquote {
    margin: 0 0 .5rem;
    padding-left: .75rem;
    border-left: 3px solid var(--sv-linie, rgba(0, 0, 0, .15));
}
.sv-mk-beschreibung a {
    color: var(--sv-primaer-text, #7a1b3c);
}
.sv-mk-frist {
    margin: 0 0 .25rem;
    font-size: .875rem;
    font-weight: 500;
    color: var(--sv-primaer-text, #7a1b3c);
}
.sv-mk-knoepfe {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: .6rem 0 0;
}
@media (min-width: 560px) {
    .sv-mk.hat-plakat {
        flex-direction: row;
        align-items: flex-start;
    }
    .sv-mk.hat-plakat .sv-mk-plakat {
        order: 0;   /* breiter Bildschirm: das Plakat steht links neben dem Text */
        flex: none;
        width: 230px;
    }
}
