/**
 * resource-library.css
 * Add to child theme functions.php:
 *   wp_enqueue_style('rl-style', get_stylesheet_directory_uri() . '/resource-library.css', [], '1.0');
 */

:root {
  --rl-green:        #3a7d2e;
  --rl-green-dark:   #2d6124;
  --rl-green-light:  #e8f2e5;
  --rl-green-header: #5a8a2e;
  --rl-text:         #1a1a1a;
  --rl-muted:        #555;
  --rl-border:       #d4d4d4;
  --rl-bg:           #f2f0eb;
  --rl-white:        #ffffff;
  --rl-radius:       5px;
  --rl-font:         'Georgia', serif;
  --rl-font-ui:      system-ui, -apple-system, sans-serif;
}

/* ── Wrap & Layout ────────────────────────────────────────────────────────── */
.rl-wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  font-family: var(--rl-font-ui);
  background: var(--rl-bg);
  min-height: 100vh;
}

.rl-breadcrumb {
  font-size: 13px;
  color: var(--rl-muted);
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
}
.rl-breadcrumb a { color: var(--rl-green); text-decoration: none; }
.rl-breadcrumb a:hover { text-decoration: underline; }

.rl-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.rl-sidebar {
  background: var(--rl-white);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--rl-border);
}

.rl-sidebar-header {
  background: var(--rl-green-header);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 16px;
}

.rl-facet {
  padding: 16px;
  border-bottom: 1px solid var(--rl-border);
}
.rl-facet:last-child { border-bottom: none; }

.rl-facet-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--rl-text);
  margin: 0 0 10px;
}

.rl-facet-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rl-facet-item.rl-hidden { display: none; }

.rl-facet-link {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--rl-green);
  text-decoration: none;
  padding: 2px 0;
  line-height: 1.5;
}
.rl-facet-link:hover { text-decoration: underline; }
.rl-facet-link.is-active {
  font-weight: 700;
  color: var(--rl-green-dark);
}

.rl-facet-count {
  color: var(--rl-muted);
  font-size: 12px;
  margin-left: 4px;
  flex-shrink: 0;
}

.rl-show-more {
  background: none;
  border: none;
  color: var(--rl-green);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 0 0;
  text-decoration: underline;
  display: block;
}
.rl-show-more:hover { color: var(--rl-green-dark); }

/* ── Main ─────────────────────────────────────────────────────────────────── */
.rl-main {
  background: var(--rl-white);
  border-radius: 8px;
  padding: 28px 32px 36px;
  border: 1px solid var(--rl-border);
}

.rl-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.rl-title {
  font-family: var(--rl-font);
  font-size: 26px;
  font-weight: 700;
  color: var(--rl-text);
  margin: 0;
}

.rl-bookmark {
  background: none;
  border: none;
  cursor: pointer;
  color: #c8a93a;
  padding: 4px;
}
.rl-bookmark svg { width: 22px; height: 22px; }

.rl-intro {
  font-size: 14px;
  color: var(--rl-muted);
  margin: 0 0 22px;
  line-height: 1.6;
}

/* ── Form ─────────────────────────────────────────────────────────────────── */
.rl-form { margin-bottom: 20px; }

.rl-form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.rl-form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 160px;
}

.rl-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--rl-text);
}

.rl-input,
.rl-select {
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius);
  font-size: 14px;
  font-family: var(--rl-font-ui);
  color: var(--rl-text);
  background: var(--rl-white);
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}
.rl-input:focus,
.rl-select:focus {
  border-color: var(--rl-green);
  box-shadow: 0 0 0 3px rgba(58,125,46,.12);
}

.rl-form-actions {
  display: flex;
  gap: 10px;
}

.rl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 22px;
  border-radius: var(--rl-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: background .15s, transform .1s;
}
.rl-btn:active { transform: scale(0.97); }

.rl-btn-search {
  background: var(--rl-green);
  color: #fff;
}
.rl-btn-search:hover { background: var(--rl-green-dark); }

.rl-btn-reset {
  background: var(--rl-white);
  color: var(--rl-green);
  border: 1px solid var(--rl-green);
}
.rl-btn-reset:hover { background: var(--rl-green-light); }

/* ── Active Filter Pills ──────────────────────────────────────────────────── */
.rl-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.rl-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: var(--rl-green-light);
  color: var(--rl-green-dark);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #c2dbb9;
  transition: background .15s;
}
.rl-pill:hover { background: #d0e8c8; }

.rl-pill-clear {
  background: #f5f5f5;
  color: var(--rl-muted);
  border-color: var(--rl-border);
}
.rl-pill-clear:hover { background: #eaeaea; }

/* ── Results ──────────────────────────────────────────────────────────────── */
.rl-results-count {
  font-size: 13.5px;
  color: var(--rl-muted);
  margin-bottom: 16px;
}
.rl-results-count strong { color: var(--rl-text); }

.rl-no-results {
  font-size: 14px;
  color: var(--rl-muted);
  padding: 20px 0;
}

.rl-result-item {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rl-border);
}
.rl-result-item:last-of-type { border-bottom: none; }

.rl-result-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--rl-border);
  background: var(--rl-green-light);
}
.rl-result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rl-result-body { flex: 1; min-width: 0; }

.rl-result-type {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--rl-green-light);
  color: var(--rl-green);
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 5px;
}

.rl-result-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 5px;
  line-height: 1.4;
}
.rl-result-title a { color: var(--rl-green); text-decoration: none; }
.rl-result-title a:hover { text-decoration: underline; }

.rl-result-excerpt {
  font-size: 13.5px;
  color: var(--rl-muted);
  margin: 0;
  line-height: 1.6;
}

/* ── Pagination ───────────────────────────────────────────────────────────── */
.page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 28px;
  list-style: none;
  padding: 0;
}
.page-numbers a,
.page-numbers span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: var(--rl-radius);
  border: 1px solid var(--rl-border);
  font-size: 13px;
  text-decoration: none;
  color: var(--rl-green);
  background: var(--rl-white);
  transition: background .15s;
}
.page-numbers a:hover { background: var(--rl-green-light); }
.page-numbers .current {
  background: var(--rl-green);
  color: #fff;
  border-color: var(--rl-green);
  font-weight: 700;
}
.page-numbers .dots {
  border: none;
  background: transparent;
  color: var(--rl-muted);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .rl-layout {
    grid-template-columns: 1fr;
  }
  .rl-main {
    padding: 20px 16px 28px;
  }
  .rl-form-row { flex-direction: column; }
}
