/* Кінцевий банер Клубу Читомо (.ceb) і попап контактів (.cep).
   functions/club-end-banner.php, template-parts/club-end-banner.php, template-parts/club-end-popup.php.
   Розміри — Figma club_chytomo banners, фрейм «варіанти кінцевого банеру» (банер 771×197).
   Попап — копія стилів .popup_wrap зі styles/cytomo-club.css (той підключається лише на сторінках Клубу/Пасу). */

@font-face {
    font-family: 'Croogla 4F';
    src: url('../fonts/Croogla4F.woff2') format('woff2'),
    url('../fonts/Croogla4F.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* окрема назва сімейства з двома накресленнями — щоб не конфліктувати з 'Museo Sans Cyrl' у club-banners.css */
@font-face {
    font-family: 'CEB Museo';
    src: url('../fonts/MuseoSansCyrl-500.woff2') format('woff2'),
    url('../fonts/MuseoSansCyrl-500.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'CEB Museo';
    src: url('../fonts/MuseoSansCyrl-700.woff2') format('woff2'),
    url('../fonts/MuseoSansCyrl-700.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'CEB Museo';
    src: url('../fonts/MuseoSansCyrl-900.woff2') format('woff2'),
    url('../fonts/MuseoSansCyrl-900.woff') format('woff');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* ---------- банер ---------- */

.ceb {
    box-sizing: border-box;
    position: relative;
    clear: both;
    max-width: 771px;
    margin: 32px 0 0;
    padding: 8px 0 8px 10px;
    color: #000;
    font-family: 'CEB Museo', 'museo medium', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.2;
    text-align: left;
}

.ceb *,
.ceb *::before,
.ceb *::after {
    box-sizing: border-box;
}

/* біла підкладка заголовка ховає верх жовтої рамки і лівий верхній кут чорної — як у макеті */
.ceb__title {
    position: absolute;
    top: 0;
    left: 0;
    right: 263px;
    z-index: 2;
    min-height: 35px;
    padding: 6px 10px 0;
    background: #fff;
    font-weight: 900;
    font-size: 16px;
    line-height: 19px;
}

.ceb__body {
    display: flex;
    align-items: stretch;
}

.ceb__text {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 172px;
    margin-bottom: 9px;
    padding: 30px 97px 20px 28px;
    border: 3px solid #FFDD00;
}

.ceb__text p {
    margin: 0;
    padding: 0;
    font: inherit;
    color: inherit;
}

.ceb__text p + p {
    margin-top: 19px;
}

.ceb__box {
    position: relative;
    z-index: 1;
    flex: 0 0 330px;
    min-height: 172px;
    margin: 9px 0 0 -67px;
    padding: 31px 20px 34px 36px;
    border: 3px solid #000;
    background: #fff;
}

.ceb__controls {
    display: flex;
    gap: 0;
}

.ceb__periods {
    flex: 0 0 147px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.ceb__legend {
    display: block;
    float: left; /* legend у fieldset інакше рендериться на рамці */
    width: 100%;
    margin: 0 0 12px;
    padding: 0 20px 0 0;
    font-weight: 700;
    font-size: 16px;
    line-height: 19px;
}

.ceb__radio {
    clear: both;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-weight: 700;
    line-height: 19px;
    cursor: pointer;
}

.ceb__radio input,
.ceb__pill input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.ceb__radio span::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    vertical-align: -2px;
    border: 2px solid #000;
    border-radius: 50%;
    background: #fff;
}

.ceb__radio input:checked + span::before {
    background: #000;
}

.ceb__radio input:focus-visible + span,
.ceb__pill input:focus-visible + span {
    outline: 2px solid #000;
    outline-offset: 2px;
}

.ceb__amounts {
    display: none;
    flex: 0 0 100px;
    flex-direction: column;
    gap: 10px;
}

.ceb__box[data-period="month"] .ceb__amounts[data-for="month"],
.ceb__box[data-period="once"] .ceb__amounts[data-for="once"] {
    display: flex;
}

.ceb__pill {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

.ceb__pill span,
.ceb__other {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 27px;
    margin: 0;
    padding: 0 6px;
    border: 2px solid #000;
    border-radius: 14px;
    background: #fff;
    color: #000;
    font-family: inherit;
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
    white-space: nowrap;
    transition: background-color .15s, color .15s;
}

.ceb__pill:hover span {
    background: #FFDD00;
}

.ceb__pill input:checked + span {
    background: #000;
    color: #fff;
}

/* «інша сума»: після вибору пігулка стає полем вводу */
.ceb__other {
    display: none;
    text-align: center;
    -moz-appearance: textfield;
}

.ceb__other::-webkit-outer-spin-button,
.ceb__other::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ceb__other::placeholder {
    color: rgba(0, 0, 0, .5);
}

.ceb__pill--other input:checked + span {
    display: none;
}

.ceb__pill--other input:checked ~ .ceb__other {
    display: flex;
}

.ceb__other.is-error {
    background: #FFDD00;
}

.ceb__button {
    position: absolute;
    left: 38px;
    bottom: -11px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 246px;
    height: 30px;
    margin: 0;
    padding: 5px 10px;
    border: 0;
    border-radius: 0;
    background: #FFDD00;
    box-shadow: 0 9px 5.5px -8px rgba(0, 0, 0, .25);
    color: #000;
    font-family: 'Croogla 4F', 'museo bold', Arial, sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 1;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}

.ceb__button:hover,
.ceb__button:focus-visible {
    background: #000;
    color: #FFDD00;
}

.ceb__box[data-period="month"] .ceb__button-once,
.ceb__box[data-period="once"] .ceb__button-month {
    display: none;
}

.ceb .donate-form-error {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -40px;
    margin: 0;
}

@media (max-width: 767px) {
    .ceb {
        padding: 0;
    }

    .ceb__title {
        position: static;
        min-height: 0;
        padding: 0 0 10px;
    }

    .ceb__body {
        flex-direction: column;
    }

    .ceb__text {
        min-height: 0;
        margin: 0 20px 0 0;
        padding: 20px 20px 40px;
    }

    .ceb__box {
        flex: 0 0 auto;
        min-height: 0;
        margin: -24px 0 0 20px;
        padding: 24px 20px 40px;
    }

    .ceb__periods {
        flex: 1 1 auto;
    }

    .ceb__button {
        left: 50%;
        transform: translateX(-50%);
        max-width: calc(100% - 20px);
    }
}

/* ---------- попап контактів (як .popup_wrap на сторінці Клубу) ---------- */

.cep {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: rgba(0, 0, 0, .71);
}

.cep[hidden] {
    display: none;
}

.cep *,
.cep *::before,
.cep *::after {
    box-sizing: border-box;
}

.cep__popup {
    position: relative;
    width: 100%;
    max-width: 680px;
    max-height: 100%;
    overflow-y: auto;
    padding: 50px;
    border: 2px solid #000;
    background: #fff;
    box-shadow: 0 28px 30.9px -19px rgba(0, 0, 0, .41);
    color: #000;
    font-family: 'CEB Museo', 'museo medium', Arial, sans-serif;
}

.cep__close {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.cep__title {
    margin-bottom: 15px;
    font-family: 'Croogla 4F', 'museo bold', Arial, sans-serif;
    font-weight: 700;
    font-size: 36px;
    line-height: 1;
    letter-spacing: .05em;
    text-align: center;
    text-transform: uppercase;
}

.cep__description {
    max-width: 458px;
    margin: 0 auto 30px;
    font-size: 20px;
    line-height: 1;
    text-align: center;
}

.cep__form input[type="email"],
.cep__form input[type="text"],
.cep__form input[type="tel"] {
    display: block;
    width: 100%;
    max-width: 445px;
    height: auto;
    margin: 0 auto 15px;
    padding: 10px;
    border: 2px solid #000;
    border-radius: 0;
    background: #fff;
    color: #000;
    font-family: inherit;
    font-size: 20px;
    line-height: 1.2;
}

.cep__form input[type="tel"] {
    margin-bottom: 10px;
}

.cep__form input::placeholder {
    color: #000;
    opacity: 1;
}

.cep__form input.error {
    background: #FFDD00;
}

.cep__form .error-text {
    max-width: 445px;
    margin: -10px auto 0;
    padding-bottom: 10px;
    font-size: 14px;
}

.cep__text {
    max-width: 580px;
    margin: 0 auto 10px;
    font-size: 14px;
    line-height: 1;
    text-align: center;
}

.cep__text--phone {
    margin-bottom: 30px;
}

.cep__button {
    display: table;
    margin: 0 auto 30px;
    padding: 15px 25px;
    border: 0;
    border-radius: 0;
    background: #000;
    color: #fff;
    font-family: 'Croogla 4F', 'museo bold', Arial, sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 1;
    letter-spacing: .1em;
    text-transform: uppercase;
    cursor: pointer;
    -webkit-appearance: none;
}

html.cep-open {
    overflow: hidden;
}

@media (max-width: 767px) {
    .cep__popup {
        padding: 40px 20px 20px;
    }

    .cep__title {
        font-size: 26px;
    }

    .cep__description {
        font-size: 16px;
    }
}
