/*
 * hub-components.css
 *
 * SharedUI partial component styles for vertical hub pages (Stage 4.0.1
 * partials: _HubProductPicker, _BotAgentComparisonTable, _PricingCardsBlock).
 *
 * Architecture: vertical-agnostic — uses only --brand-primary /
 * --brand-primary-light (set per-vertical by _SharedLayout :root) +
 * Bootstrap 5.3 built-in tokens (--bs-*).
 *
 * Loaded after vertical-specific CSS (e.g. medical.css) and after
 * full-footer.css. Unique .sb-* namespace prevents conflicts.
 *
 * Stage 4.0.6 — first stylesheet for SharedUI partials.
 */

/* ============================================================
 * Shared button base — used in HubProductPicker + PricingCardsBlock
 * ============================================================ */

.sb-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
    cursor: pointer;
    text-align: center;
    line-height: 1.4;
}

.sb-btn:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

/* --brand-cta = the ONE colour every primary action on a page uses. Defaults to
   the host's brand colour (verticals), but a host whose action colour differs
   from its brand colour (www: navy brand, green actions) overrides it once, so
   the header CTA, hero CTA, pricing CTA and form submit can never diverge. */
.sb-btn-primary {
    background-color: var(--brand-cta, var(--brand-primary));
    color: var(--bs-white, #fff);
    border-color: var(--brand-cta, var(--brand-primary));
}

.sb-btn-primary:hover {
    background-color: var(--brand-cta-hover, var(--brand-primary-light));
    border-color: var(--brand-cta-hover, var(--brand-primary-light));
    color: var(--bs-white, #fff);
}

.sb-btn-secondary {
    background-color: transparent;
    color: var(--brand-cta, var(--brand-primary));
    border-color: var(--brand-cta, var(--brand-primary));
}

.sb-btn-secondary:hover {
    background-color: var(--brand-cta, var(--brand-primary));
    color: var(--bs-white, #fff);
}

/* ============================================================
 * Hub Product Picker — 2-card layout (Bot vs Agent)
 * ============================================================ */

.sb-product-picker {
    padding: 4rem 0;
    background-color: var(--bs-tertiary-bg);
}

.sb-product-picker-heading {
    text-align: center;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--bs-body-color, #141833);
}

.sb-product-picker-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (max-width: 768px) {
    .sb-product-picker-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.sb-product-card {
    background-color: var(--bs-white, #fff);
    border: 1px solid var(--bs-border-color, #e6e8f0);
    border-radius: var(--bs-border-radius-lg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.sb-product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.sb-product-card-header {
    margin-bottom: 1rem;
}

.sb-product-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bs-body-color, #141833);
    margin: 0;
}

.sb-product-card-description {
    color: var(--bs-secondary-color, #5b6577);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* Optional: subtle accent strip on Bot vs Agent cards */
.sb-product-card-bot {
    border-top: 4px solid var(--brand-primary);
}

.sb-product-card-agent {
    border-top: 4px solid var(--brand-primary-light);
}

/* ============================================================
 * Bot vs Agent Comparison Table
 * ============================================================ */

.sb-comparison {
    padding: 4rem 1.5rem;
}

.sb-comparison-heading {
    text-align: center;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--bs-body-color, #141833);
}

.sb-comparison-table {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    border-collapse: separate;
    border-spacing: 0;
    background-color: var(--bs-white, #fff);
    border: 1px solid var(--bs-border-color, #e6e8f0);
    border-radius: var(--bs-border-radius-lg);
    overflow: hidden;
}

.sb-comparison-table thead th {
    background-color: var(--bs-tertiary-bg);
    padding: 1rem 1.25rem;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: left;
    color: var(--bs-body-color, #141833);
    border-bottom: 2px solid var(--bs-border-color, #e6e8f0);
}

.sb-comparison-table thead th:nth-child(2),
.sb-comparison-table thead th:nth-child(3) {
    text-align: center;
    width: 22%;
}

.sb-comparison-table tbody th {
    padding: 0.875rem 1.25rem;
    font-weight: 500;
    text-align: left;
    color: var(--bs-body-color, #141833);
    border-bottom: 1px solid var(--bs-border-color, #e6e8f0);
}

.sb-comparison-table tbody tr:last-child th,
.sb-comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.sb-comparison-cell {
    padding: 0.875rem 1.25rem;
    text-align: center;
    font-size: 1.125rem;
    border-bottom: 1px solid var(--bs-border-color, #e6e8f0);
    vertical-align: middle;
}

.sb-comparison-cell.yes {
    color: var(--brand-primary);
    font-weight: 700;
}

.sb-comparison-cell.no {
    color: var(--bs-secondary-color, #5b6577);
    font-weight: 400;
}

.sb-comparison-note {
    font-size: 0.8rem;
    color: var(--bs-secondary-color, #5b6577);
    margin-top: 0.25rem;
    font-weight: 400;
    line-height: 1.4;
}

@media (max-width: 640px) {
    .sb-comparison-table thead th,
    .sb-comparison-table tbody th,
    .sb-comparison-cell {
        padding: 0.75rem 0.625rem;
        font-size: 0.85rem;
    }
    .sb-comparison-note {
        font-size: 0.7rem;
    }
}

/* ============================================================
 * Pricing Cards Block — 3-tier grid with featured middle tier
 * ============================================================ */

.sb-pricing {
    /* No horizontal padding: this block renders INSIDE the page .container,
       which already supplies the gutter. Adding another 1.5rem each side
       squeezed the card grid ~50px narrower than the site content width. */
    padding: 4rem 0;
    background-color: var(--bs-tertiary-bg);
}

.sb-pricing-loading,
.sb-pricing-fallback-note {
    text-align: center;
    color: var(--bs-secondary-color, #5b6577);
    font-size: 0.95rem;
    margin: 2rem auto;
}

.sb-pricing-fallback-note {
    margin-top: 1.5rem;
    font-style: italic;
}

.sb-pricing-grid {
    /* Equal widths AND a centred last row: a 3-col grid cannot centre an orphan
       row, so use flex with an explicit 1/3 basis. Every card is exactly one
       third of the row (minus gaps) — a trailing row of 2 centres itself. */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 1.5rem;
    margin: 0 auto;
}
.sb-pricing-grid > .sb-pricing-card {
    flex: 0 1 calc((100% - 3rem) / 3);
    max-width: calc((100% - 3rem) / 3);
    width: auto;
}
@media (max-width: 920px) {
    .sb-pricing-grid > .sb-pricing-card {
        flex-basis: calc((100% - 1.5rem) / 2);
        max-width: calc((100% - 1.5rem) / 2);
    }
}
@media (max-width: 600px) {
    .sb-pricing-grid > .sb-pricing-card { flex-basis: 100%; max-width: 100%; }
}



/* ------------------------------------------------------------
 * Premium pricing cards (redesign 2026-07): layered elevation,
 * gradient accent on the featured tier, serif price/tier accents
 * (Fraunces), SVG check bullets, and a filled/outline CTA hierarchy.
 * ------------------------------------------------------------ */

.sb-pricing-card {
    background-color: var(--bs-white, #fff);
    border: 1px solid var(--bs-border-color, #e6e8f0);
    border-radius: 12px;
    padding: 2.5rem 1.75rem 2rem;
    display: flex;
    flex-direction: column;
    text-align: center;
    box-shadow: 0 1px 2px rgba(20, 24, 51, 0.04),
                0 12px 30px -20px rgba(20, 24, 51, 0.22);
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
    position: relative;
}

.sb-pricing-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 4px 8px rgba(20, 24, 51, 0.05),
                0 28px 52px -26px color-mix(in srgb, var(--brand-primary, #1B2566) 42%, rgba(20, 24, 51, 0.55));
    border-color: color-mix(in srgb, var(--brand-primary, #1B2566) 22%, var(--bs-border-color, #e6e8f0));
}

.sb-pricing-card-featured {
    border: 1.5px solid color-mix(in srgb, var(--brand-primary, #1B2566) 55%, var(--bs-border-color, #e6e8f0));
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--brand-primary, #1B2566) 6%, #fff),
        var(--bs-white, #fff) 42%);
    box-shadow: 0 26px 60px -28px color-mix(in srgb, var(--brand-primary, #1B2566) 55%, transparent);
}

/* Brand accent rail across the featured card's top edge. */
.sb-pricing-card-featured::before {
    content: "";
    position: absolute;
    top: 0;
    inset-inline: 0;
    height: 4px;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(90deg, var(--brand-primary, #1B2566), var(--brand-primary-light, #3B4690));
}

@media (max-width: 900px) {
    .sb-pricing-card-featured {
        transform: none;
    }
}

.sb-pricing-card-header {
    margin-bottom: 1.25rem;
    width: 100%;
}

.sb-pricing-tier-name {
    font-family: "Fraunces", "Heebo", Georgia, serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--bs-body-color, #141833);
    margin: 0.25rem 0 0.35rem;
}

/* Fraunces carries no Hebrew glyphs: on an RTL page a Latin tier name ("Pro")
   rendered serif while the Hebrew one beside it fell back to sans — two type
   styles in the same row. Force the sans face for the whole row in RTL. */
[dir="rtl"] .sb-pricing-tier-name { font-family: "Heebo", sans-serif; font-weight: 700; }

.sb-pricing-description {
    font-size: 0.875rem;
    color: var(--bs-secondary-color, #5b6577);
    margin: 0.5rem 0 0;
    line-height: 1.5;
    min-height: 2.5em;
}

.sb-pricing-amount {
    /* Fixed height + bottom-aligned content so the price baseline (and the
       bullets below it) line up across every card regardless of whether the
       tier shows a "from" prefix, a $0, or a custom label. */
    min-height: 4.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    margin: 0.5rem 0 0.35rem;
    line-height: 1;
    color: var(--bs-body-color, #141833);
}

.sb-pricing-price-line {
    display: block;
    white-space: nowrap;
}

.sb-pricing-from {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--bs-secondary-color, #5b6577);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sb-pricing-currency {
    font-family: "Inter", "Heebo", system-ui, -apple-system, sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--bs-secondary-color, #5b6577);
    vertical-align: top;
    position: relative;
    top: 0.35rem;
    margin-inline-end: 0.12rem;
}

.sb-pricing-card .sb-pricing-amount bdi {
    font-family: "Inter", "Heebo", system-ui, -apple-system, sans-serif;
    font-size: 3.1rem;
    font-weight: 800;
    color: var(--bs-body-color, #141833);
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.sb-pricing-period {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--bs-secondary-color, #5b6577);
    margin-inline-start: 0.15rem;
}

/* Vertical-discount strike-through + "save X%" badge. Rendered only when a
   per-vertical discount is configured (DiscountVisible + effective < base). */
.sb-pricing-strike {
    color: var(--bs-secondary-color, #5b6577);
    text-decoration: line-through;
    font-size: 1rem;
    opacity: 0.75;
    margin-bottom: 0.15rem;
}

.sb-pricing-discount-badge {
    display: inline-block;
    margin: 0.15rem 0 0.35rem;
    padding: 0.15rem 0.6rem;
    background-color: rgba(21, 163, 74, 0.12);
    color: #15803d;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.sb-pricing-custom {
    /* Body font (not the serif used for numeric prices): a long localised word
       like RU "Индивидуально" overflows / mid-word-breaks in wide Fraunces. */
    display: inline-block;
    max-width: 100%;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--bs-body-color, #141833);
    line-height: 1.15;
}

.sb-pricing-bullets {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    width: 100%;
    text-align: start;
    /* Absorb the height difference between tiers with 4 vs 6 bullets so the
       CTA buttons sit on one line across the whole row. */
    flex: 1 0 auto;
}

.sb-pricing-bullet {
    position: relative;
    padding-block: 0.4rem;
    padding-inline-start: 1.7rem;
    color: var(--bs-body-color, #141833);
    font-size: 0.9rem;
    line-height: 1.5;
}

.sb-pricing-bullet::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0.5rem;
    width: 1.15rem;
    height: 1.15rem;
    /* Circle-check masked in the host vertical's brand colour (per-vertical).
       Symmetric glyph — no RTL flip. */
    background-color: var(--brand-primary, #1B2566);
    -webkit-mask: no-repeat center / contain
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 18a8 8 0 100-16 8 8 0 000 16zm3.7-9.3l-4.5 4.5a1 1 0 01-1.4 0L5.3 10.7a1 1 0 011.4-1.4l1.8 1.8 3.8-3.8a1 1 0 011.4 1.4z'/%3E%3C/svg%3E");
    mask: no-repeat center / contain
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 18a8 8 0 100-16 8 8 0 000 16zm3.7-9.3l-4.5 4.5a1 1 0 01-1.4 0L5.3 10.7a1 1 0 011.4-1.4l1.8 1.8 3.8-3.8a1 1 0 011.4 1.4z'/%3E%3C/svg%3E");
}

.sb-pricing-bullet-negative {
    color: var(--bs-secondary-color, #5b6577);
    opacity: 0.7;
}

.sb-pricing-bullet-negative::before {
    /* Muted circle-x for excluded features. */
    background-color: #9aa0b0;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2a8 8 0 100 16 8 8 0 000-16zm3 10.6L11.4 14 10 12.6 8.6 14 7 12.6 8.4 11 7 9.4 8.6 8 10 9.4 11.4 8 13 9.4 11.6 11 13 12.6z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2a8 8 0 100 16 8 8 0 000-16zm3 10.6L11.4 14 10 12.6 8.6 14 7 12.6 8.4 11 7 9.4 8.6 8 10 9.4 11.4 8 13 9.4 11.6 11 13 12.6z'/%3E%3C/svg%3E");
}

.sb-pricing-bullet-strong {
    font-weight: 700;
}

.sb-pricing-card .sb-btn {
    width: 100%;
    margin-top: auto;
    padding-block: 0.85rem;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

/* CTA hierarchy: featured tier keeps the filled primary button (with a soft
   brand glow + lift); every other tier renders it as a quiet outline so the
   recommended plan draws the eye. */
.sb-pricing-card-featured .sb-btn-primary {
    box-shadow: 0 12px 26px -12px color-mix(in srgb, var(--brand-cta, var(--brand-primary, #1B2566)) 70%, transparent);
}
.sb-pricing-card-featured .sb-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px -12px color-mix(in srgb, var(--brand-cta, var(--brand-primary, #1B2566)) 78%, transparent);
}

.sb-pricing-card:not(.sb-pricing-card-featured) .sb-btn-primary {
    background-color: transparent;
    color: var(--brand-cta, var(--brand-primary));
    border-color: color-mix(in srgb, var(--brand-cta, var(--brand-primary, #1B2566)) 40%, var(--bs-border-color, #e6e8f0));
}

.sb-pricing-card:not(.sb-pricing-card-featured) .sb-btn-primary:hover {
    background-color: var(--brand-cta, var(--brand-primary));
    color: var(--bs-white, #fff);
    border-color: var(--brand-cta, var(--brand-primary));
}

.sb-pricing-popular-badge {
    position: absolute;
    top: -0.85rem;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-primary-light));
    color: var(--bs-white, #fff);
    padding: 0.35rem 1rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    white-space: nowrap;
    box-shadow: 0 8px 18px -5px color-mix(in srgb, var(--brand-primary, #1B2566) 60%, transparent);
    z-index: 2;
}

/* ============================================================
 * Unified FAQ — ONE accordion style everywhere. Mirrors the canonical
 * .hub-faq-* pattern (hub-page.css, used on the vertical /faq/ pages) so
 * the shared pricing FAQ (.sb-pricing-faq-*, native <details>) and the
 * www page FAQ (.faq-*, JS-toggled via .open) render IDENTICALLY to it.
 * Card per question; chevron rotates 180° on open; brand-tinted hover.
 * Lives in hub-components.css so it applies on www + every vertical.
 * ============================================================ */
.sb-pricing-faq {
    /* Same width as the pricing grid — the page grid governs every block. */
    max-width: none;
    margin: 3.5rem auto 0;
    /* padding, NOT margin: the host section has padding-bottom:0, so a bottom
       margin collapses straight through it and the last FAQ card ends flush
       against the next (dark) section. */
    padding: 0 0 4rem;
}
.sb-pricing-faq > h2 { text-align: center; margin: 0 0 1.5rem; }

.sb-pricing-faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-accordion { max-width: none; margin: 2.5rem auto 0; display: flex; flex-direction: column; gap: 12px; }

/* .hub-faq-* is THE canonical FAQ, but its rules live in hub-page.css which only
   the verticals load — on www the same markup would render unstyled. Declaring it
   here (loaded by www AND every vertical) is what makes one FAQ style universal.
   On verticals hub-page.css loads later and wins; both are the same design. */
.hub-faq-list { max-width: none; margin: 2.5rem auto 0; display: flex; flex-direction: column; gap: 12px; }

.sb-pricing-faq-item,
.hub-faq-item,
.faq-accordion .faq-item {
    border: 1px solid var(--bs-border-color, #e5e7eb);
    border-radius: 12px;
    background: var(--bs-white, #fff);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.sb-pricing-faq-item:hover,
.hub-faq-item:hover,
.faq-accordion .faq-item:hover {
    border-color: color-mix(in srgb, var(--brand-primary, #1B2566) 30%, var(--bs-border-color, #e5e7eb));
}
.sb-pricing-faq-item[open],
.hub-faq-item[open],
.faq-accordion .faq-item.open {
    box-shadow: 0 10px 26px -14px rgba(20, 24, 51, 0.18);
}

/* Header row */
.sb-pricing-faq-item summary,
.hub-faq-item summary,
.faq-accordion .faq-q {
    padding: 20px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--bs-body-color, #0f172a);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    list-style: none;
    line-height: 1.4;
}
.sb-pricing-faq-item summary::-webkit-details-marker,
.hub-faq-item summary::-webkit-details-marker { display: none; }
.faq-accordion .faq-q-text { flex: 1; }

/* Chevron toggle — replaces the literal "+" text of .faq-toggle. */
.faq-accordion .faq-toggle { font-size: 0; line-height: 0; background: none; }
.sb-pricing-faq-item summary::after,
.hub-faq-item summary::after,
.faq-accordion .faq-toggle::after {
    content: "";
    display: block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform 0.25s ease;
}
.sb-pricing-faq-item[open] summary::after,
.hub-faq-item[open] summary::after,
.faq-accordion .faq-item.open .faq-toggle::after { transform: rotate(180deg); }

/* Answer */
.sb-pricing-faq-item > p,
.hub-faq-content {
    padding: 0 24px 20px;
    margin: 0;
    color: var(--bs-secondary-color, #4b5563);
    font-size: 0.95rem;
    line-height: 1.6;
}
.faq-accordion .faq-ans {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.faq-accordion .faq-item.open .faq-ans { max-height: 600px; }
.faq-accordion .faq-ans p {
    margin: 0;
    padding: 0 24px 20px;
    color: var(--bs-secondary-color, #4b5563);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ============================================================
 * Wave 4 — Accessibility additions
 * Applied globally across all SharedLayout consumers (6 verticals).
 * ============================================================ */

/* WCAG AA — visible focus indicator for keyboard users.
   :focus-visible (not :focus) к avoid showing ring on mouse click.
   2px ring + 2px offset for clear contrast on any background. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--brand-primary, #1B2566);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Respect prefers-reduced-motion — disable animations/transitions for
   users who selected reduced motion в OS settings. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================================
 * Glossary — premium searchable reference index. A scannable card
 * grid with a serif (Fraunces) term, a per-vertical brand accent, an
 * accent rail, depth + reward-on-hover, and a sticky icon search.
 * Shared across every vertical + www glossary page, all langs.
 *
 * PER-VERTICAL COLOUR: each vertical stylesheet defines only its OWN
 * primary var (--med-primary / --edu-primary / …); www sets
 * --brand-primary. Since a host loads exactly one of those, the var()
 * fallback chain below resolves to whichever is defined → the glossary
 * paints itself in that vertical's brand with zero per-site edits.
 * color-mix() derives every tint/glow from that single accent.
 * ============================================================ */
.glossary-wrap {
    --gloss-accent:
        var(--med-primary,
        var(--edu-primary,
        var(--legal-primary,
        var(--sales-primary,
        var(--fitness-primary,
        var(--business-primary,
        var(--hospitality-primary,
        var(--event-primary,
        var(--beauty-primary,
        var(--brand-primary, #1B2566))))))))));
    --gloss-ink: var(--bs-body-color, #141833);
    --gloss-slate: var(--bs-secondary-color, #5b6577);
    --gloss-surface: var(--bs-white, #fff);
    --gloss-hairline: var(--bs-border-color, #e6e8f0);
    max-width: 1120px;
    margin: 0 auto;
}

.glossary-toolbar {
    position: sticky;
    top: 12px;
    z-index: 5;
    margin: 0 0 2rem;
    display: flex;
    justify-content: center;
    padding-block: 6px;
}

.glossary-search {
    width: 100%;
    max-width: 520px;
    padding: 0.85rem 1.3rem 0.85rem 3rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--gloss-ink);
    background-color: var(--gloss-surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238a91a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 1.1rem center;
    border: 1px solid var(--gloss-hairline);
    border-radius: 999px;
    box-shadow: 0 2px 10px -4px rgba(20, 24, 51, 0.12);
    transition: border-color .18s ease, box-shadow .18s ease;
}
[dir="rtl"] .glossary-search {
    padding: 0.85rem 3rem 0.85rem 1.3rem;
    background-position: right 1.1rem center;
}
.glossary-search::placeholder { color: #8a91a3; }
.glossary-search:focus {
    outline: none;
    border-color: var(--gloss-accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--gloss-accent) 16%, transparent);
}

.glossary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.15rem;
    align-items: start;
}
@media (max-width: 720px) { .glossary-grid { grid-template-columns: 1fr; } }

.glossary-card {
    position: relative;
    background:
        linear-gradient(180deg, var(--gloss-surface),
        color-mix(in srgb, var(--gloss-accent) 3%, var(--gloss-surface)));
    border: 1px solid var(--gloss-hairline);
    border-inline-start: 3px solid color-mix(in srgb, var(--gloss-accent) 32%, var(--gloss-hairline));
    border-radius: 14px;
    padding: 1.4rem 1.5rem 1.45rem;
    box-shadow: 0 1px 2px rgba(20, 24, 51, 0.04);
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.glossary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 42px -16px color-mix(in srgb, var(--gloss-accent) 45%, transparent);
    border-color: color-mix(in srgb, var(--gloss-accent) 30%, var(--gloss-hairline));
    border-inline-start-color: var(--gloss-accent);
}
.glossary-card:target {
    border-inline-start-color: var(--gloss-accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--gloss-accent) 55%, transparent);
}

.glossary-term {
    font-family: "Fraunces", "Heebo", Georgia, serif;
    font-size: 1.22rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.25;
    margin: 0 0 0.7rem;
    padding-bottom: 0.55rem;
    color: var(--gloss-accent);
    position: relative;
}
[dir="rtl"] .glossary-term { font-family: "Heebo", sans-serif; font-weight: 700; }
.glossary-term::after {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--gloss-accent) 60%, transparent);
}
.glossary-def {
    margin: 0;
    font-size: 0.94rem;
    line-height: 1.62;
    color: var(--gloss-slate);
}
.glossary-empty {
    grid-column: 1 / -1;
    text-align: center; padding: 2.5rem 1rem;
    color: var(--gloss-slate);
    font-size: 0.95rem;
}

@media (prefers-reduced-motion: reduce) {
    .glossary-card { transition: none; }
    .glossary-card:hover { transform: none; }
}

/* ── Accessibility: keyboard focus-visible baseline (WCAG 2.4.7) ──────────
   Only shows on keyboard navigation (not mouse click), so it improves
   a11y without changing the mouse-hover look. Applies platform-wide. */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
    border-radius: 4px;
}
/* On dark surfaces, a white ring reads better than blue. */
[data-hero-dark] a:focus-visible,
[data-hero-dark] button:focus-visible,
.hub-hero a:focus-visible,
.hub-hero button:focus-visible {
    outline-color: #ffffff;
}

/* ============================================================
 * Page grid discipline — every content block spans the SAME width
 * ============================================================
 * The buyer-tools / cross-link card blocks (297 pages across www + all nine
 * verticals) are authored as inline `display:grid;
 * grid-template-columns:repeat(auto-fit,minmax(240px,1fr))` inside a NARROW
 * container. Measured on a rendered page that produced two defects on every
 * one of them:
 *   1. the block rendered 880px wide inside a 1046px page grid (-166px), so it
 *      visibly stepped in from every other block on the page;
 *   2. auto-fit dropped the 4th card onto its own row FLUSH to one edge
 *      instead of centred, because a CSS grid cannot centre an orphan row.
 * Fixing it here (rather than editing 297 files) keeps the page grid as the
 * single source of truth: the block widens to the page container, and flex
 * wrapping centres any trailing row. The max-width cap stops a lone card from
 * stretching across the full row.
 */
.page-section-container.narrow:has(div[style*="grid-template-columns"]) {
    max-width: var(--container-max, 1200px);
    padding-inline: var(--section-padding-x, 1.5rem);
}

div[style*="repeat(auto-fit"] {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
}

div[style*="repeat(auto-fit"] > * {
    flex: 1 1 240px;
    max-width: 320px;
}

/* One page grid for every content block, on every site.
   .container already resolves to max-width 1200 + section gutter = 1046px of
   content. .page-section-container had NO gutter (so its content sat 154px
   wider than every neighbouring block) and on the nine verticals it had no
   rule at all — blocks ran unconstrained. Both now resolve to the same
   content width; .narrow keeps its deliberate reading measure by absorbing
   the gutter into its max-width instead of losing content width to it. */
.page-section-container {
    max-width: var(--container-max, 1200px);
    margin-inline: auto;
    padding-inline: var(--section-padding-x, 1.5rem);
}
.page-section-container.narrow {
    max-width: calc(var(--container-narrow, 880px) + 2 * var(--section-padding-x, 1.5rem));
}
