@import url("../vendor/marinos/marinos.css");

.org-facts {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr);
  gap: 0.5rem 1.5rem;
  margin: 0;
}

.org-facts dt {
  font-weight: 700;
  color: var(--app-muted);
}

.org-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 40rem) {
  .org-facts {
    grid-template-columns: 1fr;
    gap: 0.125rem;
  }

  .org-facts dd {
    margin-bottom: 0.75rem;
  }
}

.org-tabs,
.org-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0.5rem;
}

.org-tabs a,
.org-subtabs a {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: var(--pico-border-radius);
  text-decoration: none;
}

.org-tabs a[aria-current="page"],
.org-tabs a:hover,
.org-subtabs a[aria-current="page"],
.org-subtabs a:hover {
  background: color-mix(in srgb, var(--app-accent) 14%, transparent);
  color: var(--app-accent-on-tint);
}


[data-record-list] + p,
[data-key-numbers] + p,
.mm-stats-grid + p {
  margin-top: 1rem;
}

/* The sub-tabs sit under the page tabs, set off by a line, and sit a little tighter. */
.org-subtabs {
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--app-border);
}

/* The result cards and stat cards below use the class names of the Mentions and
   Reach apps (assets/app.css in each), so a tab here reads the same as the app. They
   are copied for now and belong in marin-ui with the other shared pieces. */
.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-results-list > .app-card {
  margin-bottom: 0;
  list-style: none;
}

.mm-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.mm-card__body {
  flex: 1 1 auto;
  min-width: 0;
}

.mm-card__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--app-muted);
  font-size: 0.9375rem;
}

.mm-card__meta .app-badge {
  font-weight: 400;
}

.mm-card__title {
  margin: 0 0 0.25rem;
}

.mm-card__byline {
  margin: 0 0 0.5rem;
  color: var(--app-muted);
  font-size: 0.9375rem;
}

.mm-card__text {
  margin: 0 0 0.5rem;
}

.mm-card__image {
  flex: 0 0 auto;
  width: 9rem;
  height: 9rem;
  object-fit: cover;
  border-radius: var(--pico-border-radius);
}

@media (max-width: 480px) {
  .mm-card {
    flex-direction: column;
  }

  .mm-card__body {
    align-self: stretch;
  }

  .mm-card__image {
    width: 100%;
    height: 10rem;
  }
}

.mm-stats-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}

.mm-stats-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.mm-stats-kpi {
  padding: 1rem;
  border: 1px solid var(--app-border);
  border-radius: var(--pico-border-radius);
  background: var(--app-surface);
}

.mm-stats-kpi__value {
  margin: 0.25rem 0 0;
  font-family: var(--app-font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--app-text);
}

/* A link to a sub-tab names the panel, and the browser scrolls to what a link names.
   The margin keeps the page tabs and the sub-tabs in view above it. */
[data-subtab] {
  scroll-margin-top: 16rem;
}

/* Budget tables: numbers align right, totals stand out. */
.table-scroll {
  overflow-x: auto;
  margin: 1rem 0;
}

.budget-table {
  width: 100%;
  font-variant-numeric: tabular-nums;
}

/* A table has a border, and each cell has one, so rows and columns read as a grid. */
.budget-table {
  border: 1px solid var(--app-border);
  border-collapse: collapse;
}

.budget-table th,
.budget-table td {
  border: 1px solid var(--app-border);
}

/* The heading above each table names it; the caption stays for screen readers. */
.budget-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.mm-stats-kpis + h3 {
  margin-top: 2rem;
}

.budget-table__num {
  text-align: right;
  white-space: nowrap;
}

.budget-table__total th,
.budget-table__total td {
  font-weight: 700;
  border-top: 2px solid var(--app-border);
}

.budget-table__group th {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--app-surface);
}

/* Dashboard: a tight look at each tab, with a link to it for more. */
.budget-table th[scope="row"] {
  min-width: 7rem;
}

/* A button or menu a tab does not have is left out. */
.doc-actions [hidden] {
  display: none;
}

/* Insights: choose the data, ask a question, copy the prompt. */
.insights__include {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 1rem 0;
}

.insights__option {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.insights__question textarea {
  width: 100%;
  margin-top: 0.25rem;
}

.insights__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
}

.insights__actions .app-help-text {
  margin: 0 0 0 0.5rem;
}

.insights__preview {
  max-height: 24rem;
  overflow: auto;
  white-space: pre-wrap;
}

/* Every table has its own Copy and Download buttons above it. */
.table-block {
  margin: 1rem 0;
}

.table-block > .doc-actions {
  margin: 0 0 0.5rem;
  justify-content: flex-start;
}

/* A chart has its own Copy and Download buttons above it, left, as a table does. */
.chart-block {
  margin: 1rem 0;
}

.chart-block > .doc-actions {
  margin: 0 0 0.5rem;
  justify-content: flex-start;
}

/* A heading line and a total line inside a budget schedule table. */
.budget-table__group {
  text-align: left;
  font-weight: 600;
}

.budget-table__subtotal th,
.budget-table__subtotal td {
  font-weight: 600;
}

/* The description column of a schedule is wide enough to read without wrapping every word. */
.budget-schedule .budget-table tbody th[scope="row"] {
  min-width: 16rem;
}

/* The budget year dropdown and the column dropdown in the budget tool. */
.year-select {
  margin: 0 0 1rem;
}

.year-select select,
.action-toolbar select {
  width: auto;
  min-width: 14rem;
  margin: 0;
}

/* Tags at the bottom of a card, exactly as Marin Mentions draws them: plain pills, not buttons. */
.mm-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: 0.25rem 0 0.75rem;
}

.mm-term {
  display: inline-flex;
  max-width: 100%;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--app-muted) 12%, transparent);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}
