/*
Theme Name: Schul-Theme (Header/Footer)
Theme URI: https://example.com
Author: Max
Author URI: https://example.com
Description: Klassisches WordPress-Theme mit Header/Footer im Stil einer Schul-Website. Vollständig kompatibel mit dem klassischen Editor (kein Block-/FSE-Theme). Farben, Menüs, Logo und Footer-Inhalte lassen sich im gewohnten Backend (Customizer, Menüs, Widgets) anpassen.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kzs-theme
*/

/* ==========================================================================
   Basis
   ========================================================================== */

:root {
    --kzs-color-topbar: #9c1b34;
    --kzs-color-accent: #9c1b34;
    --kzs-color-text: #4a4a4a;
    --kzs-color-footer: #0e7ea3;
    --kzs-color-footer-bottom: #4a4a4a;
    --kzs-font-primary: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--kzs-font-primary);
    color: #333;
    line-height: 1.6;
    background: #fff;
    overflow-anchor: none;
}

h1, h2, h3, h4, h5, h6,
button, input, select, textarea {
    font-family: var(--kzs-font-primary);
}

a { color: var(--kzs-color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

ul { list-style: none; margin: 0; padding: 0; }

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(1px,1px,1px,1px);
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 500;
    background: #fff;
    overflow-anchor: none;
}

.top-bar {
    background: var(--kzs-color-topbar);
    max-height: 60px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

body.kzs-scrolled .top-bar {
    max-height: 0;
    opacity: 0;
}

.main-header {
    background: #fff;
    transition: box-shadow 0.3s ease;
}

body.kzs-scrolled .main-header {
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.top-bar-inner {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 38px;
}

.top-menu {
    display: flex;
    align-items: center;
    gap: 18px;
}

.top-menu li a {
    color: #fff;
    font-size: 0.85rem;
    display: inline-block;
    transition: color 0.2s ease;
}

.top-menu li a:hover {
    color: #d9d9d9;
    text-decoration: none;
}

.main-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 18px 24px;
    gap: 24px;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 18px;
}

.custom-logo-link img {
    max-height: 78px;
    width: auto;
}

.site-title-link {
    display: block;
    line-height: 1.1;
}

.site-title {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: var(--kzs-color-accent);
    text-transform: uppercase;
}

.site-description {
    margin: 4px 0 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: #777;
}

.main-navigation {
    margin-left: auto;
}

.primary-menu {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
}

.primary-menu > li {
    position: relative;
}

.primary-menu > li > a {
    display: block;
    padding: 8px 6px;
    color: #555;
    font-family: "Noto Sans", sans-serif;
    font-size: 18px;
    font-weight: 400;
    font-style: normal;
    font-variant: normal;
    text-transform: none;
    text-decoration: none;
    letter-spacing: normal;
    transition: color 0.2s ease;
}

.primary-menu > li > a:hover,
.primary-menu > li.current-menu-item > a {
    color: #999;
    background-color: transparent;
    text-decoration: none;
}

.primary-menu .sub-menu {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 220px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 8px 0;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.primary-menu li:hover > .sub-menu,
.primary-menu li.kzs-open > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.primary-menu .sub-menu li a {
    display: block;
    padding: 8px 20px;
    color: #555;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.primary-menu .sub-menu li a:hover {
    background: transparent;
    color: #999;
    text-decoration: none;
}

.menu-item-has-children > a::after {
    content: "";
}

/* Automatisch erkannte Social-Icons in Menüs (z. B. Instagram-Link) */
.menu-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.menu-item-is-social > a {
    display: inline-flex !important;
    align-items: center;
    padding: 6px !important;
}

.top-menu .menu-item-is-social > a {
    color: #fff;
}

.top-menu .menu-item-is-social > a:hover {
    opacity: 0.85;
}

.primary-menu .menu-item-is-social > a {
    color: #555;
    border-bottom: none !important;
}

.footer-legal-menu .menu-item-is-social a,
.footer-widget .menu-item-is-social a {
    color: #fff;
}

.menu-toggle {
    display: none;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #333;
    margin: 5px 0;
}

/* ==========================================================================
   Content
   ========================================================================== */

.site-content { padding: 40px 0; min-height: 40vh; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer-main {
    background: var(--kzs-color-footer);
    color: #fff;
    padding: 56px 0 40px;
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.footer-title,
.footer-widget h3 {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 16px;
}

.footer-widget {
    font-size: 0.95rem;
    line-height: 1.7;
}

.footer-widget a { color: #fff; text-decoration: underline; }

.footer-widget .widget-title { display: none; } /* footer-title from before_title is used instead */

.social-icons {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
    text-decoration: none;
}

.social-icons a:hover { background: rgba(255,255,255,0.3); }

.site-footer-bottom {
    background: var(--kzs-color-footer-bottom);
    color: #ddd;
    font-size: 0.85rem;
}

.footer-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 24px;
}

.footer-legal-menu {
    display: flex;
    gap: 20px;
}

.footer-legal-menu a { color: #ddd; }
.footer-legal-menu a:hover { color: #fff; }

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--kzs-color-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
    z-index: 200;
}

.back-to-top:hover { text-decoration: none; opacity: 0.9; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 782px) {
    .menu-toggle { display: block; margin-left: auto; }

    .main-navigation { width: 100%; order: 3; margin-left: 0; }

    .primary-menu {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 0;
    }

    .primary-menu.kzs-menu-open { display: flex; }

    .primary-menu > li { width: 100%; }

    .primary-menu .sub-menu {
        position: static;
        box-shadow: none;
        padding-left: 16px;
        max-height: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        overflow: hidden;
        transition: max-height 0.25s ease;
        pointer-events: auto;
    }

    .primary-menu li.kzs-open > .sub-menu {
        max-height: 600px;
    }

    .footer-columns { grid-template-columns: 1fr; gap: 32px; }

    .footer-bottom-inner { flex-direction: column; align-items: flex-start; }
}
