/* --- BASE SETUP --- */
.wave, .blob-scene, .blob-scatter {
    position: relative;
    overflow: hidden;
}

/* Zapewnienie, że treść Kadence jest nad dekoracjami */
.wave > .kt-row-column-wrap,
.blob-scene > .kt-row-column-wrap,
.blob-scatter > .kt-row-column-wrap {
    position: relative;
    z-index: 1;
}

/* Wspólne ustawienia dla wszystkich pseudoelementów dekoracyjnych */
.wave::after, 
.blob-scene::before, .blob-scene::after,
.blob-scatter::after {
    content: "";
    position: absolute;
    pointer-events: none;
    z-index: 0;
    opacity: 0.05; /* Stałe 5% zgodnie z wytycznymi */
    background-color: var(--svg-fill, #000); /* Domyślny kolor */
}

/* --- 1. WAVE --- */
.wave::after {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 500px; /* Dostosuj wysokość fali */
    mask-image: url('assets/svg/wave.svg');
    mask-size: 100% auto;
    mask-repeat: no-repeat;
    mask-position: bottom;
}

/* --- 2. BLOB SCENE --- */
.blob-scene::before {
    bottom: -10%;
    left: -10%;
    width: 40%;
    height: 60%;
    mask-image: url('assets/svg/blob-bottom-left.svg');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: bottom left;
}

.blob-scene::after {
    top: -10%;
    right: -10%;
    width: 40%;
    height: 60%;
    mask-image: url('assets/svg/blob-top-right.svg');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: top right;
}

/* --- 3. BLOB SCATTER --- */
.blob-scatter::after {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    mask-image: url('assets/svg/scatter.svg');
    mask-size: cover;
    mask-repeat: no-repeat;
    mask-position: center;
}

/* --- KOLORY (BEM Modifiers) --- */
/* Brązowy */
.--color-red { --svg-fill: #5D2416; }

/* Zielony */
.--color-green { --svg-fill: #1E500F; }

/* Złoty/Oliwkowy */
.--color-yellow { --svg-fill: #503F0F; }

/* Niebieski */
.--color-blue { --svg-fill: #294F88; }

/* BASIC STYLING */
.wp-social-link {
    background-color: var(--global-palette6)
}

.footer-menu-container > .menu {
    flex-direction: column;
}

.kb-button:hover, .header-button:hover {
    transform: translate(4px, 4px);
}

/* RESOURCES */
.resource-list-item {
    padding: 1rem 1.5rem;
    border-radius: 16px;
    background: var(--global-palette-btn-sec-bg);
    border: 1px solid var(--global-palette2);
}

.resource-list-item > div {
    display: flex;
}

.resource-list-item > div .kt-adv-heading177_be0667-5c {
    margin: 0 0 1rem 0;
    font-size: 14px;
}

.resource-list-item > div h4 {
    margin: 1rem 0;
}


.resource-list-item > div .btn-container {
    min-width: 300px;
}

.resource-list-item > div .btn-container > div {
    margin-left: auto;
    width: fit-content;
}

.resource-filter-form {
    display: flex;
}

.resource-filter-form > select {
    border: 1px solid var(--global-palette2);
    margin: auto;
}

@media screen and (max-width: 768px) {
    .resource-list-item > div {
        flex-direction: column;
    }

    .resource-list-item > div .btn-container {
        min-width: 100px;
    }
}

/* FLIPBOOK */
.fb-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    perspective: 3000px; /* Increased perspective for better 'open book' look */
    padding: 60px 0;
}

.fb-book {
    position: relative;
    width: 400px;  /* Width of ONE page (Right Side) */
    height: 550px;
    transform-style: preserve-3d;
    transform: translateX(50%); /* Shifts the whole spine to center of screen */
}

/* THE STATIC LEFT PAGE (0000) */
.fb-static-left {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: -100%; /* Sits to the left of the spine */
    background-size: cover;
    background-position: center;
    background-color: #fff;
    border: 1px solid #ddd;
    box-shadow: inset -10px 0 20px rgba(0,0,0,0.05); /* Shadow on right edge (spine) */
    z-index: 0; /* Always at bottom */
}

.fb-sheet {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transform-origin: left center; /* Pivots on the spine */
    transform-style: preserve-3d;
    transition: transform 0.9s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.fb-side {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background-size: cover;
    background-position: center;
    background-color: #fff;
    border: 1px solid #ddd;
}

.fb-front {
    z-index: 2;
    box-shadow: inset 10px 0 20px rgba(0,0,0,0.05); /* Spine shadow left */
}

.fb-back {
    transform: rotateY(180deg);
    box-shadow: inset -10px 0 20px rgba(0,0,0,0.05); /* Spine shadow right */
}

/* Animation */
.fb-sheet.flipped {
    transform: rotateY(-180deg);
}

/* UI Elements */
.fb-loader {
    position: absolute; top: 50%; left: 50%; width: 24px; height: 24px;
    border: 2px solid #eee; border-top: 2px solid #555; border-radius: 50%;
    animation: fb-spin 1s linear infinite; transform: translate(-50%, -50%);
}
.fb-side.loaded .fb-loader, .fb-static-left.loaded .fb-loader { display: none; }
@keyframes fb-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.fb-controls { margin-top: 40px; display: flex; align-items: center; gap: 20px; transform: translateX(0); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 850px) {
    .fb-book { width: 45vw; height: 65vw; }
}