/* ===========================================================
   Public calendar + events  (scoped under .cal — see landing.css)
   Brand indigo #3f51b5. Additive only: nothing here leaks outside .cal.
   =========================================================== */

.cal {
    --cal-ink: #1f2430;
    --cal-muted: #6b7280;
    --cal-line: #e6e8ef;
    --cal-brand: #3f51b5;
    --cal-closed: #fff1f2;
    --cal-closed-ink: #be123c;
    --cal-today: #eef2ff;
    --cal-card: #fff;
    font-family: inherit;
    color: var(--cal-ink);
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 16px 64px;
}

/* ---------- header ---------- */
.cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.cal-head__title {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.3px;
}

.cal-head__sub {
    margin: 4px 0 0;
    color: var(--cal-muted);
    font-size: 14px;
}

.cal-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cal-nav__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--cal-line);
    background: #fff;
    color: var(--cal-ink);
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

    .cal-nav__btn:hover {
        background: var(--cal-today);
        border-color: var(--cal-brand);
        transform: translateY(-1px);
    }

.cal-nav__label {
    min-width: 168px;
    text-align: center;
    font-weight: 700;
    font-size: 17px;
}

.cal-nav__today {
    padding: 0 14px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    border-radius: 10px;
    background: var(--cal-brand);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
}

    .cal-nav__today:hover { color: #fff; opacity: .92; }

/* ---------- legend ---------- */
.cal-legend {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin: 0 0 14px;
    font-size: 12.5px;
    color: var(--cal-muted);
}

.cal-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.cal-legend__dot {
    width: 11px;
    height: 11px;
    border-radius: 3px;
    display: inline-block;
}

/* ---------- grid ---------- */
.cal-grid {
    background: var(--cal-card);
    border: 1px solid var(--cal-line);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 14px rgba(31,36,48,.05);
}

.cal-grid__dow,
.cal-grid__days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.cal-grid__dow {
    background: #fafbfc;
    border-bottom: 1px solid var(--cal-line);
}

    .cal-grid__dow span {
        padding: 12px 8px;
        text-align: center;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: .6px;
        text-transform: uppercase;
        color: var(--cal-muted);
    }

        .cal-grid__dow span.is-weekend { color: var(--cal-closed-ink); }

.cal-day {
    min-height: 116px;
    padding: 8px;
    border-right: 1px solid var(--cal-line);
    border-bottom: 1px solid var(--cal-line);
    position: relative;
    background: #fff;
}

    .cal-day:nth-child(7n) { border-right: none; }

.cal-grid__days > .cal-day:nth-last-child(-n+7) { border-bottom: none; }

.cal-day.is-out { background: #fcfcfd; }

    .cal-day.is-out .cal-day__num { color: #c9ced8; }

.cal-day.is-closed { background: var(--cal-closed); }

.cal-day.is-today { background: var(--cal-today); }

.cal-day__num {
    font-size: 13px;
    font-weight: 700;
    color: var(--cal-ink);
    width: 26px;
    height: 26px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
}

.cal-day.is-today .cal-day__num {
    background: var(--cal-brand);
    color: #fff;
}

.cal-day.is-closed .cal-day__num { color: var(--cal-closed-ink); }

.cal-day__holiday {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--cal-closed-ink);
    line-height: 1.25;
    word-break: break-word;
}

/* event chip inside a day cell */
.cal-ev {
    display: block;
    margin-top: 5px;
    padding: 4px 7px;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: transform .12s ease, box-shadow .12s ease;
}

    .cal-ev:hover {
        color: #fff;
        transform: translateY(-1px);
        box-shadow: 0 4px 10px rgba(31,36,48,.18);
    }

    .cal-ev.is-soldout { opacity: .55; text-decoration: line-through; }

.cal-ev__time {
    opacity: .85;
    font-weight: 600;
    margin-right: 4px;
}

/* ---------- upcoming ---------- */
.cal-up {
    margin-top: 38px;
}

.cal-up__title {
    font-size: 21px;
    font-weight: 800;
    margin: 0 0 16px;
}

.cal-up__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.cal-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--cal-line);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .16s ease, box-shadow .16s ease;
}

    .cal-card:hover {
        color: inherit;
        transform: translateY(-3px);
        box-shadow: 0 12px 28px rgba(31,36,48,.12);
    }

.cal-card__img {
    height: 148px;
    background: #f1f3f7 center/cover no-repeat;
    position: relative;
}

.cal-card__accent {
    height: 4px;
}

.cal-card__body { padding: 14px 16px 16px; }

.cal-card__date {
    font-size: 12px;
    font-weight: 700;
    color: var(--cal-brand);
    text-transform: uppercase;
    letter-spacing: .4px;
}

.cal-card__title {
    margin: 6px 0 8px;
    font-size: 16.5px;
    font-weight: 800;
    line-height: 1.35;
}

.cal-card__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--cal-muted);
    margin-bottom: 4px;
}

.cal-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    gap: 8px;
}

/* ---------- badges ---------- */
.cal-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.cal-badge--free { background: #dcfce7; color: #166534; }
.cal-badge--price { background: #eef2ff; color: #3730a3; }
.cal-badge--left { background: #fff7ed; color: #9a3412; }
.cal-badge--soldout { background: #fee2e2; color: #991b1b; }
.cal-badge--few { background: #fef3c7; color: #92400e; }

/* ---------- empty ---------- */
.cal-empty {
    padding: 46px 20px;
    text-align: center;
    color: var(--cal-muted);
    border: 1px dashed #d5d9e2;
    border-radius: 14px;
}

/* ===========================================================
   Event detail
   =========================================================== */
.cev {
    max-width: 1060px;
    margin: 0 auto;
    padding: 24px 16px 72px;
    color: #1f2430;
}

.cev-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 16px;
}

    .cev-back:hover { color: #3f51b5; }

/* Posters are any shape — portrait A4 flyers as often as landscape banners.
   Never crop: fit the whole image inside the box, bounded by the viewport
   height so a tall poster doesn't push the page content off-screen. */
.cev-hero {
    border-radius: 18px;
    overflow: hidden;
    background: #f1f3f7;
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cev-hero__img {
    display: block;
    max-width: 100%;
    max-height: 78vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.cev-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: start;
}

.cev-title {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 14px;
    letter-spacing: -.4px;
}

.cev-meta {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 22px;
}

.cev-meta__row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: #414855;
}

    .cev-meta__row i {
        width: 20px;
        color: #3f51b5;
        text-align: center;
    }

/* Authored in the admin's rich-text editor, so this is real HTML now — no
   `white-space: pre-wrap`, which would double every <p>'s spacing. */
.cev-body {
    font-size: 15.5px;
    line-height: 1.75;
    color: #3a4150;
}

    .cev-body p { margin: 0 0 14px; }
    .cev-body p:last-child { margin-bottom: 0; }

    .cev-body h1, .cev-body h2, .cev-body h3, .cev-body h4 {
        margin: 26px 0 10px;
        font-weight: 800;
        line-height: 1.3;
        color: #1f2430;
    }

    .cev-body h1 { font-size: 24px; }
    .cev-body h2 { font-size: 21px; }
    .cev-body h3 { font-size: 18px; }
    .cev-body h4 { font-size: 16px; }

    .cev-body ul, .cev-body ol { margin: 0 0 14px; padding-left: 22px; }
    .cev-body li { margin-bottom: 6px; }

    .cev-body a { color: #3f51b5; text-decoration: underline; }
    .cev-body a:hover { color: #2c3a91; }

    .cev-body strong, .cev-body b { font-weight: 700; color: #1f2430; }

    .cev-body img {
        max-width: 100%;
        height: auto;
        border-radius: 10px;
        margin: 10px 0;
    }

    .cev-body blockquote {
        margin: 16px 0;
        padding: 10px 16px;
        border-left: 3px solid #3f51b5;
        background: #f7f8fb;
        border-radius: 0 8px 8px 0;
        color: #4b5563;
    }

    .cev-body table { width: 100%; border-collapse: collapse; margin: 14px 0; }
    .cev-body th, .cev-body td { border: 1px solid #e6e8ef; padding: 8px 10px; text-align: left; }

/* ---------- buy panel ---------- */
.cev-buy {
    position: sticky;
    top: 90px;
    border: 1px solid #e6e8ef;
    border-radius: 16px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 6px 24px rgba(31,36,48,.07);
}

.cev-buy__price {
    font-size: 30px;
    font-weight: 900;
    color: #1f2430;
    line-height: 1;
}

.cev-buy__unit {
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
    margin-left: 4px;
}

.cev-buy__seats {
    margin: 14px 0 6px;
    font-size: 13.5px;
    font-weight: 700;
}

.cev-bar {
    height: 7px;
    border-radius: 4px;
    background: #eef0f4;
    overflow: hidden;
    margin-bottom: 16px;
}

.cev-bar__fill {
    height: 100%;
    background: linear-gradient(90deg,#16a34a,#22c55e);
    transition: width .4s ease;
}

    .cev-bar__fill.is-low { background: linear-gradient(90deg,#f59e0b,#fbbf24); }
    .cev-bar__fill.is-out { background: #ef4444; }

.cev-field { margin-bottom: 12px; }

.cev-field__label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: #4b5563;
    margin-bottom: 5px;
}

/* style.css declares `input[type="email"] { border:0; background:none; height:66px }`
   — specificity (0,1,1), which beats a bare `.cev-input` class (0,1,0) whatever the
   load order. Qualifying with `.cev` (0,2,0) is what makes these fields visible. */
.cev .cev-input {
    width: 100%;
    box-sizing: border-box;
    height: 46px;
    padding: 0 13px;
    border: 1px solid #cdd2dc;
    border-radius: 10px;
    font-size: 14.5px;
    font-weight: 500;
    color: #1f2430;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(22,27,51,.05);
    transition: border-color .15s ease, box-shadow .15s ease;
}

    .cev .cev-input::-webkit-input-placeholder { color: #a3a9b6; font-weight: 400; }
    .cev .cev-input::placeholder { color: #a3a9b6; font-weight: 400; }

    .cev .cev-input:hover { border-color: #b3bac7; }

    .cev .cev-input:focus {
        outline: none;
        border-color: #3f51b5;
        background: #fff;
        box-shadow: 0 0 0 3px rgba(63,81,181,.16);
    }

.cev-qty {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cev-qty__btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid #d9dde5;
    background: #fff;
    font-size: 19px;
    font-weight: 700;
    color: #3f51b5;
    cursor: pointer;
    line-height: 1;
}

    .cev-qty__btn:disabled { opacity: .4; cursor: not-allowed; }

.cev-qty__val {
    flex: 1;
    text-align: center;
    font-size: 19px;
    font-weight: 800;
}

.cev-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 16px 0 14px;
    padding-top: 14px;
    border-top: 1px dashed #e0e3ea;
    font-weight: 800;
}

.cev-btn {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg,#3f51b5,#5c6bc0);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .14s ease, box-shadow .14s ease, opacity .14s ease;
}

    .cev-btn:hover:not(:disabled) {
        transform: translateY(-1px);
        box-shadow: 0 8px 22px rgba(63,81,181,.34);
    }

    .cev-btn:disabled {
        background: #cbd0da;
        cursor: not-allowed;
    }

.cev-note {
    margin-top: 10px;
    font-size: 12px;
    color: #8a919e;
    line-height: 1.5;
    text-align: center;
}

.cev-err {
    margin-top: 10px;
    padding: 9px 12px;
    border-radius: 9px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 13px;
    font-weight: 600;
    display: none;
}

/* ---------- QPay modal ---------- */
.cev-modal {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15,18,26,.62);
}

    .cev-modal.is-open { display: flex; }

.cev-modal__box {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 18px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0,0,0,.32);
    max-height: 92vh;
    overflow-y: auto;
}

.cev-modal__title {
    font-size: 19px;
    font-weight: 800;
    margin: 0 0 4px;
}

.cev-modal__sub {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 16px;
}

.cev-qr {
    width: 224px;
    height: 224px;
    margin: 0 auto 14px;
    border: 1px solid #e6e8ef;
    border-radius: 12px;
    padding: 8px;
    background: #fff;
}

    .cev-qr img { width: 100%; height: 100%; object-fit: contain; }

.cev-timer {
    font-size: 13px;
    font-weight: 700;
    color: #9a3412;
    background: #fff7ed;
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.cev-apps {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
    gap: 8px;
    margin: 12px 0;
    max-height: 180px;
    overflow-y: auto;
}

.cev-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 7px 3px;
    border: 1px solid #eceef3;
    border-radius: 10px;
    text-decoration: none;
    color: #414855;
    font-size: 10.5px;
    font-weight: 600;
}

    .cev-app:hover { border-color: #3f51b5; color: #3f51b5; }
    .cev-app img { width: 32px; height: 32px; border-radius: 8px; }

.cev-modal__close {
    margin-top: 8px;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 13.5px;
    cursor: pointer;
    text-decoration: underline;
}

/* ---------- success ---------- */
.cev-ok__icon {
    font-size: 48px;
    color: #16a34a;
    margin-bottom: 6px;
}

.cev-code {
    border: 2px dashed #3f51b5;
    border-radius: 12px;
    padding: 14px;
    margin: 10px 0;
    font-size: 30px;
    font-weight: 900;
    letter-spacing: 9px;
    color: #3f51b5;
    font-family: "Courier New", monospace;
}

.cev-spin {
    width: 26px;
    height: 26px;
    margin: 10px auto;
    border: 3px solid #e6e8ef;
    border-top-color: #3f51b5;
    border-radius: 50%;
    animation: cev-spin 0.8s linear infinite;
}

@keyframes cev-spin { to { transform: rotate(360deg); } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .cev-grid { grid-template-columns: 1fr; }
    .cev-buy { position: static; }
    .cev-title { font-size: 26px; }
}

@media (max-width: 720px) {
    .cal { padding: 18px 10px 48px; }
    .cal-day { min-height: 84px; padding: 5px; }
    .cal-day__num { width: 22px; height: 22px; font-size: 12px; }
    .cal-day__holiday { display: none; }
    .cal-ev { font-size: 0; padding: 0; height: 6px; border-radius: 3px; margin-top: 3px; }
    .cal-ev__time { display: none; }
    .cal-nav__label { min-width: 120px; font-size: 15px; }
    .cal-head__title { font-size: 23px; }
}
