/* ── Maxlab Resources — page & card styling ── */

.resources-grid {
  --rc-radius: 20px;
  --rc-accent: #EA2B16;
  --rc-shadow: 0 2px 12px rgba(8, 8, 14, 0.06), 0 8px 32px rgba(8, 8, 14, 0.07);
  --rc-shadow-hover: 0 4px 16px rgba(8, 8, 14, 0.08), 0 24px 56px rgba(8, 8, 14, 0.14);
}

/* ── Card shell ── */
.resource-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--rc-radius);
  overflow: hidden;
  box-shadow: var(--rc-shadow);
  height: 100%;
  border: 1px solid rgba(8, 8, 14, 0.06);
  transition: transform 0.35s cubic-bezier(0.22, 0.9, 0.36, 1),
              box-shadow 0.35s ease;
}
.resource-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--rc-shadow-hover);
}

/* ── Thumbnail ── */
.resource-card-thumb {
  position: relative;
  /* Taller ratio → more of the PDF cover shows */
  aspect-ratio: 4 / 3;
  background: #111;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* Smooth gradient fade into the card body */
.resource-card-thumb::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to bottom, transparent, rgba(8, 8, 14, 0.55));
  z-index: 3;
  pointer-events: none;
}

/* Scale the PDF preview slightly on card hover */
.resource-card:hover .resource-card-canvas-wrap {
  transform: scale(1.03);
}

.resource-card-canvas-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  transition: transform 0.5s cubic-bezier(0.22, 0.9, 0.36, 1);
}

.resource-card-canvas {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.resource-card-loaded .resource-card-canvas {
  opacity: 1;
}

/* Skeleton shimmer */
.resource-card-thumb-skeleton {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}
.resource-card-thumb-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(255,255,255,0)   0%,
    rgba(255,255,255,0.12) 40%,
    rgba(255,255,255,0.18) 50%,
    rgba(255,255,255,0.12) 60%,
    rgba(255,255,255,0)   100%
  );
  background-size: 300% 100%;
  animation: rcShimmer 1.8s ease-in-out infinite;
}
.resource-card-loaded .resource-card-thumb-skeleton,
.resource-card-failed .resource-card-thumb-skeleton {
  display: none;
}
@keyframes rcShimmer {
  0%   { background-position: 150% 0; }
  100% { background-position: -150% 0; }
}

/* Fallback icon */
.resource-card-thumb-fallback {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  align-items: center;
  justify-content: center;
  color: #555;
}
.resource-card-failed .resource-card-thumb-fallback {
  display: flex;
}
.resource-card-thumb-fallback svg {
  width: 52px;
  height: 52px;
}

/* ── Card body ── */
.resource-card-body {
  padding: 22px 24px 26px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.resource-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(234, 43, 22, 0.08);
  color: var(--rc-accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 12px;
  align-self: flex-start;
  border: 1px solid rgba(234, 43, 22, 0.15);
}
.resource-card-tag::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--rc-accent);
  border-radius: 50%;
  flex-shrink: 0;
}

.resource-card-title {
  font-size: 20px;
  font-weight: 700;
  color: #08080E;
  margin-bottom: 10px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.resource-card-desc {
  font-size: 13.5px;
  color: #999;
  line-height: 1.65;
  margin-bottom: 18px;
  flex: 1;
}

/* Divider before meta/CTA */
.resource-card-divider {
  height: 1px;
  background: #f0f0f4;
  margin-bottom: 18px;
}

.resource-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.resource-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #bbb;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  /* Keep it on one row; let title/desc flex grow */
  flex-shrink: 0;
}
.resource-card-meta-dot {
  width: 3px;
  height: 3px;
  background: #ddd;
  border-radius: 50%;
}

/* ── CTA button ── */
.resource-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #08080E;
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 10px 18px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.22s ease,
              box-shadow 0.22s ease,
              transform  0.22s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.resource-card-cta:hover {
  background: var(--rc-accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(234, 43, 22, 0.3);
}
.resource-card-cta-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.22s ease;
}
.resource-card-cta:hover .resource-card-cta-arrow {
  transform: translateX(3px);
}

/* ── Mobile ── */
@media (max-width: 600px) {
  .resource-card-body {
    padding: 18px 18px 22px;
  }
  .resource-card-title {
    font-size: 18px;
  }
  .resource-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}
