/* ============================================================
   VividCharts — Resource Library / Catalog
   Inherits tokens + nav/footer/buttons from styles.css.
   ============================================================ */

/* ============================================================
   HERO
   ============================================================ */
.lib-hero { position: relative; padding: 56px 0 0; overflow: hidden; }
.lib-hero .hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.lib-hero .hero-bg .grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 22%, transparent 72%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 22%, transparent 72%);
  opacity: .5;
}
body.bg-plain .lib-hero .hero-bg .grid { display: none; }
.lib-hero .wrap { position: relative; z-index: 1; }
.lib-head { max-width: 760px; }
.lib-head h1 { font-size: clamp(34px, 5vw, 60px); max-width: 16ch; margin-top: 20px; }
.lib-head h1 .accent { color: var(--brand); }
.lib-head p { font-size: clamp(16px, 1.5vw, 20px); color: var(--ink-2); margin-top: 20px; max-width: 52ch; line-height: 1.55; }

/* ============================================================
   FILTER + SEARCH BAR (sticky)
   ============================================================ */
.lib-toolbar {
  position: sticky; top: 0; z-index: 50;
  margin-top: 48px; padding: 16px 0;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.lib-toolbar-inner { display: flex; align-items: center; gap: 20px; justify-content: space-between; flex-wrap: wrap; }
.lib-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.lib-filter {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-strong); background: var(--white);
  border-radius: var(--r-pill, 999px); border-radius: 999px;
  padding: 10px 18px; cursor: pointer;
  font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--ink-2);
  transition: all .16s var(--ease); white-space: nowrap;
}
.lib-filter .cnt { font-size: 12px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.lib-filter:hover { border-color: var(--brand); color: var(--ink); }
.lib-filter.active { background: var(--ink); border-color: var(--ink); color: var(--white); }
.lib-filter.active .cnt { color: rgba(255,255,255,.6); }

.lib-search { position: relative; flex: none; width: 280px; max-width: 100%; }
.lib-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-3); pointer-events: none; }
.lib-search input {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--white); color: var(--ink);
  font-family: var(--font-body); font-size: 14.5px; font-weight: 500;
  padding: 11px 14px 11px 40px; outline: 0;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.lib-search input::placeholder { color: var(--ink-3); }
.lib-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(63,193,199,.2); }
@media (max-width: 720px) {
  .lib-toolbar-inner { gap: 14px; }
  .lib-search { width: 100%; order: -1; }
}

/* ============================================================
   RESULTS GRID
   ============================================================ */
.lib-results { padding: 48px 0 90px; }
.lib-count { font-size: 13.5px; font-weight: 600; color: var(--ink-3); margin-bottom: 24px; }
.lib-count b { color: var(--ink); }
.lib-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 920px) { .lib-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .lib-grid { grid-template-columns: 1fr; } }

/* card */
.res-card {
  position: relative;
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--white); overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.res-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--brand); }
/* whole-card click target (visual .res-link sits on top, non-interactive) */
.res-cardlink { position: absolute; inset: 0; z-index: 1; }
.res-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--light-cream); overflow: hidden; }
.res-thumb image-slot { position: absolute; inset: 0; width: 100%; height: 100%; }
.res-thumb .res-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 6px 11px; border-radius: var(--r-sm); backdrop-filter: blur(3px);
}
.res-badge.t-case { background: var(--brand); color: var(--brand-fg); }
.res-badge.t-webinar { background: rgba(35,34,45,.86); color: #fff; }
.res-badge.t-guide { background: var(--white); color: var(--ink); border: 1px solid var(--line); }
.res-badge.t-guide .gd { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.res-thumb .res-play {
  position: absolute; right: 12px; bottom: 12px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(35,34,45,.55); border: 1px solid rgba(255,255,255,.25);
  color: #fff; display: grid; place-items: center; backdrop-filter: blur(3px);
}
.res-thumb .res-play svg { width: 16px; height: 16px; margin-left: 2px; }

.res-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.res-card h3 { font-size: 18px; line-height: 1.3; text-wrap: pretty; }
.res-card p { font-size: 14px; color: var(--ink-2); margin-top: 10px; line-height: 1.55; flex: 1; }
.res-metric {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  margin-top: 16px; padding: 6px 12px; border-radius: var(--r-sm);
  background: var(--brand-tint); color: var(--brand-strong);
  font-size: 12.5px; font-weight: 700; letter-spacing: .01em;
}
.res-metric svg { width: 14px; height: 14px; }
.res-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.res-link { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--ink); }
.res-link svg { width: 14px; height: 14px; transition: transform .25s var(--ease); }
.res-card:hover .res-link { color: var(--brand-strong); }
.res-card:hover .res-link svg { transform: translateX(3px); }
.res-meta { font-size: 12px; color: var(--ink-3); font-weight: 600; }

/* Featured card — spans 2 columns, horizontal */
.res-card.featured { grid-column: span 2; flex-direction: row; }
.res-card.featured .res-thumb { aspect-ratio: auto; width: 48%; flex: none; }
.res-card.featured .res-body { padding: 30px; justify-content: center; }
.res-card.featured h3 { font-size: clamp(20px, 2.2vw, 28px); }
.res-card.featured p { font-size: 15px; flex: none; margin-top: 12px; }
.res-card.featured .res-foot { margin-top: 22px; }
@media (max-width: 920px) {
  .res-card.featured { grid-column: span 2; flex-direction: column; }
  .res-card.featured .res-thumb { width: 100%; aspect-ratio: 16/9; }
}
@media (max-width: 600px) { .res-card.featured { grid-column: span 1; } }

/* featured toggled off → behave as a normal card */
.res-card.featured.nofeat { grid-column: span 1; flex-direction: column; }
.res-card.featured.nofeat .res-thumb { width: 100%; aspect-ratio: 16/9; }
.res-card.featured.nofeat .res-body { padding: 22px; justify-content: flex-start; }
.res-card.featured.nofeat h3 { font-size: 18px; }
.res-card.featured.nofeat p { font-size: 14px; flex: 1; }
.res-card.featured.nofeat .res-foot { margin-top: 18px; }

/* hidden by filter/search */
.res-card.hide { display: none; }

/* empty state */
.lib-empty { display: none; text-align: center; padding: 70px 20px; }
.lib-empty.on { display: block; }
.lib-empty .ei { width: 56px; height: 56px; border-radius: 50%; background: var(--light-cream); color: var(--ink-3); display: grid; place-items: center; margin: 0 auto 18px; }
.lib-empty .ei svg { width: 26px; height: 26px; }
.lib-empty h3 { font-size: 22px; }
.lib-empty p { color: var(--ink-2); font-size: 15.5px; margin-top: 10px; }
.lib-empty button { margin-top: 18px; }

/* ============================================================
   KEEP EXPLORING — demo trio
   ============================================================ */
.explore { background: var(--light-cream); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.explore-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 44px; }
.exp-card { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease); }
.exp-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--brand); }
.exp-card .exp-ic { width: 46px; height: 46px; border-radius: var(--r-sm); background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; margin-bottom: 18px; }
.exp-card .exp-ic svg { width: 23px; height: 23px; }
.exp-tag { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.exp-card h3 { font-size: 20px; margin-top: 8px; }
.exp-card p { font-size: 14.5px; color: var(--ink-2); margin-top: 10px; line-height: 1.55; flex: 1; }
.exp-card .exp-link { margin-top: 18px; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--brand-strong); }
.exp-card .exp-link svg { width: 15px; height: 15px; transition: transform .25s var(--ease); }
.exp-card:hover .exp-link svg { transform: translateX(3px); }
@media (max-width: 820px) { .explore-grid { grid-template-columns: 1fr; } }
