/* ─────────────────────────────────────────────────────────────────────────
   Dyfonus Enhancer - Global Styles
   Version: 1.4.2
────────────────────────────────────────────────────────────────────────── */

/* ─── Hide Kadence Default Theme Toggle (we use our custom one) ───────── */
/* Only target the specific Kadence color toggle button/widget */
.kadence-color-toggle-wrapper,
.kadence-color-toggle-btn,
button.kadence-color-toggle,
.wp-block-kadence-color-toggle .kadence-color-toggle,
.wp-block-kadence-theme-toggle .kadence-theme-toggle-btn {
    display: none !important;
}

/* ─── WordPress Admin Bar Fix ─────────────────────────────────────────── */
#wpadminbar {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 99999;
}


body.admin-bar .site-header,
body.admin-bar #dyfo-custom-header,
body.admin-bar #dyfo-custom-header-wrapper {
    top: 32px !important;
}

@media (max-width: 782px) {

    body.admin-bar .site-header,
    body.admin-bar #dyfo-custom-header,
    body.admin-bar #dyfo-custom-header-wrapper {
        top: 46px !important;
        /* WordPress admin bar is 46px on small screens */
    }
}

/* ─── Hide Default Header/Footer (we use custom ones) ─────────────────── */
/* Only hide Kadence's default header, not our custom one */
#masthead.site-header:not(#dyfo-custom-header),
.site-header-primary:not(#dyfo-custom-header),
.site-header-secondary:not(#dyfo-custom-header),
.site-footer:not(#dyfo-custom-footer) {
    display: none !important;
}

/* ─── Smooth Scroll ───────────────────────────────────────────────────── */
html {
    scroll-behavior: smooth;
}

/* ─── Selection Color ─────────────────────────────────────────────────── */
::selection {
    background-color: rgba(99, 102, 241, 0.3);
    color: inherit;
}

/* ─── Focus Styles for Accessibility ──────────────────────────────────── */
:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* ─── Reduced Motion ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ─── Global Page Layout & Spacing Optimization ───────────────────────── */
/* Completely Nuke Theme Default Empty Space Above Custom Content */
.site-content,
#content,
.content-area,
.site-main,
#primary,
.entry-content,
.entry {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Eliminate empty page titles generating white space */
.entry-header:is(.has-transparent-header, .kt-title-layout-normal) {
    display: none !important;
}

/* Custom dyfonus containers */
.dyfo-page-container {
    padding-top: 0px !important;
    /* Fully disabled padding here so nothing sits between content and header */
    padding-bottom: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
}

.dyfo-intro {
    text-align: center;
    padding: 10px 0 30px;
    max-width: 800px;
    margin: 0 auto;
}

/* More elegantly scaled down titles and fonts for all screens */
.dyfo-intro h1 {
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 800;
    margin: 0 0 12px 0;
    line-height: 1.25;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dyfo-intro p {
    font-size: clamp(14px, 2.5vw, 17px);
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
}

[data-theme="dark"] .dyfo-intro p {
    color: #9ca3af;
}

    /* Aggressively compact layout on mobile phones */
    @media (max-width: 768px) {
        .dyfo-page-container {
            padding-top: 0px !important;
            padding-left: 12px;
            padding-right: 12px;
        }

        .dyfo-intro {
            padding: 5px 0 20px;
        }
}

/* ============================================
   GLOBAL MOBILE FIXES - March 2026
   ============================================ */

/* Prevent horizontal scroll on mobile */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    /* Ensure all content stays within viewport */
    .site, 
    #wrapper,
    .content-area,
    .entry-content,
    .wp-site-blocks {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    
    /* Fix for images */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Fix for tables */
    table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
    }
    
    /* Ensure popups/modals are centered */
    .popup-overlay,
    .modal-overlay,
    .dyfo-popup-overlay,
    [class*="overlay"][class*="popup"],
    [class*="overlay"][class*="modal"] {
        align-items: flex-start !important;
        padding-top: 80px !important;
    }
    
    .popup-content,
    .modal-content,
    .dyfo-popup-content,
    [class*="popup"][class*="content"],
    [class*="modal"][class*="content"] {
        width: calc(100% - 24px) !important;
        max-width: 400px !important;
        margin: 0 12px !important;
        box-sizing: border-box !important;
    }
    
    /* Fix for fixed position elements */
    .fixed,
    [style*="position: fixed"] {
        max-width: 100vw !important;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .dyfo-page-container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    
    /* Ensure text doesn't overflow */
    h1, h2, h3, h4, h5, h6, p {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
}