/* ==========================================================
   Custom Cassiopeia layout – Joomla 6.1.x
   Layout: header image / mega menu / left sidebar / content / footer
   ========================================================== */

:root {
    --custom-page-width: 1120px;
    --custom-sidebar-width: 285px;
    --custom-gap: 0px;
    --custom-blue: #1296cf;
    --custom-header-blue: #4d6fa5;
    --custom-border: #eceff2;
    --custom-page-bg: #f4f5f7;
    --custom-content-bg: #ffffff;
}

/* ----------------------------------------------------------
   Grundlayout
   ---------------------------------------------------------- */

html {
    scroll-behavior: smooth;
}

body.custom-protostar-layout {
    margin: 0;
    background: var(--custom-page-bg);
    color: #222;
}

body.custom-protostar-layout .site-wrapper {
   width: min(var(--custom-page-width), calc(100% - 32px));
    margin: 28px auto 0;
    background: var(--custom-content-bg);
		-moz-border-radius: 4px;
    -webkit-border-radius: 4px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    -moz-box-shadow: 0px 0px 6px rgba(0,0,0,0.05);
    -webkit-box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.05);
    box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.05);
}

/* Cassiopeia Standard-Grid für dieses Layout neutralisieren */
body.custom-protostar-layout .grid-child,
body.custom-protostar-layout .site-grid {
    max-width: none;
    width: auto;
    margin: 0;
    padding: 0;
    display: block;
}

/* ----------------------------------------------------------
   Headerbild – Modulposition: topbar
   ---------------------------------------------------------- */

.custom-header {
    width: 100%;
}

.header-image {
    min-height: 200px;
    overflow: hidden;
    background: var(--custom-header-blue);
}

.header-image > div,
.header-image .moduletable,
.header-image .mod-custom,
.header-image p,
.header-image figure {
    margin: 0;
    padding: 0;
    width: 100%;
}

.header-image img {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* ----------------------------------------------------------
   Mega-Menü – Modulposition: menu
   ---------------------------------------------------------- */

.mega-menu {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-bottom: 1px solid var(--custom-border);
    position: relative;
    z-index: 100;
}

.mega-menu > * {
    width: 100%;
}

/* Joomla Standard-Menü: horizontal */
.mega-menu .mod-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mega-menu .mod-menu > li {
    margin: 0;
}

.mega-menu .mod-menu > li > a,
.mega-menu .mod-menu > li > span,
.mega-menu .mod-menu > li > button {
    display: block;
    padding: 28px 20px;
    color: #111;
    text-decoration: none;
}

/* Maximenu CK darf seine eigene Darstellung behalten */
.mega-menu .maximenuck,
.mega-menu [class*="maximenuck"] {
    max-width: 100%;
}

/* ----------------------------------------------------------
   Hauptbereich
   ---------------------------------------------------------- */

.content-layout {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 520px;
    background: #fff;
}

.content-layout.has-sidebar-left {
    grid-template-columns: var(--custom-sidebar-width) minmax(0, 1fr);
}

.custom-sidebar-left {
    padding: 0px 15px 0px 20px;
    border-right: 1px solid var(--custom-border);
    min-width: 0;
	margin-left: 20px;
    margin-top: 20px;
}

.custom-main {
    min-width: 0;
    padding: 20px;
}

.custom-main main {
    margin: 0;
}

/* Module nicht mit Cassiopeias Kartenstil versehen */
.custom-sidebar-left .moduletable,
.custom-main .moduletable,
.footer-center .moduletable {
    margin-bottom: 1.5rem;
}

.page-header h1 {
	font-size: 22px;
    font-weight: 500;
    line-height: 1.2;
    margin: 0px 0 13px 0;
    color: #0088cc;
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 13px;
}

.com-content-article__body a {
    color: #0088cc;
	text-decoration: none;
}

.com-content-article__body a:hover {
    color: #005080;
	text-decoration: underline;
}

/* ----------------------------------------------------------
   Footer
   ---------------------------------------------------------- */

.custom-footer {
    min-height: 68px;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    gap: 20px;
    padding: 0 18px;
    background: var(--custom-blue);
    color: #fff;
}

.footer-left {
    text-align: left;
    white-space: nowrap;
}

.footer-center {
    text-align: center;
    font-size: 1.2rem;
}

.footer-center p,
.footer-center .mod-custom {
    margin: 0;
}

.footer-right {
    text-align: right;
    white-space: nowrap;
}

.custom-footer a,
.custom-footer a:visited {
    color: #fff;
    text-decoration: none;
}

.custom-footer a:hover,
.custom-footer a:focus {
    color: #fff;
    text-decoration: underline;
}

/* ----------------------------------------------------------
   Allgemeine Korrekturen für Cassiopeia
   ---------------------------------------------------------- */

.custom-protostar-layout .container-component {
    max-width: none;
}

.custom-protostar-layout .joomla-alert--show {
    margin: 1rem 0;
}

/* Bilder im Inhalt responsiv */
.custom-main img {
    max-width: 100%;
    height: auto;
}

/* ----------------------------------------------------------
   Responsive
   ---------------------------------------------------------- */

@media (max-width: 900px) {
    body.custom-protostar-layout .site-wrapper {
        width: min(100% - 20px, var(--custom-page-width));
        margin-top: 10px;
    }

    .content-layout.has-sidebar-left {
        grid-template-columns: 230px minmax(0, 1fr);
    }

    .custom-sidebar-left {
        padding: 60px 25px 35px;
    }

    .custom-main {
        padding: 60px 40px 45px;
    }
}

@media (max-width: 700px) {
    body.custom-protostar-layout .site-wrapper {
        width: 100%;
        margin-top: 0;
    }

    .header-image,
    .header-image img {
        min-height: 0;
        height: auto;
    }

    .mega-menu {
        min-height: 64px;
    }

    .mega-menu .mod-menu {
        flex-direction: column;
        align-items: stretch;
    }

    .mega-menu .mod-menu > li > a,
    .mega-menu .mod-menu > li > span,
    .mega-menu .mod-menu > li > button {
        padding: 14px 18px;
        text-align: center;
    }

    .content-layout,
    .content-layout.has-sidebar-left {
        display: block;
        min-height: 0;
    }

    .custom-sidebar-left {
        padding: 25px 20px;
        border-right: 0;
        border-bottom: 1px solid var(--custom-border);
    }

    .custom-main {
        padding: 30px 20px 40px;
    }

    .custom-footer {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 14px 18px;
        text-align: center;
    }

    .footer-left,
    .footer-center,
    .footer-right {
        text-align: center;
    }
}
