/* ============================================================================
 * Resources library — index + article styles
 * Inherits design tokens from base.css (--construction-orange, --steel, etc.)
 * ========================================================================== */

/* Visually hidden but reachable to screen readers */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------------------
 * Index page — toolbar (search + category pills)
 * ------------------------------------------------------------------------ */
.resources-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  padding: 1.25rem;
  background: var(--industrial-black-2);
  border: 1px solid var(--steel);
  border-radius: 8px;
}

.resources-search {
  flex: 1 1 280px;
  min-width: 260px;
}

.resources-search__input {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--highway-white);
  background: var(--industrial-black);
  border: 1px solid var(--steel-2);
  border-radius: 6px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.resources-search__input::placeholder {
  color: var(--ash, #888);
}

.resources-search__input:focus {
  outline: none;
  border-color: var(--construction-orange);
  box-shadow: 0 0 0 3px var(--orange-soft);
}

.resources-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem .9rem;
  font-family: var(--font-tech);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--highway-white);
  background: var(--industrial-black);
  border: 1px solid var(--steel-2);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.filter-pill:hover {
  border-color: var(--construction-orange);
  color: var(--construction-orange);
}

.filter-pill.is-active {
  background: var(--construction-orange);
  color: var(--industrial-black);
  border-color: var(--construction-orange);
}

.filter-pill__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 .35rem;
  font-size: .75rem;
  font-weight: 700;
  color: inherit;
  background: rgba(255, 255, 255, .08);
  border-radius: 999px;
}

.filter-pill.is-active .filter-pill__count {
  background: rgba(0, 0, 0, .2);
}

/* ---------------------------------------------------------------------------
 * Empty state for filter
 * ------------------------------------------------------------------------ */
.resources-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--ash, #999);
  background: var(--industrial-black-2);
  border: 1px dashed var(--steel-2);
  border-radius: 8px;
  margin-bottom: 2rem;
}

.resources-empty__reset {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  margin-left: .25rem;
  color: var(--construction-orange);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.resources-empty__reset:hover { color: var(--orange-hover); }

/* ---------------------------------------------------------------------------
 * Category sections + cards
 * ------------------------------------------------------------------------ */
.resource-section {
  margin-bottom: 3.5rem;
  scroll-margin-top: 6rem;
}

.resource-section[hidden] { display: none; }

.resource-section__header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--steel);
}

.resource-section__title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.75rem);
  letter-spacing: .04em;
  margin: 0 0 .5rem;
  color: var(--highway-white);
}

.resource-section__blurb {
  margin: 0;
  color: var(--ash, #b3b3b3);
  max-width: 78ch;
  font-size: .95rem;
  line-height: 1.6;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.resource-card {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: 1.4rem;
  background: var(--industrial-black-2);
  border: 1px solid var(--steel);
  border-radius: 8px;
  transition: border-color .18s ease, transform .18s ease;
}

.resource-card[hidden] { display: none; }

.resource-card:hover {
  border-color: var(--construction-orange);
  transform: translateY(-2px);
}

.resource-card__title {
  font-family: var(--font-tech);
  font-size: 1.1rem;
  line-height: 1.35;
  margin: 0;
  font-weight: 600;
}

.resource-card__title a {
  color: var(--highway-white);
  text-decoration: none;
}

.resource-card__title a:hover { color: var(--construction-orange); }

.resource-card__summary {
  font-size: .92rem;
  line-height: 1.6;
  color: var(--ash, #b3b3b3);
  margin: 0;
  flex: 1;
}

.resource-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .25rem;
}

.resource-tag {
  display: inline-block;
  padding: .2rem .55rem;
  font-family: var(--font-tech);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: lowercase;
  color: var(--construction-orange);
  background: var(--orange-soft);
  border-radius: 4px;
}

/* ---------------------------------------------------------------------------
 * Article page
 * ------------------------------------------------------------------------ */
.article-page {
  padding: clamp(2rem, 5vw, 4rem) 1.25rem;
  max-width: 780px;
  margin: 0 auto;
}

.article__header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--steel);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  font-family: var(--font-tech);
  font-size: .85rem;
  margin-bottom: 1.5rem;
  color: var(--ash, #999);
}

.breadcrumbs a {
  color: var(--ash, #b3b3b3);
  text-decoration: none;
}

.breadcrumbs a:hover { color: var(--construction-orange); }

.breadcrumbs__sep { color: var(--steel-2); }

.article__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: .02em;
  margin: 0 0 1rem;
  color: var(--highway-white);
}

.article__summary {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.55;
  color: var(--bone, #e6e6e6);
  margin: 0 0 1.25rem;
  max-width: 64ch;
}

.article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  font-family: var(--font-tech);
  font-size: .85rem;
  color: var(--ash, #999);
  margin-bottom: 1rem;
}

.article__tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.article-tag {
  display: inline-block;
  padding: .2rem .55rem;
  font-family: var(--font-tech);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: lowercase;
  color: var(--construction-orange);
  background: var(--orange-soft);
  border-radius: 4px;
}

/* ---------------------------------------------------------------------------
 * Prose styling for rendered markdown body
 * ------------------------------------------------------------------------ */
.prose { color: var(--bone, #e6e6e6); font-size: 1.05rem; line-height: 1.75; }

.prose h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.7rem);
  letter-spacing: .03em;
  color: var(--highway-white);
  margin: 2.5rem 0 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--steel);
}

.prose h3 {
  font-family: var(--font-tech);
  font-size: clamp(1.1rem, 1.8vw, 1.3rem);
  font-weight: 600;
  color: var(--construction-orange);
  margin: 2rem 0 .75rem;
  letter-spacing: .02em;
}

.prose h4 {
  font-family: var(--font-tech);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--highway-white);
  margin: 1.5rem 0 .5rem;
}

.prose p { margin: 0 0 1.25rem; }

.prose ul, .prose ol {
  margin: 0 0 1.5rem;
  padding-left: 1.5rem;
}

.prose li {
  margin-bottom: .5rem;
  line-height: 1.7;
}

.prose li::marker { color: var(--construction-orange); }

.prose a {
  color: var(--construction-orange);
  text-decoration: underline;
  text-decoration-color: rgba(254, 80, 0, 0.4);
  text-underline-offset: 3px;
  transition: text-decoration-color .15s ease;
}

.prose a:hover { text-decoration-color: var(--construction-orange); }

.prose strong { color: var(--highway-white); font-weight: 700; }

.prose em { font-style: italic; }

.prose code {
  font-family: var(--font-mono, 'Roboto Mono', monospace);
  font-size: .9em;
  padding: .15rem .4rem;
  background: var(--industrial-black-2);
  border: 1px solid var(--steel);
  border-radius: 3px;
  color: var(--construction-orange);
}

.prose pre {
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--industrial-black-2);
  border: 1px solid var(--steel);
  border-radius: 6px;
  overflow-x: auto;
  font-size: .92rem;
  line-height: 1.55;
}

.prose pre code {
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--bone, #e6e6e6);
}

.prose blockquote {
  margin: 0 0 1.5rem;
  padding: .75rem 1.25rem;
  border-left: 3px solid var(--construction-orange);
  background: var(--industrial-black-2);
  color: var(--bone, #d8d8d8);
  font-style: italic;
}

.prose hr {
  margin: 2.5rem 0;
  height: 0;
  border: 0;
  border-top: 1px solid var(--steel);
}

/* ---------------------------------------------------------------------------
 * Article footer (CTA) + related links
 * ------------------------------------------------------------------------ */
.article__footer {
  margin-top: 3rem;
  padding: 2rem 1.5rem;
  background: var(--industrial-black-2);
  border: 1px solid var(--steel);
  border-radius: 8px;
}

.article__footer h2 {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.5vw, 1.6rem);
  letter-spacing: .03em;
  margin: 0 0 .75rem;
  color: var(--highway-white);
}

.article__footer p {
  margin: 0 0 1.25rem;
  color: var(--bone, #d8d8d8);
}

.article__cta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.article__related {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--steel);
}

.article__related h3 {
  font-family: var(--font-tech);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--highway-white);
  margin: 0 0 .75rem;
}

.article__related p { margin: 0 0 .5rem; }

.article__related a {
  color: var(--construction-orange);
  text-decoration: none;
  font-weight: 500;
}

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

/* ---------------------------------------------------------------------------
 * Responsive tweaks
 * ------------------------------------------------------------------------ */
@media (max-width: 640px) {
  .resources-toolbar { flex-direction: column; align-items: stretch; }
  .resources-filters { justify-content: flex-start; }
  .resource-grid { grid-template-columns: 1fr; }
  .article-page { padding-inline: 1rem; }
}
