/*
 Theme Name:   Regenbogenschule
 Description:  Astra Child Theme für die Regenbogenschule GGS Dieringhausen
 Author:       Senior WP Architect
 Template:     astra
 Version:      1.1.0
*/

/* ==========================================================================
   CSS DESIGN TOKENS
   ========================================================================== */
:root {
    --primary-bg: #ffffff;
    --text-main: #333333;
    --heading-dark: #1e3a8a;
    --accent-blue: #e3f2fd;
    --accent-orange: #ffb74d;
    --rainbow-gradient: linear-gradient(90deg, #ff7b7b 0%, #ffb347 20%, #ffe66d 40%, #8ce071 60%, #6bb9f0 80%, #a29bfe 100%);
    --white: #ffffff;
    --header-text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.35);
    --letter-spacing-header: 0.05em;
}

/* ==========================================================================
   GLOBALE TYPOGRAFIE & HINTERGRUND
   ========================================================================== */
body {
    font-family: 'Nunito', Arial, Helvetica, "Comic Sans MS", sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-main);
    font-size: 1.125rem;
}

/* ==========================================================================
   SUCHE: Einheitliche "Pille" aus Container + Feld + Lupe
   ========================================================================== */
/* Äußeres Astra-Such-Icon ausblenden (doppelte Lupe) */
.ast-header-search .ast-search-menu-icon.slide-search > .ast-search-icon {
    display: none !important;
}

/* Container = sichtbare Pille (immer sichtbar, slide-search override) */
.ast-header-search .ast-search-menu-icon.slide-search .search-form {
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    background-color: #f8f9fa !important;
    border: 1px solid #1c529b !important;
    border-radius: 25px !important;
    padding: 2px 10px !important;
    width: 200px !important;
    margin: 0 !important;
}

/* Eingabefeld transparent – erbt Rahmen/Hintergrund vom Container */
.ast-header-search .ast-search-menu-icon.slide-search .search-form input[type="search"] {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 5px 5px 5px 0 !important;
    margin: 0 !important;
    flex-grow: 1 !important;
    width: auto !important;
    outline: none !important;
    font-size: 0.95rem !important;
}

/* Beide Submit-Buttons ausblenden – nur das Eingabefeld bleibt als Pille sichtbar */
.ast-header-search .ast-search-menu-icon.slide-search .search-form input[type="submit"],
.ast-header-search .ast-search-menu-icon.slide-search .search-form button.search-submit {
    display: none !important;
}

/* Klassentier-Bilder auf Startseite: quadratisch zuschneiden */
.wp-block-columns .wp-block-column .wp-block-image img {
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    border-radius: 8px !important;
}

/* Astra Content Container transparent */
.site-content,
.ast-container,
.ast-article-post,
.ast-article-page,
.ast-single-post .entry-header,
.ast-single-post .entry-content {
    background-color: transparent !important;
}

/* ==========================================================================
   BARRIEREFREIHEIT: Strikter Flattersatz
   ========================================================================== */
p {
    text-align: left !important;
}

/* ==========================================================================
   ÜBERSCHRIFTEN — Dunkelblau
   ========================================================================== */
h1, h2, h3, h4, h5, h6,
.entry-title {
    font-family: 'Nunito', Arial, "Comic Sans MS", sans-serif;
    color: var(--heading-dark);
    letter-spacing: var(--letter-spacing-header);
    margin-bottom: 0.75em;
}

/* Site-Titel im Header auf Dunkelblau für bessere Lesbarkeit */
.site-title,
.site-title a,
.site-title a:hover {
    color: #1e3a8a !important;
    text-shadow: 1px 1px 3px rgba(255, 255, 255, 0.5) !important;
}

/* Header-Titel: Zeilenumbruch responsive */
.site-title,
.site-title a {
    white-space: pre-line !important;
    line-height: 1.2 !important;
    display: block !important;
}
@media (max-width: 768px) {
    .site-title,
    .site-title a {
        font-size: 1.25rem !important;
    }
}

h1 { font-size: 2.5rem; line-height: 1.2; }
h2 { font-size: 2rem; line-height: 1.3; }
h3 { font-size: 1.75rem; line-height: 1.4; }

/* Seiten-Titel ausblenden (da in Blöcken vorhanden) */
.entry-title,
.ast-article-post .entry-title,
.ast-article-page .entry-title,
.page-title {
    display: none !important;
}

/* ==========================================================================
   ASTRA HEADER: Logo + Titel nebeneinander
   ========================================================================== */
.site-branding {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
}

.site-branding .custom-logo-link {
    margin-right: 0 !important;
}

.site-branding .site-title {
    margin-bottom: 0 !important;
}

/* ==========================================================================
   ASTRA MENÜ-STYLING (REGENBOGEN)
   ========================================================================== */

/* 1. Hauptnavigation - Regenbogen Farbverlauf */
.ast-primary-header-bar,
.main-header-bar {
    background: var(--rainbow-gradient) !important;
    border-bottom: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* 2. Hauptmenüpunkte - GROSS & UPPERCASE - Dunkelblau für bessere Lesbarkeit */
.ast-builder-menu-1 .main-header-menu > .menu-item > .menu-link,
.main-navigation ul li a {
    font-family: 'Nunito', Arial, "Comic Sans MS", sans-serif !important;
    font-weight: 800 !important;
    font-size: 1.3rem !important;
    padding: 0 10px !important;
    text-transform: uppercase !important;
    color: #1e3a8a !important;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

/* Menüpunkte enger zusammensetzen */
.ast-builder-menu-1 .main-header-menu {
    gap: 0 !important;
}

.ast-builder-menu-1 .main-header-menu > .menu-item {
    margin: 0 !important;
}

.ast-header-break-point .main-header-menu > .menu-item > .menu-link {
    padding: 5px 10px !important;
}

/* Hover-Effekt */
.ast-builder-menu-1 .main-header-menu > .menu-item:hover > .menu-link,
.main-navigation ul li:hover > a {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* 3. Dropdown-Menüs */
.ast-builder-menu-1 .main-header-menu .sub-menu,
.main-header-menu .sub-menu {
    background-color: var(--white) !important;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
    border-top: 3px solid #ffb347;
}

/* Dropdown Listenpunkte */
.ast-builder-menu-1 .main-header-menu .sub-menu .menu-item .menu-link,
.main-header-menu .sub-menu a {
    font-family: Arial, Helvetica, "Comic Sans MS", sans-serif !important;
    font-weight: 600 !important;
    color: #4a4a4a !important;
    text-shadow: none !important;
    background-color: transparent !important;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    text-transform: none !important;
    font-size: 1.15rem !important;
}

/* Dropdown Hover */
.ast-builder-menu-1 .main-header-menu .sub-menu .menu-item:hover > .menu-link,
.main-header-menu .sub-menu .menu-item:hover > a {
    background-color: #fffde7 !important;
    color: var(--heading-dark) !important;
    padding-left: 25px !important;
}

/* 3. Ebene Menüs */
.ast-builder-menu-1 .main-header-menu .sub-menu .sub-menu {
    border-top: 3px solid #6bb9f0;
}

/* 4. Untermenü-Positionierung (3. Ebene): Nach links aufklappen, um Viewport-Overflow zu verhindern */
.ast-builder-menu-1 .main-header-menu .sub-menu .menu-item-has-children .sub-menu,
.main-header-menu .sub-menu .sub-menu {
    left: auto !important;
    right: 100% !important;
    margin-right: -3px;
}

/* ==========================================================================
   HOMEPAGE HERO: 3 Header-Bilder als Hero-Section
   ========================================================================== */
.home .wp-block-columns:first-of-type {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    overflow: hidden;
}

.home .wp-block-columns:first-of-type .wp-block-column {
    padding: 0 !important;
    overflow: hidden;
}

.home .wp-block-columns:first-of-type .wp-block-image {
    margin: 0 !important;
    height: 100%;
}

.home .wp-block-columns:first-of-type .wp-block-image img {
    width: 100%;
    height: 60vh;
    object-fit: cover;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: block;
}

@media (max-width: 768px) {
    .home .wp-block-columns:first-of-type {
        flex-direction: row !important;
    }
    .home .wp-block-columns:first-of-type .wp-block-image img {
        height: 30vh;
    }
}

/* ==========================================================================
   HOMEPAGE: 2-SPALTEN-LAYOUT — Saubere Spalten
   ========================================================================== */
.home .wp-block-columns {
    gap: 2rem;
    margin-top: 2rem;
}

.home .wp-block-column {
    background-color: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

/* ==========================================================================
   REGENBOGEN-CARD — Karten-Design für Inhaltsblöcke
   ========================================================================== */
.regenbogen-card {
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-top: 4px solid #f57c00;
}

.regenbogen-card:last-child {
    margin-bottom: 0;
}

.regenbogen-card h2,
.regenbogen-card h3 {
    margin-top: 0;
}

.home .wp-block-image {
    margin-bottom: 2rem;
}

.home .wp-block-image img {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* Obere Bilder-Reihe auf exakter horizontaler Linie */
.home .wp-block-columns:first-of-type {
    align-items: stretch;
}

.home .wp-block-columns:first-of-type .wp-block-column {
    display: flex;
    align-items: stretch;
}

/* ==========================================================================
   KALENDER-BLOCK — Modern gestylt
   ========================================================================== */
.wp-block-calendar {
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.wp-block-calendar table {
    border-collapse: collapse;
    width: 100%;
}

.wp-block-calendar th {
    background-color: var(--heading-dark);
    color: var(--white);
    padding: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.wp-block-calendar td {
    text-align: center;
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
}

.wp-block-calendar a {
    color: var(--heading-dark);
    font-weight: 700;
    text-decoration: none;
}

.wp-block-calendar a:hover {
    text-decoration: underline;
}

.wp-block-calendar tbody td#today {
    background-color: #fff3e0;
    border: 2px solid var(--heading-dark);
    font-weight: 800;
}

/* ==========================================================================
   RESPONSIVE — Mobile Layout
   ========================================================================== */
@media (max-width: 768px) {
    .site-branding {
        flex-direction: column !important;
        text-align: center !important;
    }

    .site-title {
        font-size: 1.5rem !important;
    }

    .wp-block-columns {
        flex-direction: column !important;
    }

    .wp-block-column {
        flex-basis: 100% !important;
        width: 100% !important;
        margin-bottom: 1rem;
    }

    .home .wp-block-gallery.has-nested-images {
        columns: 2 !important;
    }
}

@media (max-width: 480px) {
    .regenbogen-card {
        padding: 1rem;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

/* ==========================================================================
   STARTSEITE 2/1-LAYOUT: Block an Block, minimierter Whitespace
   ========================================================================== */
.home .home-content-grid {
    gap: 1.5rem !important;
    margin-top: 1.5rem !important;
}

.home .home-content-grid .regenbogen-card {
    margin-bottom: 1.5rem !important;
}

.home .home-content-grid .regenbogen-card:last-child {
    margin-bottom: 0 !important;
}

.home .home-content-grid .wp-block-column {
    padding: 0 !important;
}

/* ==========================================================================
   KERNZEITEN-TABELLE
   ========================================================================== */
.home .wp-block-table table {
    max-width: 700px;
    margin: 0 auto 2rem;
    border-collapse: collapse;
}

.home .wp-block-table th {
    background-color: var(--heading-dark);
    color: white;
    padding: 0.75rem 1rem;
    font-weight: 700;
}

.home .wp-block-table td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.home .wp-block-table tr:nth-child(even) td {
    background-color: #f8f9fa;
}

/* ==========================================================================
   KLASSENTIERE-GALERIE (Startseite)
   ========================================================================== */
.home .wp-block-gallery {
    margin-bottom: 2rem;
}

.home .wp-block-gallery .wp-block-image img {
    border-radius: 50%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.home .wp-block-gallery .wp-block-image img:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   GLEICH HOHE KARTEN pro Reihe (Projekte, Klassen, etc.)
   ========================================================================== */
.home .home-content-grid > .wp-block-column {
    display: block !important;
}
.home .wp-block-columns:not(.home-content-grid):has(.regenbogen-card) > .wp-block-column {
    display: flex;
}
.home .wp-block-columns:not(.home-content-grid):has(.regenbogen-card) > .wp-block-column > .regenbogen-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   PARTNER-LOGOS: Nicht quadratisch beschneiden
   ========================================================================== */
.home .wp-block-columns:not(:first-of-type):not(:has(.regenbogen-card)) .wp-block-image img {
    aspect-ratio: auto !important;
    object-fit: contain !important;
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   COOKIE-BANNER — DSGVO (leichtgewichtig, fixiert unten)
   ========================================================================== */
.regenbogenschule-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    background-color: var(--heading-dark);
    color: var(--white);
    padding: 1rem 1.5rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    display: none;
    animation: regenbogenschule-slideUp 0.3s ease-out;
}

@keyframes regenbogenschule-slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.regenbogenschule-cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.regenbogenschule-cookie-content p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    flex: 1 1 60%;
    text-align: left !important;
    color: var(--white);
}

.regenbogenschule-cookie-btn {
    flex-shrink: 0;
    background-color: #00bcd4;
    color: var(--white);
    border: 2px solid transparent;
    padding: 0.65rem 1.75rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Nunito', Arial, Helvetica, "Comic Sans MS", sans-serif;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.regenbogenschule-cookie-btn:hover,
.regenbogenschule-cookie-btn:focus {
    background-color: #0097a7;
    border-color: var(--white);
    outline: none;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .regenbogenschule-cookie-banner {
        padding: 1rem;
    }

    .regenbogenschule-cookie-content {
        flex-direction: column;
        text-align: center;
    }

    .regenbogenschule-cookie-content p {
        font-size: 0.9rem;
        text-align: center !important;
    }

    .regenbogenschule-cookie-btn {
        width: 100%;
        padding: 0.75rem;
    }
}
