/* ═══════════════════════════════════════════════════════════════
   RESOURCES.CSS
   Page-specific styles for resources.html.
   Load AFTER styles.css (global tokens, header/nav, footer,
   .resource-card component, .grid-3/4/5, .skeleton).
═══════════════════════════════════════════════════════════════ */

.page-wrapper { padding-bottom: 80px; }

/* ─────────────────────────────────────────────────────────────
   HERO
───────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #0F172A 0%, #1E3A5F 60%, #164E63 100%);
  padding: 60px 0 56px;
  position: relative;
  overflow: hidden;
}

.container { padding: 0 20px; }
.hero::before {
  content: ''; position: absolute; top: -80px; right: -80px;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,.3) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: ''; position: absolute; bottom: -60px; left: -60px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(16,185,129,.2) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; text-align: center; max-width: 700px; margin: 0 auto; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-sans); font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--secondary);
  background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.3);
  padding: 4px 12px; border-radius: 99px; margin-bottom: 18px;
}
.hero h1 { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; color: #fff; line-height: 1.15; margin-bottom: 14px; }
.hero h1 em { font-style: normal; color: var(--secondary); }
.hero-sub { font-size: 1rem; color: rgba(255,255,255,.72); line-height: 1.7; margin-bottom: 32px; }

/* Hero search */
.hero-search-wrap { position: relative; max-width: 580px; margin: 0 auto 20px; }
.hero-search { display: flex; background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); overflow: hidden; }
.hero-search input { flex: 1; border: none; outline: none; padding: 14px 18px; font-size: 0.9rem; font-family: var(--font-sans); color: var(--text-head); background: transparent; }
.hero-search input::placeholder { color: var(--text-faint); }
.hero-search-btn { padding: 14px 22px; background: var(--primary); color: #fff; border: none; font-size: 0.875rem; font-weight: 700; font-family: var(--font-sans); transition: background .15s; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.hero-search-btn:hover { background: #1D4ED8; }
.hero-search-btn svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; }
#searchResults { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--bg); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); z-index: 200; max-height: 420px; overflow-y: auto; display: none; border: 1px solid var(--border); }
#searchResults.visible { display: block; }
.search-result-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); transition: background .12s; text-decoration: none; color: var(--text-body); }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--primary-light); }
.sri-icon { font-size: 1.3rem; flex-shrink: 0; }
.sri-info { flex: 1; min-width: 0; }
.sri-title { font-size: 0.85rem; font-weight: 700; color: var(--text-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sri-cat { font-size: 0.72rem; color: var(--text-faint); }
.no-results-msg { padding: 20px; text-align: center; color: var(--text-faint); font-size: 0.85rem; }
.hero-stats { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; }
.hero-stat { font-size: 0.78rem; color: rgba(255,255,255,.6); display: flex; align-items: center; gap: 6px; }
.hero-stat strong { color: #fff; font-weight: 700; }

/* ─────────────────────────────────────────────────────────────
   FILTER BAR
───────────────────────────────────────────────────────────── */
.filter-bar { background: var(--bg); border-bottom: 1px solid var(--border); padding: 12px 0; position: sticky; top: var(--nav-h); z-index: 100; box-shadow: var(--shadow-sm); }
.filter-bar .container { display: flex; align-items: center; gap: 12px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.filter-bar .container::-webkit-scrollbar { display: none; }
.filter-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.filter-divider { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }
.filter-chips { display: flex; gap: 6px; flex-wrap: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 0.78rem; font-weight: 600; padding: 5px 12px; border-radius: 99px; border: 1.5px solid var(--border); background: var(--bg); color: var(--text-body); white-space: nowrap; transition: all .15s; flex-shrink: 0; }
.chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.chip.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.filter-select { font-size: 0.78rem; font-weight: 600; font-family: var(--font-sans); padding: 5px 10px; border-radius: 99px; border: 1.5px solid var(--border); background: var(--bg); color: var(--text-body); appearance: none; -webkit-appearance: none; cursor: pointer; flex-shrink: 0; outline: none; }
.filter-select:focus { border-color: var(--primary); }
.sort-select-wrap { margin-left: auto; flex-shrink: 0; display: flex; align-items: center; gap: 6px; }

/* ─────────────────────────────────────────────────────────────
   SECTIONS
───────────────────────────────────────────────────────────── */
.section { padding: 52px 0; }
.section + .section { padding-top: 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; color: var(--text-head); display: flex; align-items: center; gap: 10px; }
.section-title .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.section-link { font-size: 0.8rem; font-weight: 700; color: var(--primary); white-space: nowrap; transition: opacity .15s; }
.section-link:hover { opacity: .7; }

/* ─────────────────────────────────────────────────────────────
   FEATURED GRID
───────────────────────────────────────────────────────────── */
.featured-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.featured-card { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); background: var(--bg); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; position: relative; }
.featured-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.featured-img-wrap { aspect-ratio: 16/9; background: linear-gradient(135deg, #E2E8F0, #CBD5E1); overflow: hidden; position: relative; }
.featured-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.featured-card:hover .featured-img-wrap img { transform: scale(1.04); }
.featured-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2.4rem; }
.featured-type-badge { position: absolute; top: 10px; left: 10px; font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 5px; }
.featured-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.featured-cat { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); margin-bottom: 8px; }
.featured-title { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--text-head); line-height: 1.4; margin-bottom: 8px; }
.featured-desc { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; flex: 1; margin-bottom: 16px; }
.featured-footer { display: flex; align-items: center; justify-content: space-between; }
.btn-read { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 700; color: var(--primary); border: 1.5px solid var(--primary-mid); border-radius: var(--radius-sm); padding: 8px 14px; background: var(--primary-light); transition: background .15s, border-color .15s; align-self: flex-start; }
.btn-read:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ─────────────────────────────────────────────────────────────
   SAVE BUTTON
───────────────────────────────────────────────────────────── */
.save-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--bg); color: var(--text-faint); transition: all .18s; flex-shrink: 0; }
.save-btn:hover { border-color: var(--warning); color: var(--warning); background: #FEF3C7; }
.save-btn.saved { border-color: var(--warning); color: var(--warning); background: #FEF3C7; }
.save-btn svg { width: 16px; height: 16px; }
.card-save-btn { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(255,255,255,.85); backdrop-filter: blur(4px); color: var(--text-faint); display: flex; align-items: center; justify-content: center; transition: all .18s; z-index: 2; }
.card-save-btn:hover, .card-save-btn.saved { color: var(--warning); background: #fff; }
.card-save-btn svg { width: 15px; height: 15px; }

/* ─────────────────────────────────────────────────────────────
   RESOURCE GRID (per-item "rc-" card layout used in the main grid)
───────────────────────────────────────────────────────────── */
.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.resource-grid .resource-card { position: relative; }
.rc-thumb { aspect-ratio: 16/8; background: var(--surface); overflow: hidden; position: relative; flex-shrink: 0; }
.rc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rc-thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; background: linear-gradient(135deg, var(--primary-light), var(--secondary-light)); }
.rc-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.rc-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 5px; }
.badge-cat  { background: var(--primary-light); color: var(--primary); }
.badge-type { background: var(--secondary-light); color: #065F46; }
.badge-pdf  { background: #FEE2E2; color: #B91C1C; }
.badge-pq   { background: #FEF3C7; color: #92400E; }
.badge-fs   { background: #EDE9FE; color: #5B21B6; }
.badge-guide{ background: #D1FAE5; color: #065F46; }
.badge-note { background: #E0F2FE; color: #0C4A6E; }
.badge-art  { background: var(--primary-light); color: var(--primary); }
.rc-title { font-family: var(--font-display); font-size: 0.92rem; font-weight: 700; color: var(--text-head); line-height: 1.4; }
.rc-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; flex: 1; }
.rc-meta { display: flex; align-items: center; gap: 12px; font-size: 0.72rem; color: var(--text-faint); margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }
.rc-meta span { display: flex; align-items: center; gap: 4px; }
.rc-read-btn { display: block; text-align: center; padding: 9px; font-size: 0.8rem; font-weight: 700; color: var(--primary); border-top: 1px solid var(--border); background: var(--surface); transition: background .15s, color .15s; }
.rc-read-btn:hover { background: var(--primary); color: #fff; }

/* ─────────────────────────────────────────────────────────────
   SKELETON LOADING CARDS (uses .skeleton from styles.css)
───────────────────────────────────────────────────────────── */
.skel-card { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.skel-img  { height: 140px; }
.skel-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.skel-line { height: 12px; }
.skel-line.short  { width: 60%; }
.skel-line.medium { width: 80%; }

/* ─────────────────────────────────────────────────────────────
   EMPTY STATE
───────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-faint); }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--text-head); margin-bottom: 6px; }
.empty-state p { font-size: 0.85rem; line-height: 1.6; }

/* ─────────────────────────────────────────────────────────────
   LOAD MORE
───────────────────────────────────────────────────────────── */
.load-more-wrap { text-align: center; padding: 28px 0 0; }
.btn-load-more { padding: 12px 32px; background: var(--bg); border: 2px solid var(--primary); color: var(--primary); border-radius: var(--radius-md); font-size: 0.875rem; font-weight: 700; font-family: var(--font-sans); transition: background .15s, color .15s; }
.btn-load-more:hover { background: var(--primary); color: #fff; }

/* ─────────────────────────────────────────────────────────────
   MODAL
───────────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.6); backdrop-filter: blur(4px); z-index: 2000; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.show { display: flex; }
.modal-box { background: var(--bg); border-radius: var(--radius-xl); padding: 36px; max-width: 420px; width: 100%; text-align: center; box-shadow: var(--shadow-lg); animation: modalIn .2s ease; }
@keyframes modalIn { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-icon { font-size: 2.8rem; margin-bottom: 14px; }
.modal-box h2 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; color: var(--text-head); margin-bottom: 8px; }
.modal-box p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 10px; }
.btn-primary, .btn-ghost { flex: 1; padding: 11px; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 700; font-family: var(--font-sans); border: none; transition: background .15s, color .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #1D4ED8; }
.btn-ghost { background: var(--surface); color: var(--text-body); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--border); }

.modal-box--search {
  max-width: 560px;
  width: 92%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  position: relative;
  text-align: left;
}
.modal-box--search .modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-faint, #94A3B8);
  cursor: pointer;
  line-height: 1;
}
.search-modal-results {
  overflow-y: auto;
  margin-top: 12px;
  padding-right: 4px;
}
/* ─────────────────────────────────────────────────────────────
   TOAST
───────────────────────────────────────────────────────────── */
#toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text-head); color: #fff; font-size: 0.82rem; font-weight: 600; padding: 10px 20px; border-radius: 99px; opacity: 0; transition: opacity .25s, transform .25s; z-index: 3000; pointer-events: none; white-space: nowrap; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.toast-success { background: var(--secondary); }
#toast.toast-warning { background: var(--warning); }

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .featured-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .featured-grid { grid-template-columns: 1fr; }
  .resource-grid { grid-template-columns: 1fr; }
  .page-wrapper  { padding-bottom: 70px; }
  .hero  { padding: 40px 0 44px; }
  .section { padding: 36px 0; }
}
@media (max-width: 480px) {
  .hero-stats { gap: 14px; }
}
