/* ========================================================
   Resource Library  |  prefix: rlib-
   ======================================================== */

:root {
  --rlib-accent:  #A55A87;
  --rlib-accent-h:#8e4872;
  --rlib-title:   #2a7fa5;
  --rlib-text:    #333;
  --rlib-muted:   #666;
  --rlib-light:   #999;
  --rlib-border:  #e5e5e5;
  --rlib-shadow:  0px 4px 12px rgba(0, 0, 0, 0.08);
  --rlib-radius:  10px;
  --rlib-font:    "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.rlib-wrap {
  font-family: var(--rlib-font);
  background: transparent;
  width: 100%;
  color: var(--rlib-text);
}

/* ── TOOLBAR ── */
.rlib-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 28px;
  flex-wrap: wrap;
}

/* Search */
.rlib-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--rlib-border);
  border-radius: 8px;
  padding: 10px 16px;
  flex: 1;
  max-width: 460px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.rlib-search-box:focus-within {
  border-color: var(--rlib-accent);
  box-shadow: 0 0 0 3px rgba(165, 90, 135, 0.1);
}
.rlib-search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  font-family: var(--rlib-font);
  color: var(--rlib-text);
  width: 100%;
}
.rlib-search-box input::placeholder { color: #bbb; }

/* Filter tabs */
.rlib-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.rlib-tab {
  font-family: var(--rlib-font);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 6px;
  border: 1px solid var(--rlib-border);
  background: #fff;
  color: var(--rlib-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.rlib-tab.rlib-active {
  background: var(--rlib-accent);
  color: #fff;
  border-color: var(--rlib-accent);
  font-weight: 600;
}
.rlib-tab:hover:not(.rlib-active) {
  border-color: var(--rlib-accent);
  color: var(--rlib-accent);
}

/* ── GRID ── */
.rlib-grid {
  display: grid;
  gap: 28px 24px;
  width: 100%;
}
.rlib-cols-3 { grid-template-columns: repeat(3, 1fr); }
.rlib-cols-2 { grid-template-columns: repeat(2, 1fr); }
.rlib-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ── CARD ── */
.rlib-card {
  background: #fff;
  border-radius: var(--rlib-radius);
  overflow: hidden;
  box-shadow: var(--rlib-shadow);
  border: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.rlib-card:hover {
  transform: translateY(-4px);
  box-shadow: 0px 12px 28px rgba(0,0,0,0.12);
}
.rlib-card.rlib-hidden { display: none; }

/* Thumbnail */
.rlib-thumb {
  width: 100%;
  height: 190px;
  overflow: hidden;
  background: #f5f3ef;
  flex-shrink: 0;
}
.rlib-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.38s ease;
}
.rlib-card:hover .rlib-thumb img { transform: scale(1.04); }
.rlib-thumb-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9f8f5;
}

/* Body */
.rlib-body { padding: 16px 18px 10px; flex: 1; }
.rlib-title {
  font-family: var(--rlib-font);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--rlib-title);
  margin: 0 0 8px;
  line-height: 1.3;
  cursor: pointer;
}
.rlib-title:hover { text-decoration: underline; }
.rlib-desc {
  font-family: var(--rlib-font);
  font-size: 13px;
  color: var(--rlib-muted);
  line-height: 1.6;
  margin: 0;
}

/* Footer */
.rlib-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px 16px;
  margin-top: auto;
  gap: 10px;
}
.rlib-date {
  font-family: var(--rlib-font);
  font-size: 11px;
  font-weight: 500;
  color: var(--rlib-light);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.rlib-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--rlib-accent);
  color: #fff !important;
  font-family: var(--rlib-font);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 9px 16px;
  border-radius: 5px;
  text-decoration: none !important;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.rlib-btn:hover {
  background: var(--rlib-accent-h);
  transform: translateY(-1px);
  color: #fff !important;
}

/* ── NO RESULTS ── */
.rlib-no-results {
  text-align: center;
  padding: 64px 0;
  color: #ccc;
}
.rlib-no-results svg { display: block; margin: 0 auto 12px; }
.rlib-no-results p   { font-size: 15px; color: #aaa; font-family: var(--rlib-font); }

.rlib-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 0;
  color: #aaa;
  font-size: 14px;
  font-family: var(--rlib-font);
}
.rlib-empty a { color: var(--rlib-accent); text-decoration: none; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .rlib-cols-3 { grid-template-columns: repeat(2, 1fr); }
  .rlib-cols-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .rlib-toolbar  { flex-direction: column; align-items: stretch; }
  .rlib-search-box { max-width: 100%; }
  .rlib-tabs     { justify-content: flex-start; }
}
@media (max-width: 580px) {
  .rlib-cols-2,
  .rlib-cols-3,
  .rlib-cols-4   { grid-template-columns: 1fr; }
  .rlib-grid     { gap: 20px; }
  .rlib-thumb    { height: 200px; }
}
