/* =========================================================
   PAGE HERO — the one shared hero (System A)
   ---------------------------------------------------------
   A single hero style used across the site: the builder tools
   (via templates/tool-shell.php), the content / listing pages
   (About, Tools, Privacy, Terms, Section Studio, Page Templates)
   and the studio pages — all rendered through
   templates/page-hero.php.

   Bucket 3 (Home, DLS landing, Hero Studio) stay bespoke — they
   are structurally different (two-column, 3D mocks, animation).

   Per-page identity = the decor SVG (passed as markup) + optional
   gradient / decor tint overrides via the CSS variables below.
   Structure, typography and spacing are shared here, so no page
   needs its own hero CSS.

   Loaded globally via @import in main.css.
   ========================================================= */

.page-hero {
    width: 100%;
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: var(--space-10) var(--space-6);

    background:
        radial-gradient(ellipse 60% 100% at 0% 60%,   var(--page-hero-grad-1, rgba(145, 45, 110, 0.10)) 0%, transparent 70%),
        radial-gradient(ellipse 60% 100% at 100% 40%, var(--page-hero-grad-2, rgba(79, 80, 145, 0.09)) 0%, transparent 70%),
        var(--surface-primary);
}

/* Optional bottom divider — content / listing pages use it to separate the
   hero from the body. Builders omit it (the workspace overlaps the hero). */
.page-hero--divide {
    border-bottom: 1px solid var(--border-primary);
}

/* ── Decor illustrations ─────────────────────────────────────────────
   Each page passes its OWN inline SVG into the left / right slots; these
   rules only place and tint them, so the decoration is per-page while the
   styling stays shared. Colour via --page-hero-deco-1 / -2. */
.page-hero-decor {
    position: absolute;
    width: 360px;
    height: 360px;
    pointer-events: none;
}
.page-hero-decor--left {
    bottom: -60px;
    left: -60px;
    color: var(--page-hero-deco-1, #912D6E);
    opacity: 0.18;
}
.page-hero-decor--right {
    top: -60px;
    right: -60px;
    color: var(--page-hero-deco-2, #4F5091);
    opacity: 0.15;
}

/* Dark mode: some tools set deco-2 to a near-black that vanishes on the dark
   hero — give the right-side decoration a visible neutral tone instead. */
[data-theme="dark"] [data-page="font-pairing-builder"] .page-hero-decor--right,
[data-theme="dark"] [data-page="shadow-builder"] .page-hero-decor--right {
    color: #64748b;
    opacity: 0.32;
}

/* ── Inner column ── */
.page-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* ── Top label — three shared, optional variants ─────────────────────
   Use whichever one a page needs; all share the same look everywhere. */

/* (1) eyebrow — uppercase tracked label */
.page-hero-eyebrow {
    display: inline-block;
    font-size: var(--text-sm);
    font-weight: var(--font-semi-bold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: var(--space-4);
}

/* (2) badge — soft blurred pill */
.page-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.35rem 0.9rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.80);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: var(--font-semi-bold);
    margin-bottom: var(--space-2);
    border: 1px solid var(--border-primary);
    backdrop-filter: blur(4px);
    letter-spacing: 0.01em;
}

/* (3) chips — informational pill row (SEO highlights).
   Emitted by seo_render_hero_chips() in config/seo.php. */
.page-hero-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}
.page-hero-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 0.3rem 0.7rem;
    border-radius: 9999px;
    background: var(--color-primary-soft);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: var(--font-semi-bold);
    letter-spacing: 0.01em;
    line-height: 1;
    white-space: nowrap;
}
.page-hero-chip-icon {
    display: inline-flex;
    color: var(--color-primary);
}
.page-hero-chip-icon svg { display: block; }

/* ── Title + gradient highlight ──────────────────────────────────────
   The highlight span reuses the global .tool-gradient-text (main.css). */
.page-hero-title {
    font-size: var(--text-6xl);
    font-weight: var(--font-extra-bold);
    letter-spacing: var(--tracking-tight);
    line-height: 1.08;
    margin: 0 0 var(--space-5) 0;
    color: var(--text-primary);
}

/* ── Subtitle / lead ── */
.page-hero-subtitle {
    font-size: var(--text-md);
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.65;
    max-width: 520px;
}

/* ── Optional meta row (e.g. "3 tools live", "Last updated …") ── */
.page-hero-meta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-4);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* ── Optional actions row (buttons) ── */
.page-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

/* =========================================================
   RESPONSIVE (mirrors the previous tool-hero tiers)
   ========================================================= */
@media (max-width: 1024px) {
    .page-hero { padding: var(--space-12) var(--space-5) var(--space-10); }
    .page-hero-title { font-size: 2.75rem; }
}
/* ── Breadcrumb (templates/sections/breadcrumb.php) ──────────────────────────
   Sits in the hero's `before` slot, above .page-hero-inner. Used only where a
   real hierarchy exists — template and category pages. */
.page-hero-crumbs {
    position: relative;
    z-index: 1;                       /* above .page-hero-decor */
    max-width: 1200px;
    margin: 0 auto var(--space-4);
    padding: 0 var(--space-4);
    text-align: left;
}
.page-hero-crumbs-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--text-sm);
}
.page-hero-crumbs-item { display: inline-flex; align-items: center; gap: 0.35rem; }
/* Separator drawn between items, so it is never read out as content. */
.page-hero-crumbs-item + .page-hero-crumbs-item::before {
    content: '/';
    color: var(--text-muted);
    opacity: 0.6;
}
.page-hero-crumbs-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.page-hero-crumbs-item a:hover { color: var(--color-primary); text-decoration: underline; }
.page-hero-crumbs-item a:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 3px; }
.page-hero-crumbs-item [aria-current='page'] { color: var(--text-primary); font-weight: 600; }

@media (max-width: 768px) {
    .page-hero { padding: var(--space-10) var(--space-4) var(--space-8); }
    .page-hero-title    { font-size: 2.25rem; }
    .page-hero-subtitle { font-size: var(--text-sm); }
    .page-hero-decor    { width: 220px; height: 220px; }
    .page-hero-crumbs   { font-size: var(--text-xs); margin-bottom: var(--space-3); }
}
@media (max-width: 480px) {
    .page-hero { padding: var(--space-8) var(--space-4) var(--space-6); }
    .page-hero-title { font-size: 1.85rem; }
    .page-hero-badge { font-size: 0.6875rem; }
}
@media (max-width: 360px) {
    .page-hero-title { font-size: 1.65rem; }
}
