/* Shared action styles for CWMP and Herbicide Tracker. Keep both copies identical. */
:root {
  --action-bg: #25684c;
  --action-hover: #9bb679;
  --action-text: #ffffff;
  --action-hover-text: #092620;
  --action-border: rgba(197, 210, 171, .38);
}

body .action-button {
  box-sizing: border-box;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  min-height: 48px !important;
  height: auto !important;
  max-width: 100% !important;
  padding: 12px 18px !important;
  border: 1px solid var(--action-border) !important;
  border-radius: 6px !important;
  background: var(--action-bg) !important;
  color: var(--action-text) !important;
  font: 600 14px/22px Arial, Helvetica, sans-serif !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  text-align: center !important;
  text-decoration: none !important;
  white-space: normal !important;
  vertical-align: middle;
  box-shadow: none !important;
  filter: none !important;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease !important;
}

body .action-button:hover,
body .action-button:focus-visible,
body .action-button:active,
body a:hover > .action-button,
body a:focus-visible > .action-button {
  background: var(--action-hover) !important;
  color: var(--action-hover-text) !important;
  border-color: var(--action-hover) !important;
  text-decoration: none !important;
  transform: none !important;
  filter: none !important;
}

body .action-button:focus-visible,
body a:focus-visible,
body button:focus-visible {
  outline: 3px solid #d6e6ae;
  outline-offset: 4px;
}

body .action-button:disabled,
body .action-button[aria-disabled="true"] {
  opacity: .55;
  cursor: not-allowed;
  background: var(--action-bg) !important;
  color: var(--action-text) !important;
}

body a.action-button::after,
body .action-button--arrow::after {
  content: "";
  position: static !important;
  display: block !important;
  flex: 0 0 16px;
  width: 16px !important;
  height: 16px !important;
  background: currentColor !important;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M4 12h16m-6-6 6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M4 12h16m-6-6 6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat;
  transform: none !important;
  transition: none !important;
}
body .action-button[data-external="true"]::after { transform: rotate(-45deg) !important; }
body .action-button[download]::after { transform: rotate(90deg) !important; }
body .action-button--back::after { transform: rotate(180deg) !important; order: -1; }
body .action-button > svg { display: none !important; }

body :where(main, footer) :where(p, li, dd, cite) > a:not(.action-button):not(.card):not(.chip),
body .calfire-source-link:not(.action-button) {
  color: #c7d8a8;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
body :where(main, footer) :where(p, li, dd, cite) > a:not(.action-button):hover,
body .calfire-source-link:not(.action-button):hover { color: #fff; }

.action-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
body .pager { flex-wrap: wrap; gap: 12px; }
body .home-alert-program {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  padding: 32px;
  border-radius: 8px;
}
body .home-alert-program > .action-button { justify-self: end; }
body .home-command-actions .action-button { width: 100%; }
body .home-search > .action-button { align-self: center; }
body .record-card-title-row { flex-wrap: wrap; gap: 16px; }
body .record-card-coverage > .action-button { align-self: flex-start; margin-top: auto; }
body .home-explore-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body .home-explore-card { min-width: 0; gap: 24px; }
body .home-explore-card .action-button { align-self: flex-start; margin-top: auto; }
body .home-county-card .action-button { justify-self: start; border-top: 1px solid var(--action-border); }
body .owner-tally > .action-button { margin-top: 16px; }

@media (max-width: 1000px) {
  body .home-explore-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body .home-alert-program { grid-template-columns: 1fr; gap: 24px; }
  body .home-alert-program > .action-button { justify-self: start; }
}
@media (max-width: 600px) {
  body .home-alert-program { padding: 24px; }
  body .home-explore-grid { grid-template-columns: 1fr; }
  body .home-alert-program > .action-button { width: 100%; }
  body .action-row > .action-button { flex: 1 1 210px; }
}
@media (prefers-reduced-motion: reduce) {
  body .action-button { transition: none !important; }
}
