/* We The People Library — 2026 theme layer.
   Loaded after style.css and discussion-cards.css: it retunes the shared
   design tokens (so every page picks up the new palette) and restyles the
   shared components, then defines the landing page. */

:root {
  --bg: #07070a;
  --bg-panel: #101015;
  --bg-panel-2: #181820;
  --border: #272730;
  --red: #e11d2e;
  --red-bright: #ff3b47;
  --white: #f5f5f7;
  --grey: #a7a7b3;
  --radius: 16px;
  --glass: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glow: 0 10px 34px rgba(225, 29, 46, 0.28);
  --ease: 0.18s ease;
}

html { scroll-behavior: smooth; }
::selection { background: var(--red); color: #fff; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background:
    radial-gradient(1100px 520px at 85% -8%, rgba(225, 29, 46, 0.16), transparent 62%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------ Header */
.site-header {
  background: rgba(9, 9, 12, 0.78);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 1px 0 rgba(225, 29, 46, 0.45);
}
.brand__title { letter-spacing: 0.04em; }
.site-header__stats { font-family: 'Inter', sans-serif; font-size: 0.78rem; }
.site-nav { gap: 2px; font-family: 'Oswald', sans-serif; letter-spacing: 0.02em; }
.site-nav a {
  padding: 8px 12px;
  border-radius: 10px;
  transition: background var(--ease), color var(--ease);
}
.site-nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.site-nav a.cta:hover { background: linear-gradient(135deg, #ff3b47, #d3182a); }
.site-nav__user { padding: 6px 10px; border-radius: 999px; background: var(--glass); }

/* ----------------------------------------------------------- Buttons */
.cta {
  background: linear-gradient(135deg, #ee2a3b, #bf1220);
  border-radius: 12px;
  padding: 11px 22px;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.06em;
  box-shadow: var(--glow);
  transition: transform var(--ease), box-shadow var(--ease), filter var(--ease);
}
.cta:hover { background: linear-gradient(135deg, #ff3b47, #d3182a); transform: translateY(-1px); filter: brightness(1.05); }
.cta:active { transform: translateY(0); }
.cta--large { padding: 14px 30px; font-size: 1rem; border-radius: 14px; }
.lp-button-ghost {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
  transition: background var(--ease), border-color var(--ease), transform var(--ease);
}
.lp-button-ghost:hover { background: rgba(255, 255, 255, 0.1); border-color: #fff; transform: translateY(-1px); }

/* ------------------------------------------- Inputs, forms and tables */
.filters input,
.filters select,
.stacked-form input,
.stacked-form select,
.stacked-form textarea,
.edit-details__body input,
.edit-details__body select,
.edit-details__body textarea,
.edit-title-form input {
  background: #0c0c11;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.filters input:focus,
.filters select:focus,
.stacked-form input:focus,
.stacked-form select:focus,
.stacked-form textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(225, 29, 46, 0.22);
}
.filters { gap: 12px; }
.alert { border-radius: 12px; }
.edit-details, .queue-item, .dropzone { border-radius: 14px; }
.admin-table tbody tr { transition: background var(--ease); }
.admin-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.pagination a, .pagination [aria-current] { border-radius: 10px; border-color: var(--border); }
.pagination a:hover { border-color: var(--red); }
.delete-button, .back-link { border-radius: 12px; }

/* ------------------------------------------------------------- Cards */
.card {
  background: linear-gradient(180deg, #15151b, #0d0d11);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}
.card:hover {
  border-color: rgba(225, 29, 46, 0.7);
  transform: translateY(-4px);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(225, 29, 46, 0.25);
}
.card__thumb-wrap { border-radius: var(--radius) var(--radius) 0 0; }
.card__type {
  border-radius: 8px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-family: 'Oswald', sans-serif;
}
.card__title { font-family: 'Oswald', sans-serif; line-height: 1.25; }
.card__author { font-family: 'Inter', sans-serif; font-size: 0.8rem; }
.card__category { font-family: 'Inter', sans-serif; font-size: 0.68rem; letter-spacing: 0.08em; }
.grid { gap: 20px; }

.category-chip {
  background: var(--glass);
  border-color: var(--glass-border);
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.02em;
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}
.category-chip:hover { background: rgba(255, 255, 255, 0.08); }
.category-chip.is-active { background: linear-gradient(135deg, #ee2a3b, #bf1220); box-shadow: var(--glow); }

.creator-heading { letter-spacing: 0.01em; border-bottom-color: var(--border); }
.results-bar, .jump-list a { font-family: 'Inter', sans-serif; }
.jump-list a { border-radius: 8px; }

/* ----------------------------------------------- Detail + community */
.detail__player, .detail__pdf, .detail__cover { border-radius: var(--radius); }
.detail__pdf { border-color: var(--border); }
.community-card, .community-sidebar__card, .community-write-box, .rewards-card,
.community-post-detail { border-radius: var(--radius); }

/* ------------------------------------------------------ Browse header */
.hero {
  background:
    radial-gradient(800px 320px at 80% 0%, rgba(225, 29, 46, 0.2), transparent 60%),
    transparent;
  border-bottom: 1px solid var(--glass-border);
}
.hero--compact { padding: 34px 0 18px; }
.hero--compact .hero__title { font-size: clamp(2rem, 4vw, 2.8rem); }
.hero--compact .hero__sub { color: var(--grey); margin: 6px auto 0; max-width: 46em; }

/* ------------------------------------------------------------ Footer */
.site-footer {
  margin-top: 40px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.55));
  border-top: 1px solid var(--glass-border);
}
.site-footer__dedication img { border-radius: var(--radius); }

/* ======================================================= Landing page */
.lp-hero {
  position: relative;
  padding: clamp(48px, 8vw, 110px) 0 36px;
  background:
    radial-gradient(900px 520px at 82% 18%, rgba(225, 29, 46, 0.3), transparent 62%),
    linear-gradient(180deg, rgba(7, 7, 10, 0.6) 0%, rgba(7, 7, 10, 0.92) 78%, var(--bg) 100%),
    url('/img/site-bg.jpg') center top / cover no-repeat;
  border-bottom: 1px solid var(--glass-border);
}
.lp-hero .wrap, .lp-main .wrap { max-width: 1280px; }
.lp-hero__inner {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
}
.lp-eyebrow {
  margin: 0;
  font-family: 'Oswald', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--red-bright);
}
.lp-hero__title {
  font-family: 'Anton', sans-serif;
  font-size: clamp(2.5rem, 6.4vw, 5.1rem);
  line-height: 1.03;
  letter-spacing: 0.01em;
  margin: 14px 0 22px;
}
.lp-hero__title span { color: var(--red-bright); text-shadow: 0 0 40px rgba(255, 59, 71, 0.45); }
.lp-hero__lead {
  max-width: 38em;
  margin: 0;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.7;
  color: #cfcfd9;
}
.lp-hero__lead strong { color: #fff; }
.lp-hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.lp-hero__note { margin: 18px 0 0; color: var(--grey); font-size: 0.9rem; }
.lp-hero__note a { color: var(--red-bright); text-decoration: underline; text-underline-offset: 3px; }
.lp-hero__note strong { color: #fff; }
.lp-hero__emblem { display: grid; place-items: center; }
.lp-hero__emblem img {
  width: min(100%, 340px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(225, 29, 46, 0.9), 0 0 90px rgba(225, 29, 46, 0.5);
}

.lp-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: clamp(32px, 5vw, 56px) 0 0;
  padding: 0;
}
.lp-stats > div {
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.lp-stats dt { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--grey); }
.lp-stats dd { margin: 4px 0 0; font-family: 'Anton', sans-serif; font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: 0.02em; }

.lp-section { padding-top: clamp(36px, 6vw, 72px); }
.lp-section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lp-section__title {
  margin: 0;
  font-family: 'Anton', sans-serif;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.lp-section__sub { margin: 8px 0 26px; color: var(--grey); }
.lp-section__head .lp-section__sub { margin-bottom: 0; }
.lp-section--shelf .lp-section__head { margin-bottom: 22px; }
.lp-link { color: var(--red-bright); font-family: 'Oswald', sans-serif; letter-spacing: 0.04em; white-space: nowrap; }
.lp-link:hover { color: #fff; }

.lp-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.lp-tile {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 30px 28px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01));
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}
.lp-tile::before {
  content: '';
  position: absolute;
  inset: auto -30% -60% auto;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--tile-accent, var(--red));
  opacity: 0.18;
  filter: blur(40px);
  transition: opacity var(--ease);
}
.lp-tile--book { --tile-accent: #9a9aa6; }
.lp-tile--video { --tile-accent: var(--red); }
.lp-tile--audio { --tile-accent: #7a5ce0; }
.lp-tile:hover { transform: translateY(-4px); border-color: var(--tile-accent); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); }
.lp-tile:hover::before { opacity: 0.35; }
.lp-tile__count { font-family: 'Anton', sans-serif; font-size: clamp(2.4rem, 4.5vw, 3.4rem); line-height: 1; }
.lp-tile__name { font-family: 'Oswald', sans-serif; font-size: 1.25rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tile-accent); filter: brightness(1.25); }
.lp-tile__desc { color: var(--grey); font-size: 0.92rem; }

.lp-shelf {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 6px max(40px, calc((100vw - 1200px) / 2)) 26px;
  scroll-snap-type: x proximity;
  scroll-padding-left: max(40px, calc((100vw - 1200px) / 2));
  scrollbar-width: thin;
  scrollbar-color: #3a3a46 transparent;
}
.lp-shelf .card { flex: 0 0 190px; padding: 14px; gap: 6px; scroll-snap-align: start; }
.lp-shelf .card__thumb-wrap { width: calc(100% + 28px); aspect-ratio: 4 / 3; margin: -14px -14px 8px; }
.lp-shelf .card__title {
  font-size: 0.92rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lp-shelf .card__category, .lp-shelf .card__meta { display: none; }

.lp-topics { display: flex; flex-wrap: wrap; gap: 12px; }
.lp-topic {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  transition: border-color var(--ease), background var(--ease), transform var(--ease);
}
.lp-topic:hover { border-color: var(--red); background: rgba(225, 29, 46, 0.1); transform: translateY(-2px); }
.lp-topic__name { font-family: 'Oswald', sans-serif; font-size: 1.05rem; letter-spacing: 0.03em; }
.lp-topic__count { color: var(--red-bright); font-weight: 700; font-size: 0.85rem; }

.lp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.lp-step {
  padding: 26px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
}
.lp-step h3 { margin: 14px 0 6px; font-family: 'Oswald', sans-serif; font-size: 1.2rem; letter-spacing: 0.03em; }
.lp-step p { margin: 0; color: var(--grey); line-height: 1.6; font-size: 0.95rem; }
.lp-step__num {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-family: 'Anton', sans-serif;
  background: linear-gradient(135deg, #ee2a3b, #bf1220);
  box-shadow: var(--glow);
}

.lp-cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding: clamp(28px, 5vw, 48px);
  border-radius: 24px;
  border: 1px solid rgba(225, 29, 46, 0.45);
  background:
    radial-gradient(600px 240px at 90% 0%, rgba(225, 29, 46, 0.35), transparent 70%),
    linear-gradient(135deg, rgba(225, 29, 46, 0.14), rgba(225, 29, 46, 0.03));
}
.lp-cta-band h2 { margin: 0; font-family: 'Anton', sans-serif; font-weight: 400; font-size: clamp(1.6rem, 3vw, 2.3rem); text-transform: uppercase; letter-spacing: 0.02em; }
.lp-cta-band p { margin: 8px 0 0; color: #d6d6df; }
.lp-cta-band__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.lp-main { padding-bottom: 56px; }

/* --------------------------------------------------------- Responsive */
@media (max-width: 900px) {
  .lp-hero__inner { grid-template-columns: 1fr; }
  .lp-hero__emblem { order: -1; justify-self: start; }
  .lp-hero__emblem img { width: 120px; box-shadow: 0 0 0 4px rgba(225, 29, 46, 0.9), 0 0 50px rgba(225, 29, 46, 0.45); }
  .lp-stats { grid-template-columns: repeat(2, 1fr); }
  .lp-tiles, .lp-steps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .lp-shelf { padding-left: 20px; padding-right: 20px; scroll-padding-left: 20px; }
  .lp-shelf .card { flex-basis: 160px; }
  .lp-hero__actions .cta, .lp-hero__actions .lp-button-ghost { flex: 1 1 100%; text-align: center; }
  .lp-cta-band__actions { width: 100%; }
  .lp-cta-band__actions .cta, .lp-cta-band__actions .lp-button-ghost { flex: 1 1 100%; text-align: center; }
  .site-nav a { padding: 8px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* ===================================================== Library (browse) */
.lib-toolbar {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  min-width: 0;
  align-items: stretch;
  gap: 14px;
  margin: 26px 0 8px;
  padding: 16px;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.lib-toolbar__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.lib-toolbar .filters__search { flex: 1 1 280px; max-width: none; }
.lib-toolbar select { flex: 0 0 auto; }
.lib-toolbar__apply { padding: 10px 20px; }

/* Radios drive the live filtering but are drawn as buttons. */
.filters .seg input,
.filters .chip-opt input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
}
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 14px; background: #0c0c11; border: 1px solid var(--border); }
.seg__opt { position: relative; cursor: pointer; }
.seg__opt span {
  display: block;
  padding: 8px 14px;
  border-radius: 10px;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.03em;
  color: var(--grey);
  white-space: nowrap;
  transition: background var(--ease), color var(--ease);
}
.seg__opt:hover span { color: #fff; }
.seg__opt input:checked + span { background: linear-gradient(135deg, #ee2a3b, #bf1220); color: #fff; box-shadow: var(--glow); }
.seg__opt input:focus-visible + span, .chip-opt input:focus-visible + span { outline: 2px solid var(--red-bright); outline-offset: 2px; }
.seg em, .chip-opt em { font-style: normal; font-size: 0.78em; opacity: 0.7; margin-left: 4px; }

.lib-toolbar__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-opt { position: relative; cursor: pointer; }
.chip-opt span {
  display: block;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--grey);
  white-space: nowrap;
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}
.chip-opt:hover span { border-color: var(--red); color: #fff; }
.chip-opt input:checked + span { background: rgba(225, 29, 46, 0.18); border-color: var(--red); color: #fff; }

/* Denser, poster-style grid */
.browse-results .grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; padding-bottom: 6px; }
.browse-results .card { padding: 12px; gap: 5px; }
.browse-results .card__thumb-wrap { width: calc(100% + 24px); aspect-ratio: 3 / 4; margin: -12px -12px 8px; }
.browse-results .card__title {
  font-size: 0.98rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.browse-results .card__author { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browse-results .card__meta { margin-top: 2px; font-size: 0.72rem; }
.results-bar { margin: 18px 0 14px; }

/* Items without a cover get a clean placeholder instead of a blank box. */
.card__thumb-wrap { background: linear-gradient(160deg, #1b1b24, #111117); display: grid; place-items: center; }
.card__thumb-wrap::after {
  content: '';
  font-size: 2.6rem;
  opacity: 0.35;
  grid-area: 1 / 1;
}
.card__thumb-wrap--book::after { content: '📖'; }
.card__thumb-wrap--video::after { content: '🎬'; }
.card__thumb-wrap--audio::after { content: '🎧'; }
.card__thumb-wrap--audio { background: linear-gradient(160deg, #26204a, #14111f); }

@media (max-width: 640px) {
  .lib-toolbar { padding: 12px; border-radius: 16px; }
  .lib-toolbar__row > * { flex: 1 1 100%; }
  .seg { display: flex; }
  .seg__opt { flex: 1 1 0; text-align: center; }
  .seg__opt span { padding: 8px 6px; }
  .seg em { display: none; }
  .lib-toolbar__apply { display: none; }
  .lib-toolbar__chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px; padding: 0 12px 4px; scrollbar-width: none; }
  .browse-results .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .browse-results .card { padding: 10px; }
  .browse-results .card__thumb-wrap { width: calc(100% + 20px); margin: -10px -10px 6px; }
  .browse-results .card__title { font-size: 0.88rem; }
}
.card__thumb { background: transparent; }
