/* OnBagan — (c) 2026 SUME Sp. z o.o. · NIP 9112058044 · OnBagan is a brand of SUME Sp. z o.o., which owns the platform and its technology. · Created by Daniel Bagan & Paweł Rymarczyk · https://onbagan.com */

/* The folding description: a hidden tick box unfolds it with no script; read-more.js turns the per cent and the lines
   the block carries (--rozwin-proc, --rozwin-linie) into the folded height (--rozwin-wys). */

.rozwin {
    margin: 0 0 26px;
}

.rozwin__pole {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rozwin__srodek {
    position: relative;
    overflow: hidden;
    transition: max-height .3s ease;
}

@media (min-width: 901px) {
    .rozwin__srodek {
        /* The spare value for the case of JavaScript being switched off. */
        max-height: var(--rozwin-wys, 320px);
    }
}

.rozwin__tekst {
    min-width: 0;
}

/* A mist at the bottom of a folded section — a sign that the text goes on. */
.rozwin__srodek::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 64px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 92%);
    pointer-events: none;
}

/* Unfolded: with no limit and with no mist. */
.rozwin__pole:checked ~ .rozwin__srodek {
    max-height: none;
}

.rozwin__pole:checked ~ .rozwin__srodek::after {
    display: none;
}

/* The button switched off on the screen of the add-on: no trace of it and the section open; `!important` beats a height
   the script worked out before the change. */
.rozwin[data-rozwin="0"] .rozwin__srodek {
    max-height: none !important;
}

.rozwin[data-rozwin="0"] .rozwin__srodek::after,
.rozwin[data-rozwin="0"] .rozwin__guzik {
    display: none;
}

/* While the measuring goes on the limit is taken off — otherwise the script would measure its own cut. */
.rozwin--mierze .rozwin__srodek {
    max-height: none !important;
    transition: none !important;
}

.rozwin--mierze .rozwin__srodek::after {
    display: none;
}

.rozwin__guzik {
    display: inline-block;
    margin-top: 12px;
    padding: 9px 20px;
    border-radius: 8px;
    background: var(--granat, #1a365d);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: background .2s ease;
}

.rozwin__guzik:hover {
    background: var(--granat-jasny, #2a4a78);
}

.rozwin__guzik .rozwin__mniej,
.rozwin__pole:checked ~ .rozwin__guzik .rozwin__wiecej {
    display: none;
}

.rozwin__pole:checked ~ .rozwin__guzik .rozwin__mniej {
    display: inline;
}

/* A phone: the text itself is cut, as many lines as set on the screen of the add-on (the height comes from the script). */
@media (max-width: 900px) {
    .rozwin__srodek {
        overflow: visible;
    }

    .rozwin__tekst {
        overflow: hidden;
        max-height: var(--rozwin-tekst-wys, 9em);
    }

    .rozwin__pole:checked ~ .rozwin__srodek .rozwin__tekst {
        max-height: none;
    }

    .rozwin[data-rozwin="0"] .rozwin__tekst,
    .rozwin--mierze .rozwin__tekst,
    .rozwin--bez-potrzeby .rozwin__tekst {
        max-height: none !important;
    }

    .rozwin__srodek::after {
        height: 90px;
    }

    .rozwin__guzik {
        display: block;
        text-align: center;
    }

    .rozwin[data-rozwin="0"] .rozwin__guzik {
        display: none;
    }
}

/* Nothing to hide (a short description: the folded and the whole height nearly the same) — no button and no cut on this
   page; the settings stay as they are. */
.rozwin--bez-potrzeby .rozwin__srodek {
    max-height: none !important;
}

.rozwin--bez-potrzeby .rozwin__srodek::after,
.rozwin--bez-potrzeby .rozwin__guzik {
    display: none;
}
