/*
 * Wave 12: design token layer for the public marketing surface only (nav,
 * homepage, footer). Never imported by the authenticated app (app.css) — see
 * base_public.html.twig, which links this file directly instead of going
 * through the shared importmap('app') JS/CSS bundle.
 *
 * Tokens sit ON TOP of the SB UI Kit Pro theme (public/ui-kit/css/styles.css)
 * — they don't replace it. --marketing-accent reuses the theme's own
 * --bs-primary (#0061f2) so there is exactly ONE accent color site-wide,
 * never a second competing brand color.
 */
:root {
    --marketing-accent: #0061f2;
    --marketing-ink: #1b2a4a;
    --marketing-muted: #5c6b8a;
    --marketing-bg-alt: #f6f4f0; /* warm neutral, not flat white, for alternating sections */
    --marketing-border: #e7e2d9;

    /* Type scale — hero display down to caption. Applied via utility classes
       below rather than overriding Bootstrap's h1-h6 globally (those are
       still used inside cards/admin-adjacent partials this file never loads). */
    --marketing-fs-display: clamp(2.25rem, 1.7rem + 2.2vw, 3.25rem);
    --marketing-fs-h2: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);
    --marketing-fs-h3: 1.25rem;
    --marketing-fs-body: 1.0625rem;
    --marketing-fs-small: 0.9375rem;
    --marketing-fs-caption: 0.8125rem;

    --marketing-space-section: clamp(3.5rem, 3rem + 2vw, 6rem);
    --marketing-nav-height: 84px;
}

/* ---------- Type scale utilities ---------- */
.marketing-display { font-size: var(--marketing-fs-display); font-weight: 700; line-height: 1.15; color: var(--marketing-ink); }
.marketing-h2 { font-size: var(--marketing-fs-h2); font-weight: 700; color: var(--marketing-ink); }
.marketing-h3 { font-size: var(--marketing-fs-h3); font-weight: 600; color: var(--marketing-ink); }
.marketing-body { font-size: var(--marketing-fs-body); }
.marketing-small { font-size: var(--marketing-fs-small); }
.marketing-caption { font-size: var(--marketing-fs-caption); color: var(--marketing-muted); }
.marketing-muted { color: var(--marketing-muted); }

/* ---------- Section rhythm ---------- */
.marketing-section { padding-top: var(--marketing-space-section); padding-bottom: var(--marketing-space-section); }
.marketing-section-alt { background-color: var(--marketing-bg-alt); }
.marketing-prose { max-width: 640px; }

/* ---------- Sticky nav + condensed state ----------
   The nav's own box height (min-height) never changes between states, so
   condensing never reflows content below it (CLS-safe) — only internal
   padding/shadow/transform animate. */
.navbar-costiva {
    position: sticky;
    top: 0;
    z-index: 1030;
    min-height: var(--marketing-nav-height);
    background-color: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid transparent;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.navbar-costiva .navbar-costiva-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--marketing-nav-height);
    transition: min-height 0.2s ease;
}
.navbar-costiva.is-condensed {
    box-shadow: 0 2px 12px rgba(27, 42, 74, 0.08);
    border-bottom-color: var(--marketing-border);
}
.navbar-costiva.is-condensed .navbar-costiva-inner {
    min-height: calc(var(--marketing-nav-height) - 18px);
}
.navbar-costiva.is-condensed .navbar-brand-mark {
    transform: scale(0.92);
}
.navbar-brand-mark { transition: transform 0.2s ease; display: inline-block; }

@media (prefers-reduced-motion: reduce) {
    .navbar-costiva,
    .navbar-costiva .navbar-costiva-inner,
    .navbar-brand-mark,
    .loop-connector path,
    .loop-connector-mini path {
        transition: none !important;
        animation: none !important;
    }
}

.navbar-costiva .navbar-nav .nav-item {
    margin-right: 0.5rem;
}
.navbar-costiva .navbar-nav .nav-link {
    padding: 0.5rem 0.85rem;
    color: var(--marketing-ink);
}

/* ---------- Free Tools mega-dropdown ----------
   CSS grid rather than a fixed 2-column split: it reflows into however many
   columns fit (5 categories today, more or fewer later) instead of forcing
   two tall columns. */
.nav-tools-dropdown {
    /* Bootstrap's .dropdown-menu is shrink-to-fit (absolutely positioned, no
       intrinsic width), so an explicit `width` is needed here — min/max-width
       alone leaves the grid sized to its narrowest usable column count. */
    width: 640px;
    padding: 1.5rem;
    /* The nav is sticky, so a menu taller than the viewport would overflow
       off-screen with no way to reach it by scrolling the page — the grid
       gets its own scroll region below, while the divider + "All tools" link
       stay pinned and always visible. */
    max-height: calc(100vh - var(--marketing-nav-height) - 1.5rem);
}
/* display:flex must only apply once Bootstrap has already added .show —
   Bootstrap's own .dropdown-menu{display:none}/.show{display:block} is how
   the menu opens/closes at all, so setting display unconditionally here
   would keep the mega-menu permanently rendered (and clickable) even when
   "closed". */
.nav-tools-dropdown.show {
    display: flex;
    flex-direction: column;
}
.nav-tools-grid-scroll { overflow-y: auto; }
.nav-tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.5rem 1.75rem; }
@media (min-width: 1200px) {
    /* Enough width for all 5 current categories to sit in a single row on
       typical desktop displays, so the scroll region above only kicks in on
       narrower lg-only viewports or if more categories are added later. */
    .nav-tools-dropdown { width: 1040px; }
}
.nav-tools-column .dropdown-header { padding-left: 0; font-weight: 700; font-size: var(--marketing-fs-caption); text-transform: uppercase; letter-spacing: 0.04em; color: var(--marketing-accent); }
.nav-tools-column .dropdown-item { white-space: normal; padding: 0.3rem 0; }
.nav-tools-column .nav-tool-purpose { display: block; font-size: var(--marketing-fs-caption); color: var(--marketing-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Footer Tools column ----------
   Spans double width (col-lg-6) so every category can list its tools under a
   sub-heading without truncation; CSS columns flow the groups compactly and
   break-inside: avoid keeps a heading from being separated from its list. */
.footer-tools-columns { column-count: 2; column-gap: 2rem; }
.footer-tools-group { break-inside: avoid; margin-bottom: 1.25rem; }
.footer-tools-heading { font-weight: 700; font-size: var(--marketing-fs-caption); text-transform: uppercase; letter-spacing: 0.04em; color: var(--marketing-accent); margin-bottom: 0.5rem; }
@media (max-width: 991.98px) {
    .footer-tools-columns { column-count: 1; }
}

/* ---------- Tool audience split (For Leaders / For Builders) ----------
   Two side-by-side panels in the mega-dropdown, each with its own category
   sub-columns — reuses .nav-tools-grid/.nav-tools-column per panel so a
   panel's categories reflow exactly like the old single-audience grid did. */
.nav-tools-audience-panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem 2.5rem;
}
.nav-tools-audience-panel + .nav-tools-audience-panel {
    border-left: 1px solid var(--marketing-border);
    padding-left: 2.5rem;
}
.nav-tools-audience-panel-heading { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.15rem; }
.nav-tools-audience-panel-description { font-size: var(--marketing-fs-caption); color: var(--marketing-muted); margin-bottom: 1rem; }
@media (min-width: 1200px) {
    .nav-tools-dropdown { width: 1240px; }
}

/* Small, muted, colour-independent "in both audiences" indicator — never the
   sole differentiator (a title tooltip + visually-hidden text carry the same
   information for keyboard/touch/screen-reader use). Kept deliberately quiet
   so it never competes with the tool name. */
.audience-pill {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.05rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--marketing-muted);
    background: var(--marketing-surface-alt, rgba(0, 0, 0, 0.05));
    border: 1px solid var(--marketing-border);
    border-radius: 999px;
    white-space: nowrap;
    vertical-align: middle;
}
@media (max-width: 991.98px) {
    /* Never lets the pill force a two-line wrap alongside the tool name —
       it drops onto its own line below instead. */
    .audience-pill { display: block; margin-left: 0; margin-top: 0.2rem; width: fit-content; }
}

/* ---------- Compact page header ----------
   .page-header-ui's theme default (public/ui-kit/css/styles.css) is 8rem of
   padding top and bottom, sized for a full marketing hero — far too much
   for a plain title + one-line tagline like the /tools index. A scoped
   modifier (added alongside .page-header-ui, never replacing it) so every
   OTHER page using the shared header (blog, glossary, use cases, ...) keeps
   its current spacing untouched. */
.page-header-ui-compact { padding-top: 3rem; padding-bottom: 2.5rem; }

/* ---------- Leaders/Builders/All tools showcase switcher ----------
   Shared by the /tools index and the homepage tools showcase (see
   _partials/tool_audience_tabs.html.twig) — bumped up from the theme's
   default .btn-sm sizing so the switcher reads as a primary piece of page
   navigation, not an incidental filter control. Margin is set here rather
   than via a Bootstrap-style `mb-8` utility class — this theme's spacer
   scale stops at 5, so an `mb-8` on the wrapper is silently a no-op. */
.tool-audience-tabs {
    margin-top: 0.5rem;
    margin-bottom: 3rem;
}
.tool-audience-tabs .btn-group .btn {
    padding: 0.75rem 1.75rem;
    font-size: var(--marketing-fs-body);
    font-weight: 600;
}
@media (max-width: 575.98px) {
    .tool-audience-tabs .btn-group .btn { padding: 0.65rem 1.1rem; font-size: var(--marketing-fs-small); }
}

/* ---------- Mobile off-canvas ---------- */
.marketing-offcanvas .offcanvas-body { display: flex; flex-direction: column; }
.marketing-offcanvas-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--marketing-border); }
body.marketing-offcanvas-open { overflow: hidden; }

/* ---------- Hero screenshot composition ---------- */
.hero-shot-frame {
    position: relative;
    border-radius: 12px;
    box-shadow: 0 30px 60px -20px rgba(27, 42, 74, 0.35);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--marketing-border);
}
.hero-shot-frame .browser-chrome {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    background: #eef0f4;
    border-bottom: 1px solid var(--marketing-border);
}
.hero-shot-frame .browser-chrome span {
    width: 10px; height: 10px; border-radius: 50%; background: #d5d9e0; display: inline-block;
}
.hero-shot-frame img { display: block; width: 100%; height: auto; }
.hero-shot-overlay {
    position: absolute;
    width: 62%;
    right: -6%;
    bottom: -12%;
    border-radius: 10px;
    box-shadow: 0 18px 40px -12px rgba(27, 42, 74, 0.4);
    border: 1px solid var(--marketing-border);
    overflow: hidden;
    background: #fff;
}
.hero-shot-overlay img { display: block; width: 100%; height: auto; }
@media (max-width: 991.98px) {
    .hero-shot-overlay { display: none; }
}

/* ---------- Loop signature element ---------- */
.loop-step { text-align: center; position: relative; z-index: 1; }
.loop-connector {
    position: absolute;
    top: 38px; /* vertical center of the 80px (icon-stack-xl) circles above */
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 0;
}
.loop-connector path {
    stroke-dasharray: 800;
    stroke-dashoffset: 0;
}
.loop-connector:not(.is-drawn) path {
    /* Only hidden-then-drawn once JS confirms the observer is attached —
       never relies on JS to become visible at all (see loop_connector_controller.js). */
    animation: none;
}
.loop-connector.js-armed:not(.is-drawn) path { stroke-dashoffset: 800; transition: stroke-dashoffset 1.1s ease; }
.loop-connector.js-armed.is-drawn path { stroke-dashoffset: 0; transition: stroke-dashoffset 1.1s ease; }

/* ---------- Stat strip (honest numbers only) ---------- */
.marketing-stat-strip { color: var(--marketing-muted); font-size: var(--marketing-fs-small); }
.marketing-stat-strip strong { color: var(--marketing-ink); }

/* ---------- Tool card badge ---------- */
.tool-card-badge {
    display: inline-block;
    font-size: var(--marketing-fs-caption);
    font-weight: 600;
    color: var(--marketing-accent);
    background: rgba(0, 97, 242, 0.08);
    border-radius: 999px;
    padding: 0.15rem 0.65rem;
}

.roi-featured-card {
    padding: clamp(1.5rem, 1rem + 2vw, 3rem);
    border: 1px solid rgba(0, 97, 242, 0.2);
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(0, 97, 242, 0.07), rgba(255, 255, 255, 0.98) 58%);
    box-shadow: 0 24px 60px -38px rgba(27, 42, 74, 0.55);
}

.roi-quickstart-form {
    padding: 1.25rem;
    border: 1px solid var(--marketing-border);
    border-radius: 0.75rem;
    background: #fff;
}

.roi-quickstart-form textarea,
.roi-quickstart-form select {
    font-size: 1rem;
}
