﻿/* responsive styles for parent_text_photo and child_text_photo */

.parent_text_photo {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0px;
    padding: 15px;
    max-width: 100%;
    margin: 0 auto;
    direction: ltr;
    box-sizing: border-box;
}

/* cards */
.child_text_photo {
    background: #eeeeff;
    overflow: hidden;
    height: auto;
    box-shadow: 0 2px 0px rgba(0, 0, 0, 0.1);
    position: relative;
    padding: 30px;
    line-height: 2;
    margin: 5px;
    border-radius: 20px;
    font-family: "Segoe UI", Arial, sans-serif;

    /* initial state before scroll */
    opacity: 0;
    transform: translateX(-80px);
    transition:
            transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
            opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
            box-shadow 0.3s ease;
}

/* when visible in viewport */
.child_text_photo.show {
    opacity: 1;
    transform: translateX(0);
}

/* title */
.child_text_photo h3 {
    text-align: center;
}

/* image */
.child_text_photo img {
    max-width: 100%;
    transition: transform 0.3s ease;
}

.child_text_photo img:hover {
    animation: shakeEffect 0.9s ease-in-out infinite;
}

/* shake animation */
@keyframes shakeEffect {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

/* iframe */
.child_text_photo iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* mobile: single column */
@media (max-width: 700px) {

    .parent_text_photo {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
    }

    .child_text_photo {
        border-radius: 8px;
    }

    .child_text_photo .video-wrapper {
        padding-bottom: 75%;
    }
}

/* very small screens */
@media (max-width: 480px) {

    .parent_text_photo {
        padding: 5px;
        gap: 8px;
    }

    .child_text_photo .video-wrapper {
        border-radius: 5px;
    }
}
