/* ============================================================
   Learn tabbed grid — /learn/library/ (groups of categories) and
   /learn/{category}/ (groups of sections), both rendered by
   learn/includes/tabbed-grid.php.

   Tab row at the top (.seg-tabs), panels below, with an
   .empty-state placeholder until a tab is picked. The tabs, pill
   button, section head, listing surface, status pills, progress bar
   and empty state are the shared components in /includes/styles.css;
   the card head band and the group trays (.lib-card-head, .lib-group)
   are in /includes/card-header.css. This file keeps the panels, their
   header and the card body. Protocols (index, category) and Resources
   load it too, for the panel and panel-header rules.
   ============================================================ */

/* Panels: only the active one is shown. */
.lib-panel { display: none; }
.lib-panel.is-active { display: block; }

/* Panel header — title, optional description and actions above the
   grid. The left accent ties the panel back to the active tab's
   colour. The Learn pages put .section-head on it (h2.section-title,
   p.section-desc, .section-actions); .lib-panel-title / -desc are the
   older Protocols and Resources markup. */
.lib-panel-header {
    margin: 0 0 1.75rem;
    padding: 0.25rem 0 0.25rem 1rem;
    border-left: 4px solid var(--primary-soft);
}
.lib-panel-title {
    margin: 0 0 0.4rem;
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}
.lib-panel-desc {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
    max-width: 760px;
}

/* ---------- Listing card body ----------
   a.surface-listing.lib-card: the .lib-card-head band, then a cover
   image or an .icon-tile--lg, the description, and a foot pinned to
   the bottom (status pills, an optional progress row, "Open"), so
   pills and links line up across a grid row. */

/* Optional cover image, framed like a photo inside the card: a little
   wider than the text column, inset from the frame. */
.lib-card-cover {
    flex: 0 0 auto;
    margin: -0.75rem -0.75rem 1.1rem;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--frame-listing);
    border-radius: var(--r-md);
    background: var(--surface-2);
}

.lib-card-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--dur) var(--ease-out);
}

@media (prefers-reduced-motion: no-preference) {
    a.lib-card:hover .lib-card-cover img,
    a.lib-card:focus-visible .lib-card-cover img {
        transform: scale(1.03);
    }
}

/* The icon tile stands in for a missing cover. */
.lib-card-icon {
    align-self: flex-start;
    margin-bottom: 1.1rem;
}

.lib-card-desc {
    margin: 0 0 1rem;
    color: var(--text-secondary);
    font-size: var(--fs-body);
    line-height: 1.55;
}

.lib-card-foot {
    display: flex;
    flex-direction: column;
    align-items: center;   /* the Open button is centred (owner, 2026-10-18) */
    gap: 0.85rem;
    margin-top: auto;
}

.lib-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
/* Pills sit above the description now, so they carry their own gap. */
.lib-card > .lib-card-meta,
.lib-card > .cert-bar-mini { margin-bottom: 0.85rem; }
/* On a card the pills are solid chips in the card colour (white in the
   light theme; owner, 2026-10-18) instead of the translucent tint, so
   they stand off the frosted surface. Text and border colours unchanged. */
.lib-card .lib-card-meta .status-pill { --pill-bg: var(--card-bg); }

.lib-card-progress {
    align-self: stretch;
}

/* "Open": the card is the link; this is its visible label, drawn as a
   solid button (.btn.btn-primary.btn-sm in the markup; owner, 2026-10-18).
   Hovering or focusing the card darkens it like a hovered button. */
.lib-card-open {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    align-self: center;
}

.lib-card-open i {
    font-size: 1.05em;
    transition: transform var(--dur-fast) var(--ease-out);
}

a.lib-card:hover .lib-card-open,
a.lib-card:focus-visible .lib-card-open {
    --bs-btn-bg: var(--bs-btn-hover-bg);
    --bs-btn-border-color: var(--bs-btn-hover-border-color);
}

@media (prefers-reduced-motion: no-preference) {
    a.lib-card:hover .lib-card-open i,
    a.lib-card:focus-visible .lib-card-open i {
        transform: translateX(3px);
    }
}

/* Creator-only hidden item: a dashed frame beside its Hidden pill. */
.lib-card.is-hidden-card {
    border-style: dashed;
}
