/* ==========================================================================
   Björn Kaufner – Kunst- & Bauschlosserei
   Statische Nachbildung des Joomla/Beez3-Templates
   Farben, Layout und Typografie wie im Original
   ========================================================================== */

/* ---------- Reset & Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 100%; }

body {
    margin: 0;
    padding: 0;
    background: #747775;
    color: #ffffff;
    font-family: Arial, sans-serif;
    font-size: 0.8em;
    line-height: 1.5;
}

img { max-width: 100%; height: auto; border: 0; display: block; }

a:link, a:visited {
    color: #095197;
    text-decoration: underline;
}
a:hover, a:active, a:focus {
    background: #095197;
    color: #ffffff;
    text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.75em 0;
    font-weight: normal;
    line-height: 1.2;
    color: #ffffff;
    word-wrap: break-word;
}
h1 { font-size: 3.6em; }
h2 { font-size: 1.5em; padding: 5px 0; }
h3 { font-size: 1.4em; padding-bottom: 5px; }
h4 { font-size: 1.2em; }
h5 { font-size: 1.1em; }

p, ol, ul, dl, address {
    margin: 0 0 1.5em 0;
    font-size: 1em;
    line-height: 1.5em;
    word-wrap: break-word;
}

/* ---------- Seiten-Container ---------- */
#all {
    margin: 0 auto;
    max-width: 1050px;
    background: #747775;
    color: #ffffff;
    box-shadow: 0px 20px 10px #555555;
}

#back { margin: 0; padding: 0; }

/* ---------- Header / Logo ---------- */
#header {
    display: block;
    position: relative;
    padding: 1em 0 0 0;
    overflow: hidden;
}

.logoheader {
    margin: 0 10px;
    padding: 0;
    min-height: 160px;
    background: #747775;
    text-align: left;
    line-height: 1.5em;
}

#logo {
    margin: 0 0 0 10px;
    padding: 1em 20px 20px 10px;
    width: 425px;
    font-weight: normal;
    line-height: 1em;
}
#logo img { display: block; }

/* ---------- Content-Bereich: 2-Spalten-Layout ---------- */
#contentarea {
    position: relative;
    overflow: hidden;
    padding: 0 20px;
    margin: 0;
}

#wrapper2 {
    width: 72%;
    float: left;
    position: relative;
    padding-bottom: 20px;
}
#wrapper2 .item-page { max-width: 660px; }

#main {
    padding-top: 10px;
    padding-bottom: 20px;
    position: relative;
}

/* Text-Inhalte: alles weiß auf Grau */
#main p, #main h1, #main h2, #main h3, #main h4, #main li {
    color: #ffffff;
}
#main p { text-align: justify; }

/* ---------- rechte Navigation ---------- */
nav.left {
    float: right;
    margin: 10px 0;
    width: 25%;
    padding-top: 0;
    position: relative;
}

/* Akkordeon-Menü (reines CSS, nutzt <details>/<summary>) */
ul.accordion-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #1a1a1a;
    background: #767777;
    line-height: 16px;
    font-size: 12px;
    overflow: hidden;
}
ul.accordion-menu > li { border-top: 1px solid #1a1a1a; }
ul.accordion-menu > li:first-child { border-top: 0; }

/* Gemeinsame Grundform für alle Menüzeilen */
ul.accordion-menu .item-wrapper {
    min-height: 35px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
}
ul.accordion-menu .menu-link {
    flex: 1;
    display: flex;
    align-items: center;
}
ul.accordion-menu .menu-link a,
ul.accordion-menu > li > .item-wrapper .menu-link {
    display: block;
    padding: 10px 10px 9px 10px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    text-decoration: none;
    color: #ffffff;
    background: none;
    flex: 1;
}
ul.accordion-menu .menu-link img {
    vertical-align: middle;
    border: 0;
    height: auto;
    max-width: 100%;
    padding: 0 5px 0 0;
}

/* Top-Level ohne Submenü: direkter Link */
ul.accordion-menu > li > .item-wrapper .menu-link a {
    padding: 10px;
}
ul.accordion-menu .menu-link a:hover,
ul.accordion-menu .menu-link a:focus {
    background: linear-gradient(#0087d1, #095197);
    color: #ffffff;
}

/* <details>-Gruppenkopf */
ul.accordion-menu details.menu-group {
    background: transparent;
}
ul.accordion-menu details.menu-group > summary {
    list-style: none;      /* Standard-Dreieck ausblenden */
    cursor: pointer;
    padding: 10px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    color: #ffffff;
    user-select: none;
    outline: none;
}
ul.accordion-menu details.menu-group > summary::-webkit-details-marker {
    display: none;
}
ul.accordion-menu details.menu-group > summary:hover,
ul.accordion-menu details.menu-group > summary:focus-visible {
    background: linear-gradient(#0087d1, #095197);
    color: #ffffff;
}

/* Plus-/Minus-Indikator rechts */
ul.accordion-menu details.menu-group > summary .toggle {
    display: inline-block;
    width: 12px;
    height: 12px;
    position: relative;
    flex: 0 0 auto;
    margin-right: 4px;
}
ul.accordion-menu details.menu-group > summary .toggle::before,
ul.accordion-menu details.menu-group > summary .toggle::after {
    content: "";
    position: absolute;
    background: #ffffff;
    transition: transform 0.2s ease;
}
/* horizontaler Balken */
ul.accordion-menu details.menu-group > summary .toggle::before {
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    margin-top: -1px;
}
/* vertikaler Balken (wird beim Öffnen weggedreht) */
ul.accordion-menu details.menu-group > summary .toggle::after {
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
}
ul.accordion-menu details.menu-group[open] > summary .toggle::after {
    transform: rotate(90deg);
}

/* Untermenü */
ul.accordion-menu ul.submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #5f6160;
    border-top: 1px solid #1a1a1a;
}
ul.accordion-menu ul.submenu li {
    border-top: 1px solid #4a4c4b;
}
ul.accordion-menu ul.submenu li:first-child { border-top: 0; }
ul.accordion-menu ul.submenu .menu-link a {
    padding: 8px 10px 8px 28px;
    font-weight: normal;
    font-size: 11px;
}

/* Aktiver Menüpunkt — sowohl Top-Level als auch Submenu */
ul.accordion-menu li.current > .item-wrapper .menu-link a,
ul.accordion-menu ul.submenu li.current > .item-wrapper .menu-link a {
    background: linear-gradient(#0087d1, #095197);
    color: #ffffff;
}
ul.accordion-menu details.menu-group.current > summary {
    /* Gruppenkopf, dessen Unterseite aktiv ist, leicht heller hinterlegt */
}

/* ---------- Slideshow (statt FPSS jetzt pure CSS) ---------- */
.slideshow {
    position: relative;
    width: 100%;
    max-width: 640px;
    height: 260px;
    margin: 0 auto 1em auto;
    overflow: hidden;
    background: #000;
}
.slideshow .slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    animation: slideFade 36s infinite;
}
.slideshow .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.slideshow .slide:nth-child(1) { animation-delay: 0s; }
.slideshow .slide:nth-child(2) { animation-delay: 6s; }
.slideshow .slide:nth-child(3) { animation-delay: 12s; }
.slideshow .slide:nth-child(4) { animation-delay: 18s; }
.slideshow .slide:nth-child(5) { animation-delay: 24s; }
.slideshow .slide:nth-child(6) { animation-delay: 30s; }

/* Version mit weniger als 6 Bildern */
.slideshow.slides-3 .slide { animation: slideFade3 18s infinite; }
.slideshow.slides-3 .slide:nth-child(1) { animation-delay: 0s; }
.slideshow.slides-3 .slide:nth-child(2) { animation-delay: 6s; }
.slideshow.slides-3 .slide:nth-child(3) { animation-delay: 12s; }

@keyframes slideFade {
    0%    { opacity: 0; }
    3%    { opacity: 1; }
    16%   { opacity: 1; }
    19%   { opacity: 0; }
    100%  { opacity: 0; }
}
@keyframes slideFade3 {
    0%    { opacity: 0; }
    5%    { opacity: 1; }
    33%   { opacity: 1; }
    38%   { opacity: 0; }
    100%  { opacity: 0; }
}

/* ---------- Galerie (Referenzbeispiele) ---------- */
.galerie {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin: 1.5em 0;
    padding: 0;
    list-style: none;
}
.galerie li { margin: 0; padding: 0; }
.galerie a {
    display: block;
    background: #3e3f3f;
    padding: 4px;
    text-decoration: none;
    transition: background 0.2s;
}
.galerie a:hover, .galerie a:focus {
    background: #095197;
}
.galerie img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

/* Lightbox (reines CSS) */
.lb { display: none; }
.lb:target {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.lb img {
    max-width: 95%;
    max-height: 95vh;
    object-fit: contain;
}
.lb .close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    text-decoration: none;
    background: transparent;
}
.lb .close:hover {
    background: transparent;
    color: #0087d1;
}

/* ---------- Rückrufformular ---------- */
.rueckruf {
    margin-top: 2em;
    padding: 15px;
    background: #5f6160;
    border: 1px solid #1a1a1a;
}
.rueckruf h3 {
    margin-top: 0;
    padding: 6px 0;
    border-bottom: 1px solid #ddd;
}
.rueckruf label {
    display: block;
    margin: 8px 0 3px 0;
    color: #ffffff;
    font-size: 12px;
}
.rueckruf input[type="text"],
.rueckruf input[type="tel"],
.rueckruf input[type="email"],
.rueckruf textarea {
    width: 100%;
    padding: 4px 6px;
    background: #f8f8f8;
    border: 1px solid #b7b7b7;
    border-radius: 0;
    color: #000;
    font-family: Verdana, Arial, sans-serif;
    font-size: 12px;
    box-sizing: border-box;
}
.rueckruf textarea { min-height: 80px; }
.rueckruf .consent {
    margin-top: 10px;
    font-size: 11px;
    color: #ffffff;
    line-height: 1.4;
}
.rueckruf .consent input { margin-right: 6px; }
.rueckruf .consent a { color: #cfe1ff; }
.rueckruf button {
    margin-top: 10px;
    padding: 8px 20px;
    background: #000;
    color: #fff;
    border: 1px solid transparent;
    font-family: Verdana, Arial, sans-serif;
    font-size: 16px;
    cursor: pointer;
}
.rueckruf button:hover { background: #095197; }

/* Honeypot – für Menschen unsichtbar, Bots sehen und füllen sie aus.
   Absichtlich nicht display:none (das ignorieren viele Bots),
   sondern off-screen gerendert. */
.rueckruf .hp {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- Footer ---------- */
#footer-outer {
    background: #747775;
}
#footer-sub { background: #747775; }
#footer {
    max-width: 1025px;
    margin: 0 auto;
    padding: 20px 10px 30px 10px;
    background: #747775;
    color: #fff;
    box-shadow: 0px 0px 10px #747775;
    text-align: center;
}
#footer h1 {
    margin: 0;
    font-size: 2em;
    text-align: center;
    color: #ffffff;
}
#footer a { color: #fff; }

.wrap { clear: both; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
    #wrapper2, nav.left {
        float: none;
        width: 100%;
    }
    #wrapper2 .item-page { max-width: 100%; }
    nav.left { margin-top: 20px; }
    .logoheader { min-height: auto; }
    #logo { width: auto; padding: 1em 10px; }
    #logo img { max-width: 100%; }
    .slideshow { height: 220px; }
    .galerie { grid-template-columns: repeat(2, 1fr); }
    .galerie img { height: 120px; }
    h1 { font-size: 2.2em; }
}

@media (max-width: 480px) {
    #contentarea { padding: 0 10px; }
    .galerie { grid-template-columns: 1fr; }
    .galerie img { height: 200px; }
    .slideshow { height: 180px; }
}

/* ---------- Print ---------- */
@media print {
    body { background: #fff; color: #000; }
    #all, #main p, #main h1, #main h2, #main h3 { color: #000 !important; background: #fff !important; }
    nav.left, .slideshow, .rueckruf, #footer { display: none; }
    #wrapper2 { width: 100%; float: none; }
}
