/* ============================================================
   NORMAN AUDIO — in-place editing chrome.

   Loaded on every page but inert until an administrator signs in:
   nothing here paints anything for a visitor. Deliberately styled
   as *tooling* — navy, tight, unmistakably not part of the site —
   so an admin can never confuse the editor with the page.
   ============================================================ */

:root {
  --na-bar-h: 46px;
  --na-edit: #1668C9;
  --na-edit-soft: rgba(22, 104, 201, .16);
  --na-panel: #0B1A2E;
  --na-panel-2: #12253D;
  --na-panel-line: rgba(255, 255, 255, .14);
  --na-panel-ink: #E6EDF6;
  --na-panel-dim: #93A4BA;
}

/* ---------------- the bar ---------------- */
.na-bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--na-bar-h);
  padding: 0 clamp(10px, 2vw, 18px);
  background: var(--na-panel);
  border-bottom: 1px solid var(--na-panel-line);
  box-shadow: 0 8px 30px -14px rgba(0, 0, 0, .8);
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  font-size: 12.5px;
  color: var(--na-panel-ink);
  -webkit-font-smoothing: antialiased;
}

.na-bar__brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: 10.5px;
  color: #fff;
  flex: none;
}
.na-bar__brand i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3FBF7F;
  box-shadow: 0 0 0 3px rgba(63, 191, 127, .2);
}

.na-bar__toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--na-panel-dim);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.na-bar__toggle input { accent-color: var(--na-edit); margin: 0; }
.na-bar__toggle:hover { color: #fff; }

.na-bar__sp { flex: 1 1 auto; }

.na-bar__note {
  color: #7FD8A6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 34vw;
}
.na-bar__note.bad { color: #FF9B8A; }

.na-bar__badge {
  flex: none;
  white-space: nowrap;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: var(--na-edit-soft);
  border: 1px solid rgba(22, 104, 201, .55);
  color: #7EB5F5;
}
.na-bar__badge.draft {
  background: rgba(224, 168, 74, .14);
  border-color: rgba(224, 168, 74, .5);
  color: #E9B765;
}

.na-btn {
  flex: none;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 8px 12px;
  border-radius: 5px;
  border: 1px solid var(--na-panel-line);
  background: rgba(255, 255, 255, .06);
  color: var(--na-panel-ink);
  cursor: pointer;
  transition: background .18s, color .18s, opacity .18s;
}
.na-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .14); color: #fff; }
.na-btn:disabled { opacity: .38; cursor: not-allowed; }
.na-btn--primary {
  background: var(--na-edit);
  border-color: transparent;
  color: #fff;
}
.na-btn--primary:hover:not(:disabled) { background: #2C7DE0; }
.na-btn--link {
  background: none;
  border-color: transparent;
  color: var(--na-panel-dim);
  text-decoration: none;
  padding: 8px 6px;
}
.na-btn--link:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.na-btn--danger { color: #FF9B8A; border-color: rgba(255, 155, 138, .35); background: none; }
.na-btn--danger:hover:not(:disabled) { background: rgba(255, 155, 138, .12); color: #FFB9AC; }

/* the site slides down to make room */
body.na-editing { padding-top: var(--na-bar-h); }
body.na-editing .site-header { top: var(--na-bar-h); }

/* The bar is tooling, and it must never push the site's own controls off the
   screen. It sheds its wording as the viewport narrows and keeps, in order of
   importance: the edit toggle, the change count, Review, Publish, Sign out. */
@media (max-width: 900px) {
  .na-bar { gap: 7px; font-size: 12px; }
  .na-bar__toggle span, .na-bar__note, .na-bar__badge span { display: none; }
  .na-btn { padding: 8px 9px; }
}
@media (max-width: 720px) {
  .na-bar__console { display: none; }
}
@media (max-width: 620px) {
  .na-bar { gap: 6px; padding: 0 8px; }
  .na-bar__brand b { display: none; }
  .na-btn { padding: 8px 7px; font-size: 11.5px; }
}

/* ---------------- what is clickable ---------------- */
.na-editing.na-live [data-na-hot] { cursor: text; }
.na-hover {
  outline: 1.5px dashed rgba(22, 104, 201, .95) !important;
  outline-offset: 2px !important;
  border-radius: 2px;
}
.na-hover-img {
  outline: 2px solid rgba(22, 104, 201, .95) !important;
  outline-offset: 2px !important;
  cursor: pointer !important;
}
/* a field the site's own data feeds — worth distinguishing from loose text */
.na-hover-field {
  outline: 1.5px solid rgba(22, 104, 201, .95) !important;
  outline-offset: 3px !important;
}

/* ---------------- unpublished-changes panel ---------------- */
.na-panel {
  position: fixed;
  z-index: 9050;
  top: calc(var(--na-bar-h) + 8px);
  right: 10px;
  width: min(420px, calc(100vw - 20px));
  max-height: calc(100vh - var(--na-bar-h) - 24px);
  display: flex;
  flex-direction: column;
  background: var(--na-panel);
  border: 1px solid var(--na-panel-line);
  border-radius: 10px;
  box-shadow: 0 30px 70px -22px rgba(0, 0, 0, .85);
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  color: var(--na-panel-ink);
}
.na-panel__head, .na-panel__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 13px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.na-panel__head { border-bottom: 1px solid var(--na-panel-line); color: #fff; }
.na-panel__foot { border-top: 1px solid var(--na-panel-line); }
.na-panel__n {
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--na-edit-soft);
  border: 1px solid rgba(22, 104, 201, .55);
  color: #7EB5F5;
  letter-spacing: 0;
}
.na-panel__list { overflow-y: auto; padding: 4px 0; }
.na-panel__empty { margin: 0; padding: 22px; text-align: center; color: var(--na-panel-dim); font-size: 12.5px; }

.na-change {
  position: relative;
  padding: 11px 78px 11px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.na-change:last-child { border-bottom: 0; }
.na-change__where {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #7EB5F5;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.na-change__was, .na-change__now {
  font-size: 12.5px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.na-change__was { color: #7A8AA0; text-decoration: line-through; margin-bottom: 3px; }
.na-change__now { color: #E6EDF6; }
.na-change__img {
  max-width: 100%;
  max-height: 72px;
  border-radius: 5px;
  background: #fff;
  padding: 3px;
  object-fit: contain;
}
.na-change__undo {
  position: absolute;
  top: 10px;
  right: 11px;
  font-size: 11px;
  padding: 5px 10px;
}

/* ---------------- the editor popover ---------------- */
.na-pop {
  position: fixed;
  z-index: 9100;
  background: var(--na-panel);
  border: 1px solid rgba(22, 104, 201, .7);
  border-radius: 9px;
  padding: 11px 12px 12px;
  box-shadow: 0 30px 70px -22px rgba(0, 0, 0, .85);
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  color: var(--na-panel-ink);
}

.na-pop__tag {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #7EB5F5;
  margin-bottom: 8px;
}
.na-pop__where {
  font-weight: 500;
  letter-spacing: .02em;
  text-transform: none;
  font-size: 10.5px;
  color: var(--na-panel-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

.na-pop__input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.55;
  color: #fff;
  background: var(--na-panel-2);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 6px;
  padding: 9px 10px;
  resize: vertical;
}
.na-pop__input:focus {
  outline: none;
  border-color: var(--na-edit);
  box-shadow: 0 0 0 3px var(--na-edit-soft);
}

.na-pop__tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  flex-wrap: wrap;
}
.na-pop__hint {
  flex: 1 1 100%;
  font-size: 10.5px;
  color: #6C7E96;
  margin-top: 2px;
}

.na-pop__file {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 12px;
  color: var(--na-panel-ink);
}
.na-pop__file::file-selector-button {
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  margin-right: 10px;
  padding: 7px 12px;
  border: none;
  border-radius: 5px;
  background: var(--na-edit);
  color: #fff;
  cursor: pointer;
}
.na-pop__preview {
  display: block;
  max-width: 100%;
  max-height: 110px;
  margin: 0 auto 9px;
  border-radius: 5px;
  background: #fff;
  object-fit: contain;
}
.na-pop__msg { margin: 8px 0 0; font-size: 12px; font-weight: 600; color: #7EB5F5; }
.na-pop__msg.bad { color: #FF9B8A; }

/* ---------------- sign in ---------------- */
.na-signin {
  position: fixed;
  z-index: 9100;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: min(400px, 92vw);
  background: var(--na-panel);
  border: 1px solid var(--na-panel-line);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .9);
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  color: var(--na-panel-ink);
}
.na-signin h2 {
  margin: 0 0 6px;
  font-family: 'Montserrat', 'Century Gothic', sans-serif;
  font-size: 17px;
  letter-spacing: .02em;
  color: #fff;
}
.na-signin p { margin: 0 0 14px; font-size: 12.5px; line-height: 1.6; color: var(--na-panel-dim); }
.na-signin input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 13px;
  padding: 10px 11px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: var(--na-panel-2);
  color: #fff;
}
.na-signin input:focus { outline: none; border-color: var(--na-edit); box-shadow: 0 0 0 3px var(--na-edit-soft); }
.na-signin__row { display: flex; gap: 8px; margin-top: 12px; }
.na-signin__err { margin: 10px 0 0; font-size: 12px; font-weight: 600; color: #FF9B8A; min-height: 15px; }
.na-veil {
  position: fixed;
  inset: 0;
  z-index: 9050;
  background: rgba(5, 15, 31, .62);
  backdrop-filter: blur(3px);
}

/* ---------------- toast ---------------- */
.na-etoast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  translate: -50% 0;
  z-index: 9200;
  max-width: min(520px, 92vw);
  padding: 11px 18px;
  border-radius: 7px;
  background: var(--na-panel);
  border: 1px solid var(--na-panel-line);
  color: var(--na-panel-ink);
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  font-size: 13px;
  box-shadow: 0 20px 50px -18px rgba(0, 0, 0, .8);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.na-etoast.show { opacity: 1; transform: none; }
.na-etoast.bad { border-color: rgba(255, 155, 138, .5); color: #FFB9AC; }

@media (prefers-reduced-motion: reduce) {
  .na-etoast { transition: none; }
}
