/* CSS Variables */
:root {
    --button-red-bg: #95a1ac;
    --button-red-hover: #e76e6e;
    --button-green: #92b548;
    --button-green-hover: #6b8a29;
    --button-yellow: #fbcd00;
    --notification-bg: #f8f9fac7;
    --notification-border: #e9ecef;
    --social-icon-color: #666;
    --social-icon-hover: #333;
    --social-media-bg: #fff;
    --content-side-bg: #f5f5f591;
    --pill-button-bg: #fbcd00;
    --pill-button-hover: #6b8a29;
}

/* Ensure scrolling works properly on all pages */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    position: relative;
}

/* Sticky Footer Layout */
html, body {
    height: auto;
    min-height: 100vh;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1 0 auto;
    padding-top: 80px; /* Account for fixed header */
    overflow-y: auto;
    min-height: calc(100vh - 80px);
}

.site-footer {
    flex-shrink: 0;
    background: #fff;
    padding: 2rem 0;
    border-top: 1px solid #e0e0e0;
    margin-top: auto;
}

.container {
    display: flex;
    justify-content: center;
    width: 100%;
}
/* Header Styles */
.site-header {
    position: fixed;
    top: 0;
    width: 100vw;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    max-width: 1200px;
    margin: 0 auto;
    height: 80px;
    position: relative;
    z-index: 1001;
    background: #fff;
}

.site-branding {
    z-index: 1001;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
}

.site-title a {
    text-decoration: none;
    color: #333;
}

/* Burger Menu Button */
.menu-toggle {
    z-index: 1001;
    display: block;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    position: relative;
}

.burger-icon {
    z-index: 1001;
    display: block;
    position: relative;
    width: 24px;
    height: 2px;
    background: #333;
    transition: all 0.5s;
}

.burger-icon::before,
.burger-icon::after {
    content: "";
    position: absolute;
    width: 24px;
    height: 2px;
    background: #333;
    transition: all 0.3s;
}

.burger-icon::before {
    top: -6px;
}

.burger-icon::after {
    bottom: -6px;
}

/* Burger Menu Open State */
.menu-toggle[aria-expanded="true"] .burger-icon {
    background: transparent;
}

.menu-toggle[aria-expanded="true"] .burger-icon::before {
    transform: rotate(45deg);
    top: 0;
}

.menu-toggle[aria-expanded="true"] .burger-icon::after {
    transform: rotate(-45deg);
    bottom: 0;
}

/* Navigation Menu */
.main-navigation {
    position: fixed;
    top: 80px; /* Start below the header */
    left: 0;
    width: 100%;
    height: calc(100vh - 80px); /* Subtract header height */
    background: #fff;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 999;
    visibility: visible;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media screen and (min-width: 768px) {
    .main-navigation {
        width: 400px;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    }
}

.main-navigation.is-active {
    transform: translateX(0);
}

.main-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
    visibility: visible;
    padding-bottom: 2rem;
}

.main-navigation li {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.main-navigation a {
    text-decoration: none;
    color: #333;
    font-size: 1.1rem;
}

/* Hide menu toggle on larger screens */
/* @media screen and (min-width: 768px) {
    .menu-toggle {
        display: none;
    }

    .main-navigation {
        position: static;
        transform: none;
        padding-top: 0;
        height: auto;
        background: none;
    }

    .main-navigation ul {
        padding-top: 40px;
        display: flex;
        gap: 2rem;
        visibility: visible;
    }

    .main-navigation li {
        padding: 0;
        border: none;
        visibility: visible;
    }
} */

/* Buttons */
.left-rounded-button {
    min-width: 300px;
    padding: 15px 30px;
    background-color: var(--button-green);
    color: white;
    border: none;
    border-top-left-radius: 30px;
    border-bottom-left-radius: 30px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.left-rounded-button:hover {
    background-color: var(--button-green-hover);
}

.right-rounded-button {
    min-width: 300px;
    padding: 15px 30px;
    background-color: var(--button-green);
    color: white;
    border: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 30px;
    border-bottom-right-radius: 30px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.right-rounded-button:hover {
    background-color: var(--button-green-hover);
}

.zielgruppen-button-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.site-title a img {
    display: block;
    width: 100px;
    height: auto;
    margin: 0;
    padding: 0;
}

.veranstaltungen {
    background-color: var(--button-yellow);
}

.link_white {
    display: inline-flex;
    text-decoration: none; /* Remove underline from links */
    color: white;
}

.left-rounded-button,
.right-rounded-button {
    position: relative;
    display: flex;
    align-items: center;
}

.button-icon {
    position: absolute;
    width: 30px; /* Adjust based on your icon size */
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.left-rounded-button .button-icon {
    left: 15px; /* Adjust position as needed */
}

.right-rounded-button .button-icon {
    right: 15px;
}

.button-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.button-text {
    flex: 1;
    text-align: center;
}

.foerdermittel-icon-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 20px;
    min-height: 80px; /* Ensure minimum height for visibility */
}

.foerdermittel-icon-wrapper span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px; /* Ensure minimum width for each icon */
    height: 60px; /* Fixed height for consistency */
}

.foerdermittel-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    height: 60px;
    margin: 0;
    padding: 0;
}

.foerdermittel-icon-wrapper img {
    max-height: 60px;
    max-width: 120px;
    width: auto;
    height: auto;
    object-fit: contain; /* Ensure image fits within container */
    filter: grayscale(100%);
    transition: filter 0.3s ease;
    opacity: 1; /* Ensure visibility */
}

.foerdermittel-icon-wrapper img:hover {
    filter: grayscale(0%);
}

@media screen and (max-width: 768px) {
    .foerdermittel-icon-wrapper {
        gap: 1rem;
        padding: 1rem 10px;
        min-height: 60px;
    }
    
    .foerdermittel-icon-wrapper span {
        min-width: 80px;
        height: 40px;
    }
    
    .foerdermittel-icon-wrapper img {
        max-height: 40px;
        max-width: 80px;
    }
}

.pfh-logo a {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* .pfh-logo a {
    display: block;
    width: 100%;
    height: 100%;
} */

.pfh-logo img {
    max-height: 55px !important;
    width: auto;
}

@media screen and (min-width: 768px) {
    /* main {
        display: flex;
        flex-direction: row-reverse;
        align-items: center;
        justify-content: center;
        gap: 20px;
    } */
}

section .featured {
    margin-top: 23px;
}

.welcome {
    flex-direction: column;
    text-align: center;
}

.welcome_background {
    margin: 20px;
    background-color: lightgray;
}

.pfh-logo a {
    margin: 20px;
}

article {
    padding: 10px;
    width: 100% !important; /* Ensure full width */
    max-width: 1600px; /* Match the content width from functions.php */
    margin: 0 auto; /* Center the content */
}

@media screen and (min-width: 768px) {
    article {
        /* width: 80vw !important; */
    }
}

.wp-block-button a {
    display: inline-flex;
    text-decoration: none; /* Remove underline from links */
    color: white;
}

.wp-block-button:visited {
    color: white;
}

/* Add padding to main content to account for fixed header */
main {
    padding-top: 80px;
}

/* Red button styles */
.btn_red {
    background-color: var(--button-red-bg) !important;
    transition: background-color 0.3s ease;
}

.btn_red:hover {
    background-color: var(--button-red-hover) !important;
}

@media screen and (min-width: 768px) {
    .btn_red {
        border-top-left-radius: 0 !important;
        border-bottom-left-radius: 0 !important;
        border-top-right-radius: 30px !important;
        border-bottom-right-radius: 30px !important;
    }
}

/* Button wrapper styles */
.main-buttons,
.additional-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media screen and (min-width: 768px) {
    .btn_red {
        border-top-left-radius: 0 !important;
        border-bottom-left-radius: 0 !important;
        border-top-right-radius: 30px !important;
        border-bottom-right-radius: 30px !important;
    }

    .zielgruppen-button-wrapper {
        flex-direction: row;
        align-items: flex-start;
        gap: 2rem;
    }

    .main-buttons,
    .additional-buttons {
        flex: 1;
        margin-bottom: 0;
    }
}

/* Notification Section */
.notification-section {
    background-color: var(--notification-bg);
    border-bottom: 1px solid var(--notification-border);
    padding: 1rem 0;
    position: relative;
}

.notification-content {
    position: relative;
    text-align: center;
}

.notification-close {
    position: absolute;
    top: -17px;
    right: -63px;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.5rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.notification-close:hover {
    color: #333;
}

/* Social Media Section */
.social-media {
    padding: 1rem 0;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.social-icon {
    color: var(--social-icon-color);
    transition: color 0.3s ease;
}

.social-icon:hover {
    color: var(--social-icon-hover);
}

.social-icon svg {
    width: 32px;
    height: 32px;
}

/* Main Content Wrapper */
.main-content-wrapper {
    position: relative;
    width: 100%;
}

@media screen and (min-width: 768px) {
    .main-content-wrapper::before,
    .main-content-wrapper::after {
        content: '';
        position: fixed;
        top: 80px; /* Header height */
        bottom: 0;
        width: calc((100vw - 1200px) / 2); /* Assuming max-width of content is 1200px */
        background-color: var(--content-side-bg);
        z-index: -1;
    }

    .main-content-wrapper::before {
        left: 0;
    }

    .main-content-wrapper::after {
        right: 0;
    }
}

/* Events Styles */
.events-shortcode {
    margin: 2rem 0;
}

.events-shortcode-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.view-all-events {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--button-green);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.view-all-events:hover {
    background: var(--button-green-hover);
    color: white;
}

/* Event Cards Grid (for use in other templates) */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.event-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e0e0e0;
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.event-card-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.event-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.event-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.event-card:hover .event-thumbnail {
    transform: scale(1.05);
}

.event-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.event-header {
    margin-bottom: 1rem;
}

.event-title {
    font-size: 1.4rem;
    margin: 0 0 1rem 0;
    line-height: 1.3;
}

.event-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.event-title a:hover {
    color: var(--button-green);
}

.event-date,
.event-time,
.event-location,
.event-price {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: #555;
}

.event-icon {
    margin-right: 0.5rem;
    font-size: 1rem;
}

.event-excerpt {
    margin-bottom: 1.5rem;
    color: #666;
    line-height: 1.6;
    flex-grow: 1;
}

.event-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.registration-badge {
    background: var(--button-green);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.event-link {
    color: var(--button-green);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.event-link:hover {
    color: var(--button-green-hover);
}

.no-events {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.1rem;
}

/* Responsive Event Grid */
@media screen and (max-width: 768px) {
    .events-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .event-card {
        /* Simplified mobile card */
        border-radius: 8px;
    }
    
    .event-image {
        height: 150px; /* Slightly smaller image on mobile */
    }
    
    .event-content {
        padding: 1rem;
        /* Hide all content except title on mobile */
    }
    
    .event-title {
        font-size: 1.1rem;
        margin: 0 0 0.5rem 0;
        /* Keep title visible */
    }
    
    /* Hide date, time, location, price on mobile - more specific selectors */
    .event-card .event-date,
    .event-card .event-time,
    .event-card .event-location,
    .event-card .event-price {
        display: none !important;
    }
    
    /* Hide excerpt on mobile */
    .event-card .event-excerpt {
        display: none !important;
    }
    
    .event-footer {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
        padding-top: 0.5rem;
        border-top: none; /* Remove border since there's less content */
    }
    
    /* Hide registration badge on mobile */
    .event-card .registration-badge {
        display: none !important;
    }
    
    /* Simplify event link on mobile */
    .event-link {
        font-size: 0.9rem;
        padding: 0.5rem 0;
    }
}

@media screen and (min-width: 769px) and (max-width: 1200px) {
    .events-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* Event Description Styles */
.event-description {
    background: #f8f9fa;
    padding: 2rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.event-description .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Ensure single event page scrolls properly */
.single-event-container {
    overflow-y: auto;
    min-height: 100vh;
}

.single-event {
    overflow: visible;
}

/* Ensure iframe content doesn't interfere with scrolling */
.event-iframe-wrapper {
    overflow: visible;
}

.event-iframe-wrapper iframe {
    overflow: auto;
}

.description-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
    color: #555;
    font-size: 1.1rem;
}

.description-content p {
    margin-bottom: 1rem;
}

.description-content p:last-child {
    margin-bottom: 0;
}

/* Category Description Below Header */
.category-description-below {
    background: white;
    padding: 1.5rem 2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
    line-height: 1.6;
    color: #555;
    font-size: 1.1rem;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.category-description-below p {
    margin-bottom: 0.75rem;
}

.category-description-below p:last-child {
    margin-bottom: 0;
}

/* Inline Event Description Styles */
.event-description-inline {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.event-description-inline p {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: #555;
    font-size: 1.1rem;
}

.event-description-inline p:last-child {
    margin-bottom: 0;
}

@media screen and (max-width: 768px) {
    .category-description-below {
        padding: 1rem;
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    /* On mobile, show description as a separate section */
    .event-description-inline {
        background: #f8f9fa;
        padding: 1.5rem;
        margin: -1rem -1rem 2rem -1rem;
        border-radius: 8px;
        border-bottom: none;
    }
    
    .event-description-inline p {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 0.75rem;
    }
}

/* Ensure proper scrolling on events hierarchical page */
.events-hierarchical-container {
    overflow-y: auto;
    min-height: 100vh;
}

.events-hierarchical {
    overflow-y: auto;
}

/* Ensure proper scroll behavior for all pages */
html {
    scroll-behavior: smooth;
}

body {
    scroll-behavior: smooth;
    overflow-y: auto;
}

/* Bouncing Pill Button Styles */
.bouncing-pill-button {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: none; /* Hidden by default, shown only on mobile */
}

.pill-button {
    background: var(--pill-button-bg);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(146, 181, 72, 0.3);
    transition: all 0.3s ease;
    animation: bounce 2s infinite;
}

.pill-button:hover {
    background: var(--pill-button-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(146, 181, 72, 0.4);
}

.pill-button:active {
    transform: translateY(0);
}

.pill-text {
    white-space: nowrap;
}

.arrow-down {
    animation: arrow-bounce 2s infinite;
}

/* Bounce animation for the button */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

/* Arrow bounce animation */
@keyframes arrow-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(2px);
    }
    60% {
        transform: translateY(1px);
    }
}

/* Show pill button only on mobile */
@media screen and (max-width: 768px) {
    .bouncing-pill-button {
        display: block;
    }
}

/* Hide pill button on desktop */
@media screen and (min-width: 769px) {
    .bouncing-pill-button {
        display: none !important;
    }
}

/* Add scroll margin to target section for proper scrolling with fixed header */
.zielgruppen-button-wrapper {
    scroll-margin-top: 80px;
}
