/* ============================================================
   TAP County Guide — Public Styles (Phase 2)
   All selectors prefixed with .tap- to avoid theme conflicts.
   ============================================================ */

/* ---- Box Sizing Reset ---- */
.tap-container *,
.tap-container *::before,
.tap-container *::after {
  box-sizing: border-box;
}

/* ---- Brand Tokens ---- */
.tap-container {
  --tap-green: #82b141;
  --tap-green-light: #9bc45e;
  --tap-green-pale: #e8f3d8;
  --tap-green-dark: #5a6b3a;
  --tap-gray: #4c4f57;
  --tap-gray-dark: #3a3d43;
  --tap-gray-light: #5c5f67;
  --tap-yellow: #ffe200;
  --tap-yellow-soft: #fff4a3;
  --tap-text: #333;
  --tap-text-muted: #6b7280;
  --tap-border: #e0e0e0;
  --tap-bg: #fff;
  --tap-bg-muted: #f7f8fa;
  --tap-radius: 8px;
  --tap-spacing: 16px;
  --tap-font: "Source Sans 3", "Source Sans Pro", -apple-system, BlinkMacSystemFont, sans-serif;
}

.tap-container {
  font-family: var(--tap-font);
  color: var(--tap-text);
  font-size: 15px;
  line-height: 1.5;
  max-width: 100%;
  position: relative;
}

.tap-container *, .tap-container *::before, .tap-container *::after {
  box-sizing: border-box;
}

.tap-notice {
  padding: 12px 16px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--tap-radius);
  margin: 16px 0;
}

/* ============================================================
   MAP HERO
   ============================================================ */

.tap-map-panel {
  margin-bottom: 0;
}

.tap-map-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  background: var(--tap-gray);
  color: #fff;
  padding: 40px 32px;
  border-radius: var(--tap-radius);
  overflow: hidden;
}

.tap-map-hero-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tap-map-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 12px;
  color: #fff;
  line-height: 1.2;
}

.tap-map-desc {
  font-size: 15px;
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}

.tap-map-instructions h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.7);
}

.tap-map-instructions ul {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}

.tap-map-instructions li {
  padding: 4px 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}

.tap-map-instructions strong {
  color: #fff;
}

/* ---- Map Toolbar ---- */
.tap-map-toolbar {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.tap-search-wrapper {
  position: relative;
  flex: 1;
}

.tap-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.tap-county-search {
  width: 100%;
  padding: 10px 12px 10px 40px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--tap-radius);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 14px;
  font-family: var(--tap-font);
  outline: none;
  transition: border-color 0.2s;
}

.tap-county-search::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.tap-county-search:focus {
  border-color: var(--tap-green);
  background: rgba(255, 255, 255, 0.15);
}

.tap-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 0 0 var(--tap-radius) var(--tap-radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  list-style: none;
  margin: 0;
  padding: 0;
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
}

.tap-search-results li {
  padding: 10px 14px;
  cursor: pointer;
  color: var(--tap-text);
  font-size: 14px;
}

.tap-search-results li:hover, .tap-search-results li.active {
  background: var(--tap-green-pale);
}

.tap-search-history-header {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #999;
  cursor: default;
  pointer-events: none;
}

/* ---- Map SVG Area ---- */
.tap-map-hero-map {
  position: relative;
}

.tap-map-wrapper {
  overflow: hidden;
  border-radius: var(--tap-radius);
  background: var(--tap-gray);
  cursor: grab;
  touch-action: none;
}

.tap-map-wrapper.grabbing {
  cursor: grabbing;
}

.tap-map-wrapper svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* County paths */
.tap-map-wrapper path[data-county] {
  fill: var(--tap-green);
  fill-rule: evenodd;
  stroke: var(--tap-gray);
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill 150ms ease;
  outline: none;
}

.tap-map-wrapper path[data-county]:focus-visible {
  outline: none;
  stroke: #fff;
  stroke-width: 2.5;
  fill: var(--tap-green-light);
}

.tap-map-wrapper path[data-county]:hover,
.tap-map-wrapper path[data-county].hovered {
  fill: var(--tap-green-light);
}

.tap-map-wrapper path[data-county].selected {
  fill: var(--tap-yellow);
  stroke: var(--tap-gray-dark);
  stroke-width: 1.5;
}

.tap-map-wrapper path[data-county].selected:hover {
  fill: var(--tap-yellow-soft);
}

.tap-map-wrapper .county-label {
  display: none;
}

.tap-map-wrapper path[data-county] title {
  pointer-events: none;
}

/* Zoom controls */
.tap-zoom-controls {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tap-zoom-controls button {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--tap-border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  color: var(--tap-text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tap-zoom-controls button:hover {
  background: #fff;
}

/* ---- Tooltip ---- */
.tap-tooltip {
  position: absolute;
  background: var(--tap-gray-dark);
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  pointer-events: none;
  z-index: 200;
  max-width: 260px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tap-tooltip strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.tap-tooltip-row {
  margin: 2px 0;
}

.tap-tooltip-label {
  color: rgba(255, 255, 255, 0.7);
}

/* ---- Mobile Banner ---- */
.tap-mobile-banner {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--tap-green);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  border-radius: var(--tap-radius);
  margin: 8px 0;
}

/* ============================================================
   SUMMARY PANEL
   ============================================================ */

.tap-summary-section {
  max-width: 720px;
  margin: 20px auto 0;
}

.tap-panel-placeholder {
  text-align: center;
  padding: 48px 16px;
  color: var(--tap-text-muted);
}

.tap-panel-placeholder svg {
  margin-bottom: 12px;
}

.tap-panel-placeholder p {
  font-size: 15px;
  margin: 0;
}

.tap-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.tap-county-name {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.tap-close-btn {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--tap-text-muted);
  padding: 0 4px;
  line-height: 1;
}

.tap-close-btn:hover {
  color: var(--tap-text);
}

/* ---- Issue link ---- */
.tap-issue-link {
  margin-bottom: 14px;
}

.tap-issue-link a {
  color: var(--tap-text-muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.15s;
}

.tap-issue-link a:hover {
  color: var(--tap-green);
  text-decoration: underline;
}

/* ---- Action Buttons ---- */
.tap-action-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: var(--tap-spacing);
  flex-wrap: wrap;
}

.tap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: var(--tap-radius);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  border: none;
  font-family: var(--tap-font);
  transition: background-color 0.2s;
}

.tap-btn-primary {
  background: var(--tap-green);
  color: #fff;
}

.tap-btn-primary:hover {
  background: var(--tap-green-dark);
  color: #fff;
}

.tap-btn-secondary {
  background: var(--tap-bg-muted);
  color: var(--tap-text);
  border: 1px solid var(--tap-border);
}

.tap-btn-secondary:hover {
  background: #eee;
  color: var(--tap-text);
}

.tap-btn-sm {
  padding: 4px 12px;
  font-size: 13px;
}

.tap-btn-full {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--tap-green);
  color: #fff;
  text-align: center;
  border-radius: var(--tap-radius);
  font-size: 15px;
}

.tap-btn-full:hover {
  background: var(--tap-green-dark);
  color: #fff;
}

/* ============================================================
   KEY-VALUE TABLES
   ============================================================ */

.tap-kv-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--tap-spacing);
  border: 1px solid var(--tap-border);
  border-radius: var(--tap-radius);
  overflow: hidden;
}

.tap-kv-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}

.tap-kv-table tr:last-child td {
  border-bottom: none;
}

.tap-kv-label {
  font-weight: 600;
  color: var(--tap-text);
  width: 45%;
  font-size: 14px;
}

.tap-kv-value {
  color: var(--tap-text-muted);
  text-align: right;
}

.tap-section-subtitle {
  font-size: 14px;
  font-weight: 600;
  color: var(--tap-text);
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--tap-border);
}

.tap-kv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
}

.tap-kv-row:last-child {
  border-bottom: none;
}

.tap-kv-callout-cell {
  padding: 12px 14px;
  background: var(--tap-bg-muted);
  border-bottom: 1px solid #f0f0f0;
  line-height: 1.6;
  font-size: 14px;
  color: var(--tap-text-muted);
}

.tap-kv-callout-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--tap-text);
  margin-bottom: 4px;
}

.tap-field-label {
  font-weight: 600;
  color: var(--tap-text);
}

.tap-section-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ============================================================
   DIRECTORY LIST
   ============================================================ */

.tap-section-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--tap-text-muted);
  margin: 20px 0 8px;
  font-weight: 700;
}

.tap-where-to-file {
  border: 1px solid var(--tap-border);
  border-radius: var(--tap-radius);
  padding: 12px 14px;
  background: #fff;
  margin-bottom: var(--tap-spacing);
}

.tap-where-to-file .tap-courthouse-table {
  margin-bottom: 0;
}

.tap-directory-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--tap-border);
  border-radius: var(--tap-radius);
  overflow: hidden;
}

.tap-directory-list li {
  border-bottom: 1px solid #f0f0f0;
}

.tap-directory-list li:last-child {
  border-bottom: none;
}

.tap-directory-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--tap-text);
  font-weight: 500;
  transition: background 0.15s;
}

.tap-directory-link:hover {
  background: var(--tap-bg-muted);
  color: var(--tap-green);
}

.tap-arrow {
  font-size: 20px;
  color: var(--tap-text-muted);
  font-weight: 300;
}

/* ============================================================
   ACCORDION (details/summary)
   ============================================================ */

.tap-accordion-section {
  border: 1px solid var(--tap-border);
  border-radius: var(--tap-radius);
  margin-bottom: var(--tap-spacing);
  overflow: hidden;
}

.tap-section-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--tap-bg-muted);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: var(--tap-text);
  list-style: none;
  user-select: none;
}

.tap-section-trigger::-webkit-details-marker {
  display: none;
}

.tap-section-trigger::after {
  content: '+';
  font-size: 18px;
  font-weight: 700;
  color: var(--tap-text-muted);
}

details[open] > .tap-section-trigger::after {
  content: '\2212';
}

.tap-section-trigger:hover {
  background: #eee;
}

.tap-accordion-body {
  padding: var(--tap-spacing);
}

/* Nested FAQ / sub-accordions */
.tap-accordion-item {
  border: 1px solid var(--tap-border);
  border-radius: 6px;
  margin-bottom: 8px;
  overflow: hidden;
}

.tap-accordion-item:last-child {
  margin-bottom: 0;
}

.tap-accordion-item > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tap-text);
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: var(--tap-bg-muted);
  transition: background 0.15s;
}

.tap-accordion-item > summary::-webkit-details-marker {
  display: none;
}

.tap-accordion-item > summary::after {
  content: '+';
  font-size: 16px;
  font-weight: 700;
  color: var(--tap-text-muted);
  flex-shrink: 0;
  margin-left: 8px;
}

.tap-accordion-item[open] > summary::after {
  content: '\2212';
}

.tap-accordion-item > summary:hover {
  background: #eee;
}

.tap-accordion-content {
  padding: 12px 14px;
  color: var(--tap-text);
  line-height: 1.6;
}

/* FAQ group styling (for courtDaMap etc.) */
.tap-faq-group {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.tap-faq-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.tap-faq-group-label {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--tap-text);
}

.tap-faq-subitem {
  padding: 3px 0 3px 12px;
  font-size: 14px;
}

.tap-text-muted {
  color: var(--tap-text-muted);
  font-size: 13px;
}

.tap-forms-xref {
  margin-top: 10px;
  font-size: 14px;
}

/* Courthouse table (filing map) */

.tap-courthouse-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--tap-spacing);
}

.tap-courthouse-table th {
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--tap-text-muted);
  padding: 6px 14px;
  border-bottom: 2px solid var(--tap-border);
}

.tap-courthouse-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
  font-size: 14px;
}

.tap-courthouse-table td:first-child {
  font-weight: 600;
  color: var(--tap-text);
}

.tap-courthouse-table td:last-child {
  color: var(--tap-text-muted);
}

.tap-courthouse-table tr:last-child td {
  border-bottom: none;
}

/* DA service table (court → DA map) */

.tap-da-group {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.tap-da-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.tap-da-group-label {
  font-weight: 600;
  font-size: 15px;
  color: var(--tap-text);
  margin-bottom: 8px;
}

.tap-da-table {
  width: 100%;
  border-collapse: collapse;
}

.tap-da-table th {
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--tap-text-muted);
  padding: 6px 14px;
  border-bottom: 2px solid var(--tap-border);
}

.tap-da-table td {
  padding: 8px 14px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
  font-size: 14px;
}

.tap-da-table td:first-child {
  font-weight: 600;
  color: var(--tap-text);
}

.tap-da-table tr:last-child td {
  border-bottom: none;
}

/* ============================================================
   CARDS (courthouses, DA offices)
   ============================================================ */

.tap-card {
  border: 1px solid var(--tap-border);
  border-radius: var(--tap-radius);
  padding: var(--tap-spacing);
  margin-bottom: 12px;
  background: var(--tap-bg);
}

.tap-card-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
}

.tap-card-subtitle {
  color: var(--tap-text-muted);
  font-style: italic;
  font-size: 14px;
}

.tap-card-row {
  padding: 3px 0;
  font-size: 14px;
  line-height: 1.5;
}

.tap-card-row a {
  color: var(--tap-green);
  text-decoration: none;
  font-weight: 500;
}

.tap-card-row a:hover {
  text-decoration: underline;
}

/* ============================================================
   BADGES / PILLS
   ============================================================ */

.tap-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin: 2px 4px 2px 0;
  background: var(--tap-green-pale);
  color: var(--tap-green-dark);
  text-decoration: none;
  cursor: pointer;
}

a.tap-badge:hover {
  background: var(--tap-green);
  color: #fff;
}

/* ============================================================
   CALLOUT / NOTE BLOCKS
   ============================================================ */

.tap-callout {
  padding: 12px 16px;
  border-radius: var(--tap-radius);
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--tap-text-muted);
  background: var(--tap-bg-muted);
  border-left: 4px solid var(--tap-border);
}

.tap-callout-olive {
  background: var(--tap-green-pale);
  border-left-color: var(--tap-green);
}

.tap-note-block {
  padding: 10px 14px;
  background: var(--tap-bg-muted);
  border-radius: 4px;
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.6;
}

.tap-note-block strong {
  display: block;
  margin-bottom: 4px;
  color: var(--tap-text);
}

/* ============================================================
   FORMS SECTION
   ============================================================ */

.tap-subsection-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--tap-text-muted);
  margin: 16px 0 8px;
}

.tap-form-group {
  margin-bottom: 10px;
}

.tap-form-label {
  font-weight: 600;
  font-size: 14px;
  display: block;
  margin-bottom: 4px;
}

.tap-form-list {
  list-style: disc;
  margin: 4px 0 0 20px;
  padding: 0;
}

.tap-form-list li {
  padding: 3px 0;
  font-size: 14px;
  color: var(--tap-text-muted);
}

.tap-form-link {
  color: var(--tap-green);
  text-decoration: none;
  font-weight: 500;
}

.tap-form-link:hover {
  text-decoration: underline;
}

.tap-link-arrow {
  font-size: 12px;
  margin-left: 2px;
}

/* ============================================================
   STATIC / MISC
   ============================================================ */

.tap-static-note {
  font-size: 14px;
  color: var(--tap-text-muted);
  font-style: italic;
  margin-bottom: 14px;
}

.tap-empty {
  color: var(--tap-text-muted);
  font-style: italic;
  font-size: 14px;
}

/* ============================================================
   DETAIL PAGE
   ============================================================ */

.tap-detail-page {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--tap-spacing) 0;
}

.tap-back-link {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--tap-green);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.tap-back-link:hover {
  text-decoration: underline;
}

.tap-detail-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.2;
}

/* ---- CTA ---- */
.tap-cta {
  margin-top: 20px;
}

/* ---- Feedback Section ---- */
.tap-feedback-detail {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--tap-border);
  border-radius: var(--tap-radius);
  text-align: center;
  background: var(--tap-bg-muted);
}

.tap-feedback-detail p {
  margin: 0 0 12px;
  color: var(--tap-text-muted);
  font-size: 15px;
}

.tap-faq {
  margin-top: var(--tap-spacing);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  .tap-map-hero {
    grid-template-columns: 1fr;
    padding: 24px 16px;
    gap: 20px;
  }

  .tap-map-title {
    font-size: 22px;
  }

  .tap-map-toolbar {
    flex-direction: column;
  }

  .tap-map-wrapper {
    max-height: 400px;
  }

  .tap-action-buttons {
    flex-direction: column;
  }

  .tap-kv-label {
    width: 50%;
  }

  .tap-detail-title {
    font-size: 22px;
  }

  .tap-mobile-banner:not([hidden]) {
    display: flex;
  }

  .tap-summary-section {
    margin-top: 0;
  }
}

@media (max-width: 480px) {
  .tap-map-hero {
    padding: 16px 12px;
  }

  .tap-card {
    padding: 12px;
  }
}
