/* Mobile Responsive Fixes for Wendy's Portfolio */
/* This file contains fixes for mobile viewport (320px-768px) */

/* ============================================
   RESPONSIVE VIDEO EMBEDS (Wistia & Sketchfab)
   ============================================ */

/* Wistia video embeds - make responsive */
.wcustomhtml iframe[src*="wistia"],
.wcustomhtml iframe[src*="fast.wistia.net"] {
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
}

/* Sketchfab 3D embeds - make responsive */
.sketchfab-embed-wrapper iframe[src*="sketchfab.com"] {
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    min-height: 300px !important;
}

/* Generic iframe responsive fix */
.wcustomhtml iframe,
.sketchfab-embed-wrapper iframe {
    max-width: 100% !important;
}

/* ============================================
   IMAGE GALLERY RESPONSIVE FIXES
   ============================================ */

/* Make image gallery grid responsive */
@media (max-width: 768px) {
    .imageGallery > div[id*="imageContainer"] {
        width: 50% !important;
        float: left !important;
    }
    
    .imageGallery .galleryImageHolder {
        padding: 0 0 75% !important;
    }
}

@media (max-width: 480px) {
    /* Stack gallery images on very small screens */
    .imageGallery > div[id*="imageContainer"] {
        width: 100% !important;
        float: none !important;
    }
    
    .galleryImageHolder .galleryInnerImageHolder a {
        display: block !important;
    }
}

/* ============================================
   MULTI-COLUMN LAYOUT RESPONSIVE FIXES
   ============================================ */

@media (max-width: 768px) {
    /* Stack multi-column layouts on mobile */
    .wsite-multicol-table {
        display: block !important;
        width: 100% !important;
    }
    
    .wsite-multicol-tbody {
        display: block !important;
        width: 100% !important;
    }
    
    .wsite-multicol-tr {
        display: block !important;
        width: 100% !important;
    }
    
    .wsite-multicol-col {
        display: block !important;
        width: 100% !important;
        padding: 10px 0 !important;
        margin-bottom: 1em !important;
        box-sizing: border-box !important;
    }
    
    .wsite-multicol-table-wrap {
        margin: 0 !important;
    }
}

/* ============================================
   CONTENT CONTAINER RESPONSIVE FIXES
   ============================================ */

@media (max-width: 768px) {
    #main-wrap .container {
        padding: 1.5em 1em 3em !important;
    }
    
    /* Ensure text content is readable */
    .paragraph,
    div.paragraph,
    p {
        font-size: 14px !important;
        line-height: 1.6 !important;
    }
    
    /* Center images in about page */
    .wsite-image {
        margin-left: 0 !important;
        margin-right: 0 !important;
        text-align: center !important;
    }
    
    .wsite-image img {
        max-width: 100% !important;
        height: auto !important;
    }
}

/* ============================================
   HAMBURGER MENU ENHANCEMENTS
   ============================================ */

/* Ensure hamburger is properly clickable */
@media (max-width: 1024px) {
    .nav-trigger {
        display: table-cell !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: transparent;
    }
    
    .nav-trigger:active,
    .nav-trigger:focus {
        outline: none !important;
    }
    
    /* Mobile wrap should slide in */
    .mobile-wrap {
        display: block !important;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Ensure menu items are clickable */
    .mobile-wrap .wsite-menu-item {
        display: block !important;
        padding: 15px 10px !important;
        -webkit-tap-highlight-color: transparent;
    }
}

/* ============================================
   HEADER IMAGE/LOGO RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    /* Ensure header logo doesn't break layout */
    #header-wrap img {
        max-width: 200px !important;
        height: auto !important;
    }
}

/* ============================================
   TOUCH TARGET IMPROVEMENTS
   ============================================ */

@media (max-width: 768px) {
    /* Ensure touch targets are at least 44x44px */
    .wsite-menu-item,
    .nav-trigger {
        min-height: 44px !important;
    }
    
    /* Improve gallery image touch targets */
    .imageGallery a {
        display: block !important;
    }
}

/* ============================================
   FIX HORIZONTAL SCROLL ON MOBILE
   ============================================ */

html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

.body-wrap, .wrapper {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

/* ============================================
   FANCYBOX THUMBNAIL STRIP - MOBILE RESPONSIVE FIX
   ============================================ */

/* Mobile styles for fancybox thumbnail strip */
@media (max-width: 768px) {
    /* Make thumbnail strip scrollable on mobile */
    #fancybox-thumbs {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        /* Smooth scrolling on iOS */
        scroll-behavior: smooth;
        /* Ensure proper z-index above content */
        z-index: 8050 !important;
        /* Add safe area padding for notched devices */
        padding-bottom: env(safe-area-inset-bottom, 2px);
    }
    
    /* Remove absolute positioning from the UL - let it flow naturally */
    #fancybox-thumbs ul {
        position: relative !important;
        left: auto !important;
        /* Add padding at the end so last thumbnails are accessible */
        padding-right: 15px !important;
        /* Ensure no margin that could cause issues */
        margin: 0 !important;
        /* Make it a flex container for better control */
        display: flex !important;
        flex-wrap: nowrap !important;
        /* Prevent items from shrinking */
        align-items: center;
    }
    
    /* Ensure thumbnail items don't shrink */
    #fancybox-thumbs ul li {
        float: none !important;
        flex-shrink: 0;
        /* Add small margin for spacing */
        margin: 0 2px !important;
    }
    
    /* Hide scrollbar but keep functionality - for cleaner look */
    #fancybox-thumbs::-webkit-scrollbar {
        height: 4px;
    }
    
    #fancybox-thumbs::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1);
    }
    
    #fancybox-thumbs::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.3);
        border-radius: 2px;
    }
}

/* Extra small screens - ensure thumbnails are touchable */
@media (max-width: 480px) {
    #fancybox-thumbs {
        /* Increase touch target area */
        padding-top: 5px;
        padding-bottom: 5px;
    }
    
    #fancybox-thumbs ul li a {
        /* Ensure minimum touch target size */
        min-width: 44px !important;
        min-height: 44px !important;
    }
    
    /* Larger padding at the end for easier scrolling to last items */
    #fancybox-thumbs ul {
        padding-right: 20px !important;
    }
}

/* ============================================
   FANCYBOX THUMBNAIL DRAG-TO-SCROLL STYLES
   ============================================ */

/* Visual feedback for drag state */
#fancybox-thumbs {
    cursor: grab;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#fancybox-thumbs.dragging {
    cursor: grabbing !important;
}

/* Prevent click events during drag */
#fancybox-thumbs.dragging ul li a {
    pointer-events: none !important;
}

/* ============================================
   RESPONSIVE VIDEO EMBEDS (Wistia & Sketchfab)
   ============================================ */