/* =====================================================================
   Home page: the Learning Bytes section (Views/Home/_LearningBytesSection.cshtml), after Free Resources.
   A centred header, a calm row of 9:16 cards (Rail.tsx, styles in the Learning Bytes bundle), a centred call to action.
   Tokens match the hero (.hh) so both read as one brand.
   ===================================================================== */
.lbs {
    --hh-ink: #0f1b2d; --hh-body: #46566b; --hh-muted: #6b7c91; --hh-line: rgba(20, 90, 140, .16); --hh-glass: rgba(255, 255, 255, .8);
    --hh-a: #0891b2; --hh-b: #2563eb; --hh-a-ink: #0b6f8c; --hh-soft: rgba(8, 145, 178, .10); --hh-on-a: #ffffff; --hh-hi: rgba(255, 255, 255, .95); --hh-glow: 8, 145, 178;
    --hh-sk: rgba(20, 90, 140, .10); --hh-sk-hi: rgba(20, 90, 140, .20); --hh-cta-bg: #0f1b2d; --hh-cta-fg: #fff;
    position: relative; isolation: isolate; overflow: hidden; color: var(--hh-body);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    padding: clamp(48px, 7vw, 100px) 0;
    background: linear-gradient(180deg, transparent, rgba(8, 145, 178, .05) 40%, transparent);
}
[data-bs-theme="dark"] .lbs {
    --hh-ink: #eef7ff; --hh-body: #b4c6d9; --hh-muted: #7f95ab; --hh-line: rgba(110, 190, 230, .16); --hh-glass: rgba(7, 24, 44, .72);
    --hh-a: #2fb8d6; --hh-b: #3b82f6; --hh-a-ink: #7fd6ec; --hh-soft: rgba(47, 184, 214, .12); --hh-on-a: #04233a; --hh-hi: rgba(255, 255, 255, .07); --hh-glow: 47, 184, 214;
    --hh-sk: rgba(130, 190, 235, .10); --hh-sk-hi: rgba(130, 190, 235, .22); --hh-cta-bg: #eef7ff; --hh-cta-fg: #06223a;
    background: linear-gradient(180deg, transparent, rgba(47, 184, 214, .06) 40%, transparent);
}
.lbs *, .lbs *::before, .lbs *::after { box-sizing: border-box; }
.lbs i.bi { line-height: 1; }

/* two slow brand lights behind the section, mirrored left and right */
.lbs-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.lbs-bg i { position: absolute; width: 44vw; height: 44vw; max-width: 620px; max-height: 620px; border-radius: 50%; filter: blur(80px); opacity: .5; animation: lbs-drift 24s ease-in-out infinite alternate; }
.lbs-bg i:first-child { left: -10%; top: 12%; background: radial-gradient(circle, rgba(var(--hh-glow), .26), transparent 65%); }
.lbs-bg i:last-child { right: -10%; top: 12%; background: radial-gradient(circle, rgba(59, 130, 246, .24), transparent 65%); animation-direction: alternate-reverse; }
@keyframes lbs-drift { to { transform: translate3d(3vw, 3vw, 0) scale(1.06); } }

.lbs-shell { width: min(1240px, 100% - 32px); margin-inline: auto; display: grid; gap: clamp(22px, 3vw, 34px); }
@media (min-width: 992px) { .lbs-shell { width: min(1240px, 100% - 72px); } }

.lbs-head { text-align: center; display: grid; justify-items: center; gap: 12px; }
.lbs-head h2 { margin: 0; font-size: clamp(2.1rem, 4.2vw, 3.5rem); line-height: 1.04; letter-spacing: -.04em; font-weight: 800; color: var(--hh-ink); text-wrap: balance; }
.lbs-head h2 em { font-style: normal; background: linear-gradient(100deg, var(--hh-a), var(--hh-b) 80%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .06em; animation: lbs-flow 9s ease-in-out infinite alternate; }
@keyframes lbs-flow { from { background-position: 0 0; } to { background-position: 100% 0; } }
.lbs-lead { margin: 0; max-width: 36em; font-size: clamp(1rem, 1.3vw, 1.125rem); line-height: 1.6; color: var(--hh-body); }

.lbs-root { min-width: 0; }
/* the row's outline, held until the React app mounts so nothing shifts */
.lbs-sk { display: flex; gap: 16px; justify-content: center; overflow: hidden; margin-top: 4px; }
.lbs-sk span { flex: 0 0 calc((100% - 64px) / 5); aspect-ratio: 9 / 16; border-radius: 20px; border: 1px solid var(--hh-line); background: linear-gradient(100deg, var(--hh-sk) 30%, var(--hh-sk-hi) 50%, var(--hh-sk) 70%); background-size: 200% 100%; animation: lbs-shimmer 1.6s linear infinite; }
@keyframes lbs-shimmer { from { background-position: 110% 0; } to { background-position: -110% 0; } }
@media (max-width: 1100px) { .lbs-sk span { flex-basis: clamp(170px, 26vw, 230px); } }
@media (max-width: 640px) { .lbs-sk span { flex-basis: 58%; } .lbs-sk span:nth-child(n+3) { display: none; } .lbs-sk { justify-content: flex-start; } }

.lbs-foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.lbs-all { justify-self: end; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: .8125rem; font-weight: 700; color: var(--hh-a-ink); text-decoration: none; }
.lbs-all:hover { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 640px) { .lbs-foot { grid-template-columns: 1fr; justify-items: center; } .lbs-foot > span { display: none; } .lbs-all { justify-self: end; } }

/* the header settles in as the section scrolls into view (supporting browsers only) */
@supports (animation-timeline: view()) {
    .lbs-head > * { animation: lbs-in linear both; animation-timeline: view(); animation-range: entry 0% entry 45%; }
    @keyframes lbs-in { from { opacity: 0; transform: translateY(18px); } }
}
@media (prefers-reduced-motion: reduce) { .lbs-bg i, .lbs-head h2 em, .lbs-sk span { animation: none; } .lbs-head > * { animation: none; } }
