/*
  Heuriger & Weinbau Moravitz – Stylesheet
  Übernommen aus der alten TYPO3-Vorlage (main.css, navigation.css, pagecustomisations.css)
  und um die Handy-Ansicht ergänzt (ab Zeile "Handy-Ansicht").

  Farben der alten Seite:
  Grün        #05852a  Titel
  Hellgelb    #fafad2  Seitenhintergrund
  Gelb        #f9f987  Kopfbereich
  Violett     #6d1aad  Rahmen, Links beim Darüberfahren
  Dunkelviolett #3c0f60 Links
*/

/* ---------- Grundlayout (wie bisher) ---------- */

body {
    margin: 8px;
    background-color: #fafad2;
    font-family: Arial, sans-serif;
}

.outerspace {
    width: 960px;
    margin: 10px auto;
}

.totalspace {
    border: 2px solid #6d1aad;
    background-color: #ffffff;
    background-image: url('../img/layout/shadow_v.png');
    background-repeat: repeat-y;
}

.topspace {
    height: 192px;
    background-color: #f9f987;
}

.logo {
    display: block;
    background-image: url('../img/layout/logo.png');
    background-repeat: no-repeat;
    float: left;
    width: 240px;
    height: 180px;
}

.header {
    clear: right;
    float: right;
    width: 690px;
    margin-top: 70px;
    font-family: 'Arial Black', Arial, sans-serif;
    font-style: italic;
    font-size: 24pt;
    font-weight: bold;
    text-align: center;
    color: #05852a;
}

.header a {
    color: #05852a;
    text-decoration: none;
}

.topshadow {
    background-image: url('../img/layout/shadow_h.png');
    background-repeat: repeat-x;
    float: right;
    width: 681px;
    height: 27px;
}

.edgeshadow {
    background-image: url('../img/layout/edge.png');
    background-repeat: no-repeat;
    width: 279px;
    height: 252px;
}

.mainspace {
    margin: 40px 20px 20px 20px;
    clear: right;
    float: right;
    width: 620px;
}

.bottomspace {
    clear: both;
    height: 10px;
}

.footerspace {
    color: gray;
    text-align: center;
    margin-top: 10px;
}

.footerspace a {
    color: gray;
}

/* Startseite: kein Untermenü, breiterer Inhalt */
.mainspace.home { width: 830px; }
.navspace.home { width: 0; }
.mainspace.home .breadcrumb { display: none; }

/* ---------- Hauptmenü mit Weinranke ---------- */

.leafs {
    background-image: url('../img/layout/blaetterranke.png');
    width: 680px;
    height: 70px;
    margin-top: -10px;
}

.menuknopf { display: none; }

/* Menüpunkte: Text über der Ranke, darunter die Fläche für die Herbstblätter */
.hauptmenue {
    display: flex;
    margin: -100px 0 0 0;
    padding: 0;
    height: 100px;
    list-style: none;
}

.menuitem {
    text-align: center;
    width: 130px;
}

.menuitem a {
    display: block;
    color: #000000;
    text-decoration: none;
}

.menuitemtext {
    display: block;
    font-size: 14pt;
    height: 30px;
}

.menuitemsurface {
    display: block;
    margin-top: -70px;
    width: 130px;
    height: 140px;
}

.menuitem a:hover .menuitemtext,
.menuitem a:focus-visible .menuitemtext,
.menuitem a.activelink .menuitemtext {
    font-weight: bold;
}

.menuitem a:hover .menuitemsurface,
.menuitem a:focus-visible .menuitemsurface,
.menuitem a.activelink .menuitemsurface {
    background-image: url('../img/layout/blaetterranke_highlight.png');
}

.mnuheuriger .menuitemsurface { background-position: 0 0; }
.mnuweinbau .menuitemsurface { background-position: -130px 0; }
.mnuueberuns .menuitemsurface { background-position: -260px 0; }
.mnukontakt .menuitemsurface { background-position: -390px 0; }

/* ---------- Untermenü und Brotkrumen-Leiste ---------- */

.navspace {
    width: 192px;
    float: left;
}

.nav { margin-left: 50px; }

.nav ul {
    padding-left: 0;
    list-style-type: none;
}

.nav ul li {
    margin-bottom: 10px;
    padding-top: 10px;
    border-top: 1px solid gray;
    text-align: center;
    font-weight: bold;
}

.nav ul li:first-child { border-top: 0; }

.nav ul li a {
    color: #3c0f60;
    text-decoration: none;
}

.nav ul li a:hover {
    color: #6d1aad;
    text-decoration: underline;
}

.nav ul li .activelink {
    padding: 5px;
    text-decoration: underline;
    font-size: 14pt;
}

.breadcrumb { margin-bottom: 40px; }

.breadcrumb a {
    text-decoration: none;
    color: #3c0f60;
}

/* ---------- Inhalte: Text mit Bildern ---------- */

.ce { margin-bottom: 20px; }
.ce::after { content: ""; display: block; clear: both; }

/* Bildgruppe; --sp = Anzahl Spalten */
.bilder {
    display: grid;
    grid-template-columns: repeat(var(--sp, 1), auto);
    gap: 10px;
    margin: 0 0 10px 0;
}
.bilder.links { justify-content: start; }
.bilder.mitte { justify-content: center; }
.bilder.rechts { justify-content: end; }
.bilder img { display: block; max-width: 100%; height: auto; }
.bilder.sp2 { --sp: 2; }
.bilder.sp3 { --sp: 3; }
.bilder.rahmen img { border: 2px solid #000000; }
.bilder.sp2 img { width: 295px; }
.bilder.sp3 img { width: 193px; }
.bilder.b200 img { width: 200px; }

/* Bild im Text rechts oder links umflossen */
.bilder.imtext-rechts { float: right; margin: 0 0 10px 10px; }
.bilder.imtext-links { float: left; margin: 0 10px 10px 0; }

.mitte-text { text-align: center; }

.hinweis {
    padding: 10px 14px;
    border: 1px solid #6d1aad;
    background-color: #fafad2;
}

/* ---------- Weinlisten (aus weine.css der alten Vorlage) ---------- */

.weinliste {
    display: grid;
    grid-template-columns: repeat(2, 300px);
    gap: 2px;
}

.wineBox {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto 1fr;
    column-gap: 15px;
    align-content: start;
    width: 300px;
    margin: 0;
    padding: 10px;
    border: 1px solid #cccccc;
    background: none;
    color: #000000;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.wineBox:hover,
.wineBox:focus-visible {
    background-color: #f9f987;
    border-color: #6d1aad;
    outline: none;
}

.wineBox .winePhoto { grid-row: 1 / span 3; }
.wineBox .winePhoto img { display: block; width: 100px; height: auto; }
.wineBox .wineName { margin-top: 5px; font-weight: bold; }
.wineBox .wineSweetness { margin-top: 4px; }
.wineBox .wineAward { margin-top: 4px; color: #05852a; font-weight: bold; }

/* Wein-Fenster */
.popupWine {
    width: 860px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    padding: 12px 20px 20px 20px;
    border: 2px solid #cecece;
    background: #fafad2;
    font-size: 14pt;
    box-sizing: border-box;
}

.popupWine::backdrop { background: rgba(0, 0, 0, 0.7); }

.popupWine h2 {
    margin: 0 50px 20px 0;
    padding-bottom: 2px;
    border-bottom: 1px dotted #d3d3d3;
    font-size: 22px;
    color: #05852a;
}

.popupWineClose {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 5px 9px;
    border: 2px solid #3c0f60;
    background: #ffffff;
    color: #3c0f60;
    font: bold 12pt Arial, sans-serif;
    cursor: pointer;
}

.winePopupInhalt {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.winePopupPhoto { flex: 0 0 auto; }
.winePopupPhoto img { display: block; width: 280px; height: auto; border: 2px solid #000000; }

.wineDaten { flex: 1 1 auto; text-align: center; }
.wineDaten .winePercentageAlc { margin-top: 40px; }
.wineDaten .wineSweetness { margin: 10px 0 20px 0; }
.wineDaten .wineAward { margin-bottom: 20px; color: #05852a; font-weight: bold; }

.wineArea {
    margin: 0;
    padding: 0;
    list-style: none;
    line-height: 1.6;
}

.winePopupPhotosDetail {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.winePopupPhotosDetail img { display: block; height: 150px; width: auto; border: 2px solid #000000; }

a[data-zoom] { cursor: zoom-in; }

/* Bild vergrößert */
.bildansicht {
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-out;
    outline: none;
}

.bildansicht::backdrop { background: rgba(0, 0, 0, 0.85); }

.bildansicht img {
    display: block;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 80px);
    border: 2px solid #ffffff;
}

.bildansicht p {
    margin: 8px 0 0 0;
    color: #ffffff;
    text-align: center;
}

/* ---------- Handy-Ansicht ---------- */

@media (max-width: 979px) {
    body { margin: 0; }

    .outerspace {
        width: auto;
        margin: 0;
    }

    .totalspace {
        border-width: 0 0 2px 0;
        background-image: none;
    }

    .topspace {
        height: auto;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 8px 16px;
    }

    .logo {
        float: none;
        flex: 0 0 auto;
        width: 80px;
        height: 60px;
        background-size: contain;
    }

    .header {
        float: none;
        flex: 1 1 auto;
        width: auto;
        margin: 0;
        font-size: 14pt;
        text-align: left;
        line-height: 1.2;
    }

    .menuknopf {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        gap: 6px;
        padding: 10px 12px;
        border: 2px solid #3c0f60;
        border-radius: 6px;
        background: #fafad2;
        color: #3c0f60;
        font: bold 12pt Arial, sans-serif;
        cursor: pointer;
    }

    .menuknopf .striche,
    .menuknopf .striche::before,
    .menuknopf .striche::after {
        display: block;
        width: 18px;
        height: 2px;
        background: #3c0f60;
        content: "";
    }
    .menuknopf .striche { position: relative; }
    .menuknopf .striche::before { position: absolute; top: -6px; }
    .menuknopf .striche::after { position: absolute; top: 6px; }

    .topshadow {
        float: none;
        width: auto;
        height: auto;
        background-image: none;
        background-color: #ffffff;
    }

    .leafs {
        width: auto;
        height: 44px;
        margin: 0;
        background-size: auto 44px;
        background-repeat: repeat-x;
        background-color: #f9f987;
    }

    .hauptmenue { display: none; margin: 0; height: auto; background-color: #ffffff; }
    .hauptmenue.offen { display: block; border-bottom: 1px solid #cccccc; }

    .menuitem {
        float: none;
        width: auto;
        margin: 0;
        text-align: left;
        border-top: 1px solid #cccccc;
    }

    .menuitem a { padding: 12px 16px; }
    .menuitemtext { height: auto; }
    .menuitemsurface { display: none; }
    .menuitem a.activelink { background-color: #fafad2; }

    .navspace,
    .navspace.home {
        float: none;
        width: auto;
    }

    .edgeshadow { display: none; }

    .nav { margin: 0; }

    .nav ul {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin: 12px 16px 0 16px;
    }

    .nav ul:empty { display: none; }

    .nav ul li,
    .nav ul li:first-child {
        margin: 0;
        padding: 0;
        border: 0;
    }

    .nav ul li a,
    .nav ul li .activelink {
        display: block;
        padding: 8px 12px;
        border: 1px solid #3c0f60;
        border-radius: 16px;
        font-size: 11pt;
        text-decoration: none;
    }

    .nav ul li .activelink {
        background-color: #3c0f60;
        color: #ffffff;
    }

    .mainspace,
    .mainspace.home {
        float: none;
        width: auto;
        margin: 16px;
    }

    .breadcrumb { margin-bottom: 16px; font-size: 10pt; }

    h1 { font-size: 1.6em; }

    .bilder.sp2,
    .bilder.sp3 { grid-template-columns: repeat(var(--sp), minmax(0, 1fr)); }
    .bilder.sp2 img,
    .bilder.sp3 img,
    .bilder.b200 img { width: 100%; }

    .weinliste { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }

    .wineBox {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: auto;
        text-align: center;
    }

    .popupWine { padding: 12px 14px 16px 14px; font-size: 12pt; }
    .popupWine h2 { font-size: 18px; }
    .winePopupInhalt { flex-direction: column; align-items: center; gap: 10px; }
    .winePopupPhoto img { width: 200px; }
    .wineDaten .winePercentageAlc { margin-top: 0; }
    .winePopupPhotosDetail { justify-content: center; }
    .winePopupPhotosDetail img { height: 100px; }

    .footerspace {
        padding: 0 16px 16px 16px;
        font-size: 10pt;
        line-height: 1.6;
    }
}

@media (max-width: 559px) {
    .bilder.imtext-rechts,
    .bilder.imtext-links {
        float: none;
        margin: 0 0 10px 0;
        justify-content: center;
    }

    .bilder.sp3 { --sp: 2; }
}
