html,
body {
    overflow-x: hidden;
    position: relative;
    width: 100%;
    /*height: 100%;*/
    height: 100dvh;
}
body {
    display: flex;
    flex-direction: column;
}
header {
    min-height: 200px;
}
footer {
    margin-top: auto;
}

.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.main-container > h2 {
    padding-top: 10px;
}

.collage-section {
    padding: 20px 0 100px 0;
    overflow: visible;
    max-height: 900px;
}

.collage-container {
    position: relative;
    width: 100%;
    min-height: 750px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 400px);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 20px;
}

.family-card {
    transition: all 0.4s ease;
    background: #ffffff;
    width: 300px;
    height: 380px;
    padding: 15px;
    box-sizing: border-box;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    cursor: pointer;
}

.family-card img {
    width: 100%;
    height: 280px;
    /* This crops the image to fill the space without stretching */
    object-fit: cover;
    border: 1px solid #eee;
}

.family-card span {
    margin-top: auto;
    margin-bottom: 10px;
    font-family: "Georgia", serif;
    font-size: 0.95em;
    color: #7a8d94;
    font-style: italic;
    height: 40px; /* Reserved space for text */
    display: flex;
    align-items: center;
}

/* The "Caption" text that appears on click */
.caption {
    display: none;
    margin-top: 15px;
    color: #7a8d94;
    font-size: 0.95em;
    line-height: 1.5;
    text-align: center;
}

/* Individual Scatter Logic: Use margins to offset within the cell */
#card-us {
    grid-column: 1;
    grid-row: 1;
    margin-top: 20px;
    margin-left: 10px;
    transform: rotate(-6deg);
}

#card-ismael {
    grid-column: 2;
    grid-row: 1;
    margin-top: -30px;
    transform: translateX(20px) rotate(4deg);
}

#card-house {
    grid-column: 3;
    grid-row: 1;
    margin-top: 40px;
    margin-left: 20px;
    transform: rotate(-3deg);
}

#card-wedding {
    grid-column: 1;
    grid-row: 2;
    margin-top: -100px;
    transform: translateX(191px) rotate(8deg);
}
#card-wedding:hover {
    transform: scale(1.1) rotate(0deg) translateX(191px) translateY(-20px) !important;
}

#card-dogs {
    grid-column: 2 / span 2;
    grid-row: 2;
    justify-self: center; /* Centers the pets at the bottom */
    margin-top: -60px;
    transform: rotate(-2deg);
}

/* Hover: Bring to front and straighten */
.family-card:hover {
    z-index: 100 !important;
    transform: scale(1.1) rotate(0deg) translateY(-20px) !important;
}

@media (max-width: 768px) {
    #currentGalleryImg {
        max-width: 80% !important;
        max-height: 40vh !important;
        border-width: 4px;
    }

    .scroll-arrow.right {
        display: block !important;
    }

    .thumb-nav img {
        height: 45px;
    }

    .audio-player-container {
        max-width: 250px;
        margin: 10px auto;
    }
}

/* The "Active" state when a card is clicked */
.family-card.active {
    z-index: 10 !important;
    transform: scale(1.1) rotate(0deg) !important;
    width: 450px;
    box-shadow: 0 20px 50px rgba(148, 167, 174, 0.3);
}
.family-card.active .caption {
    display: block;
}

h2 {
    color: #8da399;
    margin-bottom: 0;
}
.subtitle {
    color: #94a7ae;
    font-style: italic;
    margin-top: 5px;
}

/* Slideshow Overlay Styles */
.gallery-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(43, 54, 59, 0.98); /* Deeper Dusty Blue */
    z-index: 999;
    flex-direction: column;
}

.gallery-content {
    flex: 1; /* This pushes header up and thumb-bar down */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    overflow: hidden;
    pointer-events: none;
}
#currentGalleryImg {
    max-height: 100%;
    width: auto;
    max-width: 80%;
    border: 6px solid white;
    opacity: 1;
    transition: opacity 0.4s ease-in-out;
    object-fit: contain;
}
.fade-out {
    opacity: 0.3 !important;
}

.gallery-nav button {
    background: #ffdfc6;
    border: none;
    padding: 10px 20px;
    margin: 10px;
    cursor: pointer;
    font-family: "Georgia", serif;
    border-radius: 5px;
}

/* Fixed Thumbnail Bar */
.thumb-nav {
    width: 100%;
    height: 100px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    gap: 10px;
    padding: 10px;
    overflow-x: auto;
    justify-content: center;
    align-items: center;
}

.thumb-nav img {
    height: 60px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: 0.3s;
}

.thumb-nav img.active {
    border-color: #ffdfc6; /* Peach */
    opacity: 1;
    transform: scale(1.1);
}

.slideshow-wrapper {
    position: relative;
    display: inline-block;
    margin: 0 auto;
}

.prev {
    left: 40px;
}

.next {
    right: 40px;
}

.abs-btn {
    position: absolute;
    top: 50%;
    z-index: 9999;
    pointer-events: auto;
}

/* Thumbnail Scrollbar Styling */
.thumb-nav::-webkit-scrollbar {
    height: 6px;
}
.thumb-nav::-webkit-scrollbar-thumb {
    background: #ffdfc6;
    border-radius: 10px;
}

.thumb-nav-container {
    position: relative;
    width: 90%;
    max-width: 1000px;
    margin: 20px auto 0;
    margin-top: 0;
    display: flex;
    align-items: center;
    overflow: visible;
    pointer-events: auto;
}

.thumb-nav {
    display: flex;
    gap: 10px;
    padding: 10px 40px; /* Space for the arrows */
    margin: 0 45px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    justify-content: flex-start;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar for Chrome/Safari */
.thumb-nav::-webkit-scrollbar {
    display: none;
}

.scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 223, 198, 0.5);
    color: #94a7ae;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.scroll-arrow.left {
    left: 0;
}
.scroll-arrow.right {
    right: 0;
}

.scroll-arrow:hover {
    background-color: #ffdfc6; /* Peach */
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.thumb-nav img {
    height: 60px;
    border-radius: 4px;
    cursor: pointer;
    border: 3px solid transparent; /* Reserve space for the border */
    transition: all 0.3s ease;
    opacity: 0.6;
}

.thumb-nav img.active {
    opacity: 1;
    border-color: #ffdfc6;
    box-shadow: 0 0 10px rgba(255, 223, 198, 0.8);
    transform: scale(1.1);
}

.close-gallery {
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 50px;
    color: white;
    cursor: pointer;
}

/* Media Controls */
.audio-player-container {
    display: none; /* Hidden unless it's the wedding gallery */
    margin: 15px auto;
    max-width: 300px;
    text-align: center;
    pointer-events: auto;
}
.audio-player-container p {
    color: #fffaf0;
    font-size: 0.8em;
    margin-bottom: 5px;
    font-style: italic;
    pointer-events: auto;
}

.custom-player {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: 25px;
    border: 1px solid #ffdfc6;
    pointer-events: auto;
}

#playPauseBtn {
    background: #ffdfc6;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    color: #7a8d94;
    font-size: 12px;
    pointer-events: auto;
}

/* Styling the Seek Slider */
#seekSlider {
    flex-grow: 1;
    cursor: pointer;
    accent-color: #ffdfc6; /* Peach slider thumb */
}

.main-img-stage {
    width: 100%;
    /*height: 55vh;*/
    height: 67vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    overflow: hidden;
}
@media (max-height: 940px) {
    .main-img-stage {
        height: 45vh !important;
    }
}
@media (max-height: 480px) {
    .main-img-stage {
        height: 45vh !important;
    }
}

.audio-player-container p {
    color: #ffdfc6;
}
.unused {
    color: white;
}
