/*
Theme Name: weisebauen
Author: Barii
Description: A lightweight, accessible WordPress theme based on hausbaublog prototype.
Version: 1.59
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hausbaublog
*/

/* Fonts */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/inter-regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/inter-medium.ttf') format('truetype');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/inter-semibold.ttf') format('truetype');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/inter-bold.ttf') format('truetype');
}

@font-face {
    font-family: 'Merriweather';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/merriweather-regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Merriweather';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/merriweather-bold.ttf') format('truetype');
}

/* Variables */
:root {
    --color-primary: #075985;
    --color-primary-dark: #0c4a6e;
    --color-secondary: #0f172a;
    --color-text: #334155;
    --color-text-light: #475569;
    --color-bg-body: #fcfcfc;
    --color-bg-white: #ffffff;
    --color-bg-light: #f1f5f9;
    --color-border: #e2e8f0;
    --color-accent-bg: #f0f9ff;

    --font-sans: 'Inter', sans-serif;
    --font-serif: 'Merriweather', serif;

    --container-width: 1280px;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --radius-xl: 0.75rem;
    --radius-lg: 0.5rem;
}

[data-theme="dark"] {
    --color-primary: #38bdf8;
    --color-primary-dark: #7dd3fc;
    --color-secondary: #f8fafc !important;
    --color-text: #cbd5e1;
    --color-text-light: #94a3b8;
    --color-bg-body: #0f172a;
    --color-bg-white: #1e293b;
    --color-bg-light: #334155;
    --color-border: #475569;
    --color-accent-bg: #1e293b;
}

/* Dark Mode Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    transition: background-color 0.2s;
    margin-left: 1rem;
}

.theme-toggle:hover {
    background-color: var(--color-bg-light);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

:root:not([data-theme="dark"]) .theme-toggle .icon-sun {
    display: none;
}

:root:not([data-theme="dark"]) .theme-toggle .icon-moon {
    display: block;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-bg-body);
    color: var(--color-text);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
    overflow-x: hidden;
    width: 100%;
}

html {
    overflow-x: hidden;
    width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--color-secondary);
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-primary);
}

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

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 0.5rem;
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.text-center {
    text-align: center;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-row {
    flex-direction: row;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.min-h-screen {
    min-height: 100vh;
}

.gap-6 {
    gap: 1.5rem;
}

.w-full {
    width: 100%;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mb-10 {
    margin-bottom: 2.5rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.max-w-3xl {
    max-width: 48rem;
}

.text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

.text-4xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

.font-bold {
    font-weight: 700;
}

.text-slate-800 {
    color: var(--color-secondary);
}

.text-slate-600 {
    color: var(--color-text);
}

.text-slate-500 {
    color: var(--color-text-light);
}

/* Toggle Visibility Defaults (Mobile) */
/* Toggle Visibility Defaults */
.theme-toggle {
    display: flex;
    margin-left: auto;
    /* Push to right on mobile */
    margin-right: 0.5rem;
    color: var(--color-secondary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

/* Icon Toggling Logic */
.icon-sun {
    display: none;
}

.icon-moon {
    display: block;
    fill: currentColor;
}

[data-theme="dark"] .icon-sun {
    display: block;
    fill: currentColor;
}

[data-theme="dark"] .icon-moon {
    display: none;
}

.mobile-toggle {
    display: none;
}

.mobile-theme-toggle-wrapper {
    display: none;
}

/* Sticky Header */
/* Sticky Header adjustments for Admin Bar */
body.admin-bar .site-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .site-header {
        top: 46px;
    }
}

.site-header {
    background: var(--color-bg-white);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
}

.header-top {
    padding: 1rem 0;
    position: relative;
    z-index: 1001;
    /* Ensure top bar is above the dropdown */
    background: var(--color-bg-white);
}

.header-top .container {
    display: flex;
    align-items: center;
    /* Use gap to separate logo from the rest if needed, but flex behavior handles it */
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.custom-logo {
    width: auto;
    height: auto;
    max-height: 50px;
    /* Reduced for sticky header on mobile */
    object-fit: contain;
}

.secondary-navigation ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
}

/* Default Mobile Header Styles */

/* This is the dropdown container */
.header-bottom {
    background-color: var(--color-bg-white);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);

    /* Mobile dropdown behavior */
    display: block;
    /* We'll hide it with max-height or transform instead for animation, or just simple display none */
    max-height: 0;
    overflow: hidden;
    position: absolute;
    top: 100%;
    /* Position right below the header-top */
    left: 0;
    width: 100%;
    z-index: 999;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: max-height 0.3s ease-in-out;
}

.header-bottom.toggled {
    max-height: 100vh;
    /* Allow it to grow */
    overflow-y: auto;
    /* Scroll if menu is too long */
    border-bottom: 1px solid var(--color-border);
}

.header-bottom .container {
    padding-top: 1rem;
    padding-bottom: 2rem;
    flex-direction: column;
}

.menu-toggle {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--color-secondary);
}

[data-theme="dark"] .menu-toggle,
[data-theme="dark"] .theme-toggle {
    color: #ffffff !important;
    /* Force visibility in dark mode */
}

[data-theme="dark"] .entry-title {
    color: #ffffff;
}

.secondary-navigation {
    display: none;
}

[data-theme="dark"] .primary-navigation a,
[data-theme="dark"] .secondary-navigation a,
[data-theme="dark"] .site-title a {
    color: #f1f5f9;
    /* Explicitly light color for dark mode to ensure contrast */
}

[data-theme="dark"] .primary-navigation a:hover,
[data-theme="dark"] .secondary-navigation a:hover {
    color: var(--color-primary);
}

/* Mobile Menus Styling */
.primary-navigation,
.mobile-secondary-menu {
    width: 100%;
}

.primary-navigation ul,
.mobile-secondary-menu ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    /* Stack items vertically */
    width: 100%;
    padding: 0;
    margin: 0;
}

.primary-navigation li,
.mobile-secondary-menu li {
    width: 100%;
    border-bottom: 1px solid var(--color-bg-light);
}

.primary-navigation li:last-child {
    border-bottom: none;
}

.primary-navigation a,
.mobile-secondary-menu a {
    display: block;
    width: 100%;
    padding: 1rem 0.5rem;
    /* Larger padding for touch */
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-secondary);
    text-align: left;
}

.mobile-secondary-menu {
    border-top: 2px solid var(--color-bg-light);
    margin-top: 1rem;
    padding-top: 0.5rem;
}

.mobile-secondary-menu a {
    color: var(--color-text-light);
    font-weight: 500;
    font-size: 0.95rem;
}

/* Submenus in mobile - Flatten them visually */
.primary-navigation .sub-menu {
    display: block;
    /* Always show submenus */
    padding-left: 1.5rem;
    /* Indent submenus */
    margin: 0;
    box-shadow: none;
    background: transparent;
    position: static;
    visibility: visible;
    opacity: 1;
    border: none;
}

/* Tablet & Desktop Overrides */
@media (min-width: 768px) {
    .site-header {
        position: fixed;
        /* Enforce fixed on desktop too */
    }

    .custom-logo {
        max-height: 70px;
        /* Reduced from 120px to prevent excessive header height */
    }

    .header-bottom {
        display: block;
        max-height: none;
        overflow: visible;
        position: relative;
        top: auto;
        left: auto;
        width: auto;
        box-shadow: none;
        background-color: var(--color-bg-light);
        z-index: 100;
    }

    .header-bottom.toggled {
        display: block;
    }

    .header-bottom .container {
        flex-direction: row;
        padding-top: 0;
        padding-bottom: 0;
    }

    .secondary-navigation {
        display: flex;
        margin-left: auto;
        /* Push to right */
        margin-right: 0.5rem;
        /* Small gap between menu and toggle */
    }

    .desktop-toggle {
        display: flex;
        /* Show on desktop */
    }

    .mobile-toggle {
        display: none;
        /* Hide mobile toggle on desktop */
    }

    .mobile-theme-toggle-wrapper {
        display: none;
    }

    .menu-toggle {
        display: none;
    }

    .primary-navigation {
        width: auto;
    }

    .primary-navigation ul {
        flex-direction: row;
        /* Horizontal on desktop */
        align-items: center;
    }

    /* Reset margin on theme toggle for desktop since secondary-nav handles the spacing */
    .theme-toggle {
        margin-left: 0;
    }

    .primary-navigation li {
        width: auto;
        border-bottom: none;
    }

    .primary-navigation a {
        padding: 0.75rem 2rem 0.75rem 0;
        font-size: 0.875rem;
        white-space: nowrap;
    }

    /* Hide mobile secondary in desktop */
    .mobile-secondary-menu {
        display: none;
    }

    /* Desktop Submenus (dropdowns) if needed in future, currently flat list implies simple menu, but just in case */
    .primary-navigation li {
        position: relative;
    }
}

/* Sidebar Layout - Grid System */
.layout-flex {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    padding-top: 2rem;
    padding-bottom: 3rem;
}

@media (min-width: 1024px) {
    .layout-flex {
        display: grid;
        grid-template-columns: 75% 25%;
        gap: 3rem;
        align-items: start;
    }

    .main-content {
        width: 100%;
        /* Reset width for grid */
        padding: 0;
    }

    .widget-area {
        width: 100%;
        /* Reset width for grid */
        position: sticky;
        top: 2rem;
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }
}

.widget {
    width: 100%;
    margin-bottom: 2rem;
}

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

.widget li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-bg-light);
}

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

.widget a {
    color: var(--color-text);
    font-weight: 500;
}

.widget a:hover {
    color: var(--color-primary);
}

/* Main Content */
.site-main {
    padding: 1rem 0;
    flex-grow: 1;
}

.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.post-card {
    background: var(--color-bg-white);
    border: 1px solid var(--color-bg-light);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.post-thumbnail {
    height: 14rem;
    overflow: hidden;
    position: relative;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.1);
}

.post-content {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-category {
    margin-bottom: 0.75rem;
}

.post-category a {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: var(--color-accent-bg);
    color: var(--color-primary);
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.post-title a {
    color: var(--color-secondary);
}

.post-title a:hover {
    color: var(--color-primary);
}

.post-meta {
    font-size: 0.75rem;
    color: var(--color-text-light);
    font-weight: 500;
    display: flex;
    align-items: center;
    margin-bottom: 1.25rem;
}

.post-meta .sep {
    margin: 0 0.5rem;
}

.post-excerpt {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    color: var(--color-text);
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tags-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 1rem;
}

.tags-links a {
    display: inline-block;
    padding: 0.35rem 1rem;
    /* Larger padding for emphasis */
    background-color: var(--color-bg-light);
    color: var(--color-secondary);
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.2s ease;
    text-decoration: none;
    border: 1px solid var(--color-border);
}

.tags-links a:hover {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    transform: translateY(-1px);
}

.post-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--color-bg-light);
}

.read-more {
    color: var(--color-primary);
    font-weight: 700;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
}

.read-more:hover {
    color: var(--color-primary-dark);
}

.page-head-section {
    padding: 15px
}

/* Footer */
.site-footer {
    background: var(--color-bg-white);
    border-top: 1px solid var(--color-border);
    padding: 3rem 0;
    margin-top: auto;
    text-align: center;
    color: var(--color-text-light);
    font-size: 0.875rem;
}

/* Single Post */
.single-post-content {
    max-width: 100%;
    margin: 0 auto;
    background: var(--color-bg-white);
    padding: 1rem;
    border-radius: var(--radius-xl);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Comments */
.comments-area {
    margin-top: 3rem !important;
    padding-top: 0;
    border-top: none;
    display: block;
    clear: both;
}

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

/* Entry Content Typography */
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    margin-top: 2em;
    margin-bottom: 0.75em;
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-text);
}

.entry-content h2 {
    font-size: 1.7rem;
}

.entry-content h3 {
    font-size: 1.4rem;
}

.entry-content h4 {
    font-size: 1.2rem;
}

.entry-content p {
    margin-bottom: 1.5em;
    line-height: 1.7;
}

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

.entry-content li {
    margin-bottom: 0.5em;
}



.comment-list li {
    list-style: none;
    margin-bottom: 2rem;
}

.comment-body {
    background: var(--color-bg-light);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    margin-bottom: 0;
    position: relative;
}

.comment-meta {
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: flex;
    justify-content: space-between;
}

.comment-author cite {
    font-style: normal;
    font-weight: 700;
    color: var(--color-secondary);
}

.comment-form {
    background: var(--color-bg-white);
    padding: 2rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
}

.comment-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-secondary);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-family: inherit;
    font-size: 1rem;
}

.comment-form input[type="submit"] {
    background-color: var(--color-primary);
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.comment-form input[type="submit"]:hover {
    background-color: var(--color-primary-dark);
}

/* Mobile Menu Overlay Support (Basic) */
@media (max-width: 768px) {
    .mobile-menu-open .primary-navigation {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        z-index: 100;
        padding: 1rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }

    /* Contact Form Styles */
    .weisebauen-contact-form {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        max-width: 600px;
        background: var(--color-bg-light);
        padding: 2rem;
        border-radius: var(--radius-xl);
        border: 1px solid var(--color-border);
    }

    .weisebauen-contact-form .form-group {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .weisebauen-contact-form label {
        font-weight: 600;
        color: var(--color-text);
    }

    .weisebauen-contact-form input,
    .weisebauen-contact-form textarea {
        width: 100%;
        padding: 0.75rem;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-lg);
        background-color: var(--color-bg-white);
        color: var(--color-text);
        font-family: inherit;
        font-size: 1rem;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    .weisebauen-contact-form input:focus,
    .weisebauen-contact-form textarea:focus {
        outline: none;
        border-color: var(--color-primary);
        box-shadow: 0 0 0 3px var(--color-accent-bg);
    }

    .weisebauen-contact-form .btn-submit {
        padding: 0.75rem 2rem;
        background-color: var(--color-primary);
        color: white;
        border: none;
        border-radius: var(--radius-lg);
        cursor: pointer;
        font-weight: 700;
        font-size: 1rem;
        transition: background-color 0.2s, transform 0.1s;
        align-self: flex-start;
    }

    .weisebauen-contact-form .btn-submit:hover {
        background-color: var(--color-primary-dark);
    }

    .weisebauen-contact-form .btn-submit:active {
        transform: translateY(1px);
    }

    .notification {
        padding: 1rem;
        border-radius: var(--radius-lg);
        margin-bottom: 1.5rem;
        border: 1px solid transparent;
    }

    .notification.success {
        background-color: #d1fae5;
        color: #065f46;
        border-color: #a7f3d0;
    }

    .notification.error {
        background-color: #fee2e2;
        color: #991b1b;
        border-color: #fecaca;
    }

    [data-theme="dark"] .notification.success {
        background-color: #064e3b;
        color: #d1fae5;
        border-color: #065f46;
    }

    [data-theme="dark"] .notification.error {
        background-color: #7f1d1d;
        color: #fee2e2;
        border-color: #991b1b;
    }
}

/* Contact Form Styles */
.weisebauen-contact-form {
    background: var(--color-bg-white);
    padding: 2rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    max-width: 600px;
    margin-top: 2rem;
}

.weisebauen-contact-form .form-group {
    margin-bottom: 1.5rem;
}

.weisebauen-contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-secondary);
}

.weisebauen-contact-form input[type="text"],
.weisebauen-contact-form input[type="email"],
.weisebauen-contact-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background-color: var(--color-bg-body);
    color: var(--color-text);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.weisebauen-contact-form input:focus,
.weisebauen-contact-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-accent-bg);
}

.weisebauen-contact-form .btn-submit {
    display: inline-block;
    background-color: var(--color-primary);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.weisebauen-contact-form .btn-submit:hover {
    background-color: var(--color-primary-dark);
}

.weisebauen-contact-form .notification {
    padding: 1rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.weisebauen-contact-form .notification.success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.weisebauen-contact-form .notification.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Dark Mode Adjustments for Form */
[data-theme="dark"] .weisebauen-contact-form {
    background: var(--color-bg-white);
    border-color: var(--color-border);
}

[data-theme="dark"] .weisebauen-contact-form input,
[data-theme="dark"] .weisebauen-contact-form textarea {
    background-color: var(--color-bg-light);
    border-color: var(--color-border);
    color: var(--color-text);
}

[data-theme="dark"] .weisebauen-contact-form .notification.success {
    background-color: #064e3b;
    color: #a7f3d0;
    border-color: #065f46;
}

[data-theme="dark"] .weisebauen-contact-form .notification.error {
    background-color: #7f1d1d;
    color: #fca5a5;
    border-color: #991b1b;
}

/* Sidebar Specific Contact Form Override */
.widget-area .weisebauen-contact-form {
    padding: 1.5rem;
    background-color: var(--color-bg-light);
    border: none;
    margin-top: 0;
    font-size: 0.9rem;
}

[data-theme="dark"] .widget-area .weisebauen-contact-form {
    background-color: var(--color-bg-light);
    /* In dark mode bg-light is #334155 which provides decent contrast against #1e293b sidebar/body */
}

.widget-area .weisebauen-contact-form .form-group {
    margin-bottom: 0.75rem;
}

.widget-area .weisebauen-contact-form label {
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
}

.widget-area .weisebauen-contact-form input[type="text"],
.widget-area .weisebauen-contact-form input[type="email"],
.widget-area .weisebauen-contact-form textarea {
    padding: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 0;
    /* Handled by form-group */
}

.widget-area .weisebauen-contact-form textarea {
    height: 100px;
    /* Force smaller height */
}

.widget-area .weisebauen-contact-form .btn-submit {
    width: 100%;
    padding: 0.6rem;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Responsive Tables and Media */
.entry-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.5rem;
    border-collapse: collapse;
}

.entry-content img,
.entry-content iframe,
.entry-content video {
    max-width: 100%;
    height: auto;
}

.entry-content table td,
.entry-content table th {
    padding: 0.5rem;
    border: 1px solid var(--color-border);
}


/* Mobile Fixes V2 */
html,
body {
    overflow-x: hidden;
}

.entry-content {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.entry-content figure {
    margin: 0;
    max-width: 100%;
}

.entry-content img,
.entry-content iframe,
.entry-content video {
    max-width: 100% !important;
    height: auto !important;
}


/* WordPress Block Table Fix */
.wp-block-table {
    overflow-x: auto;
    margin-bottom: 1.5rem;
    display: block;
}

.wp-block-table table {
    display: table;
    /* Restore table display inside wrapper */
    width: 100%;
    min-width: 600px;
    /* Force scroll on small screens */
    border-collapse: collapse;
}

.wp-block-table td,
.wp-block-table th {
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    word-break: normal;
    /* Prevent aggressive breaking in cells */
}


/* WordPress Block Table Fix V2 */
.wp-block-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 0 1.5rem 0;
}

.wp-block-table table {
    width: 100%;
    min-width: max-content;
    /* Force table to respect content width */
    border-collapse: collapse;
}

.wp-block-table td,
.wp-block-table th {
    white-space: normal;
    /* Allow wrapping if needed, but max-content handles width */
    padding: 0.75rem;
    border: 1px solid var(--color-border);
}


/* WordPress Block Table Fix V3 */
.wp-block-table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin: 0 0 1.5rem 0 !important;
}

.wp-block-table table {
    width: max-content !important;
    /* Force table width to content */
    min-width: 100% !important;
    border-collapse: collapse !important;
    table-layout: auto !important;
}

.wp-block-table td,
.wp-block-table th {
    white-space: nowrap !important;
    /* Force cells to not wrap, expanding the table */
    padding: 0.75rem !important;
    border: 1px solid var(--color-border);
}


/* Mobile Fixes V4 (User Request) */
@media (max-width: 768px) {

    .entry-content ul,
    .entry-content ol {
        max-width: calc(100vw - 100px);
    }

    .entry-content figure {
        max-width: calc(100vw - 100px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .entry-content h2 {
        font-size: 22px;
    }

    .entry-content h3 {
        font-size: 18px;
    }

    .entry-content h4 {
        font-size: 16px;
    }

    .entry-content p {
        font-size: 14px;
    }

    header h1.entry-title {
        font-size: 25px;
    }
}#page { min-height: 100vh; text-rendering: optimizeLegibility; }
