/* GSNH Phase 3 & v5 unified directory and standalone volunteer styling. */

main.directory-main {
  padding-top: 1.15rem;
  padding-bottom: 2.75rem;
}

main.volunteer-main {
  max-width: 1220px;
  padding-top: 0.45rem;
  padding-bottom: 1.5rem;
}

/* Compact page header for community-partners.html (eliminates excessive top whitespace) */
.directory-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.9rem;
  border-bottom: 2px solid var(--border-dark, #111);
  min-width: 0;
}
.directory-page-header-main {
  min-width: 0;
  flex: 1 1 420px;
}
.directory-page-eyebrow {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: var(--color-crimson, #990000);
  margin-bottom: 0.15rem;
}
.directory-page-header h1 {
  font-family: var(--font-serif, Georgia, serif);
  font-size: clamp(1.45rem, 2.6vw, 1.95rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.22rem;
  color: var(--text-dark, #111);
}
.directory-page-header p {
  font-size: 0.9rem;
  line-height: 1.42;
  color: var(--text-muted, #4a4a4f);
  margin: 0;
  max-width: 72ch;
}
.directory-quick-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 800;
}
.directory-quick-links a {
  color: var(--color-crimson, #990000);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

/* Search + Collapsible Filter Toolbar + Density Switch */
.directory-search-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.55rem 0.65rem;
  min-width: 0;
}
.search-field-wrap {
  flex: 1 1 340px;
  min-width: 0;
}
.search-field-wrap .gsnh-semantic-help {
  font-size: 0.74rem !important;
  line-height: 1.35 !important;
  margin: 0.32rem 0 0 !important;
  color: var(--text-muted, #4a4a4f);
}
.toolbar-actions-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  min-width: 0;
}
.filter-drawer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  height: 42px;
  min-height: 42px;
  padding: 0 0.85rem;
  font-family: var(--font-sans, inherit);
  font-size: 0.83rem;
  font-weight: 800;
  color: var(--text-dark, #111);
  background: var(--surface-alt, #f4f4f6);
  border: 2px solid var(--border-dark, #111);
  border-radius: 4px;
  box-shadow: 2px 2px 0 var(--border-dark, #111);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.12s ease, transform 0.1s ease, box-shadow 0.1s ease;
}
.filter-drawer-toggle:hover {
  background: #e8e8ee;
}
.filter-drawer-toggle[aria-expanded="true"],
.filter-drawer-toggle.has-active-filters {
  background: #fff7df;
}
.filter-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.32rem;
  border-radius: 999px;
  background: var(--color-crimson, #990000);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
}
.density-toggle-group {
  display: inline-flex;
  align-items: stretch;
  border: 2px solid var(--border-dark, #111);
  border-radius: 4px;
  box-shadow: 2px 2px 0 var(--border-dark, #111);
  overflow: hidden;
  background: var(--surface-alt, #f4f4f6);
}
.density-btn {
  height: 38px;
  min-height: 38px;
  padding: 0 0.72rem;
  font-family: var(--font-sans, inherit);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-dark, #111);
  background: transparent;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}
.density-btn + .density-btn {
  border-left: 1.5px solid var(--border-dark, #111);
}
.density-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}
.density-btn.active {
  background: var(--color-yellow, #fecb00);
  color: #111;
}

.collapsible-filters-panel {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1.5px dashed var(--border-subtle, #d2d2d7);
}
.collapsible-filters-panel[hidden] {
  display: none !important;
}

/* Standalone Volunteer Page Poster/Screenshot Frame & Bottom Welcome Box */
.volunteer-poster-frame {
  min-width: 0;
}
.volunteer-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-bottom: 0.35rem;
  margin-bottom: 0.45rem;
  border-bottom: 2px solid var(--border-dark, #111);
  min-width: 0;
}
.volunteer-top-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.7rem;
  min-width: 0;
}
.volunteer-top-heading h1 {
  font-family: var(--font-serif, Georgia, serif);
  font-size: clamp(1.2rem, 1.85vw, 1.38rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text-dark, #111);
}
.volunteer-top-hint {
  font-size: 0.77rem;
  font-weight: 650;
  color: var(--text-muted, #4a4a4f);
}
.volunteer-top-url {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--color-crimson, #990000);
  text-decoration: none;
  white-space: nowrap;
}
.volunteer-top-url:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.volunteer-hero-banner {
  background: linear-gradient(145deg, #eff6e7 0%, #ffffff 88%);
  border: 2px solid var(--border-dark, #111);
  border-top: 4px solid var(--color-green-dark, #4f7711);
  border-radius: 6px;
  box-shadow: 2.5px 2.5px 0 var(--border-dark, #111);
  padding: 0.52rem 0.85rem;
  margin-top: 0.48rem;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.volunteer-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.85rem;
  width: 100%;
  min-width: 0;
}
.volunteer-hero-top h1,
.volunteer-hero-top h2,
.volunteer-hero-copy h1 {
  font-family: var(--font-serif, Georgia, serif);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text-dark, #111);
}
.volunteer-plain-contacts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted, #4a4a4f);
}
.volunteer-plain-contacts a {
  color: var(--color-crimson, #990000);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.volunteer-hero-sub,
.volunteer-hero-copy p {
  font-size: 0.8rem;
  line-height: 1.34;
  color: var(--text-dark, #111);
  margin: 0;
}
.volunteer-utility-bar {
  margin-top: 1.15rem;
}
.volunteer-utility-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.volunteer-utility-actions .density-toggle-group {
  border-width: 1.5px;
  box-shadow: 1.5px 1.5px 0 var(--border-dark, #111);
}
.volunteer-utility-actions .density-btn {
  height: 28px;
  min-height: 28px;
  padding: 0 0.55rem;
  font-size: 0.73rem;
}
.volunteer-unsure-inline {
  display: inline;
  background: #fff7df;
  padding: 0.04rem 0.3rem;
  border-radius: 3px;
  border: 1px solid rgba(17, 17, 17, 0.25);
}
.volunteer-hero-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.42rem;
  min-width: 0;
}
.volunteer-mini-btn {
  display: inline-flex;
  align-items: center;
  height: 32px;
  min-height: 32px;
  padding: 0 0.62rem;
  background: var(--surface-white, #fff);
  color: var(--text-dark, #111) !important;
  border: 1.5px solid var(--border-dark, #111);
  border-radius: 4px;
  box-shadow: 1.5px 1.5px 0 var(--border-dark, #111);
  font-family: var(--font-sans, inherit);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none !important;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.1s ease, background-color 0.12s ease;
}
.volunteer-mini-btn.is-primary {
  background: var(--color-yellow, #fecb00);
}
.volunteer-mini-btn:hover {
  background: #fff7df;
  transform: translate(-1px, -1px);
}
.volunteer-select-shell {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  height: 33px;
  min-height: 33px;
  border: 1.5px solid var(--border-dark, #111);
  border-radius: 4px;
  box-shadow: 1.5px 1.5px 0 var(--border-dark, #111);
  background-color: var(--surface-white, #fff);
}
.volunteer-select-shell:hover {
  background-color: #fffdf5;
}
.volunteer-select-shell:focus-within {
  outline: 2.5px solid var(--color-crimson, #990000);
  outline-offset: 2px;
}
.volunteer-select-display {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0 0.58rem 0 0.65rem;
  font-family: var(--font-sans, inherit);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-dark, #111);
  white-space: nowrap;
  pointer-events: none;
}
.volunteer-select-display svg {
  flex-shrink: 0;
  display: block;
}
.volunteer-region-select {
  height: 33px;
  min-height: 33px;
  max-width: 195px;
  padding: 0 1.65rem 0 0.6rem;
  font-family: var(--font-sans, inherit);
  font-size: 0.75rem;
  font-weight: 750;
  line-height: 1.2;
  color: var(--text-dark, #111);
  background-color: var(--surface-white, #fff);
  border: 1.5px solid var(--border-dark, #111);
  border-radius: 4px;
  box-shadow: 1.5px 1.5px 0 var(--border-dark, #111);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.volunteer-select-shell .volunteer-region-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  opacity: 0;
  cursor: pointer;
  font-size: 0.85rem;
}
.volunteer-region-select::picker-icon,
.control-select::picker-icon,
.controls-access-select::picker-icon {
  display: none;
}
.volunteer-hero-controls .density-toggle-group {
  border-width: 1.5px;
  box-shadow: 1.5px 1.5px 0 var(--border-dark, #111);
}
.volunteer-hero-controls .density-btn {
  height: 30px;
  min-height: 30px;
  padding: 0 0.58rem;
  font-size: 0.74rem;
}

/* Container overflow safety */
.partner-card > div,
.pv-card-title,
.pv-card-title a,
.partner-regions-line,
.pv-towns-subline {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.controls-top-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 0.85rem;
  align-items: end;
  margin-bottom: 0.85rem;
}
.controls-top-row.has-service-filter {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.control-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
.control-label {
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.06em;
}
.control-input,
.control-select {
  width: 100%;
  min-width: 0;
  height: 42px;
  min-height: 42px;
  font-size: 0.86rem;
  line-height: 1.25;
}
.control-input {
  padding: 0 0.85rem;
}
.control-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 0 2.05rem 0 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 12px 12px;
}
.search-input-group {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  width: 100%;
  min-width: 0;
}
.search-input-group .control-input {
  flex: 1;
  min-width: 0;
}
.search-submit-btn {
  flex-shrink: 0;
  padding: 0 1.15rem;
  height: 42px;
  min-height: 42px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 850;
  color: #111;
  background: var(--color-yellow, #fecb00);
  border: 2px solid var(--border-dark, #111);
  border-radius: 4px;
  box-shadow: 2px 2px 0 var(--border-dark, #111);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}
.search-submit-btn:hover,
.search-submit-btn:focus-visible {
  background: var(--color-yellow-hover, #e5b700);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--border-dark, #111);
}
.phase3-service-note {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted, #555);
  line-height: 1.45;
  margin: 0.25rem 0 0;
}
.group-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.65rem;
  flex-wrap: wrap;
  font-family: var(--font-serif, Georgia, serif);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 1.5rem 0 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border-dark, #111);
}
.group-heading span {
  font-family: var(--font-sans, Arial, sans-serif);
  font-size: 0.8rem;
  color: var(--text-muted, #555);
  font-weight: 700;
}

/* Full & Compact Grid Layouts */
#partnerGrid,
#volunteerGrid {
  display: block;
  min-width: 0;
}
#partnerGrid .partner-grid,
#volunteerGrid .partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
#partnerGrid .partner-grid.partner-grid-compact,
#volunteerGrid .partner-grid.partner-grid-compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem 0.52rem;
  margin-bottom: 1.1rem;
}
#volunteerGrid .partner-grid.partner-grid-compact {
  margin-bottom: 0;
}
#partnerGrid .partner-card,
#volunteerGrid .partner-card {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Compact Clickable Card (<a> element, zero inner buttons) */
a.partner-card.partner-card-compact {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.16rem;
  padding: 0.44rem 0.64rem 0.42rem;
  background: var(--surface-white, #fff);
  border: 2px solid var(--border-dark, #111);
  border-radius: 6px;
  box-shadow: 2.5px 2.5px 0 var(--border-dark, #111);
  color: var(--text-dark, #111);
  text-decoration: none !important;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.12s ease;
}
a.partner-card.partner-card-compact::before {
  content: "";
  display: block !important;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #315c85;
  border-bottom: 1.5px solid var(--border-dark, #111);
}
a.partner-card.partner-card-compact[data-tier="CORE_MOVEMENT_SOLIDARITY"]::before {
  background: var(--header-gradient, linear-gradient(90deg, #f8cca2 0%, #bfeee2 35%, #cbd5f8 70%, #f5bde4 100%));
}
a.partner-card.partner-card-compact:hover,
a.partner-card.partner-card-compact:focus-visible {
  transform: translate(-1.5px, -1.5px);
  box-shadow: 4px 4px 0 var(--border-dark, #111);
  background: #fffdf5;
}
a.partner-card.partner-card-compact:focus-visible {
  outline: 3px solid var(--color-crimson, #990000);
  outline-offset: 2px;
}
.compact-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.28rem;
  flex-wrap: wrap;
  margin-top: 0.14rem;
  min-width: 0;
}
.compact-badges-left {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  min-width: 0;
}
.compact-pill-movement {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1.15;
  padding: 0.1rem 0.34rem;
  border-radius: 3px;
  background: var(--color-crimson, #990000);
  color: #fff;
  border: 1px solid #111;
  white-space: nowrap;
}
.compact-pill-resource {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 750;
  line-height: 1.15;
  padding: 0.1rem 0.34rem;
  border-radius: 3px;
  background: #eef2f6;
  color: #1f3a52;
  border: 1px solid #6a8298;
  white-space: nowrap;
}
.compact-pill-zero {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1.15;
  padding: 0.1rem 0.34rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #14532d;
  border: 1px solid #15803d;
  white-space: nowrap;
}
.compact-region-tag {
  font-size: 0.6rem;
  font-weight: 750;
  color: var(--text-muted, #4a4a4f);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
a.partner-card.partner-card-compact h3 {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--text-dark, #111);
  margin: 0.05rem 0 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
a.partner-card.partner-card-compact:hover h3 {
  color: var(--color-crimson, #990000);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.compact-blurb {
  font-size: 0.73rem;
  line-height: 1.26;
  color: var(--text-muted, #424247);
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  min-width: 0;
  overflow-wrap: anywhere;
}

.service-tag {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  line-height: 1.25;
  background: #e9f6da;
  color: #204b17;
  border: 1.5px solid #709750;
  border-radius: 4px;
  padding: 0.14rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 750;
  cursor: pointer;
}
.service-tag:hover,
.service-tag:focus-visible {
  background: #d6f5b1;
  outline: 2px solid #295d1c;
  outline-offset: 2px;
}
.services-tag-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0.55rem 0 0.8rem;
}
.pv-more-tags {
  font-size: 0.68rem;
  font-weight: 750;
  color: var(--text-muted, #555);
  background: #f3f4f6;
  border: 1px dashed #9ca3af;
  border-radius: 4px;
  padding: 0.12rem 0.38rem;
  white-space: nowrap;
}
.partner-desc-snippet {
  font-size: 0.89rem;
  line-height: 1.48;
  color: var(--text-dark, #111);
  margin: 0.55rem 0 0.75rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.partner-aliases {
  font-size: 0.76rem;
  color: var(--text-muted, #555);
  margin: 0.2rem 0 0.55rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}
.partner-contact-fallback {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted, #444);
  max-width: 100%;
  overflow-wrap: anywhere;
}

@media (max-width: 1079px) {
  #partnerGrid .partner-grid.partner-grid-compact,
  #volunteerGrid .partner-grid.partner-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .controls-top-row,
  .controls-top-row.has-service-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  #partnerGrid .partner-grid.partner-grid-compact,
  #volunteerGrid .partner-grid.partner-grid-compact {
    grid-template-columns: 1fr;
  }
  .controls-top-row,
  .controls-top-row.has-service-filter {
    grid-template-columns: 1fr;
  }
  .search-input-group {
    flex-direction: column;
  }
  .search-submit-btn {
    width: 100%;
  }
  .volunteer-region-select {
    max-width: 100%;
    flex: 1 1 160px;
  }
}

/* Full-view card top banner (hidden on compact cards which use ::before) */
#partnerGrid .partner-card:not(.partner-card-compact)::before,
#volunteerGrid .partner-card:not(.partner-card-compact)::before,
.pv-card-grid .partner-card::before {
  display: none;
}

.partner-card .card-top-banner {
  margin: -1.65rem -1.65rem 0.85rem -1.65rem;
  padding: 0.5rem 1.25rem;
  min-height: 2.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border-dark, #111);
  background: linear-gradient(90deg, #315c85 0%, #4678a8 100%);
}

/* Structure-coordinated top banner palette (v5 + legacy compatibility) */
.partner-card[data-structure="Grassroots Collective"] .card-top-banner,
.partner-card[data-structure="1. Grassroots Association"] .card-top-banner {
  background: linear-gradient(90deg, #2e7d32 0%, #43a047 100%);
}
.partner-card[data-structure="Labor Union"] .card-top-banner,
.partner-card[data-structure="2. Union/Labor"] .card-top-banner {
  background: linear-gradient(90deg, #f5b800 0%, #fecb00 100%);
}
.partner-card[data-structure="Cooperative"] .card-top-banner,
.partner-card[data-structure="3. Co-op"] .card-top-banner,
.partner-card[data-structure="5. Business"] .card-top-banner {
  background: linear-gradient(90deg, #8ec628 0%, #a2db38 100%);
}
.partner-card[data-structure="Community Nonprofit"] .card-top-banner,
.partner-card[data-structure="4. Nonprofit"] .card-top-banner {
  background: linear-gradient(90deg, #315c85 0%, #4678a8 100%);
}
.partner-card[data-structure="Community Grantmaker"] .card-top-banner,
.partner-card[data-structure="6. Donor"] .card-top-banner {
  background: linear-gradient(90deg, #6b3fa0 0%, #8656c2 100%);
}
.partner-card[data-structure="Political Organization"] .card-top-banner,
.partner-card[data-structure="7. Political Org/Party"] .card-top-banner {
  background: linear-gradient(90deg, #8a0000 0%, #b31212 100%);
}
.partner-card[data-structure="Public & Municipal Program"] .card-top-banner,
.partner-card[data-structure="8. Municiple Gov"] .card-top-banner,
.partner-card[data-structure="9. State Gov"] .card-top-banner {
  background: linear-gradient(90deg, #236664 0%, #328a87 100%);
}
.partner-card[data-structure="Other"] .card-top-banner {
  background: linear-gradient(90deg, #4a575e 0%, #60717a 100%);
}
/* Core Movement / Solidarity always wears the GSNH rainbow banner across structures */
.partner-card[data-tier="CORE_MOVEMENT_SOLIDARITY"] .card-top-banner {
  background: var(--header-gradient, linear-gradient(90deg, #f8cca2 0%, #bfeee2 35%, #cbd5f8 70%, #f5bde4 100%));
}

/* Rounded location & access pills inside the top color banner */
.partner-card .card-top-banner .region-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.71rem;
  font-weight: 800;
  padding: 0.16rem 0.68rem;
  border-radius: 999px;
  border: 1.5px solid var(--border-dark, #111);
  background-color: #ffffff;
  color: var(--text-dark, #111);
  box-shadow: 1.5px 1.5px 0 rgba(17, 17, 17, 0.85);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.partner-card .card-top-banner .region-pill.is-statewide {
  background-color: #eef9d2;
  color: #16360d;
}
.access-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.66rem;
  font-weight: 800;
  padding: 0.14rem 0.52rem;
  border-radius: 999px;
  border: 1.5px solid #111;
  background: #ffffff;
  color: #111;
  white-space: nowrap;
  max-width: 100%;
}
.access-pill.is-zero-barrier { background: #dcfce7; color: #14532d; }
.access-pill.is-low-barrier { background: #e0f2fe; color: #0c4a6e; }
.access-pill.is-coop { background: #fef9c3; color: #713f12; }
.access-pill.is-referral { background: #f3e8ff; color: #4c1d95; }
.access-pill.is-intake { background: #f3f4f6; color: #374151; }

/* First neat white space row: Tier badge pinned top-left, Structure label pinned top-right */
.partner-card .card-meta-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.45rem;
  margin-top: 0;
  margin-bottom: 0.55rem;
  min-height: 1.6rem;
}

.tier-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 750;
  padding: 0.14rem 0.46rem;
  border-radius: 4px;
  border: 1.5px solid var(--border-dark, #111);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.015em;
}
.tier-pill.tier-movement {
  background-color: var(--color-crimson, #990000);
  color: #ffffff;
  box-shadow: 1.5px 1.5px 0 var(--border-dark, #111);
}
.tier-pill.tier-resource {
  background-color: #eef2f6;
  color: #1f3a52;
  border-color: #6a8298;
}

.partner-card .structure-badge {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.15;
  text-align: right;
  text-transform: uppercase;
}
.partner-card[data-structure="Grassroots Collective"] .structure-badge,
.partner-card[data-structure="1. Grassroots Association"] .structure-badge {
  color: #1e5a22;
}
.partner-card[data-structure="Community Nonprofit"] .structure-badge,
.partner-card[data-structure="Community Grantmaker"] .structure-badge,
.partner-card[data-structure="4. Nonprofit"] .structure-badge,
.partner-card[data-structure="6. Donor"] .structure-badge {
  color: #264a6e;
}

/* Compact focus tags and pills */
.focus-pill { padding: 0.26rem 0.62rem; font-size: 0.76rem; }
.focus-tag { font-size: 0.67rem; font-weight: 650; padding: 0.12rem 0.38rem; line-height: 1.25; letter-spacing: 0.01em; }

/* Card footer & profile link styling matching semantic cards */
.partner-card .partner-card-footer.pv-card-footer {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1.5px solid var(--border-subtle, #d2d2d7);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  min-width: 0;
}
.partner-card .pv-footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.6rem;
  min-width: 0;
}
.partner-card a.pv-profile-cta {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0.45rem 0.75rem;
  background: #fff;
  border: 2px solid #111;
  border-radius: 4px;
  box-shadow: 2px 2px 0 #111;
  font-size: 0.85rem;
  font-weight: 850;
  line-height: 1.2;
  color: #7a0000 !important;
  text-decoration: none !important;
  white-space: nowrap;
  transition: transform 0.13s ease, box-shadow 0.13s ease;
}
.partner-card a.pv-profile-cta:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #111;
  color: #7a0000 !important;
  text-decoration: none !important;
}
.partner-card a.pv-visit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  max-width: 100%;
  min-height: 38px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none !important;
  color: var(--text-dark, #111) !important;
  background: var(--color-yellow, #fecb00);
  border: 2px solid var(--border-dark, #111);
  border-radius: 4px;
  padding: 0.45rem 0.75rem;
  box-shadow: 3px 3px 0 var(--border-dark, #111);
  white-space: nowrap;
  transition: transform 0.13s ease, box-shadow 0.13s ease, background-color 0.13s ease;
}
.partner-card a.pv-visit-btn:hover {
  background: var(--color-yellow-hover, #e5b700);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #111;
  text-decoration: none;
  color: #111 !important;
}
.partner-card .pv-caution {
  font-size: 0.73rem;
  color: var(--text-muted, #4a4a4f);
  line-height: 1.42;
  margin: 0;
}
.partner-card h3 a.pv-profile-link {
  color: inherit;
  text-decoration: none;
}
.partner-card h3 a.pv-profile-link:hover {
  color: var(--color-crimson, #990000);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.controls-access-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-top: 0.75rem;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--border-subtle, #d2d2d7);
}
.controls-access-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}
.controls-access-group label {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dark, #111);
}
.controls-access-select {
  min-height: 36px;
  padding: 0.35rem 0.65rem;
  border: 2px solid var(--border-dark, #111);
  border-radius: 4px;
  background: var(--surface-white, #fff);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-dark, #111);
}
.controls-print-link {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--color-crimson, #990000);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.directory-noscript-box {
  border: 2px solid var(--border-dark, #111);
  border-left: 6px solid var(--color-crimson, #990000);
  background: #fff7df;
  border-radius: 6px;
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.5rem;
}

@media print {
  @page { margin: 0.38in; }
  header, footer, .directory-controls, .callout, .partner-card a.pv-visit-btn, .volunteer-utility-bar {
    display: none !important;
  }
  body { background: #fff !important; color: #000 !important; font-size: 9pt; }
  main { max-width: 100% !important; padding: 0 !important; margin: 0 !important; }
  .directory-page-header { margin-bottom: 0.6rem !important; padding-bottom: 0.4rem !important; box-shadow: none !important; }
  .partner-grid:not(.partner-grid-compact) { display: block !important; column-count: 2; column-gap: 0.8rem; }
  body.volunteer-page #volunteerGrid .partner-grid.partner-grid-compact {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.3rem 0.45rem !important;
    margin-bottom: 0.35rem !important;
  }
  .partner-card {
    break-inside: avoid;
    margin-bottom: 0.5rem;
    padding: 0.5rem !important;
    box-shadow: none !important;
    border: 1px solid #222 !important;
    background: #fff !important;
  }
  body.volunteer-page a.partner-card.partner-card-compact {
    margin-bottom: 0 !important;
    padding: 0.3rem 0.45rem !important;
  }
  body.volunteer-page .volunteer-hero-banner {
    margin-top: 0.35rem !important;
    padding: 0.4rem 0.6rem !important;
    box-shadow: none !important;
    border: 1.5px solid #111 !important;
  }
  .p4-index details { display: block; }
}
