/* ------------------------------------------------------------------
   /learn/ Pillar Hub Styles ("Proxy Fundamentals").

   Prefix: lrn-. Loaded once, by templates/proxies/learn_hub.html, after
   article_assets.html -- so the shared pxa- component vocabulary (tables,
   chips, CTA banner) is already in scope and is reused rather than
   re-declared here.

   The ambient glow blobs (.page-ambient / .hero-glow-blob) are defined
   globally in static/css/base.css and are deliberately NOT repeated here.

   This hub is definitional rather than commercial, and it is styled to
   read that way: a numbered reading path with a left spine instead of the
   boxed category families /proxy-types/ uses, a quieter second title line,
   and one honesty panel that no other page on the site carries.
   ------------------------------------------------------------------ */

.lrn-page {
    --lrn-shell: 1160px;
    position: relative;
}

/* ------------------------------------------------------------------
   Hero (a div, NOT a header, so base.html's sticky-header rule never
   applies to it)
   ------------------------------------------------------------------ */
.lrn-hero {
    position: relative;
    text-align: center;
    max-width: var(--lrn-shell);
    margin: 0 auto;
    padding: 3.5rem 1.5rem 2.5rem;
    z-index: 2;
}
.lrn-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.95rem;
    border-radius: 999px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 1.4rem;
}
.lrn-hero-eyebrow-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 3px var(--glow-color);
}
.lrn-hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.3rem, 5.2vw, 3.8rem);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 1.2rem;
    letter-spacing: -0.035em;
    text-wrap: balance;
}
.lrn-hero-title-line1 {
    display: block;
    color: var(--text-primary);
}
/* Quieter, lighter second line: this pillar explains rather than sells, so
   the accent colour is spent on the reading path below instead. */
.lrn-hero-title-line2 {
    display: block;
    font-size: clamp(1.15rem, 2.2vw, 1.65rem);
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--text-secondary);
    margin-top: 0.6rem;
}
.lrn-hero-desc {
    font-size: clamp(1rem, 1.5vw, 1.12rem);
    color: var(--text-secondary);
    max-width: 66ch;
    margin: 0 auto 2rem auto;
    line-height: 1.65;
    text-wrap: pretty;
}
.lrn-hero-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 2.75rem;
}
.lrn-hero-actions .btn {
    padding: 0.75rem 1.6rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.lrn-hero-actions .btn-primary {
    background: var(--primary);
    color: var(--white);
    border: 1px solid var(--primary);
    box-shadow: 0 4px 14px var(--glow-color);
}
.lrn-hero-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--glow-color);
}
.lrn-hero-actions .btn-secondary {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
}
.lrn-hero-actions .btn-secondary:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    color: var(--primary);
}

/* Stat strip */
.lrn-hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    max-width: 960px;
    margin: 0 auto;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--bg-secondary);
    overflow: hidden;
}
.lrn-hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1.25rem 1rem;
    border-left: 1px solid var(--border);
}
.lrn-hero-stat:first-child { border-left: none; }
.lrn-hero-stat .number {
    display: block;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(1.2rem, 1.8vw, 1.55rem);
    color: var(--primary);
    line-height: 1.15;
    letter-spacing: -0.02em;
}
.lrn-hero-stat .label {
    display: block;
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ------------------------------------------------------------------
   Landmark rail. A div, not a <nav>, so base.html's global
   `nav { height: var(--nav-height) }` header rule cannot reach it --
   height is pinned to auto anyway as a belt-and-braces guard.
   ------------------------------------------------------------------ */
.lrn-toc {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0.5rem !important;
    height: auto !important;
    max-width: var(--lrn-shell);
    margin: 2rem auto 0;
    padding: 0 1.5rem;
    border: none !important;
    background: transparent !important;
}
.lrn-toc a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.lrn-toc a:hover {
    border-color: var(--primary);
    color: var(--text-primary);
    background: var(--bg-secondary);
    transform: translateY(-1px);
}
.lrn-toc .pxm2-icon { color: var(--primary); }

/* ------------------------------------------------------------------
   Layout + section rhythm
   ------------------------------------------------------------------ */
.lrn-layout-container {
    max-width: var(--lrn-shell);
    margin: 0 auto;
    padding: 3rem 1.5rem 0 1.5rem;
    box-sizing: border-box;
}
.lrn-layout-container [id] { scroll-margin-top: 100px; }

.lrn-section {
    margin: 4.5rem 0;
    width: 100%;
    box-sizing: border-box;
}
.lrn-layout-container > .lrn-section:first-child { margin-top: 1rem; }

.lrn-section-header { margin-bottom: 2.25rem; }
.lrn-section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.65rem, 3vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}
.lrn-section-subtitle {
    font-size: 1.02rem;
    color: var(--text-secondary);
    margin: 0;
    max-width: 78ch;
    line-height: 1.65;
}

/* ------------------------------------------------------------------
   Reading path: two groups on a shared left spine. Deliberately not the
   boxed family cards /proxy-types/ uses -- this cluster is an ordered
   path, and it should not look like a catalogue of families.
   ------------------------------------------------------------------ */
.lrn-group {
    position: relative;
    padding: 0 0 0 3.25rem;
    margin-bottom: 3rem;
}
.lrn-group:last-child { margin-bottom: 0; }
/* The spine itself, running through the number badge. */
.lrn-group::before {
    content: '';
    position: absolute;
    left: 1.06rem;
    top: 0.35rem;
    bottom: -3rem;
    width: 1px;
    background: linear-gradient(to bottom, var(--border), transparent);
}
.lrn-group:last-child::before { bottom: 1.5rem; }
.lrn-group-head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.6rem;
}
.lrn-group-num {
    position: absolute;
    left: 0;
    top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 50%;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    box-shadow: 0 0 0 5px var(--bg-primary);
}
.lrn-group-name {
    font-family: var(--font-heading);
    font-size: clamp(1.25rem, 2.4vw, 1.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--text-primary);
}
.lrn-group-tagline {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 1.6rem;
    font-size: 0.95rem;
    max-width: 72ch;
}

/* Explainer cards */
.lrn-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.1rem;
}
.lrn-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.5rem 1.35rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--bg-secondary);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}
.lrn-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), transparent 70%);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.lrn-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 10px 28px var(--glow-color);
}
.lrn-card:hover::before { opacity: 1; }
.lrn-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.lrn-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--primary);
    flex-shrink: 0;
}
/* Reading-order badge -- the number is the point of this cluster. */
.lrn-card-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.lrn-card:hover .lrn-card-step {
    color: var(--primary);
    border-color: var(--primary);
}
.lrn-card-title {
    margin: 0 0 0.55rem;
    font-family: var(--font-heading);
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    text-wrap: balance;
}
.lrn-card-desc {
    margin: 0 0 1.1rem;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-secondary);
    flex: 1;
}
.lrn-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: auto;
}
.lrn-card-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-tertiary);
    white-space: nowrap;
}
.lrn-card-go {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
}
.lrn-card-go .pxm2-icon {
    transition: transform 0.2s ease;
}
.lrn-card:hover .lrn-card-go .pxm2-icon { transform: translateX(4px); }

/* ------------------------------------------------------------------
   Four axes grid
   ------------------------------------------------------------------ */
.lrn-axis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.1rem;
}
.lrn-axis {
    display: flex;
    flex-direction: column;
    padding: 1.4rem 1.4rem 1.25rem;
    border: 1px solid var(--border);
    border-top: 2px solid var(--primary);
    border-radius: 4px 4px 16px 16px;
    background: var(--bg-secondary);
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.lrn-axis:hover { transform: translateY(-2px); }
.lrn-axis-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}
.lrn-axis-num {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.lrn-axis-icon {
    display: inline-flex;
    color: var(--primary);
    flex-shrink: 0;
}
.lrn-axis-name {
    margin: 0 0 0.45rem;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}
.lrn-axis-desc {
    margin: 0 0 1.1rem;
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--text-secondary);
    flex: 1;
}
.lrn-axis-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: auto;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}
.lrn-axis-link:hover { text-decoration: underline; }

/* ------------------------------------------------------------------
   Routing table + honesty panel
   ------------------------------------------------------------------ */
.lrn-table-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--bg-secondary);
    overflow: hidden;
}
.lrn-table-card .pxa-table-wrap {
    margin: 0;
    border: none;
    border-radius: 0;
}

/* The pillar's honesty anchor: the one block on the site that says what
   PXM2 does not sell. Warning-toned on purpose -- it is a caveat, not a
   feature list, and it must not read as another product card. */
.lrn-honesty {
    margin-top: 1.75rem;
    padding: 1.6rem 1.75rem;
    border: 1px solid var(--border);
    border-left: 3px solid var(--warning);
    border-radius: 4px 16px 16px 4px;
    background: var(--bg-secondary);
}
.lrn-honesty-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}
.lrn-honesty-icon {
    display: inline-flex;
    color: var(--warning);
    flex-shrink: 0;
}
.lrn-honesty-head h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.lrn-honesty-lede {
    margin: 0 0 1.1rem;
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--text-secondary);
    max-width: 78ch;
}
.lrn-honesty-list {
    list-style: none;
    margin: 0 0 1.1rem;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}
.lrn-honesty-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 82ch;
}
.lrn-honesty-list strong { color: var(--text-primary); }
.lrn-honesty-mark {
    display: inline-flex;
    color: var(--warning);
    flex-shrink: 0;
    margin-top: 0.2rem;
}
.lrn-honesty-foot {
    margin: 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--text-secondary);
    max-width: 82ch;
}
.lrn-honesty-foot a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}
.lrn-honesty-foot a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */
@media (max-width: 820px) {
    .lrn-group { padding-left: 2.75rem; }
    .lrn-honesty { padding: 1.35rem 1.25rem; }
}

@media (max-width: 720px) {
    .lrn-hero { padding: 2.5rem 1.25rem 2rem; }
    .lrn-toc {
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        overflow-x: auto;
        scrollbar-width: none;
        padding: 0 1.25rem 0.25rem;
    }
    .lrn-toc::-webkit-scrollbar { display: none; }
    .lrn-toc a { white-space: nowrap; }
    .lrn-hero-stats { grid-template-columns: repeat(2, 1fr); }
    .lrn-hero-stat:nth-child(3) { border-left: none; }
    .lrn-hero-stat:nth-child(n + 3) { border-top: 1px solid var(--border); }
    .lrn-layout-container { padding-top: 2rem; }
    .lrn-section { margin: 3.5rem 0; }
    .lrn-group {
        padding-left: 0;
        padding-top: 3rem;
    }
    .lrn-group::before { display: none; }
    .lrn-group-num { top: 0; }
}
