/*
 * TOHOSIS – Layout angelehnt an "Phantom" von HTML5 UP (html5up.net, CC BY 3.0)
 * Eigenständig neu geschrieben, ohne Build-Tools / SASS.
 */

:root {
    --text: #585858;
    --text-hell: #9a9a9a;
    --rand: #c9c9c9;
    --rand-hell: rgba(88, 88, 88, .15);
    --hintergrund: #ffffff;
    --footer: #f6f6f6;
    --akzent: #f2849e;
    --logo: #39454b;
    --logo-rot: #c74343;
    --button: rgba(199, 67, 67, .08);        /* dezentes Rot als zarte Fläche */
    --button-rand: rgba(199, 67, 67, .35);
    --button-text: #a83636;                  /* dunkleres Rot für gute Lesbarkeit */
    --button-hover: #c74343;                 /* beim Überfahren: Logo-Rot, gefüllt */
    --grundschrift: 1.5em;    /* Fliesstext: 0.5em grösser */
    --schrift: "Source Sans Pro", "Source Sans 3", Helvetica, Arial, sans-serif;

    --s1: #f2849e;  /* rosa   */
    --s2: #7ecaf6;  /* blau   */
    --s3: #7bd0c1;  /* türkis */
    --s4: #c75b9b;  /* beere  */
    --s5: #ae85ca;  /* violett*/
    --s6: #8499e7;  /* indigo */

    --abstand: 2.5rem;
    --rand-seite: 2.5rem;
    --innen: min(68rem, 100vw) - 2 * var(--rand-seite);
    --kachel-breite: calc((var(--innen) - 2 * var(--abstand)) / 3);
}

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

html { font-size: 16pt; scroll-behavior: smooth; }
@media (max-width: 1680px) { html { font-size: 13pt; } }
@media (max-width: 1280px) { html { font-size: 12pt; } }
@media (max-width: 736px)  { html { font-size: 11pt; } }

body {
    margin: 0;
    background: var(--hintergrund);
    color: var(--text);
    font-family: var(--schrift);
    font-weight: 500;
    line-height: 1.6;
    -webkit-text-size-adjust: none;
}
/* Dezenter Holz-Hintergrund: ganzes Foto im Seitenverhältnis (nicht gekachelt), wandert langsam */
body::before {
    content: "";
    position: fixed; inset: -6%; z-index: -1;
    background: url("/dateien/bilder/holz.jpg") no-repeat center / cover;
    opacity: .12;
    pointer-events: none;
    animation: holz-wandern 60s ease-in-out infinite alternate;
    will-change: transform;
}
/* Seitenhintergrund pro Seite (Eintrag 'hintergrund' in inc/inhalt.php) */
body.hg-muschelblume::before { background-image: url("/dateien/bilder/muschelblume.jpg"); }

@keyframes holz-wandern {
    from { transform: translate(-3%, -2%) scale(1); }
    to   { transform: translate(3%, 2%) scale(1.04); }
}

body.is-preload *, body.is-preload *::before, body.is-preload *::after {
    animation: none !important;
    transition: none !important;
}

a {
    color: inherit;
    border-bottom: dotted 1px;
    text-decoration: none;
    transition: color .2s, border-color .2s;
}
a:hover { color: var(--akzent) !important; border-bottom-color: transparent; }

strong, b { font-weight: 900; color: inherit; }
p { margin: 0 0 2em; }
h1, h2, h3 { color: inherit; line-height: 1.3; margin: 0 0 1em; }
h1 { font-size: 2.75em; font-weight: 900; letter-spacing: -.035em; line-height: 1.3; }
h2 { font-size: 1.35em; font-weight: 700; letter-spacing: -.01em; }
@media (max-width: 736px) { h1 { font-size: 1.85em; } }

blockquote {
    margin: 0 0 2em;
    padding: .5em 0 .5em 2em;
    border-left: solid 4px var(--rand);
    font-style: italic;
}
address { font-style: normal; margin-bottom: 1.5em; }

/* Grundschrift für Fliesstext */
#main p, #main ul:not(.actions) > li, #main td, #main blockquote,
#footer address, #footer p, #footer input[type="text"], #footer input[type="email"], #footer textarea {
    font-size: var(--grundschrift);
}
#main p.klein, #main p.region { font-size: calc(var(--grundschrift) * .8); }
#main blockquote p { font-size: 1em; }
img { max-width: 100%; }
.klein { font-size: .9em; color: var(--text-hell); }

/* ---------- Listen ---------- */
ul.haken { list-style: none; padding: 0; margin: 0 0 2em; }
ul.haken li { padding-left: 1.6em; position: relative; }
ul.haken li::before {
    content: "✓"; position: absolute; left: 0;
    color: var(--akzent); font-weight: 900;
}

/* Button-Reihen im gleichen Raster wie die Kacheln */
ul.actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1em var(--abstand);
    list-style: none; padding: 0; margin: 0 0 2em;
}
ul.actions .button, ul.actions input[type="submit"] { display: block; width: 100%; }
@media (max-width: 980px) { ul.actions { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { ul.actions { grid-template-columns: 1fr; } }
/* im Footer: Senden-Button genau eine Kachel breit */
#footer ul.actions { grid-template-columns: var(--kachel-breite); }

/* ---------- Buttons ---------- */
input[type="submit"], .button {
    appearance: none;
    display: inline-block;
    min-height: 2.7em; line-height: 1.3;
    padding: .86em .94em;                    /* Innenabstand 25 % kleiner */
    border: 0px solid var(--button-rand); border-radius: 4px;
    background: var(--button);
    color: var(--button-text) !important;
    cursor: pointer;
    font-family: inherit;
    font-size: 1.05em; font-weight: 700;
    letter-spacing: .01em;
    text-align: center;
    transition: background-color .2s, border-color .2s, color .2s;
}
input[type="submit"]:hover, .button:hover,
input[type="submit"]:focus-visible, .button:focus-visible {
    background: var(--button-hover);
    border-color: var(--button-hover);
    color: #fff !important;
}

/* ---------- Formular ---------- */
form .fields { display: flex; flex-wrap: wrap; gap: 1.5em; margin-bottom: 2em; }
form .field { flex: 1 1 100%; }
form .field.half { flex: 1 1 calc(50% - .75em); }
@media (max-width: 480px) { form .field.half { flex-basis: 100%; } }

input[type="text"], input[type="email"], textarea {
    appearance: none;
    width: 100%;
    background: transparent;
    border: 0; border-radius: 0;
    border-bottom: solid 1px var(--rand);
    color: inherit;
    font: inherit;
    padding: .5em 0;
    outline: 0;
    transition: border-color .2s;
}
input:focus, textarea:focus { border-bottom-color: var(--akzent); box-shadow: inset 0 -1px 0 0 var(--akzent); }
textarea { min-height: 8em; resize: vertical; }
input.ungueltig, textarea.ungueltig { border-bottom-color: #e05a5a; }
::placeholder { color: var(--text-hell); opacity: 1; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-hinweis { color: #e05a5a; font-weight: 400; margin: -1em 0 1.5em; }
.meldung { padding: .9em 1.2em; border-radius: 4px; font-weight: 400; }
.meldung.ok { background: rgba(123, 208, 193, .2); border-left: 4px solid var(--s3); }
.meldung.fehler { background: rgba(242, 132, 158, .15); border-left: 4px solid var(--s1); }

/* ---------- Tabelle ---------- */
.table-wrapper { overflow-x: auto; margin-bottom: 2em; }
table { width: 100%; border-collapse: collapse; }
td { padding: .85em 1em; border-bottom: solid 1px var(--rand-hell); }
td:last-child { text-align: right; font-weight: 700; white-space: nowrap; }
tr:nth-child(odd) td { background: rgba(144, 144, 144, .06); }

/* ---------- Wrapper / Header ---------- */
#wrapper { transition: opacity .45s ease; }
body.is-menu-visible #wrapper { opacity: .25; pointer-events: none; }

#header { padding: 3.5em 0 1.5em; }
/* Desktop: Kopfbereich bleibt stehen, Inhalt scrollt darunter */
@media (min-width: 1201px) {
    #header {
        position: sticky; top: 0; z-index: 100;
        padding: 1.4em 0 1.2em;
        background: rgba(255, 255, 255, .9);
        -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
        transition: box-shadow .3s ease;
    }
    #header.gescrollt { box-shadow: 0 2px 14px rgba(0, 0, 0, .08); }
    #main { padding-top: 2em; }
    [id] { scroll-margin-top: 9em; }
}
#header .inner, #main .inner, #footer .inner {
    max-width: 68em; width: 100%;
    margin: 0 auto; padding: 0 2.5em;
}
#header .inner { display: flex; align-items: center; gap: 3em; }
@media (max-width: 736px)  {
    #header { padding-top: 2em; }
    #header .inner, #main .inner, #footer .inner { padding: 0 1.25em; }
}

/* Logo – auf allen Seiten gleich gross, Zusatz auf zweiter Zeile */
#header .logo {
    display: flex; flex-direction: column; flex-shrink: 0;
    border: 0; color: var(--logo);
    font-family: "Source Sans Pro", "Source Sans 3", sans-serif;
    font-size: 60px; font-weight: 900; line-height: 1; letter-spacing: -3px;
}
#header .logo:hover { color: var(--logo) !important; }
#header .logo .rot { color: var(--logo-rot); }
#header .logo .zusatz {
    font-weight: normal; font-size: .45em; letter-spacing: -.5px;
    margin-top: -.15em;          /* fast bündig an die erste Zeile */
    padding-left: .12em;
}
@media (max-width: 736px) { #header .logo { font-size: 44px; letter-spacing: -2px; } }
@media (max-width: 380px) { #header .logo { font-size: 38px; } }

/* Hauptmenü: über die ganze restliche Breite verteilt */
.hauptmenue { flex: 1 1 auto; }
.hauptmenue ul {
    display: flex; justify-content: space-between; align-items: center;
    list-style: none; margin: 0; padding: 0;
}
.hauptmenue a {
    display: block; position: relative;
    padding: .55em .5em;
    border: 0;
    color: #000;
    font-size: 1.05em; font-weight: 700;
    white-space: nowrap;
}
.hauptmenue a::after {
    content: ""; position: absolute; left: .5em; right: .5em; bottom: .2em;
    height: 2px; background: var(--logo-rot);
    transform: scaleX(0); transition: transform .25s ease;
}
.hauptmenue a:hover { color: var(--logo-rot) !important; }
.hauptmenue a:hover::after, .hauptmenue a.aktiv::after { transform: scaleX(1); }
.hauptmenue a.aktiv { color: var(--logo-rot); }

/* Menü-Icon nur bei kleinem Fenster / Smartgeräten */
#header a.menu-toggle {
    display: none; margin-left: auto;
    align-items: center; gap: .5em;
    border: 0; padding: .3em .25em .3em .75em;
    font-size: 2.05em; font-weight: 700;   /* 1em grösser */
    color: #000;
}
#header a.menu-toggle:hover { color: var(--logo-rot) !important; }
#header a.menu-toggle::after {
    content: "";
    width: 1.1em; height: .8em;
    background:
        linear-gradient(currentColor, currentColor) top    / 100% 2px no-repeat,
        linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
        linear-gradient(currentColor, currentColor) bottom / 100% 2px no-repeat;
}
@media (max-width: 1200px) {
    .hauptmenue { display: none; }
    #header a.menu-toggle { display: inline-flex; }
}
@media (max-width: 480px) { #header a.menu-toggle { font-size: 0; gap: 0; } #header a.menu-toggle::after { font-size: 16px; width: 2.2em; height: 1.6em; } }

/* ---------- Slide-Menü (mobil) ---------- */
#menu {
    position: fixed; top: 0; right: 0; z-index: 10002;
    width: 22em; max-width: 85%; height: 100%;
    padding: 2.75em 2em;
    background: #fff; color: #000;
    box-shadow: -8px 0 30px rgba(0, 0, 0, .15);
    overflow-y: auto;
    transform: translateX(110%);
    transition: transform .45s ease, visibility .45s;
    visibility: hidden;
}
body.is-menu-visible #menu { transform: translateX(0); visibility: visible; }
#menu ul { list-style: none; margin: 0; padding: 0; }
#menu ul a {
    display: block; border: 0;
    padding: .6em 0;
    font-size: 1.2em; font-weight: 700;
    color: #000;
    border-top: solid 1px rgba(0, 0, 0, .1);
}
#menu ul li:first-child a { border-top: 0; }
#menu ul a.aktiv { color: var(--logo-rot); }
#menu ul a:hover { color: var(--logo-rot) !important; }

/* ---------- Telefon: immer rot und verlinkt ---------- */
a.tel { color: var(--logo-rot); font-weight: 700; border-bottom: 0; white-space: nowrap; }
a.tel:hover { color: var(--logo-rot) !important; text-decoration: underline; }

/* ---------- Main ---------- */
#main { padding: 2.5em 0 6em; }
#main > .inner > header { margin-bottom: 3em; }
#main > .inner > header p { max-width: 46em; }
#main .cta { font-weight: 400; }
#main .cta a { white-space: nowrap; }
.region { margin-top: 3em; color: var(--text-hell); font-size: .9em; }

.image { display: inline-block; position: relative; border-radius: 4px; overflow: hidden; }
.image img { display: block; }
/* Hauptbild: einheitliche Höhe, so breit wie der Textblock, rechteckig */
.image.main {
    display: block; width: 100%;
    height: 24em;
    margin: 0 0 2.5em;
    border-radius: 0;
    overflow: hidden;
}
.image.main img {
    display: block; width: 100%; height: 100%;
    object-fit: cover;
    animation: bild-ein 2.2s cubic-bezier(.2, .7, .2, 1) both;
}
/* blendet von 50 % auf 100 % ein und zoomt von 270 % auf volle Breite */
@keyframes bild-ein {
    from { opacity: .5; transform: scale(2.7); }
    to   { opacity: 1;  transform: scale(1); }
}
@media (max-width: 736px) { .image.main { height: 14em; } }
.image.portrait { float: right; width: 14em; margin: 0 0 2em 2.5em; }
.image.portrait img { width: 100%; }
@media (max-width: 736px) { .image.portrait { float: none; width: 60%; margin: 0 0 2em; } }
.logo-eduqua { max-width: 9em; }
.weiter { clear: both; padding-top: 1em; }
.weiter .button, #footer input[type="submit"] { font-size: 1.55em; }   /* 0.5em grösser */
.referenzen { line-height: 2; }

/* ---------- Kacheln (Tiles) ---------- */
.tiles {
    display: flex; flex-wrap: wrap;
    margin: calc(var(--abstand) * -1) 0 0 calc(var(--abstand) * -1);
}
.tiles article {
    position: relative;
    width: calc(33.333% - var(--abstand));
    margin: var(--abstand) 0 0 var(--abstand);
    transition: transform .5s ease, opacity .5s ease;
}
.tiles article > .image {
    display: block; width: 100%;
    aspect-ratio: 4 / 3.4;
    background: var(--farbe);          /* Kachelfarbe schimmert durch */
    transition: transform .5s ease;
}
/* Foto im Hintergrund mit 50 % Deckkraft */
.tiles article > .image img {
    width: 100%; height: 100%;
    object-fit: cover;
    filter: grayscale(1);
    opacity: .5;
    transition: opacity .5s ease;
}
.tiles article > a {
    position: absolute; inset: 0; z-index: 3;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 1em; border: 0;
    color: #fff; text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.tiles article > a:hover { color: #fff !important; }
.tiles article h2 { margin: 0; font-size: 1.6em; }
.tiles article .content {
    width: 100%;
    max-height: 0; opacity: 0; overflow: hidden;
    transition: max-height .5s ease, opacity .5s ease;
}
.tiles article .content p { margin: .8em 0 0; font-size: 1.1em; line-height: 1.45; font-weight: 600; }

.tiles article.style1 { --farbe: var(--s1); }
.tiles article.style2 { --farbe: var(--s2); }
.tiles article.style3 { --farbe: var(--s3); }
.tiles article.style4 { --farbe: var(--s4); }
.tiles article.style5 { --farbe: var(--s5); }
.tiles article.style6 { --farbe: var(--s6); }

/* Hover: Foto tritt zurück, Kurztext erscheint (kein Weichzeichner) */
@media (hover: hover) {
    .tiles article:hover > .image { transform: scale(1.04); }
    .tiles article:hover > .image img { opacity: .2; }
    .tiles article:hover .content { max-height: 12em; opacity: 1; }
}
/* Touch-Geräte: Kurztext immer zeigen */
@media (hover: none) {
    .tiles article .content { max-height: 12em; opacity: 1; }
}

@media (max-width: 1280px) { :root { --abstand: 2rem; } .tiles article { width: calc(33.333% - var(--abstand)); } }
@media (max-width: 980px)  {
    .tiles article { width: calc(50% - var(--abstand)); }
    :root { --kachel-breite: calc((var(--innen) - var(--abstand)) / 2); }
}
@media (max-width: 736px)  { :root { --abstand: 1.25rem; --rand-seite: 1.25rem; } }
@media (max-width: 480px)  { :root { --kachel-breite: calc(var(--innen)); } }
@media (max-width: 480px)  { .tiles { margin: 0; } .tiles article { width: 100%; margin: 1.25em 0 0; } }

/* ---------- Galerie + Lightbox ---------- */
/* Referenzen-Kacheln: Abstand zum Text */
.tiles.galerie { margin-bottom: 3em; }

#lightbox {
    position: fixed; inset: 0; z-index: 20000;
    background: rgba(30, 30, 30, .92);
    display: flex; align-items: center; justify-content: center;
    padding: 2em;
}
#lightbox[hidden] { display: none; }
#lightbox figure { margin: 0; text-align: center; color: #fff; }
#lightbox img { max-height: 80vh; border-radius: 4px; }
#lightbox figcaption { margin-top: .8em; }
body.lb-offen { overflow: hidden; }
#lightbox figure { max-width: calc(100vw - 9em); }
#lightbox figcaption { display: flex; justify-content: space-between; gap: 1.5em; font-size: 1.05em; }
#lightbox .lb-zaehler { white-space: nowrap; opacity: .7; }
#lightbox img.lb-ein { animation: lb-ein .35s ease both; }
@keyframes lb-ein { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
#lightbox .lb-pfeil {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 1.6em; height: 1.6em;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .12); color: #fff;
    border: 0; border-radius: 50%;
    font-size: 2.6em; line-height: 1; cursor: pointer;
    transition: background-color .2s;
}
#lightbox .lb-pfeil:hover, #lightbox .lb-pfeil:focus-visible { background: var(--logo-rot); }
#lightbox .lb-zurueck { left: .4em; }
#lightbox .lb-weiter { right: .4em; }
#lightbox.einzeln .lb-pfeil, #lightbox.einzeln .lb-zaehler { display: none; }
@media (max-width: 736px) {
    #lightbox { padding: 1em; }
    #lightbox figure { max-width: 100%; }
    #lightbox .lb-pfeil { top: auto; bottom: .6em; transform: none; font-size: 2em; }
}
#lightbox .lb-schliessen {
    position: absolute; top: .5em; right: .75em;
    background: none; border: 0; color: #fff;
    font-size: 2.5em; cursor: pointer; line-height: 1;
}

/* ---------- Footer ---------- */
#footer {
    --footer-text: #3a1212;
    background: rgba(57,69,75, .3);   /* #39454B mit 30 % */
    color: var(--footer-text);
    padding: 5em 0 3em;
}
#footer h2, #footer strong { color: var(--footer-text); }
/* Firmenname im Footer wie das Logo, etwas kleiner */
#footer .logo-fuss {
    display: flex; flex-direction: column;
    margin: 0 0 .5em;
    color: var(--logo);
    font-family: "Source Sans Pro", "Source Sans 3", sans-serif;
    font-size: 48px; font-weight: 900; line-height: 1; letter-spacing: -2.4px;
}
#footer .logo-fuss .rot { color: var(--logo-rot); }
#footer .logo-fuss .zusatz { font-weight: normal; font-size: .45em; letter-spacing: -.5px; margin-top: -.15em; padding-left: .12em; }
@media (max-width: 736px) { #footer .logo-fuss { font-size: 38px; letter-spacing: -2px; } }
#footer a { color: var(--footer-text); }
#footer a:hover { color: #fff !important; }
#footer input[type="text"], #footer input[type="email"], #footer textarea {
    border-bottom-color: rgba(58, 18, 18, .45);
}
#footer input:focus, #footer textarea:focus { border-bottom-color: var(--footer-text); box-shadow: inset 0 -1px 0 0 var(--footer-text); }
#footer ::placeholder { color: rgba(58, 18, 18, .7); }
#footer .form-hinweis { color: #7a1f1f; }
#footer input[type="submit"] { background: rgba(255, 255, 255, .55); }   /* hebt sich vom rosa Footer ab */
#footer input[type="submit"]:hover, #footer input[type="submit"]:focus-visible { background: var(--button-hover); }
/* Symbole: Logo-Grau (SIS) mit 50 %, beim Überfahren Rot */
#footer ul.icons .icon { background: rgba(57, 69, 75, .5); color: #fff; box-shadow: none; transition: background-color .2s; }
#footer ul.icons .icon:hover, #footer ul.icons .icon:focus-visible { background: var(--logo-rot); color: #fff !important; box-shadow: none; }
/* Telefon bleibt rot – auf weissem Grund für genügend Kontrast */
#footer a.tel { color: var(--logo-rot); }
#footer a.tel:hover { color: var(--logo-rot) !important; }
#footer .meldung.ok { background: rgba(255, 255, 255, .55); border-left-color: var(--footer-text); }
#footer .meldung.fehler { background: rgba(255, 255, 255, .55); border-left-color: var(--logo-rot); }

#footer .inner { display: flex; flex-wrap: wrap; gap: 0 4em; }
#footer .inner > section { flex: 1 1 0; min-width: 0; }
#footer .inner > section:first-of-type { flex: 2 1 0; }
#footer .copyright {
    flex: 1 1 100%;
    list-style: none; padding: 0; margin: 2em 0 0;
    font-size: .8em; color: rgba(58, 18, 18, .8);
    display: flex; flex-wrap: wrap;
}
#footer .copyright li { padding: 0 1em; border-left: solid 1px rgba(58, 18, 18, .35); }
#footer .copyright li:first-child { padding-left: 0; border-left: 0; }
@media (max-width: 980px) {
    #footer .inner { flex-direction: column; }
    #footer .copyright li { border: 0; padding: 0 1em 0 0; }
}

ul.icons { list-style: none; padding: 0; margin: 0 0 1.5em; display: flex; gap: .75em; }
ul.icons .icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.6em; height: 2.6em;
    border: 0; border-radius: 4px;
    box-shadow: inset 0 0 0 2px var(--text);
    transition: box-shadow .2s, color .2s;
}
ul.icons .icon svg { width: 1.15em; height: 1.15em; }
ul.icons .icon:hover { box-shadow: inset 0 0 0 2px var(--akzent); }

/* ---------- Einfahren von unten (per JavaScript) ---------- */
.js .einfahren {
    opacity: 0;
    transform: translateY(3.5em);
    transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1);
    transition-delay: var(--verzoegerung, 0s);
}
.js .einfahren.sichtbar { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    body::before { animation: none; }
    .image.main img { animation: none; }
    .js .einfahren { opacity: 1; transform: none; }
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
