/*
Theme Name:   Amy Movie Child
Theme URI:    https://moviepooper.com
Description:  Child theme for Amy Movie with v3/v4 compatibility fixes
Author:       MoviePooper Admin
Template:     amy-movie
Version:      1.0.4
*/

/* ==========================================================================
   Logo Size Fix - Constrain oversized logo
   Using !important to override any inline or parent theme styles
   ========================================================================== */
#amy-site-logo img,
#amy-header-logo-wraper img,
.amy-header-logo img,
.site-logo img,
.custom-logo,
.amy-logo img,
header img[src*="LOGO"],
header img[src*="logo"] {
    max-width: 250px !important;
    max-height: 80px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

/* Catch-all for any logo in header */
#amy-header-logo-wraper * img,
.site-header .logo img,
.header-logo img {
    max-width: 250px !important;
    max-height: 80px !important;
}

/* ==========================================================================
   Sidebar Layout Fixes (if needed)
   ========================================================================== */
/* Ensure sidebar displays properly */
.amy-sidebar,
#sidebar,
.sidebar,
.widget-area {
    display: block !important;
}

/* ==========================================================================
   FIX: Hide empty amy-iframe divs (homepage whitespace bug)
   The theme wraps tracking pixels in .amy-iframe divs that are 720px tall
   even when the iframe inside is display:none. This causes massive whitespace
   below the footer on the homepage.
   ========================================================================== */
.amy-iframe:has(iframe[style*="display: none"]),
.amy-iframe:has(iframe[style*="display:none"]) {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Fallback: Position the parent to collapse when iframe is hidden */
.amy-iframe {
    min-height: 0 !important;
}

/* Catch any amy-iframe appearing after the footer */
footer ~ .amy-iframe,
#amy-colophon ~ .amy-iframe,
.amy-site-footer ~ .amy-iframe {
    display: none !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
}

/* ==========================================================================
   SEARCH BAR STYLES - Rounded white/grey with orange GO button
   ========================================================================== */
.amy-mv-search {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
}

.amy-mv-search form {
    display: flex !important;
    align-items: center !important;
}

.amy-mv-search input[type="text"],
.amy-mv-search input.input-txt {
    background: #ffffff !important;
    border: 1px solid #d0d0d0 !important;
    border-radius: 25px !important;
    display: inline-block !important;
    min-width: 220px !important;
    width: auto !important;
    padding: 10px 18px !important;
    font-size: 14px !important;
    color: #000000 !important;
    height: 40px !important;
    outline: none !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s ease !important;
}

.amy-mv-search input[type="text"]::placeholder,
.amy-mv-search input.input-txt::placeholder {
    color: #999999 !important;
}

.amy-mv-search input[type="text"]:focus,
.amy-mv-search input.input-txt:focus {
    border-color: #aaaaaa !important;
    box-shadow: none !important;
}

.amy-mv-search input[type="submit"] {
    background: #fe7900 !important;
    border: none !important;
    border-radius: 50% !important;
    height: 40px !important;
    width: 40px !important;
    min-width: 40px !important;
    margin-left: 8px !important;
    padding: 0 !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease, transform 0.15s ease !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    line-height: 40px !important;
}

.amy-mv-search input[type="submit"]:hover {
    background: #e56d00 !important;
    transform: scale(1.05) !important;
}

.amy-mv-search input[type="submit"]:active {
    transform: scale(0.98) !important;
}

/* Ajax search dropdown styling */
.amy-mv-search .search-ajax-content {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    background: #ffffff !important;
    z-index: 9999 !important;
    width: 100% !important;
    max-width: 320px !important;
    padding: 10px !important;
    display: none !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    margin-top: 5px !important;
    border: 1px solid #e0e0e0 !important;
}

.amy-mv-search .search-ajax-content.open {
    display: block !important;
}

.amy-mv-search .search-ajax-content .item-movie {
    display: flex !important;
    margin-bottom: 8px !important;
    padding: 5px !important;
    border-radius: 4px !important;
    transition: background-color 0.15s ease !important;
}

.amy-mv-search .search-ajax-content .item-movie:hover {
    background-color: #f5f5f5 !important;
}

.amy-mv-search .search-ajax-content .item-movie:last-child {
    margin-bottom: 0 !important;
}

.amy-mv-search .search-ajax-content .item-movie .item-name {
    margin-left: 10px !important;
    color: #333333 !important;
}

/* ==========================================================================
   MOVIE GRID FIXES - Proper alignment & mobile responsiveness
   Fixes: Row 2 pushed down, wonky image sizes on mobile
   ========================================================================== */

/* Use flexbox instead of inline-block for consistent row alignment */
.amy-movie-grid-1 .amy-movie-list .amy-movie-items,
.amy-movie-grid-2 .amy-movie-list .amy-movie-items {
    display: flex !important;
    flex-wrap: wrap !important;
    margin: 0 -10px !important;
}

/* Fix individual grid items */
.amy-movie-grid-1 .amy-movie-list .amy-movie-item {
    display: flex !important;
    flex-direction: column !important;
    padding: 0 10px !important;
    margin-bottom: 20px !important;
    box-sizing: border-box !important;
}

/* Ensure poster container doesn't overflow */
.amy-movie-grid-1 .amy-movie-item-front {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
}

/* Fix poster images - maintain aspect ratio */
.amy-movie-grid-1 .amy-movie-item-poster {
    position: relative !important;
    width: 100% !important;
    overflow: hidden !important;
}

.amy-movie-grid-1 .amy-movie-item-poster img,
.amy-movie-grid-2 .amy-movie-item-poster img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    object-fit: cover !important;
}

/* Title area - consistent height */
.amy-movie-grid-1 .amy-movie-field-title {
    min-height: 22px !important;
    max-height: 44px !important;
    overflow: hidden !important;
    margin-top: 8px !important;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS - Movie Grid
   ========================================================================== */

/* Desktop: 5 columns */
@media (min-width: 1200px) {
    .amy-movie-grid-1 .amy-movie-item {
        width: 20% !important;
        flex: 0 0 20% !important;
    }
}

/* Large tablet / small desktop: 4 columns */
@media (min-width: 992px) and (max-width: 1199px) {
    .amy-movie-grid-1 .amy-movie-item {
        width: 25% !important;
        flex: 0 0 25% !important;
    }
}

/* Tablet: 3 columns */
@media (min-width: 768px) and (max-width: 991px) {
    .amy-movie-grid-1 .amy-movie-item {
        width: 33.333% !important;
        flex: 0 0 33.333% !important;
    }
}

/* Large phone: 2 columns */
@media (min-width: 480px) and (max-width: 767px) {
    .amy-movie-grid-1 .amy-movie-item {
        width: 50% !important;
        flex: 0 0 50% !important;
    }
    
    .amy-movie-grid-1 .amy-movie-item-poster img {
        max-height: 280px !important;
        object-fit: cover !important;
    }
}

/* Small phone: 2 columns, smaller images */
@media (max-width: 479px) {
    .amy-movie-grid-1 .amy-movie-list .amy-movie-items {
        margin: 0 -5px !important;
    }
    
    .amy-movie-grid-1 .amy-movie-item {
        width: 50% !important;
        flex: 0 0 50% !important;
        padding: 0 5px !important;
        margin-bottom: 15px !important;
    }
    
    .amy-movie-grid-1 .amy-movie-item-poster img {
        max-height: 220px !important;
        object-fit: cover !important;
    }
    
    .amy-movie-grid-1 .amy-movie-field-title {
        font-size: 13px !important;
        line-height: 1.3 !important;
    }
}

/* Very small screens: still 2 columns but tighter */
@media (max-width: 359px) {
    .amy-movie-grid-1 .amy-movie-item {
        padding: 0 3px !important;
    }
    
    .amy-movie-grid-1 .amy-movie-item-poster img {
        max-height: 180px !important;
    }
    
    .amy-movie-grid-1 .amy-movie-field-title {
        font-size: 12px !important;
    }
}

/* ==========================================================================
   CAROUSEL/SLIDER GRID FIXES
   ========================================================================== */
.amy-slick-carousel .amy-movie-item {
    padding: 0 10px !important;
    box-sizing: border-box !important;
}

.amy-slick-carousel .amy-movie-item-poster img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
}
