/* pages/resources.css — Resources hub + article pages */

/* ========================================
   1. Article grid (resources hub)
   ======================================== */
.res-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-xl);
}

@media (min-width: 768px) {
  .res-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .res-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* "What can we help with" link closing the article list */
.res-grid__more {
  margin: var(--space-xl) 0 0;
}

/* Whole card is the link; cover bleeds to the card edge */
a.res-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.res-card__cover {
  aspect-ratio: 2 / 1;
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
}

.res-card__cover svg {
  display: block;
  width: 100%;
  height: 100%;
}

.res-card__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  padding: var(--space-lg);
}

@media (min-width: 768px) {
  .res-card__body {
    padding: var(--space-xl) var(--space-lg);
  }
}

.res-card__title {
  font-size: 1.125rem;
  font-weight: var(--font-medium);
  line-height: 1.45;
  margin: var(--space-md) 0 var(--space-sm);
}

.res-card__desc {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.res-card__link {
  margin-top: auto;
}

a.res-card:hover .res-card__link::after {
  transform: translateX(3px);
}

/* ========================================
   2. Article hero (beige) — breadcrumb, title, meta
   ======================================== */
.article-hero {
  padding: 56px 0;
  background: var(--color-bg-alt);
}

@media (min-width: 1024px) {
  .article-hero {
    padding: 96px 0;
  }
}

.article-hero__crumbs {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
}

.article-hero__crumbs a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-hero .hero__heading {
  max-width: 22em;
  font-size: clamp(1.75rem, 4.6vw, 2.5rem);
  line-height: 1.22;
  margin-bottom: var(--space-lg);
}

/* Publish / update date · reading time · author */
.article-meta {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.article-meta time {
  font-weight: var(--font-regular);
}

/* ========================================
   3. Article body + sticky sidebar
   ======================================== */
.res-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3xl);
  align-items: start;
}

@media (min-width: 1024px) {
  .res-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: var(--space-4xl);
  }
}

.res-article {
  max-width: 740px;
}

.res-article__lead {
  font-size: 1.125rem;
  line-height: 1.85;
  color: var(--color-ink);
  margin-bottom: var(--space-2xl);
}

.res-article__body h2 {
  font-size: 1.375rem;
  margin: var(--space-3xl) 0 var(--space-md);
}

.res-article__body h2:first-child {
  margin-top: 0;
}

.res-article__body p,
.res-article__body li {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--color-text-muted);
}

.res-article__body p {
  margin-bottom: var(--space-lg);
}

.res-article__body ul,
.res-article__body ol {
  margin: 0 0 var(--space-lg);
  padding-left: 1.4em;
}

.res-article__body ol {
  list-style: decimal;
}

.res-article__body ul {
  list-style: disc;
}

.res-article__body li {
  margin-bottom: var(--space-sm);
}

/* Figure / comparison table */
.res-figure {
  margin: 0 0 var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  overflow-x: auto;
}

.res-figure table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.65;
}

.res-figure caption {
  padding: var(--space-md) var(--space-md) var(--space-sm);
  font-weight: var(--font-medium);
  color: var(--color-ink);
  text-align: left;
}

.res-figure th,
.res-figure td {
  padding: var(--space-md);
  border-top: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.res-figure thead th {
  background: var(--color-bg-alt);
  font-weight: var(--font-medium);
  color: var(--color-ink);
}

.res-figure tbody th {
  width: 28%;
  font-weight: var(--font-medium);
  color: var(--color-ink);
}

.res-figure td {
  color: var(--color-text-muted);
}

/* Closing call-to-action box */
.res-article__cta {
  margin-top: var(--space-3xl);
  padding: var(--space-xl) var(--space-lg);
  background: var(--color-bg-alt);
  border-radius: var(--radius-card);
}

.res-article__cta-title {
  font-size: 1.25rem;
  font-weight: var(--font-medium);
  margin-bottom: var(--space-sm);
}

.res-article__cta p {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.res-article__cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.res-article__cta .res-article__cta-more {
  margin: var(--space-md) 0 0;
}

/* Previous / next */
.res-article__nav {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.res-article__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.875rem;
  color: var(--color-primary);
  text-decoration: none;
}

.res-article__nav a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Sidebar — contents + consult card, sticky beside the article on desktop */
.res-sidebar {
  display: grid;
  gap: var(--space-lg);
}

@media (min-width: 1024px) {
  .res-sidebar {
    position: sticky;
    top: 96px;
  }
}

/* The contents list only helps beside the article, not after it */
.res-toc {
  display: none;
}

@media (min-width: 1024px) {
  .res-toc {
    display: block;
  }
}

.res-toc__title {
  font-size: 0.875rem;
  font-weight: var(--font-medium);
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}

.res-toc ol {
  margin: 0;
  padding-left: 1.3em;
  list-style: decimal;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.res-toc li {
  margin-bottom: 6px;
}

.res-toc li:last-child {
  margin-bottom: 0;
}

/* block (not inline-block) so the list number sits on the first line of a wrapped entry */
.res-toc__link {
  display: block;
  padding: 3px 0;
  line-height: 1.5;
  color: var(--color-ink);
  text-decoration: none;
}

.res-toc__link:hover {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sidebar-cta {
  padding: var(--space-xl) var(--space-lg);
  background: var(--color-primary);
  border-radius: var(--radius-card);
  color: var(--color-white);
}

.sidebar-cta__title {
  font-size: 1.0625rem;
  font-weight: var(--font-medium);
  color: var(--color-white);
  margin-bottom: var(--space-xs);
}

.sidebar-cta p {
  font-size: 0.875rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: var(--space-md);
}

@media (max-width: 479px) {
  .res-article__cta-actions .btn {
    width: 100%;
  }
}
