/* ==========================================================================
   RESOURCES HUB STYLES
   Matches Serena Health storefront design system
   ========================================================================== */

/* Scope resources-specific article-card styles to resources pages only,
   since homepage.css defines .article-card differently for the homepage */

/* ========== Base ========== */
[data-page^="resources-"] .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ========== Hero ========== */
.resources-hero {
  position: relative;
  padding: 5rem 0 4rem;
  text-align: center;
  background: linear-gradient(135deg,
    rgba(233, 30, 140, 0.05) 0%,
    rgba(123, 63, 157, 0.08) 50%,
    rgba(0, 71, 187, 0.05) 100%
  );
}
.resources-hero h1 {
  font-family: var(--font-family-heading);
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 0.75rem;
  line-height: 1.15;
}
.resources-hero p {
  font-family: var(--font-family-body);
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  margin: 0 auto 2rem;
  max-width: 540px;
  line-height: 1.6;
}

/* Search Bar */
.search-bar {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
}
.search-bar input {
  width: 100%;
  padding: 0.875rem 1.25rem 0.875rem 3rem;
  font-size: 1rem;
  font-family: var(--font-family-body);
  border: 2px solid var(--color-gray-200);
  border-radius: 50px;
  background: var(--color-white);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  color: var(--color-text-primary);
}
.search-bar input:focus {
  border-color: var(--color-accent-purple);
  box-shadow: 0 0 0 3px rgba(123, 63, 157, 0.1);
}
.search-bar input::placeholder { color: var(--color-gray-400); }
.search-bar .search-icon {
  position: absolute;
  left: 1.125rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-gray-400);
  pointer-events: none;
}

/* ========== Section spacing ========== */
.resources-section {
  padding: 4rem 0;
}
.resources-section .section-title {
  font-family: var(--font-family-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 2rem;
}

/* ========== Featured Article ========== */
.featured-card {
  position: relative;
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-gray-900);
  min-height: 360px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.featured-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}
.featured-card-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
  transition: opacity 0.4s ease;
}
.featured-card:hover .featured-card-image { opacity: 0.4; }
.featured-card-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  min-height: 360px;
  padding: 2rem;
  color: var(--color-white);
}
.featured-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}
.featured-card-body h2 {
  font-family: var(--font-family-heading);
  font-size: 1.75rem;
  color: var(--color-white);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.featured-card-body p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 1rem;
  max-width: 640px;
  line-height: 1.6;
}
.featured-read-link {
  font-weight: 600;
  color: var(--color-white);
  font-size: 0.9375rem;
}

/* ========== Category Badge ========== */
.category-badge {
  display: inline-block;
  font-family: var(--font-family-label);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent-purple);
  background: none;
  padding: 0;
  border-radius: 0;
}

/* ========== Category Grid ========== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.category-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
  text-decoration: none;
}
.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  border-color: var(--color-accent-purple);
}
.category-card-icon {
  display: none;
}
.category-card-info { flex: 1; min-width: 0; }
.category-card-info h3 {
  font-family: var(--font-family-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 0.125rem;
}
.category-card-info span {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}
.category-card-arrow {
  color: var(--color-gray-300);
  transition: color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}
.category-card:hover .category-card-arrow {
  color: var(--color-accent-purple);
  transform: translateX(2px);
}

/* ========== Article Grid ========== */
[data-page^="resources-"] .articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
[data-page^="resources-"] .article-card {
  position: relative;
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  min-height: auto;
  padding: 0;
  background-image: none;
  background-size: auto;
  justify-content: stretch;
  box-shadow: var(--shadow-subtle);
  cursor: pointer;
}
[data-page^="resources-"] .article-card::before {
  display: none;
}
[data-page^="resources-"] .article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}
.article-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--color-gray-100);
  display: block;
}
.article-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.article-card-body .category-badge {
  align-self: flex-start;
  margin-bottom: 0.625rem;
}
.article-card-body h3 {
  font-family: var(--font-family-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 0.5rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-body .article-excerpt {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
  flex: 1;
}
.article-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--color-gray-100);
}
.article-card-footer .read-time { color: var(--color-text-tertiary); }
.article-card-footer .read-link {
  color: var(--color-accent-purple);
  font-weight: 600;
  font-size: 0.875rem;
}
.article-card-footer .read-link:hover { text-decoration: underline; }

/* No image placeholder — clean gradient, no emoji */
.article-card-image-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg,
    rgba(233, 30, 140, 0.08) 0%,
    rgba(123, 63, 157, 0.12) 50%,
    rgba(0, 71, 187, 0.08) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  color: transparent;
}

/* ========== Load More ========== */
.load-more-wrapper { text-align: center; margin-top: 2rem; }
.load-more-btn {
  display: inline-block;
  padding: 0.875rem 2.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--font-family-label);
  color: var(--color-accent-purple);
  background: transparent;
  border: 2px solid var(--color-accent-purple);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}
.load-more-btn:hover {
  background: var(--color-accent-purple);
  color: var(--color-white);
}
.load-more-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========== Product CTA Banner ========== */
.product-cta-section {
  background: var(--gradient-primary);
  padding: 5rem 0;
  text-align: center;
}
.product-cta-section h2 {
  font-family: var(--font-family-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-white);
  margin: 0 0 0.75rem;
}
.product-cta-section p {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 520px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}
.product-cta-section .btn-cta {
  display: inline-block;
  padding: 1rem 2.25rem;
  background: var(--color-white);
  color: var(--color-accent-purple);
  font-family: var(--font-family-label);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.product-cta-section .btn-cta:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.trust-text {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 1rem;
}

/* ========== Breadcrumb ========== */
.breadcrumb {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
  padding-top: 1.5rem;
}
.breadcrumb a { color: var(--color-accent-purple); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 0.375rem; color: var(--color-gray-300); }

/* ========== Category Hero ========== */
.category-hero {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--color-gray-200);
  margin-bottom: 2rem;
}
.category-hero-content { display: flex; align-items: center; gap: 1.5rem; }
.category-hero-icon {
  display: none;
}
.category-hero-text h1 {
  font-family: var(--font-family-heading);
  font-size: 2rem;
  margin-bottom: 0.25rem;
}
.category-hero-text p {
  font-size: 1rem;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.6;
}
.category-article-count {
  font-family: var(--font-family-label);
  font-size: 0.8125rem;
  color: var(--color-accent-purple);
  font-weight: 600;
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* Related categories */
.related-categories {
  padding: 3rem 0;
  border-top: 1px solid var(--color-gray-200);
  margin-top: 3rem;
}
.related-categories .section-title {
  font-family: var(--font-family-heading);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}
.related-categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

/* ========== Empty / Loading States ========== */
.loading-state, .empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-secondary);
}
.empty-state p { font-size: 1rem; }

/* ========== Animations ========== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.4s ease forwards; }

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  [data-page^="resources-"] .articles-grid { grid-template-columns: repeat(2, 1fr); }
  .related-categories-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .resources-hero { padding: 3rem 0 2.5rem; }
  .resources-hero h1 { font-size: 2rem; }
  .resources-hero p { font-size: 1rem; }

  .featured-card { min-height: auto; }
  .featured-card-image {
    position: relative;
    height: 200px;
    opacity: 1;
  }
  .featured-card-body {
    position: relative;
    min-height: auto;
    padding: 1.5rem;
    color: var(--color-text-primary);
    background: var(--color-white);
  }
  .featured-card-body h2 { color: var(--color-text-primary); font-size: 1.375rem; }
  .featured-card-body p { color: var(--color-text-secondary); }
  .featured-card { background: var(--color-white); border: 1px solid var(--color-gray-200); }

  .category-grid { grid-template-columns: repeat(2, 1fr); }
  [data-page^="resources-"] .articles-grid { grid-template-columns: 1fr; }
  .related-categories-grid { grid-template-columns: 1fr; }

  .resources-section { padding: 2.5rem 0; }

  .product-cta-section { padding: 3rem 0; }
  .product-cta-section h2 { font-size: 1.75rem; }

  .category-hero-content { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .category-hero-text h1 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  [data-page^="resources-"] .container { padding: 0 1rem; }

  .category-grid { grid-template-columns: 1fr; }
  .search-bar input { font-size: 0.875rem; padding: 0.75rem 1rem 0.75rem 2.625rem; }
}
