/*
 * cabbicore-public.css - the public site's design system.
 *
 * ONE definition of the shared chrome: tokens, nav, buttons, footer, forms,
 * alerts and page furniture. Every public page links this and defines only what
 * is genuinely its own.
 *
 * This file exists because the header partial was already shared while the CSS
 * behind it was not - each page carried its own copy, and the copies drifted.
 * The support page's nav buttons were 10x14 with a 10px radius while the home
 * page's were 10x16 with a 12px radius and a hover lift; the footer headings
 * were uppercase on one and not the other. Same markup, visibly different
 * header, which is exactly what got reported.
 *
 * Where the copies disagreed, the home page's values won - it is the reference
 * everything else was being compared against.
 *
 * tests/Feature/PublicLayoutConsistencyTest.php fails the build if a page
 * redefines anything in here locally, which is how the drift comes back.
 */

:root {
    --cbf-bg-0: #0b1d12;
    --cbf-bg-1: #0e2417;
    --cbf-bg-2: #0f3a23;
    --cbf-bg-3: #0f2619;
    --cbf-border: #1c3c28;
    --cbf-border-strong: #17442a;
    --cbf-text: #e9f9ef;
    --cbf-text-strong: #eafff0;
    --cbf-muted: #cfe9d7;
    --cbf-accent: #22c55e;
    --cbf-accent-strong: #40bb57;
    --cbf-danger: #ef4444;
    --cbf-warning: #f59e0b;
    --cbf-shadow: 0 24px 60px rgba(0,0,0,0.6);
    --cbf-radius-lg: 22px;
    --cbf-radius-md: 16px;
    --cbf-radius-sm: 12px;
    --cbf-radius-pill: 999px;
    --cbf-console-space: 0px;
    --cbf-font: "Sora", "Space Grotesk", sans-serif;
    --cbf-display: "Space Grotesk", "Sora", sans-serif;
    --cbf-mono: ui-monospace, Menlo, Consolas, monospace;
    --cbf-content-bg: #ffffff;
    --cbf-content-text: #0f172a;
    --cbf-content-muted: #475569;
    --cbf-content-border: #e2e8f0;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--cbf-font);
    color: var(--cbf-text);
    background:
        radial-gradient(900px 400px at 12% -10%, rgba(34,197,94,0.25), transparent 60%),
        radial-gradient(800px 420px at 110% 10%, rgba(14,68,42,0.5), transparent 55%),
        linear-gradient(180deg, var(--cbf-bg-0), #08120c 60%, #060f0a 100%);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.cbf-ui {
    font-family: var(--cbf-font);
    color: var(--cbf-text);
}

.cbf-container {
    width: min(1200px, 92vw);
    margin: 0 auto;
}

/* ---------------------------------------------------------------- nav ---- */

.cbf-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(18px);
    background: rgba(7, 17, 11, 0.7);
    border-bottom: 1px solid rgba(28, 60, 40, 0.4);
}

.cbf-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    gap: 16px;
}

.cbf-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cbf-brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid var(--cbf-border);
    background: linear-gradient(135deg, #0f2c1a, #0b1d12);
    display: grid;
    place-items: center;
    box-shadow: 0 10px 24px rgba(0,0,0,0.4);
}

.cbf-brand-icon img { width: 26px; height: 26px; }

.cbf-wordmark { height: 28px; }

.cbf-nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 14px;
    color: var(--cbf-muted);
}

.cbf-nav-links a {
    padding: 6px 4px;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.cbf-nav-links a:hover { color: var(--cbf-text-strong); }

.cbf-nav-cta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

/* ------------------------------------------------------------ buttons ---- */

.cbf-btn {
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid var(--cbf-border);
    background: var(--cbf-bg-2);
    color: var(--cbf-text);
    /* <button> doesn't inherit font-family from the page the way <a> does, and
       keeps native UA chrome (appearance/min-height) - with several .cbf-btn
       buttons sitting inline next to .cbf-btn anchors (see
       plugin-release-notes.blade.php), that mismatch showed up as the button
       rendering at a visibly different size and baseline than its neighbours. */
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.cbf-btn::after {
    content: "";
    position: absolute;
    inset: -40% auto -40% -65%;
    width: 42%;
    transform: rotate(18deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.24), transparent);
    opacity: 0;
    pointer-events: none;
}

.cbf-btn:hover {
    transform: translateY(-1px);
    border-color: var(--cbf-accent);
    background: #124b2c;
}

.cbf-btn:hover::after { animation: cbf-button-sheen 0.7s ease; }

.cbf-btn--accent {
    background: var(--cbf-accent);
    color: #05210f;
    border-color: var(--cbf-accent);
    font-weight: 700;
    box-shadow: 0 14px 30px rgba(34,197,94,0.25);
}

.cbf-btn--accent:hover {
    background: var(--cbf-accent-strong);
    border-color: var(--cbf-accent-strong);
    color: #05230f;
}

@keyframes cbf-button-sheen {
    0% { left: -65%; opacity: 0; }
    18%, 64% { opacity: 1; }
    100% { left: 125%; opacity: 0; }
}

/* ------------------------------------------------------------- footer ---- */

.cbf-footer {
    margin-top: 40px;
    padding: 40px 0 60px;
    border-top: 1px solid rgba(28, 60, 40, 0.4);
    background: rgba(7, 17, 11, 0.55);
}

.cbf-footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 20px;
}

.cbf-footer h4 {
    margin: 0 0 10px;
    font-size: 15px;
    color: var(--cbf-text-strong);
}

.cbf-footer a { color: var(--cbf-muted); font-size: 14px; }
.cbf-footer a:hover { color: var(--cbf-text-strong); }

/* ---------------------------------------------------- page furniture ---- */

.cbf-release-shell {
    min-height: 100vh;
    padding: 40px 20px 64px;
}

.cbf-page-header {
    margin: 0 0 28px;
    padding: 20px 22px;
    position: relative;
    border-radius: var(--cbf-radius-lg);
    border: 1px solid var(--cbf-border);
    background: linear-gradient(135deg, #0c2013 0%, #0a1710 60%, #08130d 100%);
    box-shadow: var(--cbf-shadow);
}

.cbf-page-header h1 {
    margin: 0 0 6px;
    font-weight: 800;
    font-size: clamp(22px, 3vw, 30px);
    color: var(--cbf-text-strong);
}

.cbf-page-header p {
    margin: 0;
    color: var(--cbf-muted);
    font-size: 13px;
}

.cbf-page-logo { text-align: center; margin-bottom: 12px; }

.cbf-page-search {
    position: absolute;
    right: 18px;
    bottom: 14px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.cbf-page-desc { color: var(--cbf-muted); font-size: 13px; margin-top: 8px; }
.cbf-page-desc p { margin: 0 0 6px; }
.cbf-page-desc ul { margin: 8px 0 0 1.1rem; padding: 0; }
.cbf-page-desc li { margin-bottom: 6px; line-height: 1.35; }
.cbf-desc-item { margin-bottom: 12px; }
.cbf-desc-title {
    font-weight: 700;
    color: var(--cbf-text-strong);
    margin: 0 0 6px;
    font-size: 14px;
}

/* The column every page sits in. Width is set here and nowhere else, so the
   header and the content below it cannot disagree about where the page edge
   is - which is what "weirdly out of line" turned out to be. */
.cbf-page {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
}

.cbf-page.cbf-main-wide {
    max-width: 1200px;
}

.cbf-release-shell main {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* --------------------------------------------------------------- cards --- */

/* The default panel. The home page elaborates this one class with its own
   hover and ::before treatment - that is a deliberate, documented exception
   (see PublicLayoutConsistencyTest), not drift. */
.cbf-card {
    border: 1px solid var(--cbf-border);
    border-radius: var(--cbf-radius-lg);
    background: linear-gradient(180deg, var(--cbf-bg-1), #0b1f16);
    box-shadow: var(--cbf-shadow);
    padding: 22px;
}

.cbf-release-card {
    border: 1px solid var(--cbf-border);
    border-radius: var(--cbf-radius-lg);
    background: linear-gradient(180deg, var(--cbf-bg-1), #0b1f16);
    box-shadow: var(--cbf-shadow);
    padding: 18px 20px;
}

.cbf-release-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.cbf-release-date {
    font-size: 12px;
    color: var(--cbf-muted);
    background: var(--cbf-bg-0);
    border: 1px solid var(--cbf-border);
    padding: 6px 10px;
    border-radius: var(--cbf-radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.cbf-release-version {
    font-size: 12px;
    color: var(--cbf-text-strong);
    background: rgba(34, 197, 94, 0.16);
    border: 1px solid rgba(34, 197, 94, 0.55);
    padding: 6px 10px;
    border-radius: var(--cbf-radius-pill);
    letter-spacing: 0.3px;
    font-weight: 700;
}

.cbf-release-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--cbf-text-strong);
}

/* Long-form content sits on a light panel - the one thing on these pages that
   is read rather than scanned. */
.cbf-release-body {
    color: var(--cbf-content-text);
    line-height: 1.65;
    font-size: 13px;
    background: var(--cbf-content-bg);
    border: 1px solid var(--cbf-content-border);
    border-radius: var(--cbf-radius-md);
    padding: 14px 16px;
    margin-top: 12px;
}

.cbf-release-body a { color: #166534; }
.cbf-release-body ul,
.cbf-release-body ol { padding-left: 20px; }
.cbf-release-body p { margin: 0 0 10px 0; }
.cbf-release-body p:last-child { margin-bottom: 0; }
.cbf-release-body img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
    margin: 12px auto;
}
.cbf-release-body figure,
.cbf-release-body .align-center { text-align: center; }
.cbf-release-body figure img { margin: 12px auto; display: block; }

/* --------------------------------------------------------------- forms --- */

.cbf-form-card { padding: 22px 22px; }
.cbf-form { display: grid; gap: 14px; }
.cbf-form-row {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cbf-field { display: flex; flex-direction: column; gap: 6px; }

.cbf-label {
    font-size: 12px;
    color: var(--cbf-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.cbf-input,
.cbf-select,
.cbf-textarea {
    background: var(--cbf-bg-0);
    color: var(--cbf-text);
    border: 1px solid var(--cbf-border);
    border-radius: var(--cbf-radius-sm);
    padding: 10px 12px;
    font-size: 14px;
    font-family: var(--cbf-font);
}

.cbf-input:focus,
.cbf-select:focus,
.cbf-textarea:focus {
    border-color: var(--cbf-accent);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.15);
    outline: none;
}

.cbf-textarea { min-height: 160px; resize: vertical; }

.cbf-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

/* ------------------------------------------------------------ feedback --- */

.cbf-alert {
    border-radius: var(--cbf-radius-md);
    padding: 12px 14px;
    border: 1px solid var(--cbf-border);
    background: rgba(11, 29, 18, 0.7);
    color: var(--cbf-text);
}

.cbf-alert-success {
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(34, 197, 94, 0.12);
}

.cbf-alert-error {
    border-color: rgba(239, 68, 68, 0.6);
    background: rgba(239, 68, 68, 0.12);
}

.cbf-alert ul { margin: 8px 0 0; padding-left: 18px; }

.cbf-empty {
    text-align: center;
    color: var(--cbf-muted);
    padding: 24px 18px;
    border: 1px dashed var(--cbf-border);
    border-radius: var(--cbf-radius-lg);
    background: rgba(11, 29, 18, 0.55);
}

/* --------------------------------------------------------- responsive --- */

@media (max-width: 980px) {
    .cbf-nav-links { display: none; }
    .cbf-footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .cbf-release-shell { padding: 28px 14px 48px; }
    .cbf-page-header { padding: 16px; }
    .cbf-release-card { padding: 16px; }
    .cbf-card { padding: 16px; }
    .cbf-form-card { padding: 16px; }
    .cbf-form-row { grid-template-columns: 1fr; }
    .cbf-page-search { position: static; margin-top: 10px; }
    .cbf-nav-inner { flex-direction: column; align-items: flex-start; }
    .cbf-nav-cta { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
    .cbf-btn { transition: none; }
    .cbf-btn:hover { transform: none; }
    .cbf-btn:hover::after { animation: none; }
}

/* ----------------------------------------------------- knowledge base --- */

/* Shown on both /knowledge-base and /support from one partial, so the styles
   live here rather than in either page. Dark cards on purpose: the content
   area behind them is dark, and a white card leaves pale inherited text on a
   white ground with the title invisible. */

.kb-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.kb-cat {
    font-size: 13.5px; padding: 7px 15px; border-radius: var(--cbf-radius-pill);
    text-decoration: none; border: 1px solid var(--cbf-border);
    background: rgba(255,255,255,.03); color: var(--cbf-muted);
}
.kb-cat:hover { border-color: var(--cbf-border-strong); color: var(--cbf-text); }
.kb-cat.is-on {
    background: var(--cbf-accent); border-color: var(--cbf-accent);
    color: #06230f; font-weight: 600;
}

.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.kb-card {
    display: flex; flex-direction: column; text-decoration: none;
    border: 1px solid var(--cbf-border); border-radius: var(--cbf-radius-lg); overflow: hidden;
    background: linear-gradient(180deg, var(--cbf-bg-1), #0b1f16); box-shadow: var(--cbf-shadow);
    transition: border-color .15s ease, transform .15s ease;
}
.kb-card:hover { border-color: var(--cbf-accent-strong); transform: translateY(-2px); }

.kb-thumb {
    aspect-ratio: 16/9; position: relative; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #12351f, #0a1d12); border-bottom: 1px solid var(--cbf-border);
}
.kb-play {
    width: 44px; height: 44px; border-radius: 50%; background: rgba(64,187,87,.18);
    border: 1px solid rgba(64,187,87,.55); display: flex; align-items: center; justify-content: center;
}
.kb-play::after {
    content: ""; border-left: 13px solid var(--cbf-text); border-top: 8px solid transparent;
    border-bottom: 8px solid transparent; margin-left: 3px;
}
.kb-doc {
    width: 30px; height: 38px; background: rgba(255,255,255,.06);
    border: 1px solid var(--cbf-border-strong); border-radius: 3px; position: relative;
}
.kb-doc::before, .kb-doc::after {
    content: ""; position: absolute; left: 7px; right: 7px; height: 2px; background: var(--cbf-border-strong);
}
.kb-doc::before { top: 11px; }
.kb-doc::after { top: 18px; }
.kb-dur {
    position: absolute; right: 9px; bottom: 9px; background: rgba(0,0,0,.66); color: var(--cbf-text);
    font-size: 11.5px; padding: 2px 7px; border-radius: 5px; font-variant-numeric: tabular-nums;
    border: 1px solid var(--cbf-border);
}

.kb-body { padding: 15px 17px 17px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.kb-title { font-size: 15.5px; font-weight: 700; margin: 0; line-height: 1.35; color: var(--cbf-text-strong); }
.kb-summary { font-size: 13.5px; color: var(--cbf-muted); margin: 0; line-height: 1.5; }
.kb-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: auto; padding-top: 11px; }
.kb-tag { display: inline-flex; font-size: 11.5px; white-space: nowrap;
    background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.3);
    border-radius: 6px; padding: 2px 8px; color: #8ff0b0;
}

.kb-foot {
    margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--cbf-border);
    font-size: 14px; color: var(--cbf-muted);
}
.kb-foot a { color: var(--cbf-accent); }

/* The section heading used where the knowledge base sits alongside something
   else, as it does on the support page. */
.kb-section-head { margin: 0 0 6px; font-size: 18px; font-weight: 700; color: var(--cbf-text-strong); }
.kb-section-sub { margin: 0 0 18px; font-size: 13.5px; color: var(--cbf-muted); line-height: 1.55; }

@media (max-width: 520px) { .kb-grid { grid-template-columns: 1fr; } }

/* The still behind the play badge - an uploaded thumbnail, or the video's own
   frame at one second. Covers the 16:9 box so a tall or odd-sized capture is
   cropped rather than letterboxed. */
.kb-shot {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    border: 0; border-radius: 0;
    pointer-events: none;
}
/* The badge and duration sit above it. */
.kb-play, .kb-dur { position: relative; z-index: 1; }
.kb-dur { position: absolute; }

/* ---------------------------------------------------------- lightbox --- */

/* Screenshots in a written guide are the point of it, and at body width the
   dispatch UI in them is unreadable. Clicking one opens it at full size. */

[data-cbf-lightbox] img {
    cursor: zoom-in;
}

.cbf-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(4, 12, 8, .88);
    cursor: zoom-out;
    /* Hidden until it has an image, so the first paint is never an empty sheet. */
    opacity: 0;
    transition: opacity .12s ease;
}

.cbf-lightbox.is-open { opacity: 1; }

.cbf-lightbox img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: var(--cbf-radius-sm);
    box-shadow: 0 30px 70px rgba(0, 0, 0, .6);
}

.cbf-lightbox-close {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--cbf-border);
    background: rgba(11, 29, 18, .9);
    color: var(--cbf-text);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cbf-lightbox-close:hover { border-color: var(--cbf-accent); }

@media (prefers-reduced-motion: reduce) {
    .cbf-lightbox { transition: none; }
}
