/* =================================================================== */
/* MA35 & Friends Mobile Fixes - V14 (Aggressive & Targeted)       */
/* =================================================================== */

@media (max-width: 767px) {

    /* --- GENERAL/GLOBAL FIXES --- */

    h1, .wp-block-post-title { font-size: 2.2rem !important; }
    h2 { font-size: 1.8rem !important; }
    h3 { font-size: 1.5rem !important; }
    p, body { font-size: 1rem !important; }
    p, h1, h2, h3, h4, h5, h6 {
        word-break: normal !important;
        overflow-wrap: break-word !important;
        hyphens: none !important;
    }

    /* FIX: Make header flow with page, not overlay content */
    header#masthead {
        position: relative !important;
    }

    /* FIX: Un-squish the header logo */
    .wp-block-site-logo img {
        height: auto !important;
        max-height: 35px !important; /* Slightly larger for clarity */
        width: auto !important;
    }

    /* FIX: Prevent "Kontakt" button from breaking apart on ALL pages */
    #primary-header-button a.wp-block-button__link {
        font-size: 0.8rem !important;
        padding: 8px 12px !important;
        white-space: nowrap !important; /* Prevents text from wrapping */
        display: inline-block !important; /* Reinforces nowrap behavior */
    }


    /* 4) Make last image larger */
    .home figure.wp-block-image.aligncenter,
    .home figure.wp-block-image.aligncenter img {
        width: 80% !important;
        height: auto !important;
    }


    /* --- III. TICKETS PAGE FIXES --- */

    /* 1) Make "Treffpunkt" text block wider */
    .page-id-17 .is-style-nfd-theme-white.alignwide {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        box-sizing: border-box;
    }
    .page-id-17 .nfd-wb-features__features-42 h2 {
        font-size: 1.1rem !important; /* Slightly larger now that there's room */
        line-height: 1.6 !important;
    }


    /* --- IV. TEAM PAGE FIXES --- */

    /* 1) Generic rule to fix ALL popups from Popup Maker plugin */
    /* This rule is very strong and should override the plugin's defaults */
    body.pum-open .pum-container {
        width: 90vw !important; /* 90% of screen width */
        max-width: 500px !important; /* But no wider than 500px */
        height: auto !important;
        max-height: 85vh !important; /* 85% of screen height */
        overflow-y: auto !important; /* Add scrollbar if content is too long */
        box-sizing: border-box !important;
    }
}
/* --- Fix for images causing horizontal scroll --- */
.wp-block-image img {
  max-width: 100%; /* Ensures image is never wider than its container */
  width: auto;     /* Lets the image scale naturally */
  height: auto;    /* Maintains the aspect ratio */
}

/* --- Allow flex items to wrap on mobile --- */
@media (max-width: 768px) {
  .nfd-gap-3xl.nfd-gap-y-xl {
    flex-wrap: wrap !important;
  }
}