/* ==========================================================================
 * Block 1 of 2 — Library header
 * Description: Brand row, tagline panes, theme control for library home
 * Version: 1.a
 * Revised: 10Jul26
 * ========================================================================== */

.page-library {
  min-height: 100dvh;
}

.library-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.library-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

.library-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.library-brand-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  color: var(--text);
}

.lang-chip {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.library-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  /* Match splash brand rhythm (docs/BRAND.md) */
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: none;
}

/* Upper-script beta badge next to brand */
.brand-beta {
  display: inline-block;
  margin-left: 0.2em;
  font-size: 0.48em;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  vertical-align: super;
  line-height: 1;
  color: var(--text-muted);
  opacity: 0.9;
}

.library-panes {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.library-panes-sep {
  margin: 0 0.35rem;
  opacity: 0.55;
}

.library-header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ==========================================================================
 * Block 2 of 2 — Library main + cover grid
 * Description: Intro copy and book cover cards from library.json
 * Version: 1.a
 * Revised: 10Jul26
 * ========================================================================== */

.library-main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.library-heading {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.library-lead {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  max-width: 36rem;
}

.cover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 1.25rem;
}

.library-filter-wrap {
  margin: 0 0 1.25rem;
  max-width: 20rem;
}
.library-filter {
  width: 100%;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 0.65rem;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
}
.library-filter:focus {
  outline: none;
}
.library-filter:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.cover-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface);
  color: inherit;
}

.cover-card:hover {
  text-decoration: none;
}

.cover-card.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.cover-face {
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  background: var(--cover-bg, #4a5568);
  color: #fff;
}

.cover-emoji {
  /* legacy class unused when Lucide book icon is shown */
  font-size: 2.5rem;
  line-height: 1;
}

.cover-icon {
  width: 2.75rem;
  height: 2.75rem;
  /* Lucide stroke SVGs as <img>: white glyph on cover (solid or gradient) */
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.cover-meta {
  padding: 0.75rem 0.85rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cover-name {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
}

.cover-author {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.library-empty {
  padding: 1.25rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
}

.library-footer {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.library-footer-rule {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0 0 1rem;
}

.library-footer-links {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
}

.library-footer-links a {
  color: var(--text-muted);
}

.library-footer-links a:hover {
  color: var(--accent);
}

/* Site pages (about / help / legal) */
.page-site {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 42rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.site-back {
  margin: 0;
}

.site-back a {
  color: var(--accent);
  font-weight: 500;
}

.site-page {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  line-height: 1.55;
}

.site-page h1 {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
}

.site-page h2 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.1rem;
}

.site-lead {
  color: var(--text-muted);
  margin-top: 0;
}

.site-steps {
  padding-left: 1.25rem;
}

.site-footer-nav {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.site-footer-nav a {
  color: var(--text-muted);
}

.site-footer-nav a:hover {
  color: var(--accent);
}
