/* ==========================================================================
   VP Joomla — Extensions Documentation styles
   --------------------------------------------------------------------------
   Loaded only on documentation pages (see template override). Because the
   stylesheet itself only ships on /docs/extensions-docs/* pages, the rules
   below are safe to write without a scoping wrapper — they can never leak
   into the rest of the site.
   ========================================================================== */

/* ---- Base text colours -------------------------------------------------- */
/* On vpjoomla.com all articles render inside a .vp-article-page wrapper that
   sets `color: var(--va-text)` with --va-text: #334155 (slate-grey). That's
   fine for blog posts and marketing content, but documentation reads better
   in higher contrast. Since docs.css only loads on /docs/extensions-docs/*
   pages, we override the wrapper's variables here for the docs scope only. */
.vp-article-page {
    --va-text: #0f172a;
    --va-muted: #475569;
    color: var(--va-text);
}
.vp-article-page h1,
.vp-article-page h2,
.vp-article-page h3,
.vp-article-page h4,
.vp-article-page h5,
.vp-article-page h6 {
    color: #0f172a;
}

/* Fallback for any docs page that isn't wrapped in .vp-article-page. */
.item-page,
.com-content-article,
article.item {
    color: #0f172a;
}
.item-page h1,
.item-page h2,
.item-page h3,
.item-page h4,
.com-content-article h1,
.com-content-article h2,
.com-content-article h3,
.com-content-article h4,
article.item h1,
article.item h2,
article.item h3,
article.item h4 {
    color: #0f172a;
}

/* ---- Lead paragraph (intro under the H1) ------------------------------- */
/* Keep this minimal: just size and line-height. We intentionally do NOT set
   a colour here, because Joomla's TinyMCE editor has a habit of copying
   inline color onto neighbouring elements when you save the article — this
   was causing whole article bodies to render in lead-grey by accident. */
.vp-lead {
    font-size: 1.15em;
    line-height: 1.65;
    margin-bottom: 1.75em;
}

/* ---- PRO badge ---------------------------------------------------------- */
.vp-badge-pro {
    display: inline-block;
    background: linear-gradient(180deg, #1d4ed8, #2563eb);
    color: #fff !important;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 0.04em;
    vertical-align: middle;
    margin-left: 6px;
    text-decoration: none;
}

/* ---- Figures (image + caption) ----------------------------------------- */
.item-page figure,
.com-content-article figure,
article figure {
    margin: 1.75em 0;
    text-align: center;
}
.item-page figure img,
.com-content-article figure img,
article figure img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.item-page figcaption,
.com-content-article figcaption,
article figcaption {
    font-size: 0.875em;
    color: #64748b;
    text-align: center;
    margin-top: 0.6em;
    font-style: italic;
}

/* ---- Callouts: Note / Tip / Warning ------------------------------------ */
.vp-note,
.vp-tip,
.vp-warning {
    margin: 1.5em 0;
    padding: 14px 18px;
    border-radius: 8px;
    border-left: 4px solid;
    line-height: 1.6;
}
.vp-note    { border-left-color: #2563eb; background: #eff6ff; color: #1e3a8a; }
.vp-tip     { border-left-color: #10b981; background: #ecfdf5; color: #064e3b; }
.vp-warning { border-left-color: #f59e0b; background: #fffbeb; color: #78350f; }
.vp-note > strong:first-child,
.vp-tip > strong:first-child,
.vp-warning > strong:first-child {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8125em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.vp-note > strong:first-child    { color: #1e40af; }
.vp-tip > strong:first-child     { color: #047857; }
.vp-warning > strong:first-child { color: #b45309; }

/* ---- Inline code -------------------------------------------------------- */
.item-page code,
.com-content-article code,
article code {
    background: #f1f5f9;
    color: #0f172a;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---- Code blocks -------------------------------------------------------- */
.item-page pre,
.com-content-article pre,
article pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px 20px;
    border-radius: 8px;
    overflow-x: auto;
    line-height: 1.5;
    font-size: 0.875em;
    margin: 1.25em 0;
}
.item-page pre code,
.com-content-article pre code,
article pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: 1em;
}

/* ---- Tables ------------------------------------------------------------- */
.item-page table,
.com-content-article table,
article table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.95em;
}
.item-page table th,
.com-content-article table th,
article table th,
.item-page table td,
.com-content-article table td,
article table td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}
.item-page table th,
.com-content-article table th,
article table th {
    background: #f8fafc;
    font-weight: 600;
    color: #0f172a;
    border-bottom: 2px solid #cbd5e1;
}
.item-page table tbody tr:hover,
.com-content-article table tbody tr:hover,
article table tbody tr:hover {
    background: #f8fafc;
}

/* ---- Headings rhythm ---------------------------------------------------- */
.item-page h2,
.com-content-article h2,
article h2 {
    margin-top: 2.5em;
    margin-bottom: 0.75em;
    padding-bottom: 0.4em;
    border-bottom: 1px solid #e2e8f0;
}
.item-page h3,
.com-content-article h3,
article h3 {
    margin-top: 1.75em;
    margin-bottom: 0.5em;
}

/* ---- Lists -------------------------------------------------------------- */
.item-page ul,
.item-page ol,
.com-content-article ul,
.com-content-article ol,
article ul,
article ol {
    line-height: 1.7;
}
.item-page ul li,
.item-page ol li,
.com-content-article ul li,
.com-content-article ol li,
article ul li,
article ol li {
    margin-bottom: 0.35em;
}

/* ---- Mobile tweaks ------------------------------------------------------ */
@media (max-width: 640px) {
    .item-page pre,
    .com-content-article pre,
    article pre {
        padding: 12px 14px;
        font-size: 0.8em;
    }
    .item-page table,
    .com-content-article table,
    article table {
        font-size: 0.875em;
    }
    .item-page table th,
    .com-content-article table th,
    article table th,
    .item-page table td,
    .com-content-article table td,
    article table td {
        padding: 8px 10px;
    }
}