/* ATM Health Network: hub, join forms, opportunities board */

/* Hero map card */
.network-hero .hero-card h2 { margin-bottom: 12px; font-size: 1.9rem; }
.network-hero .hero-card p { margin: 0 0 6px; font-size: .94rem; }
.network-map { margin: -6px -6px 18px; padding: 10px; border-radius: 14px; background: linear-gradient(160deg, #f3f9f8, #e6f4f3); }
.network-map svg { display: block; width: 100%; height: auto; }
.map-links line { stroke: var(--teal); stroke-width: 1.4; stroke-opacity: .35; stroke-dasharray: 4 5; animation: atm-dash 14s linear infinite; }
.map-nodes circle { fill: #fff; stroke: var(--teal-deep); stroke-width: 2; }
.map-nodes circle.hub { fill: var(--ink); stroke: var(--teal); stroke-width: 4; animation: atm-pulse 2.8s ease-in-out infinite; transform-origin: 149px 109px; }
.map-labels text { fill: var(--ink-soft); font: 700 10px Arial, Helvetica, sans-serif; text-anchor: middle; letter-spacing: .02em; }
.map-labels text.label-start { text-anchor: start; }
.map-labels text.hub-label { fill: var(--ink); font-size: 12px; font-weight: 800; }
@keyframes atm-dash { to { stroke-dashoffset: -90; } }
@keyframes atm-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* Audience chooser */
.audience-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.audience-card {
  display: grid; align-content: start; gap: 8px;
  min-height: 270px; padding: 22px 20px;
  border: 1px solid var(--line); border-radius: 16px;
  background: #fff; color: inherit; text-decoration: none;
  box-shadow: 0 10px 22px rgba(9,36,64,.04);
  transition: border-color .16s ease, transform .16s ease, background .16s ease, box-shadow .16s ease;
}
.audience-card:hover, .audience-card:focus-visible { border-color: var(--teal); background: var(--teal-pale); transform: translateY(-3px); box-shadow: 0 16px 30px rgba(9,36,64,.08); color: inherit; }
.audience-card .number { color: var(--teal); font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; }
.audience-card strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.32rem; font-weight: 500; letter-spacing: -.03em; line-height: 1.15; color: var(--ink); }
.audience-pitch { color: var(--ink-soft); font-size: .88rem; line-height: 1.55; }
.audience-go { margin-top: auto; padding-top: 10px; color: var(--teal-deep); font-size: .84rem; font-weight: 800; }

/* How it works */
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; counter-reset: none; }
.how-steps li { position: relative; padding: 26px 22px 24px; border-top: 3px solid var(--teal); background: #fff; border-radius: 0 0 14px 14px; box-shadow: 0 14px 28px rgba(9,36,64,.05); }
.how-steps .number { display: block; margin-bottom: 18px; color: var(--teal); font-family: Georgia, "Times New Roman", serif; font-size: 1.6rem; }
.how-steps h3 { font-size: 1.25rem; }
.how-steps p { margin: 0; font-size: .92rem; }

/* Opportunities */
.opp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.opp-card { display: grid; align-content: start; gap: 6px; padding: 24px 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 14px 28px rgba(9,36,64,.05); }
.opp-card[hidden] { display: none; }
.opp-card h3 { margin: 4px 0 2px; font-size: 1.3rem; }
.opp-card h3 a { color: inherit; text-decoration: none; }
.opp-card h3 a:hover { color: var(--teal-deep); }
.opp-card p { margin: 0; font-size: .92rem; }
.opp-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.opp-role, .opp-town { display: inline-flex; align-items: center; min-height: 26px; padding: 2px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.opp-role { background: var(--ink); color: #fff; }
.opp-town { background: var(--teal-pale); color: var(--teal-deep); border: 1px solid #c5e0dd; }
.opp-dates { color: var(--teal-deep) !important; font-weight: 700; }
.opp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px !important; }
.opp-actions .button { min-height: 42px; padding: 9px 14px; font-size: .84rem; }
.opp-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filter-chip { min-height: 40px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font: inherit; font-weight: 800; font-size: .86rem; cursor: pointer; }
.filter-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.opp-count { margin: 0 0 18px; font-size: .88rem; font-weight: 700; }
.opp-single .opp-meta { margin-bottom: 10px; }

.empty-state { padding: 34px 30px; border: 1px dashed #b9cfcf; border-radius: 16px; background: var(--mist); }
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { margin: 0; max-width: 680px; }
.empty-state-large { max-width: 820px; margin: 0 auto; padding: 56px 40px; text-align: center; background: #fff; }
.empty-state-large h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.empty-state-large p { margin: 0 auto; }
.empty-state-large .hero-actions { justify-content: center; margin-top: 26px; }
.empty-mark { display: block; width: 64px; height: 64px; margin: 0 auto 22px; border-radius: 50%; border: 2px dashed var(--teal); background: radial-gradient(circle, var(--teal) 0 7px, transparent 8px); }

/* Join section */
.join-section { scroll-margin-top: 80px; }
.join-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 auto 22px; }
.join-tabs [role="tab"] { min-height: 44px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font: inherit; font-weight: 800; font-size: .88rem; cursor: pointer; }
.join-tabs [role="tab"][aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.join-panel { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); gap: clamp(26px, 5vw, 60px); align-items: start; padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 18px 40px rgba(9,36,64,.07); }
.join-panel + .join-panel { margin-top: 22px; }
.join-panel[hidden] { display: none; }
.js-tabs .join-panel + .join-panel { margin-top: 0; }
.join-panel-intro h3 { font-size: 1.8rem; }
.join-panel-intro p { font-size: .95rem; }
.join-error, .join-ref { max-width: 860px; margin: 0 auto 20px; padding: 16px 18px; border-radius: 12px; }
.join-error { border-left: 4px solid var(--danger); background: #fff9f8; }
.join-error p { margin: 6px 0 0; color: #6f3a35; }
.join-ref { border: 1px solid #c5e0dd; background: var(--teal-pale); color: var(--ink); text-align: center; }

.network-form { display: grid; gap: 18px; }
.network-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.network-form .field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.network-form .field-wide { grid-column: 1 / -1; }
.network-form .field label, .network-form .field legend { font-size: .86rem; font-weight: 800; color: var(--ink); }
.network-form .field input, .network-form .field select, .network-form .field textarea {
  width: 100%; min-height: 48px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper); color: var(--ink); font: inherit;
}
.network-form .field textarea { min-height: 120px; resize: vertical; }
.network-form .field [aria-invalid="true"] { border-color: var(--danger); background: #fff9f8; }
.network-form abbr { color: var(--danger); text-decoration: none; }
.field-help { margin: 0; font-size: .8rem; line-height: 1.5; }
.field-checks { margin: 0; padding: 0; border: 0; }
.field-checks legend { margin-bottom: 8px; padding: 0; }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: .88rem; font-weight: 700; color: var(--ink); cursor: pointer; }
.network-form .check-chip input, .network-form .check-row input { flex: 0 0 auto; width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; border: 0; background: none; accent-color: var(--teal-deep); }
.check-chip:has(input:checked) { border-color: var(--teal); background: var(--teal-pale); }
.network-consent { display: grid; gap: 10px; padding: 16px 18px; border-radius: 12px; background: var(--mist); }
.check-row { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; font-size: .88rem; line-height: 1.55; color: var(--ink); cursor: pointer; }
.network-form .check-row input { width: 18px; height: 18px; margin-top: 2px; }
.check-row-optional { color: var(--ink-soft); }
.network-form-note { margin: 0; font-size: .8rem; }
.network-form-error { margin: 0; padding: 10px 14px; border-radius: 8px; background: #fff9f8; color: #6f3a35; font-size: .88rem; font-weight: 700; }
.network-form-error[hidden] { display: none; }
.network-hp { position: absolute !important; left: -10000px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }

.join-thanks { max-width: 760px; margin: 0 auto; padding: 44px 36px; border: 1px solid #c5e0dd; border-radius: 18px; background: #fff; text-align: center; box-shadow: 0 18px 40px rgba(9,36,64,.07); }
.join-thanks:focus { outline: none; }
.join-thanks .hero-actions { justify-content: center; margin-top: 24px; }
.thanks-mark { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 1.9rem; font-weight: 800; }

/* Directory placeholder */
.directory-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr); gap: clamp(32px, 7vw, 90px); align-items: center; }
.directory-ghost { position: relative; padding: 26px; border: 1px dashed #b9cfcf; border-radius: 16px; background: var(--mist); }
.ghost-row { display: grid; grid-template-columns: 44px 1fr .6fr; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ghost-row span { height: 12px; border-radius: 6px; background: linear-gradient(90deg, #dde8e8, #eef4f4, #dde8e8); background-size: 200% 100%; animation: atm-shimmer 2.4s linear infinite; }
.ghost-row span:first-child { width: 44px; height: 44px; border-radius: 50%; }
.directory-ghost p { margin: 16px 0 0; color: var(--teal-deep); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; text-align: center; }
@keyframes atm-shimmer { to { background-position: -200% 0; } }

/* Guardrails */
.guardrail-list { list-style: none; max-width: 860px; margin: 0 auto; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.guardrail-list li { padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink-soft); font-size: .94rem; line-height: 1.6; }
.guardrail-list strong { color: var(--ink); }

@media (max-width: 1100px) {
  .audience-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .how-steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 950px) {
  .join-panel, .directory-grid { grid-template-columns: 1fr; }
  .opp-grid { grid-template-columns: 1fr 1fr; }
  .audience-grid { grid-template-columns: 1fr 1fr; }
  .audience-card { min-height: 0; }
}
@media (max-width: 680px) {
  .audience-grid, .how-steps, .opp-grid, .guardrail-list, .network-fields { grid-template-columns: 1fr; }
  .join-panel { padding: 22px 18px; }
  .join-tabs { justify-content: flex-start; }
  .empty-state-large { padding: 40px 22px; }
  .join-thanks { padding: 34px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .map-links line, .map-nodes circle.hub, .ghost-row span { animation: none; }
  .audience-card:hover { transform: none; }
}

