/* ============================================================
   zb-base.css — Reset, typography, layout primitives
   ============================================================ */

/* --- CSS reset (modern, minimal) --- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    font-family: var(--zb-font-body, 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);
    font-size: 16px;
    line-height: 1.6;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }

:root {
    --zb-container-max: 1200px;
    /* Boxed frame is wider than the reading container so full-bleed
       section backgrounds (dark hero, dark sections, etc.) still span
       edge-to-edge inside the frame, while their text/content lines up
       with .zb-container everywhere else. */
    --zb-frame-max: 1440px;
    --zb-frame-gutter: clamp(1rem, 3vw, 2.5rem);
}

/* --- Site width modes ---------------------------------------------
   'boxed'  (default) — the whole site sits in a frame with visible
             margin on both sides at wide viewports.
   'full'   — frame spans the full viewport; only .zb-container (used
             inside every section) still caps content width.
   Toggle via ZB_BRAND_LAYOUT_WIDTH in config.php.
   ------------------------------------------------------------------- */
.zb-site-frame { width: 100%; }
body.zb-layout--boxed .zb-site-frame {
    max-width: var(--zb-frame-max);
    margin-inline: auto;
    padding-inline: var(--zb-frame-gutter);
}
body.zb-layout--boxed .zb-site-frame {
    box-shadow: 0 0 0 1px var(--c-border);
}
@media (max-width: 760px) {
    body.zb-layout--boxed .zb-site-frame { padding-inline: 0; box-shadow: none; }
}
body.zb-layout--full .zb-site-frame { max-width: none; padding-inline: 0; }
button { background: none; border: none; cursor: pointer; }
a { color: var(--c-primary); text-decoration: none; transition: color 0.15s ease, text-decoration 0.15s ease; }
a:hover { color: var(--c-primary-hover); text-decoration: underline; }
p, ul, ol, blockquote, table, figure { margin: 0 0 1.2em; }
ul, ol { padding-left: 1.5em; }
h1, h2, h3, h4, h5, h6 {
    font-family: var(--zb-font-head, 'Inter', system-ui, sans-serif);
    line-height: 1.25;
    color: var(--c-text);
    margin: 0 0 0.6em;
    font-weight: 700;
    letter-spacing: -0.02em;
}
h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.875rem); }
h3 { font-size: clamp(1.15rem, 1rem + 0.6vw, 1.375rem); }
h4 { font-size: 1.125rem; }
h5, h6 { font-size: 1rem; }
hr { border: 0; border-top: 1px solid var(--c-border); margin: 2em 0; }
code, pre, kbd, samp { font-family: var(--zb-font-mono, 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace); font-size: 0.9em; }
code { background: var(--c-bg-subtle); padding: 0.15em 0.35em; border-radius: 4px; }
pre { background: var(--c-bg-subtle); padding: 1em; border-radius: 8px; overflow-x: auto; border: 1px solid var(--c-border); }
pre code { background: none; padding: 0; }
blockquote {
    border-left: 4px solid var(--c-primary);
    padding: 0.5em 1em;
    margin: 1.2em 0;
    color: var(--c-text-muted);
    background: var(--c-bg-subtle);
    border-radius: 0 8px 8px 0;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.6em 0.8em; text-align: left; border-bottom: 1px solid var(--c-border); }
th { font-weight: 600; background: var(--c-bg-subtle); }

/* --- Layout primitives --- */
.zb-container {
    width: 100%;
    max-width: var(--zb-container-max, 1200px);
    margin-inline: auto;
    padding-inline: clamp(1rem, 2.5vw, 2rem);
}
.zb-main { min-height: 60vh; }
.zb-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--c-primary);
    color: #fff;
    padding: 0.6em 1em;
    z-index: 9999;
    border-radius: 0 0 6px 0;
}
.zb-skip-link:focus { left: 0; color: #fff; }

/* --- Prose (long-form content) --- */
.zb-prose { font-size: 1.0625rem; line-height: 1.7; color: var(--c-text); }
.zb-prose > * + * { margin-top: 1.2em; }
.zb-prose h2 { margin-top: 2em; padding-bottom: 0.3em; border-bottom: 1px solid var(--c-border); }
.zb-prose h3 { margin-top: 1.5em; }
.zb-prose h2:first-child, .zb-prose h3:first-child { margin-top: 0; }
.zb-prose img { max-width: 100%; height: auto; border-radius: 8px; margin-block: 1.5em; }
.zb-prose ul, .zb-prose ol { padding-left: 1.6em; }
.zb-prose li { margin-bottom: 0.4em; }
.zb-prose a { text-decoration: underline; text-underline-offset: 2px; }

/* --- Grids --- */
.zb-grid { display: grid; gap: 1rem; }
.zb-grid--2 { grid-template-columns: repeat(2, 1fr); }
.zb-grid--3 { grid-template-columns: repeat(3, 1fr); }
.zb-grid--4 { grid-template-columns: repeat(4, 1fr); }
.zb-grid--tools { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@media (max-width: 900px) {
    .zb-grid--3, .zb-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .zb-grid--2, .zb-grid--3, .zb-grid--4 { grid-template-columns: 1fr; }
}

/* --- Breadcrumb --- */
.zb-breadcrumb { font-size: 0.875rem; color: var(--c-text-muted); margin-bottom: 1.2em; }
.zb-breadcrumb__list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4em; }
.zb-breadcrumb__sep { color: var(--c-border); }
.zb-breadcrumb__link { color: var(--c-text-muted); }
.zb-breadcrumb__item--current { color: var(--c-text); font-weight: 500; }

/* --- Section primitives --- */
.zb-section { padding-block: clamp(2rem, 4vw, 3.5rem); border-top: 1px solid var(--c-border); }
.zb-section:first-of-type { border-top: 0; }
.zb-section__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.5rem; }
.zb-section__title { margin: 0; }
/* Matches .zb-tool-group__more (the category "Browse all X tools ->"
   links) - was plain, undifferentiated body-color text here while
   that one had a bold black + yellow-underline treatment, so the two
   "see more" patterns on the same page read as inconsistent. align-
   items switched from baseline to center above: aligning a large
   heading and a small link by text baseline (rather than visual
   center) reads as the link sitting oddly high against the heading. */
.zb-section__more {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--c-text, #0b0b0b);
    border-bottom: 2px solid var(--c-accent, #ffcc00);
    padding-bottom: 0.15em;
    text-decoration: none;
    white-space: nowrap;
}
.zb-section__more:hover {
    color: var(--c-text, #0b0b0b);
    border-bottom-color: var(--c-text, #0b0b0b);
    text-decoration: none;
}

/* --- Pagination --- */
.zb-pagination { margin-top: 2.5rem; text-align: center; }
.zb-pagination .page-numbers {
    display: inline-block;
    padding: 0.5em 0.85em;
    margin: 0 0.15em;
    border: 1px solid var(--c-border);
    border-radius: 6px;
    color: var(--c-text);
    background: var(--c-surface);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}
.zb-pagination .page-numbers:hover { border-color: var(--c-primary); color: var(--c-primary); text-decoration: none; }
.zb-pagination .page-numbers.current { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.zb-pagination .page-numbers.dots { border: 0; background: none; }

/* --- Badges --- */
.zb-badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--c-primary);
    color: #fff;
    border-radius: 999px;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-decoration: none;
    transition: opacity 0.15s ease;
}
.zb-badge:hover { text-decoration: none; opacity: 0.88; color: #fff; }
.zb-badge--cat, .zb-badge--user { background: var(--c-accent); color: #fff; }

/* --- 404 --- */
.zb-404 { padding-block: clamp(3rem, 8vw, 6rem); text-align: center; }
.zb-404__title { font-size: clamp(4rem, 10vw, 8rem); line-height: 1; color: var(--c-primary); margin-bottom: 0.2em; }
.zb-404__search { max-width: 480px; margin: 1.5rem auto; }
.zb-404__links { max-width: 600px; margin: 2.5rem auto 0; }
.zb-404__list { list-style: none; padding: 0; margin: 1rem 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.4em; text-align: left; }
@media (max-width: 600px) { .zb-404__list { grid-template-columns: 1fr; } }
