/* ==================================================
   1. GRUNDEINSTELLUNGEN
   ================================================== */

* {
    box-sizing: border-box;
    font-family: "Georgia", "Helvetica", "Times New Roman", sans-serif;
    line-height: clamp(1.4, 1.2 + 0.5vw, 1.6);
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-size: clamp(1rem, 0.9rem + 0.4vw, 1.2rem);

    background-image: url(img/Hintergrund.png);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
}

a {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

a:hover {
    color: rgb(3, 89, 218);
}

a:active {
    color: aliceblue;
}

ul {
    list-style-type: none;
}


/* ==================================================
   2. ÜBERSCHRIFTEN
   ================================================== */

h1 {
    font-size: clamp(1.8rem, 7vw + 1rem, 2.5rem);
    text-align: center;
}

h3 {
    font-size: clamp(1.5rem, 7vw + 1rem, 2rem);
    text-align: center;
    justify-self: center;
}


/* ==================================================
   3. HAUPTLAYOUT / GRID
   ================================================== */

.container {
    display: grid;
    flex-grow: 1;

    grid-template-columns:
        minmax(30px, 8vw)
        minmax(0, 1fr)
        minmax(0, 1fr)
        minmax(250px, 25vw);

    grid-template-areas:
        "logo   logo   praxis contact"
        "nav    nav    nav    nav"
        ".      main   main   right"
        "footer footer footer footer";

    gap: 0;
    min-height: 100%;
    width: 100%;
    margin-inline: auto;
}

/*
.container > *,
.container > div:nth-child(odd) {
    padding: clamp(1rem, 0.5rem + 1.5vw, 2.5rem);
}
*/

.logo,
.praxis,
.contact,
.main,
.right {
    padding: clamp(1rem, 1vw + 0.5rem, 2.5rem);
}


/* ==================================================
   4. NAVIGATION
   ================================================== */

.nav {
    grid-area: nav;

    position: relative;
    z-index: 1000;

    width: 100%;
    padding-block: 0.5rem;

    background: rgba(37, 125, 240, 0.5);
    color: aliceblue;

    font-weight: bold;
    font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.35rem);
    text-shadow: 2px 2px 4px rgba(41, 40, 40, 0.5);
}

.nav-main-menu {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    margin: 0;
}

.nav-link {
    display: inline-block;

    padding: clamp(1em, 0.5em + 1vw, 1.6em);
    margin-inline: clamp(0.3em, 0.1em + 0.8vw, 1em);

    transition: 0.3s;
}

.nav-link:hover {
    text-align: left;
    border-radius: 5px;
    color: aliceblue;
}


/* Dropdown-Menüs */

.nav-main-menu .dropdown {
    position: relative;
    z-index: 1001;
}

.nav-main-menu .dropdown:hover {
    z-index: 1002;
}

.dropdown:hover .nav-link {
    color: aliceblue;
    z-index: 1002;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
     z-index: 1003;

    display: none;
    width: max-content;
    min-width: 100%;

    padding: 0;
    margin: 0;

    box-sizing: border-box;
    border-radius: 5px;
    background: rgb(115, 173, 250);
    
    list-style: none;
    animation: slideUp 0.3s;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content li {
    padding: 1em;
}

.dropdown-content li:hover {
    background: rgba(37, 125, 240, 0.5);
    border-radius: 5px;
}


/* ==================================================
   5. HEADER
   ================================================== */

.logo {
    grid-area: logo;

    display: flex;
    align-items: center;
}

.logo img {
    display: block;
    width: clamp(400px, 35vw, 100%);
    height: auto;
}

.praxis {
    grid-area: praxis;

    display: flex;
    align-items: center;
}

.praxis img {
    display: block;
    width: clamp(100px, 20vw, 250px);
    height: auto;
}

.contact {
    grid-area: contact;
    line-height: 1.5;
}


/* ==================================================
   6. HAUPTINHALT
   ================================================== */

.main {
    grid-area: main;

    min-width: 0;
    padding-block: clamp(1rem, 2vw, 2.5rem);

    background: rgba(245, 245, 245, 0.5) !important;

    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

.main > div:first-child {
    width: min(100%, 70ch);
    margin-inline: auto;
}

figure {
    text-align: center;
}

.rahmen-text {
    display: inline-block;

    padding: 5px;
    border: 4px solid rgb(24, 67, 211);
    border-radius: 5px;

    color: rgb(11, 165, 31);
    font-weight: bolder;
    font-size: larger;
}


/* ==================================================
   7. HOVER-BILDER UND INFOBOXEN
   ================================================== */

.hover-box-side {
    position: relative;
    z-index: 1;

    width: clamp(180px, 25vw, 320px);
    margin: 2rem auto;

    text-align: center;
}

/* Bildunterschrift */

.hover-box-side figcaption {
    width: 100%;
    margin: 0 0 0.75rem;

    text-align: center;

    overflow-wrap: break-word;
    hyphens: auto;

    font-size: clamp(0.9rem, 0.8rem + 0.4vw, 1.1rem);
    line-height: 1.3;
}

/* Bild */

.hover-box-img {
    display: block;

    width: 100%;
    height: auto;
    margin: 0;

    object-fit: cover;
}

/* Infobox beim Hover */

.hover-box-text {
    position: absolute;
    top: 50%;
    left: calc(100% + clamp(0.5rem, 1vw, 1rem));
    z-index: 2;

    width: clamp(220px, 30vw, 400px);
    padding: clamp(0.75rem, 0.5rem + 1vw, 1.5rem);

    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-radius: 5px;

    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%);

    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

.hover-box-side:hover .hover-box-text {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%);
}

.box-text {
    margin: 0;

    font-size: clamp(0.9rem, 0.8rem + 0.4vw, 1.1rem);
    line-height: 1.5;
}


/* ==================================================
   8. SCHULSOZIALARBEIT
   ================================================== */

.bild-container {
    float: left;

    max-width: 300px;
    margin-right: 20px;
    margin-bottom: 15px;
}

.bild-container img {
    display: block;

    width: 100%;
    height: auto;

    border-radius: 8px;
}

.kurzübersicht {
    margin-block: 1.5rem;
    text-align: left;
}

.kurzübersicht h3 {
    margin-bottom: 0.5rem;

    font-size: clamp(0.5rem, 1vw + 0.8rem, 1.5rem);
    text-align: left;
    justify-self: start;
}

.kurzübersicht ul {
    padding-left: clamp(1.2rem, 1rem + 2vw, 2rem);
    margin: 0;

    list-style-type: disc;
    text-align: left;
}

.kurzübersicht li {
    margin-bottom: 0.5rem;
    text-align: left;
}

.right-center {
    margin-block: 1.5rem;
    text-align: center;
}


/* ==================================================
   9. EINBLICKE / BILDERGALERIE
   ================================================== */

.impressions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    justify-self: center;

    gap: clamp(0.75rem, 0.5rem + 1vw, 2rem);
}

.impressions > div {
    min-width: 0;
    text-align: center;
}

.impressions > div img {
    display: block;

    width: 100%;
    height: clamp(140px, 100px + 6vw, 260px);

    object-fit: cover;
}


/* ==================================================
   10. RECHTE SEITENSPALTE
   ================================================== */

.right {
    grid-area: right;

    display: grid;
    padding-right: clamp(1rem, 5vw, 8rem);

    text-align: center;
    place-items: top;
    justify-items: center;
    grid-gap: 0.2em;
}


/* ==================================================
   11. TABELLEN
   ================================================== */

table {
    width: 100%;
    border-collapse: collapse;

    background-color: rgba(37, 125, 240, 0.3);
}

th,
td {
    padding: 1em;
    text-align: left;
}

th {
    background: rgba(37, 125, 240, 0.3);
}

tr:nth-of-type(2n) {
    background: rgba(37, 125, 240, 0.05);
}

td[colspan] {
    font-weight: bold;
    text-align: center;
}

/* Responsive Tabellen */

.responsive-table {
    width: 100%;
    border-collapse: collapse;
}

.responsive-table td {
    line-height: 1.6;
    text-align: left;
    vertical-align: top;
}

.responsive-table td:first-child {
    width: 10rem;
    padding-right: 1rem;
}

.responsive-table td img {
    display: block;

    width: clamp(5rem, 20vw, 10rem);
    height: auto;
}


/* ==================================================
   12. FOOTER
   ================================================== */

.footer {
    grid-area: footer;

    display: flex;
    justify-content: center;
    align-items: center;

    min-height: 3em;

    color: aliceblue;
    background-color: rgba(37, 125, 240, 0.5);
    
    font-weight: bold;
    font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.35rem);
    text-shadow: 2px 2px 4px rgba(41, 40, 40, 0.5);
}

.footer-nav {
    display: flex;
    justify-content: center;
    align-items: center;

    gap: clamp(1rem, 0.5rem + 3vw, 4rem);
}


/* ==================================================
   13. VERSCHACHTELTE LISTEN
   ================================================== */

ol.nested-list {
    padding-left: 1rem;

    list-style-type: none;
    counter-reset: item;
}

ol.nested-list li {
    display: block;
}

ol.nested-list li::before {
    content: counters(item, ".") " ";
    counter-increment: item;
    margin-right: 0.8rem;
}

ol.nested-list h4 {
    display: inline;

    margin: 0;
    font-size: 1em;
}

ol.nested-list ul {
    list-style-type: disc;
}

ol.nested-list ul li {
    display: list-item;
}

ol.nested-list ul li::before {
    content: none;
}

/* ==================================================
   LIGHTBOX – VERGRÖSSERTE GALERIEBILDER
   ================================================== */

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;

    justify-content: center;
    align-items: center;

    padding: 3rem 1rem;
    background: rgba(0, 0, 0, 0.9);
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    display: block;
    max-width: 95vw;
    max-height: 90vh;

    width: auto;
    height: auto;
    object-fit: contain;

    border-radius: 4px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;

    border: none;
    background: transparent;
    color: white;

    font-size: 3rem;
    line-height: 1;
    cursor: pointer;
}

.lightbox-close:hover {
    color: #ccc;
}

/* ===== Diashow: Navigation ===== */

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 3rem;
    height: 3rem;
    padding: 0;

    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;

    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* ===== Lightbox-Pfeile sichtbar machen ===== */

.lightbox.active .lightbox-prev,
.lightbox.active .lightbox-next {
    display: flex !important;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10001;

    width: 3rem;
    height: 3rem;
    padding: 0;

    align-items: center;
    justify-content: center;

    color: #fff;
    background: rgba(60, 60, 60, 0.85);
    border: 2px solid #fff;
    border-radius: 50%;

    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.lightbox.active .lightbox-prev {
    left: 1rem;
}

.lightbox.active .lightbox-next {
    right: 1rem;
}

.lightbox.active .lightbox-close {
    z-index: 10002;
}

/* ==================================================
   Google Maps
   ================================================== */
.maps-container {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
}

.maps-container iframe {
    display: block;
    width: 100%;
    height: 450px;
    border: 0;
}

.maps-placeholder {
    padding: 24px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #f7f7f7;
    text-align: center;
}

.maps-placeholder button {
    margin: 6px;
    padding: 12px 18px;
    border: none;
    border-radius: 4px;
    background: #245b40;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.maps-placeholder button:hover {
    background: #19432e;
}

.maps-placeholder a {
    display: inline-block;
    margin-top: 12px;
}


/* ==================================================
   14. RESPONSIVE DESIGN
   ================================================== */

/* Tablets und kleinere Bildschirme */

@media (max-width: 1400px) {
    .container {
        grid-template-columns: 1fr;

        grid-template-areas:
            "logo"
            "praxis"
            "contact"
            "nav"
            "main"
            "right"
            "footer";
    }

    .impressions {
        grid-template-columns: 1fr;
    }

    .nav-main-menu {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 0.25rem 0.75rem;
    }

    .nav-main-menu > li {
        flex: 0 0 auto;
    }

    .nav-link {
        display: block;
        margin: 0;
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
    }

    .logo img {
        width: 80%;
        max-width: 100%;
    }

    .praxis img {
        display: none;
    }

}


/* Smartphones */

@media (max-width: 600px) {
    /* Navigation */

    .nav {
        overflow: visible;
        padding: 0.5rem;
    }

    .nav-main-menu {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 0.25rem;
        padding: 0;
        margin: 0;
    }

    .nav-main-menu > li {
        position: relative;
        flex: 0 0 auto;
        margin: 0;
    }

    .nav-link {
        display: block;
        margin: 0;
        padding: 0.4rem 0.5rem;
        font-size: 0.95rem;
        white-space: nowrap;
    }

    /* Dropdown-Menüs */

    .nav-main-menu .dropdown-content {
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1001;

        width: max-content;
        min-width: 100%;
        max-width: calc(100vw - 1rem);

        margin: 0;
        padding: 0;

        background: rgb(115, 173, 250);
        border-radius: 5px;
    }

    .nav-main-menu .dropdown-content li {
        padding: 0.65rem 0.8rem;
        overflow-wrap: break-word;
    }

    .nav-main-menu .dropdown-content a {
        display: block;
    }

    /* Responsive Tabellen */

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table td:first-child {
        margin-bottom: 1rem;
    }

    /* Hover-Infoboxen */

    .hover-box-side {
        width: clamp(180px, 70vw, 320px);
        margin: 2rem auto;
    }

    .hover-box-text {
        position: static;
        width: 100%;
        margin-top: 1rem;

        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
    }

    .hover-box-side:hover .hover-box-text {
        transform: none;
    }

    /* Bilder und Text untereinander */

    .bild-container {
        float: none;
        max-width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
    }
    .lightbox-prev,
    .lightbox-next {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.2rem;
    }

    .lightbox-prev {
        left: 0.25rem;
    }

    .lightbox-next {
        right: 0.25rem;
    }

    .lightbox img {
        max-width: 85vw;
    }
    .lightbox.active .lightbox-prev {
        left: 0.5rem;
    }

    .lightbox.active .lightbox-next {
        right: 0.5rem;
    }

    .legal-section {
        padding: 1rem;
    }

    .legal-toc {
        padding: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}