/* =============================================================
   SchoolBench Pro — Redesign editorial components
   Extends design-system.css (which is at its size cap). Holds the
   new marketing-site primitives: rule eyebrows, floating hero cards,
   reveal stagger, and module-explorer rail. Tokens come from
   design-system.css :root — do not redeclare them here.
   ============================================================= */

/* ---- Rule eyebrow (uppercase label with flanking hairline) ---- */
.rule-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    font-family: 'Source Sans 3', -apple-system, sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-secondary);
}

.rule-eyebrow::before {
    content: "";
    width: 26px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    opacity: 0.8;
}

/* Centered variant: hairline on both sides */
.rule-eyebrow-center {
    justify-content: center;
}

.rule-eyebrow-center::before,
.rule-eyebrow-center::after {
    content: "";
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    opacity: 0.7;
}

/* Teal accent (links-on-hover / key takeaways tone) */
.rule-eyebrow.is-teal {
    color: var(--color-accent);
}

.dark .rule-eyebrow.is-teal {
    color: #7fb0a9;
}

/* ---- Floating hero cards (gentle drift) ---- */
@keyframes sbFloatA {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-9px); }
}

@keyframes sbFloatB {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(7px); }
}

.hero-float-a { animation: sbFloatA 5.5s ease-in-out infinite; }
.hero-float-b { animation: sbFloatB 6.5s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
    .hero-float-a,
    .hero-float-b { animation: none; }
}

/* ---- Reveal stagger (layers on top of .reveal in animations.css) ---- */
.reveal.rd-1 { transition-delay: 0.08s; }
.reveal.rd-2 { transition-delay: 0.16s; }
.reveal.rd-3 { transition-delay: 0.24s; }

/* ---- Hero entrance (above-the-fold) ----
   Pure-CSS so content is ALWAYS visible at rest even if JS is slow/blocked
   (unlike .reveal, which depends on a scroll handler to un-hide). animation-
   fill-mode: both keeps the final visible state. */
@keyframes sbHeroIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

.hero-in { animation: sbHeroIn 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.hero-in.hi-1 { animation-delay: 0.07s; }
.hero-in.hi-2 { animation-delay: 0.14s; }
.hero-in.hi-3 { animation-delay: 0.21s; }
.hero-in.hi-4 { animation-delay: 0.28s; }

@media (prefers-reduced-motion: reduce) {
    .hero-in { animation: none; }
}

/* ---- Module explorer rail (Features page) ---- */
.explorer-tab {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.7rem 0.75rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-family: 'Source Sans 3', -apple-system, sans-serif;
    font-size: 0.92rem;
    color: #4b5563;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.explorer-tab:hover {
    background: var(--color-light);
}

.dark .explorer-tab {
    color: #cbd5e1;
}

.dark .explorer-tab:hover {
    background: rgba(148, 163, 184, 0.08);
}

.explorer-tab.is-active {
    background: rgba(31, 58, 95, 0.1);
    color: var(--color-primary);
    font-weight: 700;
}

.dark .explorer-tab.is-active {
    background: rgba(127, 176, 169, 0.14);
    color: #ffffff;
}

.explorer-tab__icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--color-light);
    color: var(--color-primary);
    transition: background-color 0.18s ease, color 0.18s ease;
}

.dark .explorer-tab__icon {
    background: rgba(148, 163, 184, 0.1);
    color: #cbd5e1;
}

.explorer-tab.is-active .explorer-tab__icon {
    background: var(--color-primary);
    color: #ffffff;
}

/* Explorer detail "group" card */
.explorer-group {
    background: var(--color-light);
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 12px;
    padding: 1rem;
}

.dark .explorer-group {
    background: rgba(148, 163, 184, 0.05);
    border-color: rgba(148, 163, 184, 0.16);
}

/* RTL: flip the leading eyebrow hairline + left-aligned rails */
[dir="rtl"] .explorer-tab,
[dir="rtl"] .doc-toc { text-align: right; }

/* ---- Secondary-page hero uplift ----
   The legacy interior pages all use the shared `.hero-spacing.hero-surface`
   band. They keep their (brand-styled) bodies; this adds the redesign's soft
   brand glow + entrance so their heroes feel cohesive with the core pages.
   Core pages use `pt-32 pb-20 hero-surface` (no `.hero-spacing`), so they're
   unaffected. */
.hero-spacing.hero-surface {
    position: relative;
    overflow: hidden;
}

.hero-spacing.hero-surface > * {
    position: relative;
    z-index: 1;
}

.hero-spacing.hero-surface::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(46% 62% at 50% 0%, rgba(197, 101, 60, 0.10), transparent 70%);
}

.dark .hero-spacing.hero-surface::before {
    background: radial-gradient(46% 62% at 50% 0%, rgba(125, 176, 169, 0.08), transparent 70%);
}

/* Give the legacy hero headings the redesign's tighter display tracking */
.hero-spacing.hero-surface h1 {
    letter-spacing: -0.02em;
    line-height: 1.07;
}
