/* =========================================================
   SOLO Academy – knowledge base index + article typography
   Layered on the Pendax design system (style.css).
   ========================================================= */

/* Extra room at the bottom of the Academy hero so the floating filter
   panel below (see .academy-filter's negative margin) has empty
   vädersol-scene to overlap into, instead of colliding with the intro
   text. Scoped to this one hero -- .section--hero-bg is shared by every
   other page's hero and must stay untouched. */
.academy-hero { padding-bottom: calc(var(--space-section) + clamp(3rem, 7vw, 8rem)); }

/* ---- Index: filter bar (category pills + live search) ----
   Pure client-side (academy_filter.js): hides/shows the already-rendered
   .academy-card elements below, no server round-trip. Pill visual
   language deliberately matches .academy-card__cat so the "active
   category" reads as the same colour language as the cards themselves.
   The whole panel sticks just below the fixed navbar (z-index kept well
   under Bootstrap's .fixed-top navbar so the nav always wins) so the
   controls stay reachable while scrolling a long result list.
   The negative top margin floats the panel up to straddle the boundary
   with .academy-hero above -- first cancelling this section's own
   top padding, then reaching further up into the hero's reserved
   space (see .academy-hero). Sticky positioning doesn't care about the
   margin -- it only affects where the panel rests before it engages. */
.academy-filter {
    position: sticky;
    top: var(--navbar-height);
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.5rem;
    margin-top: calc(-1 * var(--space-section) - clamp(4rem, 11vw, 11rem));
    margin-bottom: 2rem;
}
.academy-filter__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}
.academy-filter__search {
    position: relative;
    flex: 1 1 16rem;
    max-width: 22rem;
}
.academy-filter__search i {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-muted);
    transition: color 0.2s ease;
}
.academy-filter__search input {
    width: 100%;
    padding: 0.6rem 0.9rem 0.6rem 2.35rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.92rem;
    color: var(--ink);
    background: var(--surface-alt);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.academy-filter__search input:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--pendax-accent);
    box-shadow: 0 0 0 4px rgba(var(--pendax-accent-rgb), 0.16);
}
.academy-filter__search:focus-within i { color: var(--pendax-accent-strong); }
.academy-filter__cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
/* Below ~576px, 6+ pills wrapping to three rows makes the sticky panel
   eat half the viewport. A horizontally-scrolling single row keeps the
   sticky header compact regardless of how many categories exist. */
@media (max-width: 575.98px) {
    .academy-filter__cats {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin: 0 -1.5rem;
        padding: 0 1.5rem;
    }
    .academy-filter__cats::-webkit-scrollbar { display: none; }
    .academy-filter__pill { flex: none; }
}
.academy-filter__pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--ink-muted);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease,
        transform 0.18s ease, box-shadow 0.18s ease;
}
.academy-filter__pill:hover {
    border-color: rgba(var(--pendax-accent-rgb), 0.5);
    color: var(--ink);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.academy-filter__pill:active { transform: translateY(0); }
.academy-filter__pill.is-active {
    background: var(--pendax-accent);
    border-color: var(--pendax-accent);
    color: var(--pendax-ink);
    box-shadow: 0 0.3rem 0.75rem rgba(var(--pendax-accent-rgb), 0.35);
}
.academy-filter__count {
    font-size: 0.72rem;
    font-weight: 700;
    color: inherit;
    background: rgba(29, 29, 29, 0.08);
    border-radius: 999px;
    padding: 0.05rem 0.42rem;
    line-height: 1.4;
}
.academy-filter__pill.is-active .academy-filter__count {
    background: rgba(29, 29, 29, 0.16);
}
.academy-filter__status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 1.3rem;
}
.academy-filter__result-count {
    margin: 0;
    font-size: 0.82rem;
    color: var(--ink-muted);
    font-weight: 600;
}
.academy-filter__clear {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: none;
    background: none;
    color: var(--pendax-accent-strong);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}
.academy-filter__clear i { font-size: 0.85rem; }
.academy-filter__clear:hover { color: var(--pendax-accent); text-decoration: underline; }
.academy-filter__empty { padding: 3rem 0; }
.academy-highlight {
    background: rgba(var(--pendax-accent-rgb), 0.4);
    color: var(--ink);
    border-radius: 0.2em;
    padding: 0 0.1em;
}

/* ---- Index: article cards ---- */
.academy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
    gap: 1.5rem;
}
.academy-grid--related { grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.academy-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--ink);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease,
        opacity 0.2s ease;
}
.academy-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(var(--pendax-accent-rgb), 0.5);
}
/* Filtering (academy_filter.js): fade + shrink out, then the script sets
   display:none once the transition finishes so the grid reflows cleanly. */
.academy-card.is-filtered-out {
    opacity: 0;
    transform: scale(0.94);
    pointer-events: none;
}
.academy-card__cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
}
.academy-card__cat {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--pendax-accent-strong);
    background: rgba(var(--pendax-accent-rgb), 0.12);
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
}
.academy-card__title {
    font-size: 1.25rem;
    margin: 0 0 0.5rem;
}
.academy-card:hover .academy-card__title {
    color: var(--pendax-accent-strong);
}
.academy-card__teaser {
    color: var(--ink-muted);
    font-size: 0.95rem;
    margin: 0 0 1.1rem;
}
.academy-card__meta {
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--ink-muted);
    font-weight: 600;
}

/* ---- Article header ---- */
.article-header .article-back {
    display: inline-block;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--pendax-accent-strong);
}
.article-header .article-back:hover { color: var(--pendax-accent); }
.article-header h1 { max-width: 24ch; }
.article-meta {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    font-size: 0.9rem;
}

/* ---- Article body: a comfortable reading column ---- */
.article-body {
    max-width: 44rem;
    font-size: 1.05rem;
}
.article-body .lead {
    font-size: 1.22rem;
    color: var(--ink);
    line-height: 1.6;
    margin-bottom: 1.4rem;
}
.article-body h2 {
    font-size: var(--fs-h3);
    margin: 2.4rem 0 0.85rem;
}
.article-body p { margin: 0 0 1.15rem; }
.article-body ul {
    margin: 0 0 1.35rem;
    padding-left: 1.25rem;
}
.article-body li { margin-bottom: 0.55rem; }
.article-body a {
    color: var(--pendax-accent-strong);
    font-weight: 600;
    text-decoration: underline;
}
.article-body a:hover { color: var(--pendax-accent); }

@media (prefers-reduced-motion: reduce) {
    .academy-card, .academy-filter__pill, .academy-filter__search i, .academy-filter__search input {
        transition: none;
    }
}
