/*
Block Name: Phone Scroller
Description: Two-column layout with WYSIWYG content on the left and a phone mockup with auto-scrolling images on the right
*/

/* WordPress Admin Styles */
body.wp-admin section.block-phone-scroller { 
    border: 1px solid #ccc; 
}

/* Main Grid Layout */
.block-phone-scroller .phone-scroller-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--grid-gap, 3rem);
    align-items: center;
}

/* Left Column: WYSIWYG Content */
.block-phone-scroller .wysiwyg-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.block-phone-scroller .wysiwyg-content h1,
.block-phone-scroller .wysiwyg-content h2,
.block-phone-scroller .wysiwyg-content h3,
.block-phone-scroller .wysiwyg-content h4,
.block-phone-scroller .wysiwyg-content h5,
.block-phone-scroller .wysiwyg-content h6 {
    margin-bottom: 1rem;
}

.block-phone-scroller .wysiwyg-content p {
    margin-bottom: 1rem;
}

.block-phone-scroller .wysiwyg-content ul,
.block-phone-scroller .wysiwyg-content ol {
    margin-bottom: 1rem;
    margin-left: 1.5rem;
}

.block-phone-scroller .wysiwyg-content li {
    margin-bottom: 0.5rem;
}

/* Right Column: Phone Mockup */
.block-phone-scroller .phone-mockup-wrapper {
    position: relative;
    width: 100%;
    max-width: 390px;
    aspect-ratio: 9 / 19.5; /* Modern iPhone screen ratio */
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Phone Frame */
.block-phone-scroller .phone-frame {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 10; /* Ensure frame sits on top of screen content */
    pointer-events: none; /* Allow interaction with screen underneath */
}

.block-phone-scroller .phone-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Phone Screen Area (positioned absolutely inside the frame) */
.block-phone-scroller .phone-screen {
    position: absolute;
    /* Adjust these values to align with your specific phone cutout image bezel */
    /* These percentages create space for the phone frame to be visible */
    top: 6%;
    left: 3.5%;
    right: 3.5%;
    bottom: 6%;
    overflow: hidden;
    border-radius: 50px; /* Adjust to match your phone's screen corners */
    background: #000;
    z-index: 1; /* Behind the phone frame */
}

/* Scrolling Container */
.block-phone-scroller .phone-screen-scroller {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Hide scrollbar but keep functionality */
.block-phone-scroller .phone-screen-scroller::-webkit-scrollbar {
    display: none;
}

.block-phone-scroller .phone-screen-scroller {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

/* Screen Images */
.block-phone-scroller .screen-image {
    width: 100%;
    height: auto;
    display: block;
}

.block-phone-scroller .screen-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    .block-phone-scroller .phone-scroller-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        min-height: auto;
    }

    .block-phone-scroller .wysiwyg-content {
        padding: 1rem;
    }

    .block-phone-scroller .phone-mockup-wrapper {
        max-height: 500px;
    }

    .block-phone-scroller .phone-frame {
        max-height: 500px;
    }
}

@media screen and (max-width: 576px) {
    .block-phone-scroller .phone-mockup-wrapper {
        max-height: 400px;
    }

    .block-phone-scroller .phone-frame {
        max-height: 400px;
    }
}
