/*
 Lista ofert: strona sezonu (/oferta/zima, /oferta/lato) i strona kategorii.
 Uzupełnia style/style.css i style/responsive.css; zachowanie: scripts/pages/offer.js.
 */

/* ------------------------------------------------------------------ karta oferty */

.offer-list .offer-item-title {
    overflow: visible;
    overflow-wrap: break-word;
}

/* termin, miejsce i cena pod nazwą */
.offer-item-facts {
    margin-top: var(--gap-25);
    font-size: max(14px, calc(var(--font-25) - 4px));
    line-height: 1.5;
    overflow-wrap: break-word;
}

.offer-item-facts .offer-item-date {
    margin-top: 0;
    font-size: inherit;
}

.offer-item-price {
    margin-top: 4px;
    font-size: max(16px, calc(var(--font-25) - 2px));
    font-weight: 700;
}

.offer-item-spots {
    font-size: clamp(13px, 1vw, 14px);
}

.offer-item-inner:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

/* brak ofert: komunikat na całą szerokość listy */
.offer-list .no-offers {
    width: 100%;
}

/* ------------------------------------------------------------------ nagłówek listy */

/* opis kategorii pisany w panelu: nagłówki zachowują wielkość sprzed przeniesienia o poziom (rich-h{stary poziom}) */
.section-subtitle-rich .rich-h1 {
    font-size: 2em;
}

.section-subtitle-rich .rich-h2 {
    font-size: 1.5em;
}

.section-subtitle-rich .rich-h3 {
    font-size: 1.17em;
}

.section-subtitle-rich .rich-h4,
.section-subtitle-rich .rich-h5,
.section-subtitle-rich .rich-h6 {
    font-size: 1em;
}

.section-subtitle-rich {
    overflow-wrap: break-word;
}

.section-subtitle-rich a {
    text-decoration: underline;
}

.section-subtitle-rich li {
    list-style: disc;
    margin-left: 25px;
}

.section-subtitle-rich ol li:not([data-list="bullet"]) {
    list-style: decimal;
}

.section-subtitle-rich img {
    max-width: 100%;
    height: auto;
}

/* "Czytaj dalej": tylko na telefonach, tylko przy długim opisie */
.intro-more-toggle,
.intro-more-label {
    display: none;
}

/* filtry: pole dotyku 44 px */
.offer-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.btn-tag {
    min-height: 44px;
}

.btn-tag:focus-visible,
.aside-toggle:focus-visible,
.intro-more-toggle:focus-visible ~ .intro-more-label {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

/* na ekranach dotykowych przycisk filtra nie zostaje "podświetlony" po dotknięciu */
@media (hover: none) {
    .btn.btn-transparent.btn-tag:not(.active):hover {
        color: var(--color-secondary);
        background: transparent;
    }
}

/* ------------------------------------------------------------------ lista kategorii */

/* każda kategoria ma wysokość wygodną do kliknięcia i dotknięcia */
a.offer-banner-title {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 11px 0;
}

.offer-banner-title + .offer-banner-title {
    margin-top: 0;
}

.offer-banner-title:before {
    top: 50%;
    margin-top: -4px;
}

.offer-banner-titles {
    display: flex;
    flex-direction: column;
}

@media screen and (max-width: 1139px) {
    /* panel kategorii wysuwany z boku: zamknięty jest niewidoczny także dla klawiatury i czytników ekranu */
    .offer-categories-list {
        visibility: hidden;
        transition: all 300ms, visibility 0s linear 300ms;
        flex-wrap: nowrap;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    }

    .offer-categories-list.active {
        visibility: visible;
        transition: all 300ms, visibility 0s linear 0s;
    }

    /* długa lista kategorii przewija się wewnątrz panelu */
    .offer-banner-titles {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-left: 18px;
        margin-left: -18px;
    }

    /* przycisk zamykania: pole dotyku 44 px */
    .offer-categories-list .btn-close {
        width: 44px;
        height: 44px;
        top: -17px;
        cursor: pointer;
    }

    .offer-categories-list .btn-close:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 2px;
    }
}

/* ------------------------------------------------------------------ telefony */

@media screen and (max-width: 767px) {
    /* opis kategorii: tekst ciągły wyrównany do lewej czyta się łatwiej niż wyśrodkowany */
    .offer-list-section .section-header .section-subtitle-rich {
        align-self: stretch;
        text-align: left;
    }

    .offer-list-section .section-header .section-subtitle-rich h2,
    .offer-list-section .section-header .section-subtitle-rich h3 {
        text-align: center;
    }

    /* długi opis: początek + "Czytaj dalej" (pole wyboru działa także bez JavaScript) */
    .intro-more-toggle {
        display: block;
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
        pointer-events: none;
    }

    .section-subtitle-long {
        position: relative;
        max-height: 22em;
        overflow: hidden;
    }

    .section-subtitle-long::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 4.5em;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 90%);
        pointer-events: none;
    }

    .intro-more-label {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 0 var(--gap-40);
        margin-top: 4px;
        border-radius: 30px;
        font-weight: 600;
        font-size: 14px;
        color: var(--color-secondary);
        text-decoration: underline;
        cursor: pointer;
    }

    .intro-more-toggle:checked ~ .section-subtitle-long {
        max-height: none;
    }

    .intro-more-toggle:checked ~ .section-subtitle-long::after,
    .intro-more-toggle:checked ~ .intro-more-label {
        display: none;
    }

    .offer-list-section .aside-toggle.aside-open {
        margin-top: var(--gap-25);
    }
}

/* ------------------------------------------------------------------ cennik ośrodka (kategoria z tabelą cen) */

.offer-list-table table {
    width: 100%;
}

.offer-list-table table td,
.offer-list-table table th {
    padding: 6px 8px;
    overflow-wrap: break-word;
}

.offer-list-table h2 {
    font-size: calc(var(--font-25) + 2px);
}

@media screen and (max-width: 480px) {
    .offer-list-table {
        font-size: 14px;
    }
}
