/**
 * Dynamic taxonomy term listing pages (grouped index + single-type drill-in).
 *
 * Typography is deliberately inherited from the theme's global element styles:
 * the hero title is a plain <h1>, group headers <h2>, row titles <h3> on the
 * index / <h2> on the drill-in (sized to <h4> via the .h4 utility so they match
 * visually), and summaries plain <p>. Only layout, colour, and small meta
 * chrome are set here.
 *
 * Markup: views-view--taxonomy-term / -unformatted- / -fields- .html.twig
 */

.view-taxonomy-term {
  --tax-teal: #052530;
  --tax-green: #00a261;
  --tax-link: #00885a;
  --tax-muted: #6a6a6a; /* ~5.4:1 on white — AA for the small date/badge/count text */
  --tax-line: #e0e5e3;
  --tax-line-strong: #cdd6d2;
}

.tax-inner {
  max-width: 1080px;
  margin: 0 auto;
}

/* ---------- Hero ---------- */
.tax-hero {
  background: var(--tax-teal);
  color: #fff;
  padding: clamp(2.25rem, 5vw, 3.25rem) 24px;
}
.tax-hero h1 {
  /* Uses the site-wide .title-font page-title treatment (green gradient); just
     drop the default heading margin. */
  margin: 0;
}
.tax-eyebrow {
  /* Block wrapper so the inline-block .kicker-label sits on its own line
     (and its :after accent rule stays tight to the text). */
  margin: 0 0 1rem;
}
.tax-hero .kicker-label {
  color: #fff;
}
.tax-hero-desc {
  max-width: 62ch;
  color: #c6ddd7;
  margin-top: 1rem;
}

/* ---------- Listing ---------- */
.tax-listing {
  padding: clamp(1.75rem, 4vw, 2.5rem) 24px clamp(3rem, 6vw, 4rem);
}
.tax-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: clamp(0.85rem, 2vw, 1.15rem);
}
.tax-count {
  margin: 0;
  font-style: italic;
  color: var(--tax-muted);
}
.tax-count strong {
  color: var(--tax-teal);
}
.tax-empty {
  color: var(--tax-muted);
  padding: 0.5rem 0 2rem;
}
.tax-empty p {
  margin: 0;
}

/* ---------- Group ---------- */
.tax-group {
  margin-bottom: clamp(2rem, 4vw, 2.75rem);
}
.tax-group > h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--tax-line-strong);
}
.tax-group > h2::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  background: var(--tax-green);
}
.tax-group-count {
  align-self: flex-start;
  margin-top: 0.15em;
  font-size: 0.5em;
  font-weight: 400;
  color: var(--tax-muted);
}

/* ---------- Rows ---------- */
.tax-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tax-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 20px;
  padding: 18px 4px 18px 16px;
  border-bottom: 1px solid var(--tax-line);
  position: relative;
}
.tax-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 3px;
  background: var(--tax-green);
  opacity: 0;
}
.tax-row:hover,
.tax-row:focus-within {
  background: #f9fbfa;
}
.tax-row:hover::before,
.tax-row:focus-within::before{
  opacity: 1;
}
.tax-row-main {
  grid-column: 1;
  min-width: 0;
}
.tax-row-title {
  /* Element is <h3> on the index and <h2> on the drill-in; class keeps styling
     independent of the level. */
  margin: 0;
}
.tax-row-title a {
  color: inherit;
  text-decoration: none;
}
.tax-row-title a:hover,
.tax-row-title a:focus {
  color: var(--tax-link);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.tax-row p {
  margin: 0.25rem 0 0;
  max-width: 68ch;
}
.tax-meta {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
}
.tax-badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--tax-muted);
  border: 1px solid var(--tax-line-strong);
  border-radius: 4px;
  padding: 3px 8px;
  white-space: nowrap;
}
.tax-date {
  font-size: 0.75rem;
  color: var(--tax-muted);
  white-space: nowrap;
}

/* ---------- Links + pager ---------- */
.tax-group-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}
.view-taxonomy-term .pagination {
  margin-top: 2rem;
}
.tax-return-bottom {
  margin-top: 1.75rem;
}

/* Back / "View all" links reuse the site's .text-link-btn (green with an
   animated underline). Scope the colour to the AA-contrast green (the global
   utility uses #00a261 ≈ 3.3:1) and let our own wrappers own the spacing. */
.view-taxonomy-term .text-link-btn {
  margin-top: 0;
  font-size: 0.975rem; /* matches the site's .view-return-link sizing; .875rem reads small */
  color: var(--tax-link);
}
.view-taxonomy-term .text-link-btn::after {
  background: var(--tax-link);
}

/* Visible keyboard focus indicator — the base theme defines none for links. */
.tax-row-title a:focus-visible,
.view-taxonomy-term .text-link-btn:focus-visible {
  outline: 2px solid var(--tax-link);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .tax-row {
    grid-template-columns: 1fr;
  }
  .tax-meta {
    grid-column: 1;
    grid-row: auto;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 12px;
    margin-top: 6px;
  }
}
