/* ============================================================
   ck-tabs — Cookbook variation selector
   Matches the original recipe design: bordered card row with
   per-tab variation label, bold name, and italic subtitle.
   Scoped to .ck-tabs-wrapper only — no Salient overlap.
   ============================================================ */

/* ── Color tokens ───────────────────────────────────────── */
:root {
    --ck-ink:        #18160f;
    --ck-ink-3:      #8c8472;
    --ck-ink-4:      #b8b0a0;
    --ck-cream-2:    #f2ede3;
    --ck-cream-3:    #e6dfd0;
    --ck-rule:       rgba(0,0,0,0.09);
    --ck-teal:       #0f6e56;
    --ck-teal-bg:    #e4f4ef;
    --ck-purple:     #3c3489;
    --ck-purple-bg:  #eeedfe;
    --ck-amber:      #7a4800;
    --ck-amber-bg:   #fdf3e0;
}

/* ── Wrapper ────────────────────────────────────────────── */

.ck-tabs-wrapper {
    margin-bottom: 8px;
}

/* ── Tab navigation — the card-style selector row ───────── */

.ck-tabs-nav {
    display: flex;
    gap: 0;
    border: 1px solid var(--ck-rule);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 0 28px;
    background: var(--ck-cream-2);
}

/* ── Individual tab button ──────────────────────────────── */

.ck-tab-btn {
    flex: 1;
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    background: transparent;
    border-right: 1px solid var(--ck-rule);
    transition: background 0.15s ease;
    font-family: inherit;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    user-select: none;
}

.ck-tab-btn:last-child {
    border-right: none;
}

.ck-tab-btn:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.15);
}

/* Hover — inactive tabs only */
.ck-tab-btn:not(.ck-tab-active):hover {
    background: var(--ck-cream-3);
}

/* ── Active tab background by color ─────────────────────── */

.ck-tab-btn.ck-tab-active.ck-color-teal   { background: var(--ck-teal-bg); }
.ck-tab-btn.ck-tab-active.ck-color-purple { background: var(--ck-purple-bg); }
.ck-tab-btn.ck-tab-active.ck-color-amber  { background: var(--ck-amber-bg); }

/* ── Variation label (e.g. "VARIATION A") ───────────────── */

.ck-tab-variation {
    display: block;
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.ck-tab-btn:not(.ck-tab-active) .ck-tab-variation {
    color: var(--ck-ink-4);
}
.ck-tab-btn.ck-tab-active.ck-color-teal   .ck-tab-variation { color: var(--ck-teal); }
.ck-tab-btn.ck-tab-active.ck-color-purple .ck-tab-variation { color: var(--ck-purple); }
.ck-tab-btn.ck-tab-active.ck-color-amber  .ck-tab-variation { color: var(--ck-amber); }

/* ── Tab name (e.g. "Off-the-Shelf") ────────────────────── */

.ck-tab-name {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--ck-ink);
    line-height: 1.25;
    margin-bottom: 2px;
}

/* ── Subtitle (e.g. "Open data only · ~45 min") ─────────── */

.ck-tab-sub {
    display: block;
    font-size: 11px;
    color: var(--ck-ink-3);
    font-style: italic;
    line-height: 1.3;
}

/* ── Tab content container ──────────────────────────────── */

.ck-tabs-content {
    /* top spacing handled by .ck-tabs-nav margin-bottom */
}

/* ── Individual tab panel ───────────────────────────────── */

.ck-tab-panel {
    display: none;
}

.ck-tab-panel.ck-tab-active {
    display: block;
}

/* ── Recipe code & pre overrides ───────────────────────── */
/* Salient sets code to display:block — override it within  */
/* the recipe row only. Pre code keeps its own styling.     */

.ck-recipe-row code {
    display: inline !important;
    font-family: 'DM Mono', 'SF Mono', monospace;
    font-size: 12px;
    background: #f2ede3;
    border: 1px solid rgba(0,0,0,0.09);
    border-radius: 3px;
    padding: 1px 6px;
    color: #18160f;
    white-space: nowrap;
}

.ck-recipe-row pre {
    background: #18160f;
    border-radius: 6px;
    padding: 14px 18px;
    margin: 14px 0;
    overflow-x: auto;
}

.ck-recipe-row pre code {
    display: block !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    font-size: 13px;
    color: #a8e6cf;
    letter-spacing: 0.02em;
    white-space: pre-wrap;
}

/* ── [ck_bts] Behind The Scenes panel ──────────────────── */
/* Fully self-contained — no Salient classes, no conflicts.  */

.ck-bts-panel {
    background: #f2ede3;
    border: 1px solid rgba(0,0,0,0.09);
    border-radius: 7px;
    margin: 18px 0;
    overflow: hidden;
}

.ck-bts-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.09);
    cursor: pointer;
    user-select: none;
}

.ck-bts-icon {
    font-size: 13px;
    opacity: 0.5;
    color: #8c8472;
    flex-shrink: 0;
}

.ck-bts-label {
    font-family: monospace;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8c8472;
    flex: 1;
}

.ck-bts-toggle {
    font-family: monospace;
    font-size: 10px;
    color: #b8b0a0;
    flex-shrink: 0;
}

.ck-bts-body {
    padding: 14px 16px;
    font-size: 13px;
    color: #4a4637;
    line-height: 1.65;
}

.ck-bts-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ck-bts-body ul li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 5px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    font-size: 13px;
    color: #4a4637;
    line-height: 1.65;
    list-style: none;
}

.ck-bts-body ul li:last-child {
    border-bottom: none;
}

.ck-bts-body ul li::before {
    content: "→";
    color: #b8b0a0;
    font-family: monospace;
    font-size: 11px;
    flex-shrink: 0;
    margin-top: 3px;
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 640px) {
    .ck-tab-btn {
        padding: 11px 6px;
    }
    .ck-tab-name {
        font-size: 12px;
    }
    .ck-tab-sub {
        display: none; /* hide subtitle on small screens */
    }
}

/* ============================================================
   BRAND VARIANT — Obsidian & Ember (light beige surface)
   Opt-in: add class "ck-recipe-brand" to the recipe row.
   Everything below is scoped to .ck-recipe-brand, so the
   original cream cookbook styling is left fully intact for
   any page that does NOT carry this class.
   ============================================================ */

/* Re-point the package's color tokens to the brand palette.
   Custom properties cascade, so the tab nav, buttons, variation
   labels and active states all inherit these inside the wrapper. */
.ck-recipe-brand {
    --ck-ink:        #251E1A;   /* onyx headings/ink   */
    --ck-ink-3:      #8A8178;   /* muted               */
    --ck-ink-4:      #A39B91;   /* faint labels        */
    --ck-cream-2:    #FFFFFF;   /* nav / panel fill    */
    --ck-cream-3:    #E5E0DA;   /* hover fill          */
    --ck-teal:       #00767B;   /* Var A -> signal teal */
    --ck-teal-bg:    #E4FAFB;
    --ck-purple:     #C73D14;   /* Var B -> ember       */
    --ck-purple-bg:  #FDEFE9;
    --ck-amber:      #B86E00;   /* Var C -> brand amber */
    --ck-amber-bg:   #FEF5E6;
}

/* Brand display font on the tab selector (matches the page) */
.ck-recipe-brand .ck-tab-name,
.ck-recipe-brand .ck-tab-variation,
.ck-recipe-brand .ck-tab-sub {
    font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* BTS panels use hard-coded cream colors in the base rules —
   re-skin them for the brand surface. */
.ck-recipe-brand .ck-bts-panel        { background: #FFFFFF; }
.ck-recipe-brand .ck-bts-icon,
.ck-recipe-brand .ck-bts-label        { color: #8A8178; }
.ck-recipe-brand .ck-bts-toggle       { color: #A39B91; }
.ck-recipe-brand .ck-bts-body,
.ck-recipe-brand .ck-bts-body ul li   { color: #555555; }
.ck-recipe-brand .ck-bts-body ul li::before { color: #A39B91; }

/* Dark code blocks -> brand obsidian (if any <pre> is used) */
.ck-recipe-brand pre      { background: #0F0D0C; }
.ck-recipe-brand pre code { color: #00C0C7; }

/* ── Layout: full-bleed beige band, flush to nav & footer, wider content ──
   The row is full_width="stretch_row", but the beige (set on the .vc_row
   element) only spans the contained width, leaving white gutters + white
   gaps above/below. Force the whole band to the viewport width and paint
   Salient's bg layer too, then re-center the content at the site width.
   (Theme uses overflow:clip, so 100vw + negative margin won't scroll.) */
.ck-recipe-brand.vc_row {
    background: #F7F5F2 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    margin-top: 0 !important;      /* kill the banner's 40px white bar + row gap */
    margin-bottom: 0 !important;   /* flush to footer */
    padding-top: 64px !important;  /* beige breathing room under the nav  */
    padding-bottom: 64px !important;
    box-sizing: border-box !important;
}
/* paint Salient's own background layer so nothing shows through */
.ck-recipe-brand > .row-bg-wrap .row-bg,
.ck-recipe-brand .row-bg {
    background-color: #F7F5F2 !important;
    background-image: none !important;
    opacity: 1 !important;
}
/* drop the empty 1/6 spacer columns and Salient's side inset, then
   widen the 2/3 content column to the site's standard content width */
.ck-recipe-brand .vc_col-sm-2 { display: none !important; }
.ck-recipe-brand .row_col_wrap_12,
.ck-recipe-brand .col_wrapper {
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: none !important;
}
.ck-recipe-brand .vc_col-sm-8 {
    width: 100% !important;
    float: none !important;
    max-width: var(--max-content, 1150px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
