/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Mobile overflow menu (#390) — belt-and-braces copy for Propshaft :app
 * resolution if the Tailwind build is stale. Source of truth also lives in
 * app/assets/tailwind/application.css. */
.top-nav-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 0.375rem;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-primary);
  color: var(--color-text-muted);
  cursor: pointer;
}
.top-nav-menu-button:hover,
.top-nav-menu-button[aria-expanded="true"] {
  color: var(--color-text);
  border-color: var(--color-accent);
}
.top-nav-menu-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 1.1rem;
  height: 0.85rem;
}
.top-nav-menu-icon > span {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}
.top-nav-mobile-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem 1.1rem;
  border-top: 1px solid var(--color-border-subtle);
  background: var(--color-surface);
}
.top-nav-mobile-panel[hidden] {
  display: none !important;
}
.top-nav-mobile-panel .nav-link {
  display: block;
  padding: 0.35rem 0;
}
/* From 1,024 px the bar shows the links TopNavHelper picks and the rest sit
 * behind "More" (docs/08 UI-20), so the bar no longer widens the page with each
 * new link. Below 1,024 px the hamburger panel lists every link. The right-hand
 * group (org switcher, theme, sign out) never shrinks or wraps; the link count
 * is set so the links fit beside it. */
.top-nav-inner {
  column-gap: 1rem;
}
.top-nav-end {
  flex-shrink: 0;
  white-space: nowrap;
}
.top-nav-links {
  display: none;
}
.top-nav-more {
  position: relative;
}
.top-nav-more > summary {
  cursor: pointer;
  list-style: none;
}
.top-nav-more > summary::-webkit-details-marker {
  display: none;
}
.top-nav-more > summary::after {
  content: " \25BE";
}
.top-nav-more-panel {
  position: absolute;
  z-index: 60;
  top: calc(100% + 0.75rem);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 12rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.5rem;
  background: var(--color-surface);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
}
.top-nav-more-panel .nav-link {
  display: block;
  padding: 0.35rem 0;
}
.nav-link[aria-current] {
  color: var(--color-accent);
}
/* The org switcher (#264): in the bar from 1,024 px, at the foot of the menu
 * panel below that, so a phone never scrolls sideways to reach it. */
.top-nav-org {
  display: none;
}
.top-nav-org-select {
  max-width: 10rem;
}
.top-nav-org-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border-subtle);
}
.top-nav-org-menu .top-nav-org-select {
  flex: 1;
  min-width: 0;
  max-width: none;
}
@media (min-width: 1024px) {
  .top-nav-org {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .top-nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    white-space: nowrap;
  }
  .top-nav-menu-button {
    display: none;
  }
  .top-nav-mobile-panel {
    display: none !important;
  }
}

/* Skip link: off-screen until focused, then the first thing on the page. */
.skip-link {
  position: absolute;
  z-index: 100;
  top: 0.5rem;
  left: 0.75rem;
  padding: 0.5rem 0.85rem;
  border: 2px solid var(--color-accent);
  border-radius: 0.375rem;
  background: var(--color-surface);
  color: var(--color-text);
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
}
#main:focus {
  outline: none;
}

/* Checksum failure alert (slice A2).
   Text is --color-text on --color-surface: about 15:1 in light mode and
   about 14:1 in dark mode, above the 4.5:1 bar for 14px text. The triangle
   and the border use --color-danger so the warning is not color alone.
   The banner stays in normal flow (not fixed) and is two short lines so the
   decoded values under it remain on a 390px phone screen. */
.checksum-failed-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  max-width: 100%;
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  border: 2px solid var(--color-danger);
  border-radius: 0.375rem;
  background: var(--color-surface);
  color: var(--color-text);
}
.checksum-failed-banner__icon {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.1rem;
  color: var(--color-danger);
}
.checksum-failed-banner__body {
  min-width: 0;
}
.checksum-failed-banner__title,
.checksum-failed-banner__guidance {
  margin: 0;
  color: var(--color-text);
}
.checksum-failed-banner__title {
  font-weight: 700;
}
.checksum-failed-banner__guidance {
  margin-top: 0.15rem;
  font-size: 0.875rem;
  line-height: 1.35;
}
.profile-checksums {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  max-width: 100%;
  margin-bottom: 0.75rem;
}
.profile-checksum-failed {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.25rem;
  max-width: 100%;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--color-danger);
  border-radius: 0.125rem;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
}
