/* ==========================================================================
   Connect page (/site/connect) — editorial redesign.
   Page-scoped: every rule lives under .cx, and the font families below use
   Connect-only names, so no other page's typography or layout changes.
   Layout widths follow the shared site grid (site-grid.css --bk-* tokens).
   ========================================================================== */

/* Self-hosted faces, registered under page-only family names. */
@font-face { font-family: "BK Connect Sans"; src: url("../fonts/Satoshi-Regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "BK Connect Sans"; src: url("../fonts/Satoshi-Medium.woff") format("woff"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "BK Connect Sans"; src: url("../fonts/Satoshi-Bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
/* JetBrains Mono — SIL Open Font License 1.1, see ../fonts/jetbrains-mono/OFL.txt */
@font-face { font-family: "BK Connect Mono"; src: url("../fonts/jetbrains-mono/JetBrainsMono-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

.cx {
    --cx-paper: #FBFAF8;
    --cx-paper-2: #F3F2EE;
    --cx-ink: #0C0C0E;
    --cx-red: #F92C4D;
    --cx-muted: #57554F;
    --cx-line: rgba(12, 12, 14, 0.12);
    --cx-sans: "BK Connect Sans", "Satoshi", system-ui, -apple-system, sans-serif;
    --cx-mono: "BK Connect Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --cx-display: "Druk Super", Impact, "Arial Narrow", sans-serif;
    --cx-display-text: "Druk Text Bold", Impact, "Arial Narrow", sans-serif;
    --cx-ease: cubic-bezier(0.22, 1, 0.36, 1);
    background: var(--cx-paper);
    color: var(--cx-ink);
    font-family: var(--cx-sans);
    -webkit-font-smoothing: antialiased;
}
.cx *, .cx *::before, .cx *::after { box-sizing: border-box; }
.cx a { color: inherit; text-decoration: none; }
.cx :focus-visible { outline: 2px solid var(--cx-ink); outline-offset: 3px; }
.cx-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── Shared atoms ─────────────────────────────────────────────────────────── */
.cx-mono { font-family: var(--cx-mono); font-size: 12px; line-height: 1.35; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 400; }
.cx-label-row { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--cx-line); color: var(--cx-muted); }
.cx-display { font-family: var(--cx-display); font-weight: 900; line-height: 0.88; text-transform: uppercase; letter-spacing: 0; margin: 0; }
.cx-contrast { font-family: var(--cx-sans); font-weight: 500; line-height: 0.92; letter-spacing: -0.06em; margin: 0; text-transform: none; }
.cx-pill { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; font-family: var(--cx-sans); white-space: nowrap; transition: background-color .2s var(--cx-ease), color .2s var(--cx-ease), border-color .2s var(--cx-ease), transform .2s var(--cx-ease); }
.cx-pill svg { flex-shrink: 0; transition: transform .25s var(--cx-ease); }
.cx .cx-btn-dark { background: var(--cx-ink); color: #fff; font-weight: 700; }
.cx .cx-btn-dark:hover { background: #2a2a2e; }
.cx .cx-btn-outline { border: 1px solid var(--cx-ink); color: var(--cx-ink); font-weight: 500; background: transparent; }
.cx .cx-btn-outline:hover { background: var(--cx-ink); color: #fff; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.cx-hero { padding-block: calc(var(--site-header-height, 76px) + 48px) 72px; }
.cx-hero__head { margin-top: 48px; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: clamp(24px, 4vw, 56px); align-items: end; }
/* The <h1> keeps both headline lines; display:contents lets the intro sit beside line two. */
.cx-hero__h1 { display: contents; }
.cx-hero__l1 { grid-column: 1 / -1; display: block; font-size: clamp(64px, 12.5vw, 180px); }
.cx-hero__l2 { grid-column: 1; display: block; font-size: clamp(56px, 12.5vw, 180px); color: var(--cx-red); padding-bottom: 0.06em; }
.cx-hero__intro { grid-column: 2; margin: 0 0 clamp(8px, 1.4vw, 20px); max-width: 44ch; font-size: clamp(17px, 1.4vw, 20px); line-height: 1.5; font-weight: 500; }

/* ── Featured ─────────────────────────────────────────────────────────────── */
.cx-featured { padding-block: 0 72px; }
.cx-featured__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--bk-gap, 32px); margin-top: 24px; }
.cx-feature { display: flex; flex-direction: column; gap: 14px; padding: 28px 0 32px; border-top: 1.5px solid var(--cx-ink); }
.cx-feature__meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--cx-muted); }
.cx-feature__title { margin: 0; font-family: var(--cx-display-text); font-weight: 700; font-size: clamp(30px, 3vw, 44px); line-height: 0.98; text-transform: uppercase; transition: color .2s var(--cx-ease); }
.cx-feature:hover .cx-feature__title { color: var(--cx-red); }
.cx-feature__desc { margin: 0; color: var(--cx-muted); font-size: 16px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cx-feature__where { color: var(--cx-muted); font-size: 14px; font-weight: 500; }

/* ── Filters ──────────────────────────────────────────────────────────────── */
.cx-filters { background: var(--cx-paper-2); border-top: 1.5px solid var(--cx-ink); padding-block: 24px; }
.cx-filters__row { display: flex; align-items: center; gap: 8px; }
.cx-filters__row + .cx-filters__row { margin-top: 16px; }
.cx-filters__label { flex: 0 0 64px; color: var(--cx-ink); }
.cx-filters__pills { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.cx-chip { padding: 10px 16px; font-size: 14px; font-weight: 500; color: var(--cx-ink); border: 1px solid var(--cx-line); background: transparent; cursor: pointer; }
.cx-chip--sm { padding: 8px 14px; font-size: 13px; }
.cx-chip:hover { border-color: var(--cx-ink); }
.cx-chip[aria-pressed="true"] { background: var(--cx-ink); border-color: var(--cx-ink); color: var(--cx-paper); font-weight: 700; }

/* ── Event list ───────────────────────────────────────────────────────────── */
.cx-events { padding-block: 72px 120px; }
.cx-events__flow { display: flex; flex-direction: column; gap: 56px; }
.cx-day { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; }
.cx-day__date { display: flex; flex-direction: column; gap: 8px; }
.cx-day__big { display: flex; align-items: flex-end; gap: 10px; }
.cx-day__num { font-size: 120px; line-height: 0.82; transition: color .2s; }
.cx-day__month { font-family: var(--cx-display-text); font-weight: 700; font-size: 32px; line-height: 0.95; text-transform: uppercase; }
.cx-day__weekday { color: var(--cx-muted); }
/* Large day number carries the red; the 12px label stays ink for AA contrast, with a decorative red dot. */
.cx-day.is-today .cx-day__num { color: var(--cx-red); }
.cx-day.is-today .cx-day__weekday { color: var(--cx-ink); }
.cx-day__today::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 6px 1px 4px; border-radius: 50%; background: var(--cx-red); }
.cx-day__list { border-top: 1.5px solid var(--cx-ink); }

.cx-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 32px; align-items: center; padding-block: 28px; border-bottom: 1px solid var(--cx-line); transition: background-color .2s var(--cx-ease); }
.cx-row:hover { background: rgba(12, 12, 14, 0.025); }
.cx-row__meta { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.cx-tag { display: inline-block; padding: 5px 10px; border-radius: 999px; background: var(--cx-paper-2); font-size: 11px; }
.cx-row__text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cx-row__title { margin: 0; font-size: 26px; font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; transition: color .2s var(--cx-ease); overflow-wrap: anywhere; }
.cx-row:hover .cx-row__title { color: var(--cx-red); }
.cx-row__where { display: flex; align-items: center; gap: 6px; color: var(--cx-muted); font-size: 14px; font-weight: 500; }
.cx-row__desc { margin: 0; color: var(--cx-muted); font-size: 16px; line-height: 1.5; max-width: 72ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cx-row__details { padding: 12px 20px; font-size: 14px; }
.cx .cx-row:hover .cx-row__details { background: var(--cx-ink); color: #fff; }
.cx-row:hover .cx-row__details svg { transform: translate(2px, -2px); }

/* Inline promo — in normal document flow (never sticky / overlaid). */
.cx-promo { display: flex; align-items: center; gap: 24px; padding: 28px 36px; border-radius: 4px; background: var(--cx-red); color: #fff; }
.cx-promo__title { flex: 1; margin: 0; font-family: var(--cx-display-text); font-weight: 700; font-size: clamp(26px, 2.3vw, 32px); line-height: 0.98; text-transform: uppercase; }
.cx-promo__cta { padding: 14px 22px; font-size: 15px; }
.cx-promo__cta:hover svg { transform: translateX(3px); }

.cx-more { display: flex; justify-content: center; margin-top: 56px; }
.cx-more__btn { padding: 18px 32px; font-size: 16px; cursor: pointer; }
.cx-more__btn:hover svg { transform: translateY(2px); }
.cx-empty { padding-block: 64px; text-align: center; }
.cx-empty__title { font-size: clamp(48px, 6vw, 88px); }
.cx-empty__text { margin: 16px auto 0; max-width: 42ch; color: var(--cx-muted); font-size: 18px; line-height: 1.5; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.cx-forms { background: var(--cx-paper-2); padding-block: 112px; }
.cx-forms__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(var(--bk-gap, 32px) * 2); margin-top: 56px; }
.cx-form__kicker { color: var(--cx-ink); margin: 0 0 16px; }
.cx-form__title { margin: 0 0 12px; font-family: var(--cx-display-text); font-weight: 700; font-size: clamp(36px, 3.6vw, 56px); line-height: 0.95; text-transform: uppercase; }
.cx-form__lede { margin: 0 0 32px; color: var(--cx-muted); font-size: 17px; line-height: 1.55; max-width: 46ch; }
.cx-form { display: flex; flex-direction: column; gap: 12px; }
.cx-form__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cx-input { width: 100%; height: 56px; padding: 0 18px; border: 1px solid rgba(12, 12, 14, 0.2); border-radius: 4px; background: var(--cx-paper); color: var(--cx-ink); font-family: var(--cx-sans); font-size: 16px; transition: border-color .2s; }
.cx-input::placeholder { color: var(--cx-muted); opacity: 1; }
.cx-input:focus { outline: none; border-color: var(--cx-ink); box-shadow: 0 0 0 1px var(--cx-ink); }
.cx-form__error { margin: 6px 0 0; color: #B3112F; font-size: 13px; font-weight: 500; }
.cx-form__submit { justify-content: center; margin-top: 8px; padding: 18px 28px; font-size: 16px; border: 0; cursor: pointer; }
.cx-form__success { margin: 0; padding: 20px 22px; border-left: 3px solid #157F3B; background: var(--cx-paper); color: #145C2E; font-weight: 500; }

/* ── Final CTA ────────────────────────────────────────────────────────────── */
.cx-cta { background: var(--cx-red); padding-block: clamp(96px, 11vw, 160px); overflow: hidden; }
.cx-cta__labels { color: var(--cx-ink); border-bottom-color: rgba(12, 12, 14, 0.2); }
.cx-cta__head { margin: 56px 0; }
.cx-cta__head .cx-display { font-size: clamp(52px, 10.4vw, 150px); color: #fff; }
.cx-cta__head .cx-contrast { font-size: clamp(48px, 10.4vw, 150px); color: var(--cx-ink); }
.cx-cta__row { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; }
.cx-cta__body { margin: 0; max-width: 440px; font-size: 19px; line-height: 1.55; color: var(--cx-ink); }
.cx-cta__btn { padding: 24px 36px; font-size: 19px; }
.cx-cta__btn:hover svg { transform: translateX(4px); }

/* ── Tablet ───────────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
    .cx-day { grid-template-columns: 150px minmax(0, 1fr); gap: 32px; }
    .cx-day__num { font-size: 88px; }
    .cx-day__month { font-size: 26px; }
    .cx-row { grid-template-columns: 130px minmax(0, 1fr) auto; gap: 24px; }
    .cx-row__title { font-size: 23px; }
    .cx-hero__head { grid-template-columns: minmax(0, 1fr); }
    .cx-hero__intro { grid-column: 1; margin-top: 24px; }
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */
/* ── Phones (Pen "Connect — Mobile (390)") ──────────────────────────────── */
@media (max-width: 760px) {
    .cx-hero { padding-block: calc(var(--site-header-height, 76px) + 24px) 28px; }
    .cx-hero__head { margin-top: 20px; }
    .cx-featured__grid, .cx-forms__grid { grid-template-columns: 1fr; }
    .cx-form__pair { grid-template-columns: 1fr; }

    /* Filters: one sticky bar, label + a swipeable row of chips per filter. */
    .cx-filters { position: sticky; top: 64px; /* phone header height (site-chrome.css) */ z-index: 5; padding-block: 12px; border-top: 1px solid var(--cx-line); border-bottom: 1px solid var(--cx-line); background: var(--cx-paper); }
    .cx-filters__row { flex-direction: row; align-items: center; gap: 10px; }
    .cx-filters__row + .cx-filters__row { margin-top: 8px; }
    .cx-filters__label { flex: 0 0 40px; font-size: 10px; color: var(--cx-muted); }
    .cx-filters__pills { position: relative; flex: 1; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: calc(var(--bk-edge, 20px) * -1); padding-right: var(--bk-edge, 20px); }
    .cx-filters__pills::-webkit-scrollbar { display: none; }
    .cx-chip { flex-shrink: 0; padding: 8px 13px; }

    /* Events: compact rows (meta, title, venue) with a round arrow; the whole row is the link. */
    .cx-events { padding-block: 24px 56px; }
    .cx-events__flow { gap: 32px; }
    .cx-day { grid-template-columns: 1fr; gap: 0; }
    .cx-day__date { flex-direction: row; align-items: flex-end; justify-content: space-between; padding-bottom: 10px; }
    .cx-day__num { font-size: 52px; }
    .cx-day__month { font-size: 20px; }
    .cx-row { grid-template-columns: minmax(0, 1fr) 36px; column-gap: 14px; row-gap: 6px; padding-block: 16px; }
    .cx-row__meta { grid-column: 1; flex-direction: row; align-items: center; gap: 8px; }
    .cx-row__text { grid-column: 1; }
    .cx-row__title { font-size: 18px; line-height: 1.2; }
    .cx-row__where { font-size: 13px; }
    .cx-row__desc { display: none; }
    .cx-row__details { grid-column: 2; grid-row: 1 / span 2; justify-self: end; justify-content: center; width: 36px; height: 36px; padding: 0; font-size: 0; gap: 0; }
    .cx-row__details svg { width: 16px; height: 16px; }

    .cx-promo { flex-direction: column; align-items: flex-start; padding: 22px; }

    /* Forms fold behind their titles (enhanced by the inline script). */
    .cx-forms { padding-block: 48px; }
    .cx-forms__grid { gap: 0; margin-top: 20px; border-top: 1.5px solid var(--cx-ink); }
    .cx-fold { position: relative; padding-block: 18px 22px; border-bottom: 1px solid var(--cx-line); }
    .cx-fold .cx-form__title { padding-right: 52px; }
    .cx-fold__toggle { position: absolute; top: 18px; right: 0; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--cx-ink); border-radius: 50%; background: var(--cx-ink); color: var(--cx-paper); cursor: pointer; }
    .cx-fold__toggle .cx-fold__plus { display: none; }
    .cx-fold.is-closed { padding-bottom: 18px; }
    .cx-fold.is-closed .cx-fold__toggle { border-color: var(--cx-line); background: transparent; color: var(--cx-ink); }
    .cx-fold.is-closed .cx-fold__plus { display: inline; }
    .cx-fold.is-closed > :not(.cx-form__kicker):not(.cx-form__title):not(.cx-fold__toggle) { display: none; }

    .cx-cta__row { flex-direction: column; align-items: stretch; gap: 28px; }
    .cx-cta__btn { justify-content: center; padding: 19px 24px; font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
    .cx *, .cx *::before, .cx *::after { transition-duration: 0.01ms !important; }
}
