/*
Theme Name: InForm + Farbe 2026 (Fresh Look)
Theme URI: https://www.inform-und-farbe.de/
Author: Tobias Graupner / Custom Theme
Author URI: https://citydruckleipzig.de/
Description: Die komplett frische 2026-Designvariante für InForm + Farbe: Offenes, kastenfreies Layout auf weißer Fläche, moderner Sticky-Header mit prominentem Shop-CTA-Button, gebündeltes Themen-Verzeichnis (inkl. Klappmenü-Widget), automatische Breadcrumbs und 3-Spalten-Footer. Optimiert für Mobilgeräte (kein horizontaler Overflow, Widget-Menü mobil ganz oben).
Version: 2.3.0
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
License: GPL v2 or later
Text Domain: inform-farbe
*/

:root {
    --if-blue: #154c99;
    --if-blue-dark: #0c2d5c;
    --if-blue-light: #2563eb;
    --if-blue-soft: #eff6ff;
    --if-red: #c82829;
    --if-red-hover: #a81f20;
    --if-red-soft: #fef2f2;
    --if-bg: #ffffff;
    --if-panel-bg: #f8fafc;
    --if-text: #1e293b;
    --if-text-heading: #0f172a;
    --if-text-muted: #64748b;
    --if-border: #e2e8f0;
    --if-border-light: #f1f5f9;
    --if-footer-bg: #0f172a;
    --if-footer-text: #cbd5e1;
    --if-radius: 10px;
    --if-radius-sm: 6px;
    --if-container: 1220px;
    --if-sidebar-width: 300px;
    --if-logo-width: 200px;
    --if-tagline-size: 15px;
    --if-tagline-weight: 400;
}

/* ==========================================================================
   1. Reset & Base (Modern Open Canvas + Strict Overflow Protection)
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    max-width: 100%;
    overflow-x: clip;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1.05rem;
    line-height: 1.72;
    color: var(--if-text);
    background-color: var(--if-bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

img, svg, video, iframe, canvas, object, embed {
    max-width: 100%;
    height: auto;
}

img {
    display: block;
    border-radius: var(--if-radius-sm);
}

a {
    color: var(--if-blue);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

a:hover {
    color: var(--if-red);
}

:focus-visible {
    outline: 2px solid var(--if-blue-light);
    outline-offset: 2px;
}

.if-container {
    width: 100%;
    max-width: var(--if-container);
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   2. Modern Single-Level Sticky Header
   ========================================================================== */
.site-header {
    background-color: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--if-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
    width: 100%;
}

body.admin-bar .site-header {
    top: 32px;
}

.header-main-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 82px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.site-branding {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
    flex-shrink: 1;
    min-width: 0;
    max-width: 100%;
}

.site-logo-wrap {
    display: flex;
    align-items: center;
    max-width: 100%;
}

.custom-logo-link {
    display: inline-block;
    line-height: 1;
    max-width: 100%;
}

.custom-logo-link img {
    width: var(--if-logo-width, 200px);
    max-width: 100%;
    height: auto;
    max-height: none;
    border-radius: 0;
    transition: width 0.15s ease;
}

.site-branding-tagline {
    margin: 0;
    padding: 0;
    font-size: var(--if-tagline-size, 15px);
    font-weight: var(--if-tagline-weight, 400);
    color: var(--if-blue);
    line-height: 1.25;
    letter-spacing: -0.01em;
    max-width: 100%;
    overflow-wrap: break-word;
}

.site-title {
    margin: 0;
    font-size: 2.3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}

.site-title a {
    text-decoration: none;
    color: var(--if-red);
}

.site-title .brand-plus-farbe {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    font-style: italic;
    color: var(--if-blue);
    letter-spacing: 0;
    text-align: right;
    margin-bottom: -3px;
}

/* Header Navigation */
.header-nav-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
}

.primary-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

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

.primary-menu > li > a {
    display: inline-flex;
    align-items: center;
    padding: 9px 15px;
    color: var(--if-text-heading);
    text-decoration: none;
    font-size: 0.96rem;
    font-weight: 600;
    border-radius: var(--if-radius-sm);
    position: relative;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.primary-menu > li > a:hover,
.primary-menu > li > a:focus {
    color: var(--if-blue);
    background-color: var(--if-border-light);
}

.primary-menu > li.current-menu-item > a,
.primary-menu > li.current_page_item > a,
.primary-menu > li.current-menu-ancestor > a {
    color: var(--if-blue);
    background-color: var(--if-blue-soft);
}

.primary-menu > li > a[href*="inform-und-farbe.com"] {
    background-color: var(--if-blue);
    color: #ffffff !important;
    padding: 9px 18px;
    margin-left: 4px;
    box-shadow: 0 1px 2px rgba(21, 76, 153, 0.2);
}

.primary-menu > li > a[href*="inform-und-farbe.com"]:hover {
    background-color: var(--if-red);
    color: #ffffff !important;
}

/* Dedizierter Shop-CTA-Button rechts im Header */
.header-shop-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--if-red);
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(200, 40, 41, 0.22);
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.header-shop-cta:hover,
.header-shop-cta:focus {
    background-color: var(--if-red-hover);
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(200, 40, 41, 0.28);
}

/* Dropdown Submenus in Header */
.primary-menu ul.sub-menu {
    list-style: none;
    margin: 0;
    padding: 8px;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 230px;
    background-color: #ffffff;
    border: 1px solid var(--if-border);
    border-radius: var(--if-radius);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
    display: none;
    z-index: 120;
}

.primary-menu li:hover > ul.sub-menu,
.primary-menu li:focus-within > ul.sub-menu {
    display: block;
}

.primary-menu ul.sub-menu li a {
    display: block;
    padding: 8px 14px;
    color: var(--if-text);
    text-decoration: none;
    font-size: 0.92rem;
    border-radius: var(--if-radius-sm);
}

.primary-menu ul.sub-menu li a:hover {
    background-color: var(--if-border-light);
    color: var(--if-blue);
}

/* Mobile Menu Button */
.menu-toggle {
    display: none;
    background-color: var(--if-panel-bg);
    border: 1px solid var(--if-border);
    color: var(--if-text-heading);
    padding: 9px 14px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--if-radius-sm);
    cursor: pointer;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ==========================================================================
   3. Open Workspace Layout
   ========================================================================== */
.site-main-wrapper {
    flex: 1 0 auto;
    padding: 36px 0 64px;
    width: 100%;
    max-width: 100%;
}

.layout-grid {
    display: grid;
    grid-template-columns: var(--if-sidebar-width) minmax(0, 1fr);
    gap: 44px;
    align-items: start;
    width: 100%;
    max-width: 100%;
}

body.sidebar-position-right .layout-grid:not(.layout-fullwidth):not(.layout-both-sidebars),
.layout-grid.layout-sidebar-right {
    grid-template-columns: minmax(0, 1fr) var(--if-sidebar-width);
}

body.sidebar-position-right .layout-grid:not(.layout-fullwidth):not(.layout-both-sidebars) .widget-area-left,
.layout-grid.layout-sidebar-right .widget-area-left {
    order: 2;
}

body.sidebar-position-right .layout-grid:not(.layout-fullwidth):not(.layout-both-sidebars) .site-main,
.layout-grid.layout-sidebar-right .site-main {
    order: 1;
}

.layout-grid.layout-both-sidebars {
    grid-template-columns: 270px minmax(0, 1fr) 270px;
    gap: 32px;
}

.layout-grid.layout-fullwidth {
    grid-template-columns: minmax(0, 860px);
    justify-content: center;
}

/* ==========================================================================
   4. Unified Sidebar Navigation Panel
   ========================================================================== */
.widget-area-wrapper {
    min-width: 0;
    max-width: 100%;
    width: 100%;
}

.widget-area {
    background-color: var(--if-panel-bg);
    border: 1px solid var(--if-border);
    border-radius: var(--if-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    max-width: 100%;
}

.widget {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--if-border);
    border-radius: 0;
    padding: 20px 22px;
    margin: 0;
    box-shadow: none;
    min-width: 0;
    max-width: 100%;
}

.widget:last-child {
    border-bottom: none;
}

.widget-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--if-text-muted);
    margin: 0 0 12px 0;
    padding: 0 0 0 10px;
    border-left: 3px solid var(--if-red);
    line-height: 1.25;
}

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

.widget ul li {
    margin: 2px 0;
    padding: 0;
    font-size: 0.95rem;
    position: relative;
}

.if-menu-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    border-radius: var(--if-radius-sm);
    transition: background-color 0.15s ease;
}

.if-menu-item-row:hover {
    background-color: #eef2f6;
}

.widget ul li a {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    padding: 7px 10px;
    color: var(--if-text);
    text-decoration: none;
    font-weight: 500;
    line-height: 1.4;
    border-radius: var(--if-radius-sm);
    transition: color 0.15s ease, background-color 0.15s ease;
    overflow-wrap: break-word;
}

.widget ul li > a:hover {
    background-color: #eef2f6;
    color: var(--if-blue);
}

.widget ul li.current-menu-item > a,
.widget ul li.current-menu-item > .if-menu-item-row > a,
.widget ul li.current_page_item > a,
.widget ul li.current_page_item > .if-menu-item-row > a {
    color: var(--if-blue);
    background-color: var(--if-blue-soft);
    font-weight: 600;
}

.widget ul li.current-menu-ancestor > .if-menu-item-row > a,
.widget ul li.current-menu-parent > .if-menu-item-row > a,
.widget ul li.is-open > .if-menu-item-row > a {
    color: var(--if-blue-dark);
    font-weight: 600;
}

.widget ul ul {
    margin: 4px 0 8px 14px;
    padding: 2px 0 2px 12px;
    border-left: 2px solid #cbd5e1;
}

.widget ul ul li {
    margin: 1px 0;
}

.widget ul ul li a {
    padding: 5px 10px;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--if-text-muted);
}

.widget ul ul li a:hover,
.widget ul ul li.current-menu-item > a,
.widget ul ul li.current_page_item > a {
    color: var(--if-red);
    background-color: rgba(200, 40, 41, 0.06);
    font-weight: 600;
}

/* Klappmenü-Steuerung */
.if-collapsible-menu ul.sub-menu,
.if-collapsible-menu ul.children,
ul.if-sidebar-menu[data-click-behavior] ul.sub-menu,
ul.if-sidebar-menu[data-click-behavior] ul.children {
    display: none;
}

.if-collapsible-menu li.is-open > ul.sub-menu,
.if-collapsible-menu li.is-open > ul.children,
ul.if-sidebar-menu[data-click-behavior] li.is-open > ul.sub-menu,
ul.if-sidebar-menu[data-click-behavior] li.is-open > ul.children {
    display: block;
    animation: ifSubmenuFade 0.18s ease-out;
}

@keyframes ifSubmenuFade {
    from {
        opacity: 0;
        transform: translateY(-3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.if-submenu-toggle {
    background: transparent;
    border: none;
    color: var(--if-text-muted);
    width: 30px;
    height: 30px;
    padding: 0;
    margin-right: 4px;
    border-radius: var(--if-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.if-submenu-toggle:hover {
    background-color: #e2e8f0;
    color: var(--if-blue);
}

.if-submenu-toggle .if-chevron {
    display: inline-block;
    font-size: 0.78rem;
    transition: transform 0.2s ease;
}

li.is-open > .if-menu-item-row > .if-submenu-toggle {
    color: var(--if-red);
}

li.is-open > .if-menu-item-row > .if-submenu-toggle .if-chevron {
    transform: rotate(90deg);
}

.mobile-sidebar-toggle {
    display: none;
    width: 100%;
    background-color: var(--if-panel-bg);
    color: var(--if-text-heading);
    border: 1px solid var(--if-border);
    border-radius: var(--if-radius);
    padding: 13px 18px;
    font-size: 0.96rem;
    font-weight: 600;
    cursor: pointer;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* ==========================================================================
   5. Breadcrumbs & Open Content Typography (inkl. Legacy-Content-Schutz)
   ========================================================================== */
.site-main {
    background: transparent;
    border: none;
    padding: 4px 0 24px 0;
    min-height: 420px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.entry-content {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Schutz gegen feste Inline-Breiten (z.B. style="width:650px") aus alten Beiträgen */
.entry-content div,
.entry-content figure,
.entry-content p,
.entry-content span,
.entry-content pre,
.entry-content code,
.entry-content table,
.entry-content img,
.entry-content iframe,
.entry-content video {
    max-width: 100% !important;
}

.entry-content img {
    height: auto !important;
}

.entry-content pre {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}

.if-breadcrumbs {
    margin-bottom: 14px;
    font-size: 0.85rem;
    color: var(--if-text-muted);
    max-width: 100%;
}

.if-breadcrumb-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.if-breadcrumb-item + .if-breadcrumb-item::before {
    content: "›";
    color: #94a3b8;
    margin-right: 6px;
    font-weight: 600;
}

.if-breadcrumb-item a {
    color: var(--if-text-muted);
    text-decoration: none;
}

.if-breadcrumb-item a:hover {
    color: var(--if-blue);
    text-decoration: underline;
}

.if-breadcrumb-item.is-current {
    color: var(--if-text);
    font-weight: 500;
}

/* Editorial Content Headings */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    line-height: 1.28;
    font-weight: 700;
    color: var(--if-text-heading);
    letter-spacing: -0.015em;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

h1, .entry-title {
    font-size: 2rem;
    color: var(--if-red);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--if-border-light);
}

.entry-title a {
    color: inherit;
    text-decoration: none;
}

h2 {
    font-size: 1.45rem;
    color: var(--if-blue);
    margin-top: 2.1rem;
    margin-bottom: 0.75rem;
}

h3 {
    font-size: 1.2rem;
    color: var(--if-text-heading);
    margin-top: 1.6rem;
    margin-bottom: 0.5rem;
}

p {
    margin-top: 0;
    margin-bottom: 1.2rem;
}

hr {
    border: 0;
    border-top: 1px solid var(--if-border);
    margin: 2.25rem 0;
}

.entry-content > *:last-child {
    margin-bottom: 0;
}

.entry-content ul,
.entry-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.35rem;
}

.entry-content li {
    margin-bottom: 0.4rem;
}

/* Tabellen im modernen Look */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.75rem;
    font-size: 0.96rem;
    border: 1px solid var(--if-border);
    border-radius: var(--if-radius-sm);
    overflow: hidden;
}

.entry-content th,
.entry-content td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--if-border);
    text-align: left;
    overflow-wrap: break-word;
    word-break: break-word;
}

.entry-content th {
    background-color: var(--if-panel-bg);
    font-weight: 600;
    color: var(--if-text-heading);
}

/* Classic Editor Image Alignments */
.alignleft {
    float: left;
    margin: 0.4rem 1.75rem 1.2rem 0;
}

.alignright {
    float: right;
    margin: 0.4rem 0 1.2rem 1.75rem;
}

.aligncenter {
    display: block;
    margin: 1.25rem auto;
}

.wp-caption {
    max-width: 100%;
    background: var(--if-panel-bg);
    border: 1px solid var(--if-border);
    padding: 8px;
    border-radius: var(--if-radius-sm);
    margin-bottom: 1.25rem;
}

.wp-caption-text {
    font-size: 0.86rem;
    color: var(--if-text-muted);
    text-align: center;
    margin: 8px 0 2px;
}

.clearfix::after,
.entry-content::after {
    content: "";
    display: table;
    clear: both;
}

/* ==========================================================================
   6. Buttons & Callouts
   ========================================================================== */
.btn,
.button,
.art-button,
input[type="submit"],
button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--if-blue);
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.96rem;
    padding: 11px 22px;
    border-radius: var(--if-radius-sm);
    border: none;
    cursor: pointer;
    max-width: 100%;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover,
.button:hover,
.art-button:hover,
input[type="submit"]:hover,
button[type="submit"]:hover {
    background-color: var(--if-blue-dark);
    color: #ffffff !important;
    transform: translateY(-1px);
}

.btn-red {
    background-color: var(--if-red);
}

.btn-red:hover {
    background-color: var(--if-red-hover);
}

/* ==========================================================================
   7. Modern 3-Column Footer
   ========================================================================== */
.site-footer {
    background-color: var(--if-footer-bg);
    color: var(--if-footer-text);
    margin-top: auto;
    padding: 52px 0 0;
    font-size: 0.94rem;
    line-height: 1.65;
    width: 100%;
    max-width: 100%;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 44px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-col {
    min-width: 0;
    max-width: 100%;
}

.footer-col h3,
.footer-col .widget-title {
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    border-left: none;
    padding-left: 0;
    margin: 0 0 14px 0;
}

.footer-col p {
    color: #94a3b8;
    margin-bottom: 1rem;
}

.footer-brand-badge {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    font-size: 0.82rem;
    padding: 5px 12px;
    border-radius: 999px;
    margin-top: 4px;
    max-width: 100%;
}

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

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer-col a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.footer-shop-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--if-red);
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 9px 18px;
    border-radius: var(--if-radius-sm);
    margin-top: 6px;
    max-width: 100%;
}

.footer-shop-btn:hover {
    background-color: var(--if-red-hover);
}

.footer-bottom {
    padding: 20px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: #64748b;
}

.footer-bottom-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-bottom-links a {
    color: #94a3b8;
    text-decoration: none;
}

.footer-bottom-links a:hover {
    color: #ffffff;
}

/* Footer Widgets Styling */
.footer-col .footer-widget {
    margin-bottom: 0;
}
.footer-col .footer-widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.footer-col .footer-widget ul li {
    margin-bottom: 8px;
}
.footer-col .footer-widget ul li a {
    color: #cbd5e1;
    text-decoration: none;
}
.footer-col .footer-widget ul li a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* ==========================================================================
   8. Responsive Design (Tablet & Smartphone)
   ========================================================================== */
@media (max-width: 960px) {
    .if-container {
        padding: 0 16px;
    }

    .site-main-wrapper {
        padding: 20px 0 44px;
    }

    .header-main-bar {
        flex-wrap: wrap;
        min-height: 68px;
        gap: 12px;
    }

    /* Auf dem Handy skaliert der Logo-Bereich automatisch passend neben den Menü-Button */
    .site-branding {
        flex: 1 1 auto;
        min-width: 0;
        max-width: calc(100% - 108px);
    }

    .custom-logo-link img {
        width: min(var(--if-logo-width, 200px), 100%);
        max-width: 100%;
        height: auto;
    }

    .site-branding-tagline {
        font-size: min(var(--if-tagline-size, 15px), 15px);
        line-height: 1.25;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .header-nav-wrapper {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 12px 0 8px;
        border-top: 1px solid var(--if-border-light);
    }

    .header-nav-wrapper.is-open {
        display: flex;
    }

    .primary-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .primary-menu > li > a {
        width: 100%;
        padding: 11px 14px;
        margin-left: 0 !important;
    }

    .primary-menu ul.sub-menu {
        position: static;
        display: block;
        box-shadow: none;
        border: none;
        background-color: var(--if-panel-bg);
        padding: 4px 0 4px 14px;
        margin-top: 2px;
    }

    .header-shop-cta {
        justify-content: center;
        margin-top: 6px;
        width: 100%;
    }

    /* WICHTIG: minmax(0, 1fr) verhindert jeglichen horizontalen Ausbruch auf dem Handy! */
    .layout-grid,
    body.sidebar-position-right .layout-grid:not(.layout-fullwidth):not(.layout-both-sidebars),
    .layout-grid.layout-sidebar-right,
    .layout-grid.layout-both-sidebars {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    /* MOBIL-REIHENFOLGE:
       1. Linkes Widget-Menü (.widget-area-left) ganz oben als Erstes!
       2. Hauptinhalt (.site-main) direkt darunter!
       3. Optionale rechte Sidebar (.widget-area-right) am Ende */
    .widget-area-wrapper,
    .widget-area-left,
    body.sidebar-position-right .layout-grid:not(.layout-fullwidth):not(.layout-both-sidebars) .widget-area-left,
    .layout-grid.layout-sidebar-right .widget-area-left {
        order: 1 !important;
    }

    .site-main,
    body.sidebar-position-right .layout-grid:not(.layout-fullwidth):not(.layout-both-sidebars) .site-main,
    .layout-grid.layout-sidebar-right .site-main {
        order: 2 !important;
        padding: 0;
    }

    .widget-area-right {
        order: 3 !important;
    }

    .mobile-sidebar-toggle {
        display: flex;
    }

    .widget-area.is-collapsed-mobile {
        display: none;
    }

    .alignleft,
    .alignright {
        float: none !important;
        display: block;
        margin: 1rem auto !important;
        max-width: 100% !important;
    }

    /* Falls im Content mehrspaltige Layout-Tabellen aus alten Zeiten liegen, auf Handy umbrechen */
    .entry-content table,
    .entry-content tbody,
    .entry-content tr,
    .entry-content td,
    .entry-content th {
        max-width: 100% !important;
    }

    .footer-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }

    h1, .entry-title {
        font-size: 1.55rem;
    }

    h2 {
        font-size: 1.3rem;
    }
}

@media (max-width: 600px) {
    /* Auf schmalen Smartphones nebeneinanderliegende Tabellenzellen (z.B. alte Bild-Tabellen) sauber untereinander stapeln */
    .entry-content table:not(.keep-table-columns),
    .entry-content table:not(.keep-table-columns) tbody,
    .entry-content table:not(.keep-table-columns) tr,
    .entry-content table:not(.keep-table-columns) td,
    .entry-content table:not(.keep-table-columns) th {
        display: block;
        width: 100% !important;
    }
}

@media print {
    .site-header,
    .widget-area-wrapper,
    .site-footer,
    .if-breadcrumbs {
        display: none !important;
    }
}
