/*  */
/* Stylen Homepage */
/*  */

.mainPageHeader {
    display: grid;
    grid-template-rows: auto;
    grid-template-columns: auto;
    place-items: center left;
    height: min(80vh, 850px);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    max-width: 1750px;
    margin: auto;
}

.mainPageHeader .mainPageHeaderInner {
    padding-bottom: 0;
}

.mainPageHeader.mainPageHeaderHero {
    height: auto;
    padding: 1rem 1rem 0 2rem;
    overflow: hidden;
}

.mainPageHeader.mainPageHeaderHero h1 {
    font-size: 2rem;
    line-height: 3rem;
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
}

.mobileHeaderImg img {
    height: 250px;
    margin: auto;
    margin-bottom: auto;
    margin-bottom: 20px;
}

.heroHeaderParagraph {
    font-weight: bold;
    animation: fadeIn 2s 0.5s forwards;
    font-size: 1.25rem;
    line-height: 2.25rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.mainPageHeader .mainPageHeaderButton {
    background: white;
    color: black;
    font-size: 20px;
    font-weight: bold;
    border: 2px solid black;
    animation: fadeIn 2s 0.5s forwards;
    padding: 10px 15px;
    display: block;
    width: max-content;
    /* or a fixed width */
    /* margin-left: auto; */
    /* margin-right: auto;    */
}

.mainPageHeader.mainPageHeaderHero a {
    margin: auto;
    margin-bottom: 2rem;
    display: block;
}


@media screen and (min-width: 768px) {
    .mainPageHeader {
        grid-template-rows: minmax(600px, auto);
        grid-template-columns: 1fr 1fr;
        place-items: center left;
    }

    .mainPageHeader .mainPageHeaderInner {
        padding-bottom: 25px;
        opacity: 0;
        animation: fadeIn 2.5s 0.5s forwards;
    }

    .mainPageHeader.mainPageHeaderHero h1 {
        font-size: 3rem;
        line-height: 4rem;
        margin-top: 0;
    }

    .mainPageHeader.mainPageHeaderHero p {
        font-size: 1.25rem;
        font-weight: 600;
        line-height: 2rem;
        opacity: 0;
        margin-top: 25px;
    }

    .mainPageHeader.mainPageHeaderHero a {
        margin-top: 25px;
        margin-left: 0;

    }
}

@media screen and (min-width: 970px) {
    .mainPageHeader {
        grid-template-columns: 3fr minmax(400px, 2fr);
    }

    .mainPageHeader.mainPageHeaderHero {
        padding: 4rem 4rem 0 4rem;
    }

}

.heroContainer {
    background: #f6f4f4;
}

.mobileHeaderImg img {
    animation: slideInFromRight 2s 0.25s forwards;
}

.mainPageHeaderRight {
    height: 100%;
    width: 100%;
    background-image: url("/images/babyReading.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom center;
    margin-bottom: -45px;
    transform: translateX(100%);
    animation: slideInFromRight 2s 0.25s forwards;
}

.mainPageHeaderInner {
    place-self: center;
    color: #1a1e30;
    padding-bottom: 4rem;
}

/* Language Slider */

.contentSection.languageSlider {
    padding: 0 10px;
}

.singleLanguage {
    width: 400px;
    border: 2px solid black;
    border-radius: 15px;
    overflow: hidden;
    margin-top: 1rem;
}

div.swiper.swiper-initialized {
    padding: 0 10px;
}

.swiper-slide {
    transition: all 0.3 ease-in-out;
}

.swiper-slide:hover {
    transform: scale(1.03) !important;
}

.swiper-container-wrapper {
    position: relative;
    padding: 0px;
    /* Space for arrows */
}

.swiper-container-wrapper .swiper-button-prev,
.swiper-container-wrapper .swiper-button-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.swiper-container-wrapper .swiper-button-prev {
    left: -50px;
}

.swiper-container-wrapper .swiper-button-next {
    right: -50px;
}


.swiper-container-wrapper .swiper-button-prev:hover,
.swiper-container-wrapper .swiper-button-next:hover {
    transform: translateY(-50%) scale(1.2);
}

@media screen and (max-width: 768px) {
    .swiper-container-wrapper {
        padding-right: 15px;
        padding-left: 15px;
    }

    .swiper-container-wrapper .swiper-button-prev {
        left: -20px;
    }

    .swiper-container-wrapper .swiper-button-next {
        right: -20px;
    }
}


.singleLanguage .image-wrapper {
    width: 100%;
    height: 125px;
    background-size: cover;
    background-position: center;
}


.singleLangueTitle {
    /* min-height: 50px; */
    font-size: 1.5rem;
    text-align: center;
    background: white;
    color: var(--textBlue);
    padding-topa: 0.5rem;
    margin-bottom: 0;
}

@media screen and (max-width: 1200px) {
    .languageSlider .singleLanguage {
        padding: 0;
    }
}

.singleLanguageContent {
    text-align: center;
}

.singleLanguage .slot {
    background-color: white;
    color: black;
    font-size: 20px;
    font-size: bold;
    border-radius: 5px;
    position: relative;
    text-align: center;
    margin: auto;
    text-decoration: none;

}


@media screen and (min-width: 768px) {
    div.blog-story-grid-homepage.story-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

div.blog-story-grid-homepage.story-grid .image-credit {
    position: absolute;
    top: 5px;
    /* Positive value for slight inset */
    bottom: auto;
    left: 5px;
    margin: 0;
    background: white;
    border-radius: 5px;
    padding: 5px;
    color: black;
}

/*  */
/* FreeStory Grid */
/*  */

#freeStoryGrid.story-grid .story-item {
    height: 350px;
}

.story-grid.freeStoryGrid .genres {
    position: relative;
    margin: auto;
    width: fit-content;
}

.story-grid.freeStoryGrid .languagesAndGenres {
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
}

.story-grid.freeStoryGrid .languagesAndGenres .flag {
    font-size: 50px;
    color: white;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.695), 0 1px 3px rgba(0, 0, 0, 0.702), 0 2px 5px rgba(0, 0, 0, 0.679);
}

.story-grid.freeStoryGrid .languagesAndGenres .languageFlag {
    margin: auto;
    width: fit-content;
    margin-bottom: 5px;
}

/* Mobile first: Default vertical stack, no animation */
.story-grid.freeStoryGrid {
    position: relative;
    min-height: auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.story-grid.freeStoryGrid .story-item {
    position: relative;
    transform: none;
    animation: none;
}

.clarificationTitlea1 {
    text-align: center;
}

/* Tablet: 768px to 1240px - 3 column grid with animation */

/* Disable pointer events on cards until animation triggers */

@media screen and (min-width: 768px) and (max-width: 1240px) {
    .story-grid.freeStoryGrid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        min-height: 400px;
        transition: pointer-events 0s 1.4s;
    }

    @keyframes slideToPositionTablet {
        from {
            transform: translateX(calc(var(--move-distance-tablet) * -1));
        }

        to {
            transform: translateX(0);
        }
    }

    /* Default state - cards in position but no animation */
    .story-grid.freeStoryGrid .story-item {
        transform: translateX(calc(var(--move-distance-tablet) * -1));
        animation: none;
    }

    /* Animation triggered state */
    .story-grid.freeStoryGrid.animation-triggered .story-item {
        animation: slideToPositionTablet 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    /* First row - 3 cards */
    .story-grid.freeStoryGrid .story-item:nth-child(1) {
        --move-distance-tablet: 0;
        z-index: 5;
        transform: none;
        animation: none;
    }

    .story-grid.freeStoryGrid .story-item:nth-child(2) {
        --move-distance-tablet: calc(100% + 10px);
        z-index: 4;
        animation-delay: 0.5s;
    }

    .story-grid.freeStoryGrid .story-item:nth-child(3) {
        --move-distance-tablet: calc(200% + 20px);
        z-index: 3;
        animation-delay: 0.8s;
    }

    /* Second row - 2 cards */
    .story-grid.freeStoryGrid .story-item:nth-child(4) {
        --move-distance-tablet: 0;
        z-index: 2;
        grid-column: 1;
        animation-delay: 1.1s;
    }

    .story-grid.freeStoryGrid .story-item:nth-child(5) {
        --move-distance-tablet: calc(100% + 10px);
        z-index: 1;
        grid-column: 2;
        animation-delay: 1.4s;
    }
}

@media screen and (min-width: 1241px) {
    .story-grid.freeStoryGrid {
        position: relative;
        grid-template-columns: repeat(5, 1fr);
        gap: 10px;
        display: grid;
        transform-style: preserve-3d;
        isolation: isolate;
        pointer-events: none;
        /* Transition for pointer-events with delay */
        transition: pointer-events 0s 1.4s;
    }

    @keyframes slideToPosition {
        from {
            transform: translateX(calc(var(--move-distance) * -1));
        }

        to {
            transform: translateX(0);
        }
    }

    /* Default state - cards START translated to the left, no animation */
    .story-grid.freeStoryGrid .story-item {
        position: relative;
        transform: translateX(calc(var(--move-distance) * -1));
        animation: none;
    }

    /* Animation triggered state */
    .story-grid.freeStoryGrid.animation-triggered .story-item {
        animation: slideToPosition 1s ease-out forwards;
        pointer-events: auto; 
    }

    /* Bottom card in stack - stays in place */
    .story-grid.freeStoryGrid .story-item:nth-child(1) {
        --move-distance: 0;
        z-index: 1;
        transform: none;
        animation: none;
    }

    .story-grid.freeStoryGrid .story-item:nth-child(2) {
        --move-distance: calc(100% + 10px);
        z-index: 2;
    }

    .story-grid.freeStoryGrid.animation-triggered .story-item:nth-child(2) {
        animation-delay: 0.9s;
        /* Fourth to move */
    }

    .story-grid.freeStoryGrid .story-item:nth-child(3) {
        --move-distance: calc(200% + 20px);
        z-index: 3;
    }

    .story-grid.freeStoryGrid.animation-triggered .story-item:nth-child(3) {
        animation-delay: 0.6s;
        /* Third to move */
    }

    .story-grid.freeStoryGrid .story-item:nth-child(4) {
        --move-distance: calc(300% + 30px);
        z-index: 4;
    }

    .story-grid.freeStoryGrid.animation-triggered .story-item:nth-child(4) {
        animation-delay: 0.3s;
        /* Second to move */
    }

    /* Top card in stack - moves furthest */
    .story-grid.freeStoryGrid .story-item:nth-child(5) {
        --move-distance: calc(400% + 40px);
        z-index: 5;
    }

    .story-grid.freeStoryGrid.animation-triggered .story-item:nth-child(5) {
        animation-delay: 0s;
        /* First to move - top card */
    }
}

@media screen and (min-width: 1500px) {
    .story-grid.freeStoryGrid {
        gap: 15px;
        width: 1400px;
        margin-left: -200px;
    }
}



/* WAIVERCARD STYLING */
/* Playing card spread animation for waiverCard */

/* Set up the container for the card spread */
.waiverCard {
    position: relative;
    height: 400px;
    margin: 50px auto;
    perspective: 1000px;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Base styles for all cards */
.waiverCard .story-item {
    position: absolute;
    background: white;
    border: 1px solid black;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 4px 4px 4px rgba(43, 23, 23, 0.468);
    width: 350px;
    left: 90%;
    top: 50%;
    /* Center vertically */
    transform-origin: bottom center;
    transform: translateX(-50%) translateY(-50%) rotate(-30deg) translateZ(0);
    /* Start at -30 degrees with GPU acceleration */
    text-align: center;
    height: 510px;
    display: flex;
    flex-direction: column;
    will-change: transform;
    /* Hint browser about animation */
    backface-visibility: hidden;
    /* Prevent flickering */
    contain: layout style paint;
    /* CSS containment for better performance */
}

/* The anchor tag should also be flex to fill the card */
.waiverCard .story-item>a {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* Title styling */
.waiverCard .story-item h2 {
    flex-shrink: 0;
    margin: 15px;
}

/* Subtitle styling */
.waiverCard .story-item .clarificationTitlea1 {
    line-height: 20px;
    display: block;
    margin-top: 1px;
    margin-bottom: 0.5rem;
}

/* Make the image container grow to fill available space */
.waiverCard .story-item .cover_image {
    flex-grow: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Ensure the actual image fills its container */
.waiverCard .story-item .cover_image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    transform: translateZ(0);
    /* Force GPU acceleration */
    backface-visibility: hidden;
}

/* Summary text if present */
.waiverCard .story-item .story-summary {
    flex-shrink: 0;
    padding: 10px 15px;
}

/* Animation keyframes - using transform3d for better performance */
@keyframes spreadCards {
    from {
        transform: translate3d(-50%, -50%, 0) rotate(-30deg);
    }

    to {
        transform: translate3d(-50%, -50%, 0) rotate(var(--final-rotation));
    }
}

/* Apply different rotations to each card - bigger spread */
.waiverCard .story-item.waiver-1 {
    --final-rotation: -30deg;
    z-index: 1;
    animation: spreadCards 1.5s ease-out 0s forwards;
}

.waiverCard .story-item.waiver-2 {
    --final-rotation: -15deg;
    z-index: 2;
    animation: spreadCards 1.5s ease-out 0.2s forwards;
}

.waiverCard .story-item.waiver-3 {
    --final-rotation: 0deg;
    z-index: 3;
    animation: spreadCards 1.5s ease-out 0.4s forwards;
}

.waiverCard .story-item.waiver-4 {
    --final-rotation: 15deg;
    z-index: 4;
    animation: spreadCards 1.5s ease-out 0.6s forwards;
}

.waiverCard .story-item.waiver-5 {
    --final-rotation: 30deg;
    z-index: 5;
    animation: spreadCards 1.5s ease-out 0.8s forwards;
}

/* Image credit positioning */
.waiverCard .image-credit {
    position: absolute;
    top: 5px;
    bottom: auto;
    left: 5px;
    margin: 0;
    background: white;
    border-radius: 5px;
    padding: 5px;
    color: black;
}

/* Genre container */
.waiverCard .genres {
    position: relative;
}

/* Languages and genres positioned at bottom of image */
.waiverCard .languagesAndGenres {
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1;
}


/* Flag styling */
.waiverCard .languagesAndGenres .flag {
    font-size: 50px;
    color: white;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.695), 0 1px 3px rgba(0, 0, 0, 0.702), 0 2px 5px rgba(0, 0, 0, 0.679);
}

/* Language flag container */
.waiverCard .languagesAndGenres .languageFlag {
    margin: auto;
    width: fit-content;
    margin-bottom: 5px;
}

/* Button styling */
.waiverCard .buttonReadThisStory {
    padding: 15px;
    color: white;
    font-weight: bold;
    margin: 0;
    flex-shrink: 0;
}

/* Optional: Add class to trigger animation on scroll */
.waiverCard.animate-on-scroll .story-item {
    animation-play-state: paused;
}

.waiverCard.animate-on-scroll.in-view .story-item {
    animation-play-state: running;
}

/* Optional: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .waiverCard .story-item {
        animation: none !important;
        transform: translateX(-50%) translateY(-50%) rotate(var(--final-rotation)) !important;
    }
}

.waiverCardTitle {
    font-size: 1.75rem;
    font-weight: bold;
    text-align: center;
}

/* Mobiele stijlen waivercard */
@media screen and (max-width: 768px) {
    #waiverCard {
        height: 425px;
        margin: 0px auto 50px auto;
    }

    #waiverCard .story-item {
        height: 350px;
        width: 225px;
        left: 0;
        left: 50%;
    }

    .story-item p.waiverCardTitle {
        font-size: 1.25rem;
        font-weight: bold;
        margin: 0.25rem
    }

    .waiverCard .story-item .clarificationTitlea1 {
        margin: 0.25rem;
    }
}

/* TABLET stijlen waivercard */
@media screen and (min-width: 768px) {
    #waiverCard {
        height: 600px;
        margin: 0px auto 50px auto;
    }

    #waiverCard .story-item {
        height: 475px;
        width: 325px;
        left: 0;
        left: 50%;
    }

    .story-item p.waiverCardTitle {
        font-size: 1.25rem;
        font-weight: bold;
        margin: 0.25rem
    }

    .waiverCard .story-item .clarificationTitlea1 {
        margin-bottom: 1rem;
    }
}

/* Desktop styles */
@media screen and (min-width: 1450px) {
    .contentSectionInnerGridWaiver {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    #waiverCard .story-item {
        height: 475px;
        width: 325px;
        left: 0;
        left: 90%;
    }
    .story-item p.waiverCardTitle {
        margin: 1rem
    }
}


.buttonsDownLoadPDF {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: start;
    margin: 20px 0;
}

.buttonsDownLoadPDF a {
    margin-top: 0;
    display: flex;
    align-items: center;
    font-weight: bold;
    line-height: 1.5rem;
    justify-content: center;
    gap: 10px;
    border: 2px solid blue;
    padding: 5px 15px;
    border-radius: 5px;
    transition: transform 0.25s linear;
    font-size: 18px
}

.buttonsDownLoadPDF a:hover {
    transform: scale(1.1);
}


/*  */
/* PRijzen */
/*  */



.grid-3-column {
    display: grid;
    grid-template-columns: 1fr;
    gap: 50px;
    grid-auto-flow: row;

}

@media screen and (min-width: 768px) {
    .grid-3-column {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 25px;
        margin-top: 4rem;
    }
}

.grid-3-column ul {
    font-weight: 500;
    margin-bottom: 1rem;
    color: black;
    font-weight: 500;
}

.best-choice-badge {
    position: absolute;
    top: -20px;
    left: 20px;
    background: rgb(234, 208, 57);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
}

/* .save-25-percent-badge {
    position: absolute;
    top: -20px;
    right: 20px;
    color:white;
    background: rgb(127, 165, 127);

    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
} */

.grid-column-keuzeKaartje {
    scroll-margin-top: 400px;
    /* Adjust based on your header height */
}

.grid-3-column-inner {
    background-color: rgb(230, 235, 238);
    border: 3px solid steelblue;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    position: relative;
    flex-direction: column;
}

.grid-3-column-inner:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;

}

.grid-3-column-inner:nth-child(2):hover {
    transform: scale(1.10);
    /* 5% more than its default */
}

.grid-3-column-inner:nth-child(2) {
    transform: scale(1.05);
}

.grid-3-column-inner {
    /* Increased opacity from 0.08 to 0.15 */
    box-shadow: 4px 6px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.grid-3-column-inner:hover {
    transform: scale(1.025);
    /* Increased opacity from 0.12 to 0.25 */
    box-shadow: 6px 10px 20px rgba(0, 0, 0, 0.25);
}

/* Special treatment for the yearly card */
.grid-3-column-inner:nth-child(2) {
    /* Stronger gold shadow */
    box-shadow: 4px 6px 16px rgba(255, 165, 0, 0.3);
}

.grid-3-column-inner:nth-child(2):hover {
    transform: scale(1.075);
    box-shadow: 6px 12px 24px rgba(255, 165, 0, 0.4);
}

.grid-3-column-inner h3 {
    margin-bottom: 0;
}

.grid-3-column-inner img {
    width: 200px;
    margin: 0 auto;
    /* margin-bottom: 0.5rem; */
}

.grid-3-column-inner .keuzeKaartjePrice {
    font-size: 30px;
    line-height: 2rem;
    text-align: center;
    font-weight: 700;
    color: #551a8b;

}

.grid-3-column-inner .keuzeKaartjePrice .pricePerMonth{
    font-size: 20px;
    font-weight: 600;
}

@media screen and (min-width: 768px) {
    .grid-3-column-inner:nth-of-type(3) .keuzeKaartjePrice {
        margin-bottom: 3rem;
    }
}

/* keuze voor tablet tot 1240px. dan beste keuze boven groot, daaronder 2 andere*/
@media screen and (min-width: 768px) and (max-width: 1240px) {
    .grid-column-keuzeKaartje {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "a a"
            "b c";
    }
    #yearlySubCard {
        grid-area: a;
        transform: scale(1);
    }
    #monthlySubCard {
        grid-area:  b;
    }
    #singlePurchaseCard {
        grid-area:  c;
    }
}




.grid-3-column-inner .keuzekaartjeOmschrijving {
    font-size: 2rem;
    line-height: 2.5rem;
    font-weight: 600;
    color: #551a8b;
}

.keuzeKaartjeListItem {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-left: 15px;
    font-size: 18px;
    text-align:start;
}

.grid-3-column-inner:nth-of-type(2) {
    border-color: gold;
}

.grid-3-column-inner h3 {
    text-align: center;
    min-height: 64px;
}

.grid-3-column-inner p {
    flex-grow: 1;
}

.grid-column-keuzeKaartje {
    opacity: 0;
}

.button.buttonKeuzeKaartje {
    margin: 0;
    background: steelblue;
    color: white;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
}

.button.buttonKeuzeKaartje:hover {
    transform: scale(1);
}