/* Crisis & Support Resources page (/foundation/resources) */

/* Hero */
.resources-hero {
  background: var(--color-surface-muted);
  border-left: 5px solid var(--color-accent);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.75rem 1.25rem;
  margin-bottom: 2.5rem;
}

.resources-hero .title {
  margin-bottom: var(--space-3);
}

.resources-hero__lede {
  max-width: 62ch;
  font-size: var(--text-body);
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.resources-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: 0;
}

.resources-hero__actions .button {
  margin-top: 0;
}

/* Categories */
.resources-category {
  margin-bottom: 2.75rem;
  scroll-margin-top: 1.5rem;
}

.resources-category__title {
  font-size: var(--text-h2);
  color: var(--color-heading);
  margin: 0 0 0.4rem;
}

.resources-category__blurb {
  max-width: 68ch;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-5);
}

/* Cards */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-5);
}

/* A category with a single resource should not stretch that card across the
   whole row. */
.resource-grid > :only-child {
  max-width: 420px;
}

.resource-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-5);
}

.resource-card__name {
  font-family: var(--font-heading);
  font-size: var(--text-lead);
  font-weight: var(--weight-heading-strong);
  color: var(--color-heading);
  margin: 0 0 var(--space-2);
  line-height: var(--leading-h2);
}

.resource-card__summary {
  color: var(--color-text);
  margin: 0 0 var(--space-4);
}

/* Contact methods are the point of the card, so they get the largest tap
   targets and the strongest contrast. */
.resource-card__channels {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 1.25rem;
  padding: 0;
}

.resource-card__channel {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-weight: var(--weight-ui-strong);
  font-size: var(--text-small);
  text-decoration: none;
}

.resource-card__channel:visited {
  color: var(--color-on-primary);
}

.resource-card__channel:hover,
.resource-card__channel:focus-visible {
  background: var(--color-primary-hover);
}

.resource-card__meta {
  margin: 0 0 var(--space-3);
  font-size: var(--text-small);
}

.resource-card__meta dt {
  font-family: var(--font-ui);
  font-size: var(--text-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  font-weight: var(--weight-ui-strong);
  color: var(--color-text-muted);
  margin-bottom: 0.15rem;
}

.resource-card__meta dd {
  margin: 0 0 var(--space-3);
  color: var(--color-text);
}

.resource-card__meta dd:last-child {
  margin-bottom: 0;
}

.resource-card__note {
  margin: auto 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--color-border);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* "Good to know" callout */
.resources-callout {
  background: var(--color-surface-dark);
  color: var(--color-on-dark);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin: 0 0 2.75rem;
}

.resources-callout h2 {
  margin: 0 0 1.25rem;
  font-size: var(--text-h3);
  color: var(--color-on-dark);
}

.resources-callout__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-5);
}

.resources-callout__item h3 {
  margin: 0 0 0.35rem;
  font-size: var(--text-body);
  color: var(--color-on-dark-accent);
}

.resources-callout__item p {
  margin: 0;
  font-size: var(--text-small);
  color: var(--color-on-dark-muted);
}

/* Disclaimer */
.resources-disclaimer {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-5);
  font-size: var(--text-small);
  color: var(--color-text-muted);
}

.resources-disclaimer p {
  max-width: 78ch;
  margin: 0 0 var(--space-3);
}

@media (max-width: 768px) {
  .resources-hero {
    padding: 1.25rem 1.25rem var(--space-4);
  }

  .resource-grid {
    grid-template-columns: 1fr;
  }

  .resources-hero__actions .button {
    flex: 1 1 100%;
    text-align: center;
  }
}

/* People are told to keep this guide on hand, so make the printout usable:
   drop the site chrome, flatten the cards, and spell out every link.
   Scoped with :has() so printing any other page is unaffected. */
@media print {
  /* The layout gives html/body a fixed height, hidden overflow, and a flex
     <body>. Each of those stops Chrome from fragmenting the page across
     sheets, so a printout would otherwise be clipped to a single page. */
  html:has(.resources-page),
  body:has(.resources-page) {
    height: auto;
    overflow: visible;
  }

  body:has(.resources-page) {
    display: block;
    min-height: 0;
  }

  body:has(.resources-page) main {
    flex: none;
  }

  body:has(.resources-page) .crisis-bar,
  body:has(.resources-page) .navbar,
  body:has(.resources-page) .footer,
  .resources-hero__actions {
    display: none !important;
  }

  .resources-page {
    font-size: 11pt;
  }

  .resources-hero,
  .resources-callout {
    background: none !important;
    color: #000 !important;
    border: 1px solid #999;
    padding: 0.75rem 1rem;
  }

  .resources-callout h2,
  .resources-callout__item h3,
  .resources-callout__item p {
    color: #000 !important;
  }

  .resource-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .resource-grid > :only-child {
    max-width: none;
  }

  .resource-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #999;
    padding: 0.75rem;
  }

  .resource-card__channel {
    background: none !important;
    color: #000 !important;
    min-height: 0;
    padding: 0;
    text-decoration: underline;
  }

  .resource-card__channels li:not(:last-child)::after {
    content: " \00b7";
  }

  /* Only cards avoid splitting -- holding whole sections together wastes
     most of a sheet every time one does not fit. */
  .resources-category {
    margin-bottom: 1.25rem;
  }

  .resources-category__title {
    break-after: avoid;
    font-size: 1.25rem;
    margin-bottom: 0.2rem;
  }

  .resources-category__blurb {
    margin-bottom: 0.75rem;
  }

  .resources-hero,
  .resources-callout {
    margin-bottom: 1.25rem;
  }

  .resources-hero .title {
    font-size: 1.8rem;
    margin-bottom: 0.4rem;
  }

  .resources-hero__lede {
    margin-bottom: 0;
  }

  .resource-card__summary,
  .resource-card__channels {
    margin-bottom: 0.6rem;
  }

  .resource-card__meta dd {
    margin-bottom: 0.4rem;
  }

  .resource-card__note {
    padding-top: 0.5rem;
  }
}
