/* ============================================================
   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 */
    }
}
