
/* =========================================================
   genussmaenner.de – Responsive Layout
   Ergänzung zur bestehenden frontend.css
   ========================================================= */

:root {
    --gm-blue: #324c7d;
    --gm-menu: #81909f;
    --gm-menu-active: #63819f;
    --gm-text: #666666;
    --gm-background: #fff1ed;
    --gm-white: #ffffff;
    --gm-border: #cccccc;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    width: 100%;
    max-width: 100%;
    scroll-behavior: smooth;
}

body {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: var(--gm-background);
    color: var(--gm-text);
    font-family: "Source Sans Pro", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    overflow-wrap: break-word;
}

img,
video,
iframe,
embed,
object {
    max-width: 100%;
}

img {
    height: auto;
}

a {
    color: var(--gm-blue);
    overflow-wrap: anywhere;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* Hauptcontainer */

.site-container {
    width: min(100% - 32px, 1000px);
    margin: 24px auto;
    padding: 0;
    background: var(--gm-white);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Kopfbereich */

.site-header {
    min-width: 0;
    padding: 16px 20px 0;
}

.ad-top {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 16px;
    text-align: center;
}

.ad-slot {
    min-width: 0;
    max-width: 100%;
    text-align: center;
}

.ad-slot img,
.ad-slot iframe {
    max-width: 100%;
}

.site-brand {
    width: 100%;
    margin: 0 auto 20px;
    text-align: center;
}

.site-brand a {
    display: block;
}

.site-brand img {
    display: block;
    width: 100%;
    max-width: 920px;
    height: auto;
    margin: 0 auto;
}

/* phpwcms-Kopf-Inhalte */

.site-header-content {
    min-width: 0;
    max-width: 100%;
    text-align: center;
}

.site-header-content img {
    max-width: 100%;
    height: auto;
}

/* Datum und Breadcrumb */

.site-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 24px;
    padding: 12px 20px;
    border-bottom: 1px solid #e5e5e5;
}

.site-meta .datum,
.site-meta .breadcrumb {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

/* Desktop-Layout: Navigation links, Artikel rechts */

.site-layout {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    grid-template-areas: "sidebar main";
    align-items: start;
    gap: 24px;
    padding: 20px;
}

.site-sidebar {
    grid-area: sidebar;
    min-width: 0;
    width: 100%;
}

.site-main {
    grid-area: main;
    min-width: 0;
    width: 100%;
}

/* Navigation */

.primary-navigation {
    width: 100%;
    min-width: 0;
    margin-bottom: 24px;
}

.primary-navigation .nav_table,
.primary-navigation .nav_table_active {
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* Hamburger-Schalter: standardmäßig auf Desktop verborgen */

.menu-toggle {
    display: none;
    width: 100%;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 16px;
    margin: 0 0 16px;
    border: 1px solid #d0d6df;
    border-radius: 5px;
    background: #f6f7f9;
    color: var(--gm-blue);
    cursor: pointer;
    font-weight: 700;
    text-align: center;
}

.menu-toggle:hover {
    background: #e9edf3;
}

.menu-toggle:focus-visible {
    outline: 3px solid var(--gm-blue);
    outline-offset: 3px;
}

.menu-icon {
    display: flex;
    width: 22px;
    flex-direction: column;
    gap: 5px;
}

.menu-icon span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.2s ease;
}

.menu-toggle[aria-expanded="true"] .menu-icon span:first-child {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-icon span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-icon span:last-child {
    transform: translateY(-7px) rotate(-45deg);
}

/* Artikel */

#content {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

#content p {
    line-height: 1.65;
}

#content h1,
#content h2,
#content h3,
#content h4 {
    max-width: 100%;
    overflow-wrap: anywhere;
}

#content h1 {
    font-size: clamp(26px, 3.5vw, 36px);
    line-height: 1.2;
}

#content h2 {
    font-size: clamp(19px, 2.5vw, 25px);
    line-height: 1.3;
}

#content img {
    max-width: 100%;
    height: auto;
}

#content iframe,
#content video {
    max-width: 100%;
}

#content pre {
    max-width: 100%;
    overflow-x: auto;
}

#content table {
    max-width: 100%;
}

#content td,
#content th {
    overflow-wrap: anywhere;
}

/* Bilder innerhalb von phpwcms-Artikeln */

.imgDIVinTextLeft,
.imgDIVinTextRight,
.phpwcmsArticleListImage {
    max-width: 100%;
}

.imgDIVinTextLeft img,
.imgDIVinTextRight img,
.phpwcmsArticleListImage img {
    max-width: 100%;
    height: auto;
}

/* Teaser */

.teaserExContainer {
    width: 100%;
    max-width: 100%;
}

.teaserExColumnContainer {
    max-width: 100%;
}

/* Artikelnavigation */

.article-browser {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 16px;
    padding: 10px 0;
    border-top: 1px solid var(--gm-border);
    border-bottom: 1px solid var(--gm-border);
}

.article-browser > div {
    min-width: 0;
    max-width: 100%;
}

/* Seitennummerierung */

.cpPagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
    padding: 10px 0;
    text-align: center;
}

.cpPagination a {
    display: inline-block;
    padding: 6px 9px;
}

/* Sidebar */

.sidebar-section {
    min-width: 0;
    margin: 0 0 24px;
}

.sidebar-section h3,
.site-footer h3 {
    width: 100%;
    max-width: 100%;
    margin: 0 0 12px;
    padding: 8px 10px;
    background: var(--gm-blue);
    color: var(--gm-white);
    font-size: 15px;
    line-height: 1.4;
    letter-spacing: 0.5px;
    overflow-wrap: anywhere;
}

.social-links iframe {
    max-width: 100%;
}

/* Werbung */

.article-advertising {
    margin-top: 24px;
    text-align: center;
}

.ad-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
    margin: 16px 0;
}

.ad-grid > div {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.charity-banner img {
    display: inline-block;
    max-width: 100%;
    height: auto;
}

/* Footer */

.site-footer {
    padding: 24px 20px;
    border-top: 1px solid #e5e5e5;
    background: #fafafa;
}

.footer-section {
    margin-bottom: 24px;
}

.footer-links {
    margin: 0;
    padding-left: 20px;
}

.footer-links li {
    margin: 4px 0;
    line-height: 1.6;
}

.copyright {
    margin: 24px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--gm-border);
    font-size: 13px;
}

/* Allgemeine Trennlinien */

hr {
    height: 1px;
    border: 0;
    border-bottom: 1px solid var(--gm-border);
    margin: 20px 0;
}

/* =========================================================
   Tablet
   ========================================================= */

@media screen and (max-width: 1024px) {

    .site-container {
        width: calc(100% - 24px);
        margin: 12px auto;
    }

    .site-layout {
        grid-template-columns: 180px minmax(0, 1fr);
        gap: 18px;
        padding: 16px;
    }

    .site-header {
        padding-right: 16px;
        padding-left: 16px;
    }
}

/* =========================================================
   Smartphone
   ========================================================= */

@media screen and (max-width: 767px) {

    body {
        font-size: 16px;
        line-height: 1.6;
    }

    .site-container {
        width: 100%;
        margin: 0;
        box-shadow: none;
    }

    .site-header {
        padding: 12px;
    }

    .ad-top {
        margin-bottom: 12px;
    }

    .site-brand {
        margin-bottom: 12px;
    }

    .site-brand img {
        width: 100%;
        max-width: 100%;
    }

    .site-header-content {
        text-align: left;
    }

    .menu-toggle {
        display: flex;
    }

    .site-meta {
        display: block;
        padding: 10px 12px;
    }

    .site-meta .datum {
        margin-bottom: 4px;
    }

    /* Artikel zuerst, Navigation danach */
    .site-layout {
        display: flex;
        flex-direction: column;
        gap: 20px;
        padding: 12px;
    }

    .site-main {
        order: 1;
        width: 100%;
    }

    .site-sidebar {
        order: 2;
        width: 100%;
        max-width: none;
    }

    /* Navigation bleibt geschlossen, bis der Button gedrückt wird */
    .site-sidebar:not(.is-open) {
        display: none;
    }

    .site-sidebar.is-open {
        display: block;
    }

    .primary-navigation {
        width: 100%;
        max-width: none;
        margin-bottom: 20px;
    }

    /* Vertikales phpwcms-Menü auf volle Breite */
    .primary-navigation .nlu_navi1,
    .primary-navigation .nlu_navi1 ul {
        width: 100%;
        max-width: 100%;
    }

    .primary-navigation .nlu_navi1 ul li a {
        width: auto;
        min-height: 44px;
        padding-top: 11px;
        padding-bottom: 11px;
        box-sizing: border-box;
        line-height: 1.4;
    }

    /* Überschriften */
    #content h1 {
        font-size: 28px;
        line-height: 1.2;
    }

    #content h2 {
        font-size: 22px;
        line-height: 1.3;
    }

    #content h3,
    .site-footer h3,
    .sidebar-section h3 {
        width: 100%;
        margin-top: 20px;
        font-size: 15px;
        line-height: 1.4;
    }

    /* Text und Bilder */
    #content p {
        font-size: 16px;
        line-height: 1.65;
    }

    .imgDIVinTextLeft,
    .imgDIVinTextRight,
    .phpwcmsArticleListImage {
        float: none;
        display: block;
        margin: 0 0 16px;
    }

    .imgDIVtopLeft,
    .imgDIVtopCenter {
        max-width: 100%;
        margin: 8px auto;
    }

    /* Tabellen in Artikeln */
    #content table {
        max-width: 100%;
    }

    #content td,
    #content th {
        overflow-wrap: anywhere;
    }

    /* Werbeeinheiten */
    .ad-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ad-grid > div,
    .ad-slot {
        min-width: 0;
        max-width: 100%;
    }

    /* Social-Media-Elemente */
    .social-links {
        overflow-wrap: anywhere;
    }

    /* Artikelnavigation */
    .article-browser {
        flex-direction: column;
        align-items: flex-start;
    }

    .cpPagination {
        justify-content: flex-start;
        text-align: left;
    }

    /* Footer */
    .site-footer {
        padding: 20px 12px;
    }
}

/* Sehr schmale Smartphones */

@media screen and (max-width: 380px) {

    .site-layout {
        padding: 8px;
    }

    .site-header {
        padding: 8px;
    }

    #content h1 {
        font-size: 25px;
    }

    .menu-toggle {
        justify-content: flex-start;
    }
}

/* Barrierefreiheit: reduzierte Animation berücksichtigen */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .menu-icon span {
        transition: none;
    }
}
