body, html {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    scroll-behavior: smooth;
    overflow-x: hidden;
    background-color: #f0f2f5;
    color: #333;
}

/* from slideshow
body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
    font-family: sans-serif;
}
*/

.slideshow-container {
	background-color: #fff; /* Still good to have a background color for the container */
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
	top:0;
	width: 100%; /* Example width */
	min-height: 100px; /* Example height to ensure space for absolute children */
	/* max-height: 1024; /* Example height to ensure space for absolute children */
	position: relative; /* Crucial for absolute positioning of children */
	overflow: hidden; /* Hides parts of images that might exceed container */
	clear:both;
}
.slideshow-container::after {
        content: "";
        display: block;
        clear: both;
}

/* Apply common styles to both image elements */
#slideshow-image-1 {
	/*
	position: absolute;
	top: 0;
	left: 0;
	*/
	max-width: 100%; /* Fill the container */
	height: auto; /* Fill the container */
	/* object-fit: contain; /* Ensures image fits within bounds without cropping */

	opacity: 0; /* Start hidden */
	transition: opacity 1s ease-in-out; /* Smooth transition over 1 second */
}

#slideshow-image-2 {
	position: absolute;
	top: 0;
	left: 0;
	max-width: 100%; /* Fill the container */
	height: auto; /* Fill the container */
	/* object-fit: contain; /* Ensures image fits within bounds without cropping */

	opacity: 0; /* Start hidden */
	transition: opacity 1s ease-in-out; /* Smooth transition over 1 second */
}

/* When an image is active, make it visible and bring it to the front */
#slideshow-image-1.active,
#slideshow-image-2.active {
    opacity: 1; /* Make visible when active */
    z-index: 2; /* Bring the active (fading in) image to the top */
}

/* Ensure the inactive image is below so the new one can fade over it */
#slideshow-image-1:not(.active),
#slideshow-image-2:not(.active) {
    z-index: 1; /* Keep inactive image below active one */
}


/* Header and Footer Styling */
.header, .footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 60px 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.header h1 {
    font-size: 3.5em;
    margin-bottom: 15px;
}

.header p {
    font-size: 1.3em;
    opacity: 0.9;
}

.footer {
    padding: 30px;
    font-size: 0.9em;
    background-color: #34495e;
}

/* General Content Section Styling */
.content-section {
    padding: 100px 5%;
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 40px;
    border-radius: 8px;
    line-height: 1.8;
}

.content-section:nth-of-type(odd) {
    background-color: #fdfefe;
}

.content-section h2 {
    font-size: 2.8em;
    color: #444;
    margin-bottom: 30px;
    text-align: center;
}

.content-section p {
    font-size: 1.1em;
    margin-bottom: 20px;
    text-align: justify;
}

/* Image Effect Containers */
.image-effect-container {
    margin: 40px auto;
    max-width: 900px;
    border-radius: 14px;
    overflow: hidden; /* Ensures image corners are rounded */
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.image-effect-container img {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Specific Effect Styles --- */

/* 1. Fade In/Out Image */
.fade-in-out-image img {
    opacity: 0.05; /* Initially hidden */
    transition: opacity 15s ease-out; /* Smooth transition for opacity */
}

.fade-in-out-image.is-visible img {
    opacity: 1; /* Fully visible when in view */
}

/* 2. Sticky Image with Scrolling Content (JS controlled) */
.sticky-image-section {
    display: flex;
    flex-direction: column; /* Stack vertically on small screens */
    max-width: 1200px;
    margin: 0 auto 40px auto;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-radius: 8px;
    min-height: 200vh; /* Increased even more for demonstration */
    padding: 0;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .sticky-image-section {
        flex-direction: row; /* Side-by-side on larger screens */
    }
}

.sticky-image-wrapper {
    flex: 1; /* Takes up available space */
    position: relative; /* Crucial: Context for absolutely positioned elements within */
    min-height: 100vh; /* Ensures this column is tall enough to allow the image to pin for a duration */
    display: flex;
    align-items: center; /* Center the image vertically within the wrapper */
    justify-content: center; /* Center horizontally */
    padding: 20px;
    box-sizing: border-box;
}

#js-pinned-image {
    width: 100%;
    max-width: 500px;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    position: relative; /* Default state */
    top: auto;
    left: auto;
    /* Transition for smooth movement when position changes */
    transition: transform 0.3s ease-out, top 0.3s ease-out, left 0.3s ease-out;
    z-index: 1;
}

/* Classes controlled by JavaScript */
.js-pinned-image--fixed {
    position: fixed !important; /* Force fixed positioning */
    /* top and transform will be handled by JS for more granular control */
    left: auto !important; /* Will be set dynamically by JS based on parent's left offset */
}

.js-pinned-image--absolute {
    position: absolute !important; /* Unpin at the bottom of its parent */
    bottom: 20px !important; /* Position near the bottom of the wrapper */
    top: auto !important; /* Reset top */
    left: auto !important; /* Will be set dynamically by JS */
    transform: translateY(0) !important; /* Reset transform */
}


.sticky-content {
    flex: 2; /* Content takes more space */
    padding: 40px 5%;
    background-color: #fdfefe;
    line-height: 1.8;
    box-sizing: border-box;
}

.sticky-content h2 {
    font-size: 2.2em;
    margin-bottom: 25px;
    color: #444;
    text-align: left;
}

.sticky-content p {
    font-size: 1.05em;
    margin-bottom: 15px;
    text-align: justify;
}

/* 3. Multiple Fade-in Images (Gallery) */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsive grid */
    gap: 30px;
    margin-top: 50px;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(50px); /* Start slightly below */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out; /* Smooth transition */
}

.fade-in-up.is-visible {
    opacity: 1;
    transform: translateY(0); /* Move to original position */
}
