/* ==========================================================================
   Global Mobile & Tablet Responsive Fixes
   Added to resolve overlaps and ensure a professional layout on small screens
   This file specifically targets screens below 1100px.
   ========================================================================== */

/* Professional Gallery Redesign CSS */
.professional-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    width: 100%;
}
.prof-gallery-item {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(13, 27, 42, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    border: 1px solid #dfe6e9;
    cursor: pointer;
}
.prof-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(13, 27, 42, 0.2);
    border-color: #90E0EF;
}
.prof-gallery-item a {
    display: block;
    width: 100%;
    height: 100%;
}
.prof-gallery-item img {
    width: 100%;
    height: 250px !important;
    object-fit: cover !important;
    display: block;
    transition: transform 0.5s ease;
}
.prof-gallery-item:hover img {
    transform: scale(1.05);
}


@media (max-width: 1100px) {
    /* Base resets to prevent horizontal scroll and overlaps */
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }

    /* Fluid media to prevent overflowing, without breaking specific sizes */
    img, video, iframe, canvas {
        max-width: 100%;
        height: auto;
    }

    /* Responsive Tables */
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Responsive Grid & Flex Containers */
    /* Many grid systems break if they try to hold too many columns on mobile */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Prevent text from overflowing */
    p, h1, h2, h3, h4, h5, h6, span, a, div {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Floating buttons overlap fixes */
    .pre-conf-floating-btn {
        top: auto !important;
        bottom: 20px !important;
        right: 20px !important;
        padding: 10px 15px !important;
        font-size: 13px !important;
        z-index: 9999 !important;
    }

    /* Generic padding/margin reductions for sections */
    section {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }
}

@media (max-width: 768px) {
    /* More aggressive adjustments for phones */
    
    /* Header/Logo safety */
    .icbtm-logo img, .navbar-2027 .logo img {
        max-width: 200px !important;
        height: auto !important;
    }

    /* Typography scaling */
    h1 { font-size: 28px !important; line-height: 1.2 !important; }
    h2 { font-size: 24px !important; line-height: 1.3 !important; }
    h3 { font-size: 20px !important; line-height: 1.4 !important; }
    
    /* Hero section specifics */
    .hero-content {
        padding-top: 60px !important;
    }
    .hero-btns {
        justify-content: center;
        gap: 10px !important;
    }
    .btn-primary-2027, .btn-outline-2027 {
        padding: 12px 20px !important;
        font-size: 14px !important;
        width: 100%;
        justify-content: center;
    }

    /* Countdown Timer */
    .countdown-2027 {
        gap: 8px !important;
        justify-content: center;
    }
    .cd-box {
        min-width: 65px !important;
        padding: 10px !important;
        flex: 1;
    }
    .cd-box .num {
        font-size: 24px !important;
    }
    .cd-box .label {
        font-size: 9px !important;
    }

    /* Break any complex flex rows into columns */
    .d-flex, .flex-row {
        flex-wrap: wrap !important;
    }
    
    /* Ensure Speaker & Committee Cards Render Correctly on Mobile */
    .speaker-card {
        flex: 1 1 100% !important;
        max-width: 350px !important;
        margin: 0 auto 20px !important;
        background: #ffffff !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        border: 1px solid #dfe6e9 !important;
        box-shadow: 0 4px 20px rgba(13,27,42,0.15) !important;
        border-radius: 16px !important;
    }
    .speaker-card img {
        display: block !important;
        width: 100% !important;
        height: 330px !important;
        object-fit: cover !important;
        object-position: top !important;
        visibility: visible !important;
        opacity: 1 !important;
        background-color: #e9ecef !important; /* Placeholder if image drops */
    }
    
    /* Cards and containers spacing */
    .card, .box, .panel {
        padding: 15px !important;
        margin-bottom: 20px !important;
    }
}
