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

.resources-page {
  --resources-navy: #0b2545;
  --resources-primary: #305075;
  --resources-muted: #5f6b7a;
  --resources-rule: #e3e8ef;
}

/* Hero */
.resources-hero {
  background: #f4f7fb;
  border-left: 5px solid var(--resources-primary);
  border-radius: 8px;
  padding: 1.75rem 1.75rem 1.25rem;
  margin-bottom: 2.5rem;
}

.resources-hero .title {
  margin-bottom: 0.75rem;
}

.resources-hero__lede {
  max-width: 62ch;
  font-size: 1.05rem;
  color: #3d4756;
  margin-bottom: 1rem;
}

.resources-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
}

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

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

.resources-category__title {
  font-size: 1.6rem;
  color: var(--resources-navy);
  margin: 0 0 0.4rem;
}

.resources-category__blurb {
  max-width: 68ch;
  color: var(--resources-muted);
  margin: 0 0 1.5rem;
}

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

/* 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: #fff;
  border: 1px solid var(--resources-rule);
  border-top: 4px solid var(--resources-primary);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 1.5rem;
}

.resource-card__name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--resources-navy);
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

.resource-card__summary {
  color: #3d4756;
  margin: 0 0 1rem;
}

/* 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: 0.5rem;
  margin: 0 0 1.25rem;
  padding: 0;
}

.resource-card__channel {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  background: var(--resources-primary);
  color: #fff;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}

.resource-card__channel:visited {
  color: #fff;
}

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

.resource-card__meta {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.resource-card__meta dt {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--resources-muted);
  margin-bottom: 0.15rem;
}

.resource-card__meta dd {
  margin: 0 0 0.75rem;
  color: #3d4756;
}

.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(--resources-rule);
  font-size: 0.88rem;
  color: var(--resources-muted);
}

/* "Good to know" callout */
.resources-callout {
  background: var(--resources-navy);
  color: #fff;
  border-radius: 8px;
  padding: 1.75rem;
  margin: 0 0 2.75rem;
}

.resources-callout h2 {
  margin: 0 0 1.25rem;
  font-size: 1.4rem;
  color: #fff;
}

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

.resources-callout__item h3 {
  margin: 0 0 0.35rem;
  font-size: 1.02rem;
  color: #ffd166;
}

.resources-callout__item p {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Disclaimer */
.resources-disclaimer {
  border-top: 1px solid var(--resources-rule);
  padding-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--resources-muted);
}

.resources-disclaimer p {
  max-width: 78ch;
  margin: 0 0 0.75rem;
}

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

  .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;
  }
}
