/* Background layer for the card */
.intro-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    z-index: 5;
    /* Above items at 1, below text at 10 */
}

/* Ensure text content is above the background */
.intro-card>h1,
.intro-card>h2,
.intro-card>p,
.intro-card>.custom-font,
.section-header-wrapper h1 {
    position: relative;
    z-index: 10;
}

/* Base style for polaroid photos */
.polaroid-photo {
    position: absolute;
    width: 300px;
    height: auto;
    object-fit: cover;

    /* Polaroid styling */
    border: 10px solid white;
    border-bottom: 35px solid white;
    border-radius: 10px;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);

    z-index: 1;
    /* Behind the card background (5) */
    transition: transform 0.3s ease, z-index 0s linear 0.1s;
    /* Delay z-index slightly to prevent flickering? No. */
    transition: transform 0.3s ease;
}

.polaroid-photo:hover {
    transform: scale(1.05) rotate(0deg) !important;
    z-index: 30;
    /* Pop to front on hover */
}

/* Container for headers */
.section-header-wrapper {
    position: relative;
    width: 100%;
    z-index: auto;
    /* Let children manage their own stack levels */
}

/* Left positioning (Photos 1, 3, 5) */
.pos-left {
    left: -250px;
    top: -20px;
    transform: rotate(-6deg);
}

/* Right positioning (Photos 2, 4, 6) */
.pos-right {
    right: -250px;
    top: -20px;
    transform: rotate(6deg);
}

/* Specific adjustments */
.polaroid-photo.photo-1 {
    transform: rotate(-8deg);
}

.polaroid-photo.photo-2 {
    transform: rotate(5deg);
}

.polaroid-photo.photo-3 {
    transform: rotate(-5deg);
}

.polaroid-photo.photo-4 {
    transform: rotate(7deg);
}

.polaroid-photo.photo-5 {
    transform: rotate(-4deg);
}

.polaroid-photo.photo-6 {
    transform: rotate(6deg);
}

/* Responsive adjustments */
@media (max-width: 1000px) {
    .polaroid-photo {
        width: 150px;
        border-width: 6px;
        border-bottom-width: 20px;
    }

    .pos-left {
        left: -50px;
    }

    .pos-right {
        right: -50px;
    }
}

@media (max-width: 768px) {
    .polaroid-photo {
        display: none;
    }
}