/* Stellen.Cloud Portale - gemeinsames Stylesheet.
 *
 * Grundlage ist der Stand aus stellencloud/css/base.css + narrow.css. Der
 * Narrow-Teil steht als @media-Block am Ende, statt als zweite Datei per
 * media-Attribut geladen zu werden -- das kostete einen Request ohne Gewinn.
 *
 * Abweichungen gegenueber der Vorlage sind an Ort und Stelle kommentiert.
 */

:root {
    --main-bg-color: #4276a2f0;
    --main-txt-color: blue;
    --main-padding: 15px;
    /* Logo (7vmin) + Logo-Padding + Header-Rahmen */
    --header-height: calc(7vmin + 10px);
    /* Kühles Anthrazit für zurücktretende Meta-Angaben auf Weiß */
    --muted-txt-color: #5f6b76;
    /* Abstand von der Kastenkante bis zum Text – gilt für Label UND Feld,
       damit beide fluchten. 12px entspricht dem Radius der Label-Pille
       (Höhe 24px, dadurch auf 12px begrenzt): der Text beginnt exakt dort,
       wo die Rundung in die Gerade übergeht. Enger wirkt gedrängt. */
    --field-text-inset: 12px;
    --accent: #47abff;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.style2 {
    font-family: Verdana, Arial, Helvetica, sans-serif;
}

/* overflow-x muss hier stehen (nicht auf body), sonst wird es an den Viewport
   propagiert und scrollbar-gutter bliebe wirkungslos. Der reservierte Platz
   verhindert, dass das Layout zwischen kurzen und langen Inhalten springt. */
html {
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Hintergrund: WebP ist Hauptformat, JPG die Rueckfallebene fuer Browser ohne
 * image-set()/WebP. In der Vorlage setzte background.js das Bild per Zufall im
 * Skript; hier steht ein fester Dateiname, hinter den die .htaccess je nach
 * Minute ein anderes Bild legt. Damit faellt das Skript weg.
 * Pfade sind relativ zu dieser Datei in css/, nicht zum Dokument. */
body.has-background {
    background-image: url("../backgrounds/bg-1920.jpg");
    background-image: image-set(
        url("../backgrounds/bg-1920.webp") type("image/webp"),
        url("../backgrounds/bg-1920.jpg") type("image/jpeg")
    );
}

/* ------------------------------------------------------------------ Header */

#header {
    top: 0;
    position: fixed;
    border-bottom: 2px solid #c0c0c0;
    width: 100%;
    background: var(--main-bg-color);
    z-index: 50;
    background-image: url(headBack.svg);
    background-repeat: no-repeat;
    background-size: cover;
}

#headerTOP {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#headerTOP img {
    height: 7vmin;
    /* width/height stehen als Attribute im Markup, damit der Platz vor dem
       Laden reserviert ist. Ohne width:auto gewinnt das Attribut und das Logo
       wird auf volle Vorlagenbreite gezerrt. */
    width: auto;
    margin-left: 20px;
    padding: 4px;
    cursor: pointer;
}

#headerNav {
    display: flex;
    align-items: center;
    gap: 1.5em;
    margin-right: 1.5em;
}

#headerNav a {
    color: #ffffff;
    font-size: 0.95em;
    white-space: nowrap;
}

#headerNav a:hover {
    text-decoration: underline;
}

#headerBottom {
    display: flex;
}

#filterHolder {
    margin: auto;
}

#filterHolder input,
#filterHolder select {
    width: 100%;
    font-size: 1.6vh;
}

/* -------------------------------------------------------------------- Main */

#main {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    overflow: hidden;
    min-height: 73vh;
    position: absolute;
    /* ohne Breite schrumpft der absolut positionierte Block auf seinen Inhalt,
       wodurch die %-Ränder der Info-Boxen vom Inhalt abhängen würden */
    width: 100%;
    margin-top: calc(var(--header-height) + 0.75em);
}

#mainDataHolder {
    width: 100vw;
}

#mainData {
    padding-left: 4%;
    padding-right: 4%;
}

/* Seitenüberschrift über der Suche – steht auf dem Foto, daher Schatten */
#pageTitle {
    margin: 0 0 0.9em;
    padding: 0 4%;
    text-align: center;
    font-size: 1.4em;
    font-weight: normal;
    color: #ffffff;
    text-shadow: 0 1px 3px rgb(0 0 0 / 0.6);
}

.marginDiv {
    margin: auto;
    width: fit-content;
}

.centerTextAdd {
    display: flex;
    justify-content: center;
    margin: 1em;
}

/* ------------------------------------------------------------------ Filter */

#mainFilter {
    margin-bottom: 3em;
    padding: 0 4%;
}

#mainFilter .marginDiv {
    width: 100%;
    max-width: 640px;
}

.locDiv {
    margin-bottom: 1.6em;
    display: flex;
    gap: 1.5em;
}

.filterWithHeader {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Standort bekommt mehr Raum als die Umkreis-Auswahl */
.locDiv .filterWithHeader:first-child {
    flex: 2;
}

.FilterHeader {
    /* linksbündig mit dem zugehörigen Feld – das Innenpolster entspricht dem
       Feldpolster, dadurch fluchtet auch der Text */
    margin: 0 0 0.45em 0;
    background: white;
    padding: 0.15em var(--field-text-inset);
    width: fit-content;
    border-radius: 1em;
}

#searchTextField,
#umkreisInput,
#keywordSearchElement {
    width: 100%;
    margin: 0;
    font-size: inherit;
    background: #ffffff;
    border-radius: 45px;
    /* Rahmen abziehen, damit der Text auf derselben Kante sitzt wie im Label */
    padding: 0.4em calc(var(--field-text-inset) - 2px);
    z-index: 4;
    position: relative;
    border: 2px solid var(--accent);
}

#keywordSearchElement::placeholder {
    color: rgb(51, 51, 51);
}

/* Ortssuche abgeschaltet, weil Google Places nicht erreichbar ist */
#searchTextField:disabled {
    background: #f0f0f0;
    color: #6b6b6b;
    cursor: not-allowed;
}

/* ------------------------------------------------------------ Trefferliste */

/* Browser-Default-Einzug der Ergebnisliste zurücksetzen */
#content {
    list-style: none;
    margin: 0;
    padding: 0;
}

.listElement {
    display: block;
    background-color: white;
    margin: 0.3em;
    padding: 1em;
}

.listElementHeadLine {
    margin-left: 4%;
    font-size: 0.8em;
    display: flex;
}

.listElementHeadLine > div {
    margin-right: 2em;
}

.listElementHeadLine svg {
    margin-right: 0.5em;
}

/* Quellenangabe tritt gegenüber Datum und Titel zurück */
.listElementHeadLine .provider {
    color: var(--muted-txt-color);
}

.topDiv {
    margin-left: 4%;
    width: 96%;
    display: grid;
    /* exakt die Maximalbreite des Logos – Titel starten dadurch über alle
       Karten hinweg bündig, ohne dass eine breite Restspalte entsteht.
       minmax(0,1fr) statt 1fr: sonst kann die Spalte nicht unter die
       Min-Content-Breite langer Titel schrumpfen und läuft aus der Karte. */
    grid-template-columns: 22vmin minmax(0, 1fr);
    gap: 1.25em;
    align-items: center;
}

.topDiv p {
    color: black;
}

.topDiv a {
    text-decoration: none;
}

.companyLogo {
    max-width: 22vmin;
    max-height: 11vmin;
    display: flex;
}

.title {
    overflow: hidden;
    /* sehr lange Wörter umbrechen statt abschneiden */
    overflow-wrap: break-word;
    color: black;
    text-decoration: none;
    margin-bottom: 1em;
    font-size: 1.3em;
}

a {
    text-decoration: none;
}

a:-webkit-any-link {
    color: #000000;
}

::placeholder {
    color: white;
}

.cloud {
    background: #fff;
    border-radius: 52px;
    box-shadow: 6px 6px 4px rgb(0 0 0 / 0.1);
    position: relative;
    margin-bottom: 30px;
    margin-top: 0;
}

.cloud::after,
.cloud::before {
    background: #fff;
    content: '';
    position: absolute;
    z-index: -1;
}

/* height/top bewusst in px: prozentuale Werte beziehen sich auf die Kartenhöhe
   und ließen die Beulen bei inhaltsreichen Karten in die Karte darüber ragen.
   width/left bleiben in %, da alle Karten gleich breit sind. */
.cloud::after {
    border-radius: 50%;
    height: 68px;
    left: -4%;
    top: -10px;
    width: 16%;
}

.cloud::before {
    border-radius: 75%;
    width: 25%;
    height: 56px;
    left: 3%;
    top: -22px;
}

/* Frueher id="tagBox" -- die ID lag pro Treffer erneut im Dokument und war
   damit nicht eindeutig. */
.tagBox {
    display: flex;
    flex-flow: wrap;
    margin: auto;
    padding-left: 4%;
    padding-right: 4%;
    font-size: 0.8em;
}

.tag {
    position: relative;
    padding: 0.2em;
    padding-left: 1.4em;
    line-height: normal;
    background: #e6e6e694;
    height: fit-content;
    margin: 0.2em;
    color: #1d1d1d;
    width: fit-content;
    outline: 1px solid rgb(70 70 70 / 50%);
}

.tag::before {
    content: "#";
    font-weight: bolder;
    color: var(--accent);
    font-size: 1.2em;
    position: absolute;
    left: 0.15em;
    top: 0.05em;
}

.keineTreffer {
    text-align: center;
    margin: 2em 0 3em;
    color: #ffffff;
    text-shadow: 0 1px 3px rgb(0 0 0 / 0.6);
}

/* ------------------------------------------------------------ Paginierung */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1em;
    margin: 0 0 2.5em;
    padding: 0 4%;
}

.pagination a,
.paginationCurrent {
    padding: 0.5em 1.2em;
    border-radius: 45px;
    font-size: 0.95em;
}

.pagination a {
    background: #ffffff;
    color: #1d1d1d;
    border: 2px solid var(--accent);
}

.pagination a:hover {
    background: var(--accent);
    color: #ffffff;
}

.paginationCurrent {
    color: #ffffff;
    text-shadow: 0 1px 3px rgb(0 0 0 / 0.6);
}

/* ---------------------------------------------------------------- Overlays */

/* Info-Boxen "Eigene Anzeigen" und "Impressum" – gemeinsamer Stil.
   Auf- und Zuklappen laeuft ueber :target, also ueber die Adresse, ohne
   Skript. Die Boxen muessen dafuer VOR #mainDataHolder stehen. */
#booking,
#ImpressumContent {
    display: none;
    margin-left: 10%;
    margin-right: 10%;
    padding: 1em;
    background-color: #ffffff59;
    /* verhindert, dass der Sprung zum Anker unter dem fixen Header landet */
    scroll-margin-top: calc(var(--header-height) + 0.75em);
}

#booking:target,
#ImpressumContent:target {
    display: block;
}

/* Solange eine Info-Box offen ist, tritt die Ergebnisliste zurück */
#booking:target ~ #mainDataHolder,
#ImpressumContent:target ~ #mainDataHolder {
    display: none;
}

.closeOverlay {
    float: right;
}

.container {
    display: inline-block;
    cursor: pointer;
}

/* display:block ist Pflicht, nicht Kosmetik: auf inline-Elementen greifen
   weder width/height noch transform. */
.bar1,
.bar2,
.bar3 {
    display: block;
    width: 35px;
    height: 5px;
    background-color: rgb(255, 255, 255);
    margin: 6px 0;
    transition: 0.4s;
}

.closeX .bar1,
.closeX .bar2,
.closeX .bar3 {
    background-color: rgb(0, 0, 0);
}

.change .bar1 {
    transform: rotate(-45deg) translate(-9px, 6px);
}

.change .bar2 {
    opacity: 0;
}

.change .bar3 {
    transform: rotate(45deg) translate(-8px, -8px);
}

.closeX {
    float: right;
    font-family: cursive;
    font-size: large;
}

.priceTD {
    text-align: right;
    white-space: nowrap;
}

/* -------------------------------------------- Portal-Netzwerk (optional) */

#LinkView {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: auto auto auto auto auto;
    align-items: center;
}

#LinkView img {
    width: 150px;
    height: auto;
}

.photoCredit {
    font-style: normal;
    font-size: 0.8em;
}

/* ------------------------------------------------------------ Ladeanzeige */

/* Ersetzt die 137 KB grosse loading.gif, die per display:none ohnehin nie
   sichtbar wurde, aber trotzdem geladen wurde. */
body.is-loading::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 48px;
    height: 48px;
    margin: -24px 0 0 -24px;
    border: 5px solid rgb(255 255 255 / 0.6);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    z-index: 60;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ------------------------------------------------------------ Schmale Sicht */

@media screen and (max-width: 700px) {
    /* Logo ist hier 14vmin hoch, Nav kann zusätzlich umbrechen */
    :root {
        --header-height: calc(14vmin + 10px);
    }

    body.has-background {
        background-image: url("../backgrounds/bg-960.jpg");
        background-image: image-set(
            url("../backgrounds/bg-960.webp") type("image/webp"),
            url("../backgrounds/bg-960.jpg") type("image/jpeg")
        );
    }

    #headerTOP img {
        height: 14vmin;
        margin: auto;
    }

    #headerNav {
        gap: 0.75em;
        margin-right: 0.75em;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    #headerNav a {
        font-size: 0.8em;
    }

    #mainData {
        padding: 0 3%;
    }

    #mainFilter {
        padding: 0 5%;
    }

    #pageTitle {
        font-size: 1.1em;
        padding: 0 5%;
    }

    .locDiv {
        flex-direction: column;
        gap: 1.2em;
    }

    #booking,
    #ImpressumContent {
        margin-left: 3%;
        margin-right: 3%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bar1,
    .bar2,
    .bar3 {
        transition: none;
    }

    body.is-loading::after {
        animation-duration: 3s;
    }
}
