/* ============================================================
   Resources Main Page  — Fried Engineers
   Rebuilt: fixed ghost-number clipping, equal card heights,
   tighter hero/section spacing, added interactivity + filter.
   Colour scheme unchanged (yellow / purple / charcoal).
   ============================================================ */

.resources-main-page {
  background-color: var(--bg);
  background-image: radial-gradient(circle, rgba(29, 34, 38, 0.055) 1px, transparent 1px);
  background-size: 26px 26px;
}

/* ── Hero ─────────────────────────────────────────── */
.resources-hero {
  position: relative;
  padding: 18px 0 20px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 100% at -4% 0%, rgba(252, 210, 6, 0.22), transparent 48%),
    radial-gradient(ellipse 50% 80% at 108% 0%, rgba(117, 32, 146, 0.14), transparent 50%),
    linear-gradient(180deg, var(--white) 0%, rgba(255, 253, 244, 0) 100%);
}

/* floating decorative blobs to fill the empty hero space */
.resources-hero::before,
.resources-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.resources-hero::before {
  width: 220px;
  height: 220px;
  left: 38%;
  bottom: -90px;
  background: radial-gradient(circle, rgba(252, 210, 6, 0.16), transparent 70%);
  animation: rs-float 9s ease-in-out infinite;
}

.resources-hero::after {
  width: 160px;
  height: 160px;
  right: 30%;
  top: -40px;
  background: radial-gradient(circle, rgba(117, 32, 146, 0.12), transparent 70%);
  animation: rs-float 11s ease-in-out infinite reverse;
}

.resources-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 48px;
  align-items: stretch;
}

.resources-hero-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

.resources-hero-left .tag {
  align-self: flex-start;
}

.resources-hero-title {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.92;
  letter-spacing: -2.5px;
  color: var(--charcoal);
}

/* yellow underline flourish under the title */
.resources-hero-title::after {
  content: "";
  display: block;
  width: 84px;
  height: 6px;
  margin-top: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--yellow), rgba(252, 210, 6, 0.35));
}

.resources-hero-content {
  margin-top: 18px;
  max-width: 560px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.72;
  color: var(--text-muted);
}

.resources-hero-stats {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.resources-hero-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 15px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(29, 34, 38, 0.04);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.resources-hero-stat-chip:hover {
  transform: translateY(-2px);
  border-color: var(--yellow);
  box-shadow: 0 6px 16px rgba(252, 210, 6, 0.18);
}

.resources-hero-stat-chip span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(252, 210, 6, 0.18);
}

/* ── Hero Right Nav Card ─────────────────────────── */
.resources-hero-nav {
  background: var(--charcoal);
  border-radius: var(--radius);
  border-top: 4px solid var(--yellow);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: rs-fade-up 0.4s ease both;
}

.resources-hero-nav-head {
  padding: 16px 22px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  gap: 8px;
}

.resources-hero-nav-head span {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--yellow);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.resources-hero-nav-head span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(252, 210, 6, 0.2);
  animation: rs-pulse 2.2s ease-in-out infinite;
}

.resources-hero-nav-links {
  padding: 8px 0;
  flex: 1;
  overflow-y: auto;
  max-height: 360px;
}

/* slim scrollbar for the quick-access list */
.resources-hero-nav-links::-webkit-scrollbar { width: 6px; }
.resources-hero-nav-links::-webkit-scrollbar-thumb {
  background: rgba(252, 210, 6, 0.4);
  border-radius: 999px;
}

.resources-hero-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 22px;
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.12s, color 0.12s, padding-left 0.15s, border-color 0.15s;
}

.resources-hero-nav-link::after {
  content: "→";
  color: var(--yellow);
  opacity: 0;
  font-size: 12px;
  transition: opacity 0.12s, transform 0.15s;
  transform: translateX(-4px);
}

.resources-hero-nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
  padding-left: 26px;
  border-left-color: var(--yellow);
}

.resources-hero-nav-link:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.resources-hero-nav-foot {
  padding: 12px 22px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.resources-hero-nav-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 900;
  color: var(--yellow);
  text-decoration: none;
  transition: gap 0.12s;
}

.resources-hero-nav-all:hover {
  gap: 10px;
}

/* ── Section commons ──────────────────────────────── */
.resources-category-section {
  padding: 22px 0 28px;
}

.resources-latest-section {
  padding: 30px 0 34px;
  background: var(--white);
}

.resources-cta-section {
  padding: 12px 0 44px;
}

.resources-section-header {
  margin-bottom: 20px;
}

.resources-section-header h2 {
  margin-top: 12px;
  font-family: var(--font-main);
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.08;
  letter-spacing: -1px;
  color: var(--charcoal);
}

/* ── Student filter bar (NEW – adds interactivity) ── */
.resources-filter {
  margin: -4px 0 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.resources-filter-search {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 360px;
}

.resources-filter-search input {
  width: 100%;
  height: 46px;
  padding: 0 16px 0 44px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--charcoal);
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.resources-filter-search input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

.resources-filter-search input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 4px rgba(252, 210, 6, 0.16);
}

.resources-filter-search svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  stroke: var(--text-muted);
  pointer-events: none;
}

.resources-filter-count {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-muted);
  white-space: nowrap;
}

.resources-filter-count b {
  color: var(--purple);
}

/* no-results helper (toggled by JS) */
.resources-noresults {
  display: none;
  padding: 40px 24px;
  text-align: center;
  font-family: var(--font-body);
  color: var(--text-muted);
  font-weight: 600;
}

.resources-noresults.is-on {
  display: block;
}

/* ── Category cards — banner + body layout ───────── */
.resources-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;       /* equal-height rows */
}

.resources-category-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;               /* fill grid cell → equal heights */
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  animation: rs-fade-up 0.45s ease both;
}

.resources-category-card.is-hidden { display: none; }

.resources-category-card:nth-child(2) { animation-delay: 0.07s; }
.resources-category-card:nth-child(3) { animation-delay: 0.14s; }
.resources-category-card:nth-child(4) { animation-delay: 0.21s; }
.resources-category-card:nth-child(5) { animation-delay: 0.28s; }
.resources-category-card:nth-child(6) { animation-delay: 0.35s; }
.resources-category-card:nth-child(7) { animation-delay: 0.42s; }
.resources-category-card:nth-child(8) { animation-delay: 0.49s; }
.resources-category-card:nth-child(9) { animation-delay: 0.56s; }

.resources-category-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 50px -10px rgba(29, 34, 38, 0.2);
}

/* Card banner/thumb — number now anchored TOP, never clipped */
.resources-cat-thumb {
  position: relative;
  padding: 22px 22px 20px;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

/* 3-color rotation based on PHP-assigned variant classes */
.resources-cat-var-a .resources-cat-thumb {
  background: linear-gradient(135deg, #1d2226 0%, #2e3d52 100%);
}

.resources-cat-var-b .resources-cat-thumb {
  background: linear-gradient(135deg, #46046a 0%, #752092 100%);
}

.resources-cat-var-c .resources-cat-thumb {
  background: linear-gradient(135deg, #5a3d00 0%, #8a6200 100%);
}

/* subtle diagonal sheen on the banner */
.resources-cat-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.08) 0%, transparent 38%);
  pointer-events: none;
}

/* Large ghost number — anchored to TOP-right, fully visible */
.resources-cat-num {
  position: absolute;
  right: 16px;
  top: 6px;
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -3px;
  color: rgba(255, 255, 255, 0.14);
  pointer-events: none;
  user-select: none;
  z-index: 0;
  transition: color 0.25s ease, transform 0.25s ease;
}

.resources-category-card:hover .resources-cat-num {
  color: rgba(255, 255, 255, 0.22);
  transform: scale(1.06);
}

.resources-cat-thumb-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.resources-cat-thumb-title {
  font-family: var(--font-main);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.3px;
  color: var(--white);
  text-decoration: none;
  flex: 1;
  transition: opacity 0.15s;
}

.resources-cat-thumb-title:hover {
  opacity: 0.85;
}

.resources-cat-count {
  flex-shrink: 0;
  min-width: 26px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  backdrop-filter: blur(2px);
}

/* Card body */
.resources-cat-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.resources-cat-desc {
  margin-bottom: 14px;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.62;
}

/* Child links */
.resources-child-links {
  display: grid;
  gap: 6px;
}

.resources-child-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.14s, border-color 0.14s, color 0.14s, padding-left 0.14s;
}

.resources-child-links a::after {
  content: "→";
  color: var(--purple);
  flex-shrink: 0;
  font-size: 12px;
  transition: transform 0.14s, color 0.14s;
}

.resources-child-links a:hover {
  background: var(--charcoal);
  border-color: var(--charcoal);
  border-left-color: var(--yellow);
  color: var(--white);
  padding-left: 14px;
}

.resources-child-links a:hover::after {
  color: var(--yellow);
  transform: translateX(3px);
}

/* Empty-subcategory note keeps short cards from looking broken */
.resources-cat-nochild {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px dashed var(--border);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.resources-cat-nochild::before {
  content: "✦";
  color: var(--yellow);
  font-size: 13px;
}

/* Footer "explore" link gives every card a consistent bottom anchor */
.resources-cat-foot {
  margin-top: auto;
  padding-top: 14px;
}

.resources-cat-explore {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 900;
  color: var(--purple);
  text-decoration: none;
  transition: gap 0.14s, color 0.14s;
}

.resources-cat-explore:hover {
  gap: 9px;
  color: var(--charcoal);
}

/* ── Empty state ─────────────────────────────────── */
.resources-empty {
  padding: 48px 40px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.resources-empty h2 {
  font-family: var(--font-main);
  font-size: 26px;
  margin-bottom: 10px;
}

.resources-empty p {
  color: var(--text-muted);
  font-family: var(--font-body);
}

/* ── Latest resource cards ───────────────────────── */
.resources-latest-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.resources-latest-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
  animation: rs-fade-up 0.45s ease both;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.resources-latest-card:nth-child(2) { animation-delay: 0.08s; }
.resources-latest-card:nth-child(3) { animation-delay: 0.16s; }
.resources-latest-card:nth-child(4) { animation-delay: 0.24s; }
.resources-latest-card:nth-child(5) { animation-delay: 0.32s; }
.resources-latest-card:nth-child(6) { animation-delay: 0.40s; }

.resources-latest-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.resources-latest-media {
  display: block;
  text-decoration: none;
  overflow: hidden;
  position: relative;
}

.resources-latest-media img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.resources-latest-card:hover .resources-latest-media img {
  transform: scale(1.06);
}

.resources-latest-placeholder {
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(117, 32, 146, 0.13), rgba(252, 210, 6, 0.22));
}

.resources-latest-placeholder span {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--charcoal);
  color: var(--yellow);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -1px;
}

.resources-latest-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}

.resources-latest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.resources-latest-tags span {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(117, 32, 146, 0.08);
  color: var(--purple);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 800;
}

.resources-latest-body h3 {
  font-family: var(--font-main);
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.3px;
}

.resources-latest-body h3 a {
  color: var(--charcoal);
  text-decoration: none;
}

.resources-latest-body h3 a:hover {
  color: var(--purple);
}

.resources-latest-body p {
  font-family: var(--font-body);
  color: var(--text-muted);
  line-height: 1.65;
  font-size: 14px;
  flex: 1;
}

.resources-latest-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--purple);
  text-decoration: none;
  font-weight: 800;
  font-family: var(--font-body);
  font-size: 13.5px;
  transition: gap 0.15s;
}

.resources-latest-link:hover {
  gap: 8px;
}

/* ── CTA box ─────────────────────────────────────── */
.resources-cta-box {
  padding: 36px 40px 36px 38px;
  border-radius: var(--radius);
  background: var(--charcoal);
  border-left: 5px solid var(--yellow);
  color: var(--white);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  position: relative;
  overflow: hidden;
}

.resources-cta-box::before {
  content: '';
  position: absolute;
  top: -70px;
  right: -70px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(252, 210, 6, 0.06);
  pointer-events: none;
}

.resources-cta-box::after {
  content: '';
  position: absolute;
  bottom: -90px;
  right: 120px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(117, 32, 146, 0.18);
  pointer-events: none;
}

.resources-cta-box > div { position: relative; z-index: 1; }

.resources-cta-box h2 {
  font-family: var(--font-main);
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 8px;
}

.resources-cta-box p {
  max-width: 680px;
  font-family: var(--font-body);
  font-size: 15px;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.7;
}

.resources-cta-box .btn-primary {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* ── Animations ──────────────────────────────────── */
@keyframes rs-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes rs-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-22px); }
}

@keyframes rs-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(252, 210, 6, 0.45); }
  50%      { box-shadow: 0 0 0 6px rgba(252, 210, 6, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .resources-hero::before,
  .resources-hero::after,
  .resources-hero-nav-head span::before { animation: none; }
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 1100px) {
  .resources-category-grid,
  .resources-latest-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .resources-hero {
    padding: 16px 0 18px;
  }

  .resources-hero-inner {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .resources-hero-nav {
    display: none;
  }
}

@media (max-width: 720px) {
  .resources-hero {
    padding: 14px 0 16px;
  }

  .resources-category-grid,
  .resources-latest-grid {
    grid-template-columns: 1fr;
  }

  .resources-cat-body,
  .resources-latest-body {
    padding: 16px 16px 18px;
  }

  .resources-filter-search {
    max-width: 100%;
  }

  .resources-cta-box {
    flex-direction: column;
    align-items: flex-start;
    padding: 26px 24px 26px 26px;
  }
}