/* The block catalog (blocks/catalog.twig, blocks.js): a light page with just the logo, the block list beside the
   chosen block's examples. Each example is a frame drawn on the demo site. */

.bk {
    background: #fff;
    color: var(--lp-navy-dark);
    font-family: 'Open Sans', system-ui, sans-serif;
}

.bk-btn-red {
    background: var(--lp-red);
    border-color: var(--lp-red);
    color: #fff;
    font-weight: 600;
}
.bk-btn-red:hover, .bk-btn-red:focus-visible {
    background: var(--lp-red-dark);
    border-color: var(--lp-red-dark);
    color: #fff;
}

/* ── Top: the logo, and the way back (signed in) or to LeadPointe ── */
.bk-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--lp-border);
}
.bk-top__logo img { height: 34px; width: auto; display: block; }
.bk-top__nav { display: flex; align-items: center; gap: 16px; }
.bk-top__link { color: var(--lp-navy); font-weight: 600; text-decoration: none; font-size: .9rem; }
.bk-top__link:hover { text-decoration: underline; }

.bk-intro {
    max-width: 1320px;
    margin: 0 auto;
    padding: 28px 24px 8px;
}
.bk-intro h1 {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    color: var(--lp-navy);
    font-size: 2rem;
    margin: 0 0 6px;
}
.bk-intro p { color: var(--lp-text-muted); max-width: 720px; margin: 0; }

/* ── The choices: block (narrow screens), style, light or dark, screen ── */
.bk-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 24px;
    max-width: 1320px;
    margin: 16px auto 0;
    padding: 12px 24px;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--lp-border);
}
.bk-bar__field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.bk-bar__field > span { font-size: .75rem; font-weight: 600; color: var(--lp-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.bk-bar__field .form-select { min-width: 160px; }
.bk-bar__block { display: none; }

/* ── The list and the examples ── */
.bk-body {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 32px;
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px 24px 48px;
}
.bk-list {
    position: sticky;
    top: 84px;
    align-self: start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-right: 4px;
}
.bk-list__group {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--lp-text-muted);
    margin: 18px 0 6px;
}
.bk-list__group:first-child { margin-top: 0; }
.bk-list ul { list-style: none; margin: 0; padding: 0; }
.bk-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--lp-navy-dark);
    text-decoration: none;
    font-size: .92rem;
}
.bk-list a:hover { background: var(--lp-subtle); }
.bk-list a[aria-current="page"] { background: var(--lp-navy); color: #fff; font-weight: 600; }
.bk-list__count {
    font-size: .72rem;
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--lp-divider);
    color: var(--lp-text-muted);
    text-align: center;
}
.bk-list a[aria-current="page"] .bk-list__count { background: rgba(255, 255, 255, .2); color: #fff; }

.bk-main { min-width: 0; scroll-margin-top: 90px; }
.bk-head h2 {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    color: var(--lp-navy);
    font-size: 1.6rem;
    margin: 0 0 4px;
}
.bk-head p { color: var(--lp-text-muted); margin: 0 0 4px; max-width: 720px; }
.bk-head__count { font-size: .85rem; }

.bk-ex { margin-top: 28px; }
.bk-ex__head h3 { font-size: 1.05rem; font-weight: 700; color: var(--lp-navy-dark); margin: 0 0 2px; }
.bk-ex__head p { color: var(--lp-text-muted); font-size: .9rem; margin: 0 0 10px; }

.bk-ex__stage {
    position: relative;
    border: 1px solid var(--lp-border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--lp-subtle);
}
.bk-ex__stage.is-phone {
    width: 392px;
    max-width: 100%;
    margin: 0 auto;
    border: 8px solid var(--lp-navy-dark);
    border-radius: 28px;
}
.bk-ex__frame {
    display: block;
    width: 100%;
    height: 240px;
    border: 0;
    background: #fff;
    transition: height .15s ease;
}
.bk-ex__loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lp-icon-muted);
    background: var(--lp-subtle);
    pointer-events: none;
}
.bk-ex__stage.is-loaded .bk-ex__loading { display: none; }

.bk-ex__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px 16px;
    margin-top: 10px;
}
.bk-ex__more { color: var(--lp-navy); font-size: .9rem; font-weight: 600; }
.bk-ex__again { margin-right: auto; padding-left: 0; }

/* ── Visitors: the main site and See it in action ── */
.bk-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 20px;
    padding: 32px 24px;
    background: var(--lp-subtle);
    border-top: 1px solid var(--lp-border);
    text-align: center;
}
.bk-foot p { width: 100%; margin: 0; font-weight: 600; color: var(--lp-navy); }
.bk-foot__link { color: var(--lp-navy); font-weight: 600; }

/* ── Narrow screens: the block picker moves into the bar ── */
@media (max-width: 991.98px) {
    .bk-body { grid-template-columns: minmax(0, 1fr); padding-top: 16px; }
    .bk-list { display: none; }
    .bk-bar__block { display: flex; }
}
@media (max-width: 575.98px) {
    .bk-top, .bk-intro, .bk-bar, .bk-body { padding-left: 16px; padding-right: 16px; }
    .bk-intro h1 { font-size: 1.6rem; }
    /* On a phone the bar would cover a third of the screen: it stays at the top of the page instead */
    .bk-bar { position: static; gap: 10px 16px; }
    .bk-bar__field .form-select { min-width: 0; }
    .bk-bar__block { flex: 1 1 100%; }
    .bk-ex__stage.is-phone { border-width: 0; border-radius: 10px; }
    .bk-ex__foot { justify-content: flex-start; }
}
