/*
  Platform-wide chrome: the configurable dashboard footer, and the announcement
  popup a super admin pushes to users.

  Hand-authored like the other shared sheets -- workspace.css is a purged
  Tailwind build output, and the announcement markup is created at runtime by
  JavaScript, so utility classes here would be stripped.
*/

/* ------------------------------------------------------------ footer links */

/*
  "no underline by default, but hovering over it shows the underline - only for
  the href words". The underline is drawn with `text-decoration` on hover rather
  than a border so it follows descenders and line wraps.
*/
.footer-link {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  border-radius: 2px;
}

.footer-link:hover,
.footer-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-link:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* ----------------------------------------------------- announcement dialog */

/*
  A modal, not a toast. An announcement is pushed deliberately by a super admin
  and carries actions, so it must be acknowledged rather than drift past while
  someone is reading something else.
*/
.pa-dialog {
  width: min(32rem, calc(100vw - 2rem));
  max-height: calc(100vh - 4rem);
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  color: #020617;
  box-shadow: 0 24px 60px -20px rgba(2, 6, 23, 0.45);
  overflow: hidden;
}

.pa-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

/* The no-<dialog> fallback: a plain overlay that behaves the same way. */
.pa-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
}

.pa-overlay[hidden],
.pa-dialog[hidden] {
  display: none;
}

.pa-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.125rem 1.25rem 0.875rem;
  border-bottom: 1px solid #e2e8f0;
}

.pa-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background: #eff6ff;
  color: #1d4ed8;
}

.pa-icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

/* Tone carries the same meaning as elsewhere in the workspace. */
.pa-icon--warning {
  background: #fffbeb;
  color: #b45309;
}

.pa-icon--critical {
  background: #fff1f2;
  color: #be123c;
}

.pa-icon--success {
  background: #ecfdf5;
  color: #047857;
}

.pa-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: #020617;
}

.pa-meta {
  margin: 0.1875rem 0 0;
  font-size: 0.6875rem;
  color: #475569;
}

.pa-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #334155;
  /* Announcements are written as plain text with real paragraph breaks; the
     author's line breaks are the formatting. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pa-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.pa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 2.375rem;
  padding: 0 0.9375rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  background: #fff;
  color: #1e293b;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.pa-btn:hover {
  border-color: #cbd5e1;
  color: #020617;
}

.pa-btn--primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.pa-btn--primary:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #fff;
}

.pa-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.pa-btn svg {
  width: 0.8125rem;
  height: 0.8125rem;
}

/* The counter shown when several announcements are queued behind this one. */
.pa-queue {
  margin-right: auto;
  align-self: center;
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  color: #475569;
}

/* ------------------------------------------- super-admin composer controls */

/* A repeatable (label, href) row, used by both the footer editor and the
   announcement button editor. */
.pa-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pa-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto;
  gap: 0.5rem;
  align-items: center;
}

@media (max-width: 640px) {
  .pa-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.pa-row__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  background: #fff;
  color: #475569;
  cursor: pointer;
}

.pa-row__remove:hover {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.pa-row__remove svg {
  width: 0.9375rem;
  height: 0.9375rem;
}
