/*
 * Local visual overrides
 * ----------------------
 * This stylesheet is loaded after the application styles on every HTML page.
 * Add deployment-specific changes here so the organized component files can
 * remain unchanged and future updates are easier to compare.
 */

:root {
  --blue: #3e393f;
  --accent: #3e393f;
  --accent-light: #dedcde;
  --accent-lighter: #eceaec;
  --accent-ultralight: #f6f5f6;
  --accent-hover: #e7e5e7;
}

html,
body {
  background: var(--accent-ultralight);
}

body {
  background-image: linear-gradient(
    135deg,
    #f3f2f3 0%,
    #faf9fa 50%,
    #f3f2f3 100%
  );
}

a {
  color: #3e393f;
}

button,
.button {
  background: var(--accent);
  color: #fff;
}

.secondary,
.button.ghost {
  background: var(--accent-light) !important;
  color: var(--accent) !important;
}

.article-table,
.scroll table {
  background: #fbfafb;
}

.article-table th,
.scroll th {
  background: var(--accent-light) !important;
  color: var(--accent) !important;
}

.article-table tbody tr,
.scroll tbody tr {
  background: #fbfafb !important;
}

.article-table tbody tr:nth-child(even),
.scroll tbody tr:nth-child(even) {
  background: var(--accent-ultralight) !important;
}

.article-table tbody tr:hover,
.article-table tbody tr:nth-child(even):hover,
.scroll tbody tr:hover,
.scroll tbody tr:nth-child(even):hover {
  background: var(--accent-hover) !important;
}

.nav-links a:hover,
.nav-links a.active,
.nav-menu summary:hover,
.nav-menu summary.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.nav-menu {
  position: relative;
}

.nav-menu summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 13px;
  border-radius: 8px;
  color: #dfe3e6;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.nav-menu summary::-webkit-details-marker {
  display: none;
}

.nav-chevron {
  flex: 0 0 auto;
  display: block;
  transition: transform 0.18s ease;
}

.nav-menu[open] .nav-menu-label {
  transform: none !important;
}

.nav-menu[open] .nav-chevron {
  transform: rotate(180deg);
}

.nav-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 120;
  display: grid;
  width: 280px;
  padding: 7px;
  border-radius: 12px;
  background: #fffdfa;
  box-shadow: 0 14px 36px rgba(31, 28, 31, 0.22);
}

.nav-menu-panel::before {
  position: absolute;
  top: -6px;
  right: 24px;
  width: 12px;
  height: 12px;
  background: #fffdfa;
  content: "";
  transform: rotate(45deg);
}

.nav-links .nav-menu-panel a {
  position: relative;
  z-index: 1;
  display: block;
  padding: 10px 11px;
  color: #3e393f;
}

.nav-links .nav-menu-panel a:hover,
.nav-links .nav-menu-panel a.active {
  background: rgba(62, 57, 63, 0.08);
  color: #3e393f;
}

.nav-menu-panel strong,
.nav-menu-panel small {
  display: block;
}

.nav-menu-panel small {
  margin-top: 2px;
  color: #777178;
  font-size: 0.7rem;
  font-weight: 500;
}

.page-heading {
  align-items: center;
  margin: 4px 0 16px;
  padding: 0 2px;
}

.page-heading .eyebrow,
.page-heading p {
  display: none;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2.5vw, 2rem);
  line-height: 1.15;
}

.record-count {
  min-width: 112px;
  padding: 10px 16px;
  background: rgba(62, 57, 63, 0.08);
  color: #3e393f;
}

.record-count strong {
  font-size: 1.35rem;
}

/* Example:
.topbar {
  background: #25384a;
}
*/

input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not(
    [type="submit"]
  ):not([type="reset"]),
select,
textarea {
  border: 1px solid rgba(45, 64, 84, 0.16) !important;
  background: var(--accent-lighter) !important;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not(
    [type="submit"]
  ):not([type="reset"]):focus,
select:focus,
textarea:focus {
  border-color: rgba(45, 64, 84, 0.34) !important;
  outline-color: rgba(62, 57, 63, 0.5);
}

.article-admin-actions,
.non-news-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.action-with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.action-icon {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.action-icon-state {
  display: none;
}

[data-action="send_article_review"] .action-send-review,
[data-action="remove_from_review"] .action-remove-review,
[data-action="mark_non_news"] .action-mark-non-news,
[data-action="restore_news"] .action-restore-news,
[data-action="discard"] .action-discard-image,
[data-action="restore"] .action-restore-image {
  display: block;
}

.review-scope-state {
  color: #4f484f;
  font-size: 0.84rem;
  font-weight: 750;
}

.non-news-actions {
  flex-wrap: nowrap;
  min-width: max-content;
}

.non-news-actions button,
.non-news-actions .status-chip {
  min-height: 34px;
  padding: 7px 11px;
  white-space: nowrap;
}

.source-article-link {
  display: inline-flex;
  flex-direction: column;
  color: #3e393f;
  text-decoration: none;
}

.source-article-link:hover strong {
  text-decoration: underline;
}

.source-article-link small {
  color: #7a737b;
}

.review-stage-text {
  display: block;
  min-width: 128px;
  color: #3e393f;
  font-size: 0.82rem;
  line-height: 1.3;
}

.review-stage-text.needs_setup {
  color: #716970;
}

.review-stage-text.ready_adjudication {
  color: #8a5200;
}

.review-stage-text.adjudicated {
  color: #28651e;
}

.nav-identity {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 155px;
  margin-left: 4px;
  color: #e8e5e8;
}

.brand-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: #ddd5c5;
  color: #332f34;
  font-size: 0.61rem;
  font-weight: 850;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-avatar[data-tone="1"] {
  background: #cdddc7;
}

.brand-avatar[data-tone="2"] {
  background: #d9cedd;
}

.brand-avatar[data-tone="3"] {
  background: #cbd9df;
}

.brand-avatar[data-tone="4"] {
  background: #e4cfc7;
}

.brand-avatar[data-tone="5"] {
  background: #d7d7c2;
}

.brand-avatar svg {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
}

.nav-user-name {
  max-width: 120px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 650;
}

.permanent-article-delete {
  background: #a8322a !important;
  color: #fff !important;
}

.article-table .quick-review.danger {
  background: #a8322a !important;
  color: #fff !important;
  box-shadow: 0 3px 9px rgba(168, 50, 42, 0.18);
}

.article-table .quick-review.danger:hover {
  background: #922a24 !important;
}

.nav-links .logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-left: 8px;
  padding: 0;
}

.nav-links .logout svg {
  display: block;
  flex: 0 0 auto;
}

.nav-links .logout-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.workspace-switch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(64px, 1fr));
  margin-left: auto;
  padding: 3px;
  border-radius: 10px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(62, 57, 63, 0.08);
  isolation: isolate;
}

.workspace-switch::before {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  z-index: -1;
  width: calc(50% - 3px);
  border-radius: 7px;
  background: #3e393f;
  box-shadow: 0 2px 7px rgba(17, 14, 17, 0.24);
  content: "";
  transition: transform 0.2s ease;
}

.workspace-switch.second-active::before {
  transform: translateX(100%);
}

.nav-links .workspace-switch a,
.nav-links .workspace-switch a:hover,
.nav-links .workspace-switch a.active {
  position: relative;
  padding: 6px 10px;
  background: transparent;
  color: #625b63;
  font-size: 0.7rem;
  text-align: center;
  transition: color 0.2s ease;
}

.nav-links .workspace-switch a[aria-current="true"],
.nav-links .workspace-switch a[aria-current="true"]:hover {
  color: #fff;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  margin: 4px 0;
  border-radius: 999px;
  background: currentColor;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.article-table .quality-ratio {
  display: block;
  color: #286526;
  font-size: .76rem;
  font-weight: 800;
  white-space: nowrap;
}

.article-table .table-final-label {
  display: grid;
  gap: 2px;
  justify-items: start;
}

.article-table .table-final-label strong {
  color: #575158;
  font-size: .78rem;
  font-weight: 800;
}

.article-table .table-final-label span {
  color: #817a82;
  font-size: .7rem;
  line-height: 1.35;
}

.article-table .table-final-label.draft strong { color: #8a5900; }
.article-table .table-final-label.complete strong { color: #286526; }

@media (max-width: 1024px) {
  .topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 16px;
    padding: 13px 18px;
  }

  .brand {
    min-width: 0;
  }

  .brand span {
    min-width: 0;
  }

  .brand small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-toggle {
    display: block;
    justify-self: end;
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .topbar .nav-links {
    display: none;
    grid-column: 1 / -1;
    width: 100%;
    padding: 8px 0 2px;
  }

  .topbar.nav-open .nav-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .topbar .nav-links a,
  .topbar .nav-links .logout,
  .topbar .nav-menu summary {
    display: block;
    width: 100%;
    padding: 11px 13px;
    border-radius: 9px;
    text-align: left;
  }

  .topbar .workspace-switch {
    width: 100%;
    margin: 4px 0;
  }

  .topbar .nav-identity {
    width: 100%;
    max-width: none;
    margin: 5px 0 0;
    padding: 9px 13px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.07);
  }

  .topbar .nav-user-name {
    max-width: none;
  }

  .topbar .nav-links .workspace-switch a,
  .topbar .nav-links .workspace-switch a:hover {
    padding: 9px 12px;
    text-align: center;
  }

  .topbar .nav-menu {
    width: 100%;
  }

  .topbar .nav-menu summary {
    display: flex;
    justify-content: space-between;
  }

  .topbar .nav-menu-panel {
    position: static;
    width: auto;
    margin: 3px 0 5px 12px;
    padding: 4px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.07);
    box-shadow: none;
  }

  .topbar .nav-menu-panel::before {
    display: none;
  }

  .topbar .nav-links .nav-menu-panel a,
  .topbar .nav-links .nav-menu-panel a:hover,
  .topbar .nav-links .nav-menu-panel a.active {
    color: #fff;
  }

  .topbar .nav-links .logout {
    display: flex;
    justify-content: flex-start;
    gap: 9px;
    height: auto;
    margin-left: 0;
  }

  .topbar .nav-links .logout-label {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
  }

  .topbar .nav-menu-panel small {
    color: #c8c4c8;
  }
}
