/* The public directory.
 *
 * The one idea this file exists to protect: the panel NBOP asserts and the
 * section the holder wrote must never look alike. They differ on ground,
 * border, type and voice, and a labelled divider sits between them saying
 * which is which. If those two ever start resembling each other the page has
 * begun claiming things NBOP did not check, which is the failure mode of every
 * paid directory this one was designed against.
 */

/* ---------- scroll lock without layout shift ----------
   The gutter is reserved at all times, so hiding the scrollbar while the
   dialog is open changes nothing about the width of anything. That is the
   whole reason scrollbar-gutter exists, and it is why no measuring is needed
   on a current browser. directory.js measures only when it is unsupported. */
html { scrollbar-gutter: stable; }
html.dirm-open, html.dirm-open body { overflow: hidden; }

/* ---------- filters ---------- */

.dir-filters { margin: 2rem 0 1.5rem; }
.dir-row {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end;
}
.dir-row-end { margin-top: 1rem; align-items: center; }
/* Capped, because with six controls the last one wraps onto its own row and
   a flex child with nothing beside it stretches the full width, which makes
   one select look like the important one. */
.dir-field { flex: 1 1 13rem; max-width: 22rem; display: block; }
.dir-field > span {
  display: block; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint); margin: 0 0 .3rem;
}
.dir-field input, .dir-field select {
  width: 100%; font: inherit; font-size: .95rem;
  border: 1px solid var(--rule); border-radius: var(--r-sm);
  padding: .55rem .65rem; background: var(--paper); color: var(--ink);
}
.dir-field input:focus-visible, .dir-field select:focus-visible {
  outline: 2px solid var(--signal); outline-offset: 1px;
}
.dir-check { display: inline-flex; align-items: center; gap: .5rem; font-size: .95rem; }

.dir-count { margin: 1.25rem 0 .2rem; font-weight: 600; color: var(--ink); }
.dir-ordering {
  margin: 0 0 1.5rem; font-size: .88rem; color: var(--ink-faint);
  max-width: var(--measure);
}

/* ---------- the cards ---------- */

.hcards {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
}
.hcard {
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: var(--r-md); padding: 1.15rem 1.25rem;
  display: flex; flex-direction: column; gap: .5rem;
}
.hcard h3 { margin: 0; font-size: 1.12rem; }
.hcard h3::before { content: none; }
.hcard-open { text-decoration: none; color: var(--ink); }
.hcard-open:hover, .hcard-open:focus-visible { color: var(--signal-ink); }

/* Nothing written is a fact stated plainly. It differs from a written headline
   by two declarations and nothing else: no warning colour, no icon, no faded
   card. A holder who wrote nothing keeps the credential they earned. */
.hcard-said { margin: 0; color: var(--ink-soft); line-height: 1.5; }
.hcard-said.none { color: var(--ink-faint); font-style: italic; }

.hcard-meta { margin: 0; font-size: .88rem; color: var(--ink-faint); }
.hcard-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.hcard-tags li {
  font-size: .78rem; padding: .2rem .55rem; border-radius: var(--r-pill);
  background: var(--paper-cream); border: 1px solid var(--rule); color: var(--ink-soft);
}
.hcard-foot { margin: .25rem 0 0; }
.hcard-cert {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .8rem; color: var(--ink-faint);
}

.dir-empty {
  background: var(--paper-cream); border: 1px solid var(--rule);
  border-left: 3px solid var(--navy); border-radius: var(--r-md);
  padding: 1.5rem 1.6rem; max-width: 44rem;
}
.dir-empty h3 { margin-top: 0; }
.dir-empty h3::before { content: none; }
.dir-empty p { color: var(--ink-soft); }

/* ---------- the record, as a dialog ---------- */

/* The base rule must NOT set display. A closed <dialog> is display: none by
   user agent default, and setting display: flex here overrides that, which
   leaves an empty Close, Previous and Next panel sitting in the page flow on
   top of the footer. Only the open state gets a display. */
.dirm {
  width: min(52rem, calc(100vw - 2rem));
  max-height: min(86vh, 56rem);
  padding: 0; border: 1px solid var(--rule); border-radius: var(--r-md);
  background: var(--paper); color: var(--ink);
  flex-direction: column;
}
.dirm::backdrop { background: rgba(12, 24, 45, .62); }
.dirm[open] { display: flex; }

.dirm-head {
  display: grid; grid-template-columns: 1fr auto; align-items: start;
  gap: .75rem 1rem; padding: 1.25rem 1.4rem 1rem;
  border-bottom: 1px solid var(--rule);
}
.dirm-eyebrow {
  grid-column: 1; margin: 0 0 .2rem;
  font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-faint);
}
.dirm-head h2 {
  grid-column: 1; margin: 0; font-size: 1.5rem; line-height: 1.2;
}
.dirm-head h2::before { content: none; }
.dirm-close {
  grid-column: 2; grid-row: 1 / span 2; align-self: start;
  font: inherit; font-size: .85rem; cursor: pointer;
  background: transparent; color: var(--ink-soft);
  border: 1px solid var(--rule); border-radius: var(--r-pill);
  padding: .35rem .9rem;
}
.dirm-close:hover { border-color: var(--navy); color: var(--ink); }
.dirm-close:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

.dirm-scroll {
  overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 1.25rem 1.4rem; flex: 1 1 auto;
}
.dirm-scroll:focus-visible { outline: 2px solid var(--signal); outline-offset: -4px; }
.dirm-load { color: var(--ink-faint); }

.dirm-foot {
  display: flex; flex-wrap: wrap; gap: .6rem; justify-content: space-between;
  align-items: center; padding: .9rem 1.4rem;
  border-top: 1px solid var(--rule); background: var(--paper-cream);
}
.dirm-move { display: flex; gap: .6rem; }
.dirm-foot .action { font-size: .85rem; padding: .5rem 1rem; }

/* ---------- verified: navy ground, monospace values, institutional voice ---------- */

.dirm-verified {
  background: var(--navy); color: #FFFFFF;
  border: 1px solid var(--navy); border-top: 4px solid var(--signal);
  border-radius: var(--r-sm);
  padding: 1.25rem 1.35rem;
}
.dirm-verified.lapsed { border-top-color: #C2410C; }
.dirm-verified-h {
  display: flex; align-items: center; gap: .55rem; margin: 0 0 1rem;
  font-size: .8rem; letter-spacing: .16em; text-transform: uppercase;
  color: #FFFFFF; font-family: var(--ui); font-weight: 600;
}
/* nbop.css paints an accent marker above every section heading. Inside the
   navy panel that reads as a stray bar, so it is suppressed here on purpose
   rather than by accident. */
.dirm-verified-h::before { content: none; }
.dirm-seal {
  width: .8rem; height: .8rem; border-radius: 50%;
  background: var(--signal); box-shadow: 0 0 0 3px rgba(0, 99, 198, .28);
  flex: 0 0 auto;
}
.dirm-vrows {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: .85rem 1.4rem; margin: 0;
}
.dirm-vrows dt {
  font-size: .66rem; letter-spacing: .12em; text-transform: uppercase;
  color: #9FB3CC; margin: 0 0 .15rem;
}
.dirm-vrows dd {
  margin: 0; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .92rem; color: #FFFFFF;
}
.dirm-verified-foot {
  margin: 1rem 0 0; padding-top: .85rem;
  border-top: 1px solid rgba(255, 255, 255, .2);
  font-size: .82rem; color: #C6D2E2;
}
.dirm-verified-foot a { color: #FFFFFF; }

/* ---------- the divider that names the boundary ---------- */

.dirm-boundary {
  display: flex; align-items: center; gap: .9rem; margin: 1.5rem 0 1.25rem;
}
.dirm-boundary::before, .dirm-boundary::after {
  content: ""; flex: 1 1 auto; height: 1px; background: var(--rule);
}
.dirm-boundary span {
  flex: 0 1 auto; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint); text-align: center;
}

/* ---------- authored: paper ground, dashed edge, the person's own voice ---------- */

.dirm-authored {
  background: var(--paper); border: 1px dashed var(--rule);
  border-radius: var(--r-sm); padding: 1.25rem 1.35rem;
}
/* Sentence case in the interface font, deliberately not the display face the
   rest of the site gives an h3. This is somebody talking, not a section of a
   standard, and the type is what says so. */
.dirm-authored .dirm-headline {
  font-family: var(--ui); font-weight: 600; font-size: 1.15rem;
  letter-spacing: 0; text-transform: none; margin: 0 0 .9rem; color: var(--ink);
}
.dirm-authored .dirm-headline::before { content: none; }
.dirm-authored h4 {
  margin: 1.2rem 0 .4rem; font-size: .68rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-faint); font-family: var(--ui);
}
.dirm-authored p { color: var(--ink-soft); line-height: 1.65; }
.dirm-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.dirm-tags li {
  font-size: .8rem; padding: .22rem .6rem; border-radius: var(--r-pill);
  background: var(--paper-cream); border: 1px solid var(--rule); color: var(--ink-soft);
}
.dirm-availnote { font-size: .92rem; }
.dirm-edited { margin: 1.2rem 0 0; font-size: .8rem; color: var(--ink-faint); }

.dirm-nowritten {
  margin: 1.5rem 0 0; color: var(--ink-faint); font-style: italic;
}
.dirm-withdrawn {
  margin: 1.5rem 0 0; padding: 1.1rem 1.25rem;
  background: var(--paper-cream); border: 1px solid var(--rule);
  border-left: 3px solid #C2410C; border-radius: var(--r-sm);
}
.dirm-withdrawn h3 { margin-top: 0; font-size: 1rem; }
.dirm-withdrawn h3::before { content: none; }
.dirm-withdrawn p { margin-bottom: 0; color: var(--ink-soft); }

.dirm-fail p { color: var(--ink-soft); line-height: 1.65; max-width: var(--measure); }

/* ---------- scores ---------- */

.dirm-scores { margin-top: 1.75rem; }
.dirm-scores h3 { font-size: 1rem; }
.dirm-scores-note { font-size: .85rem; color: var(--ink-faint); max-width: var(--measure); }
.dirm-bars { list-style: none; margin: 1rem 0 0; padding: 0; }
.dirm-bars li {
  display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr 2.5rem;
  gap: .75rem; align-items: center; margin: 0 0 .5rem;
}
.dirm-bar-label { font-size: .88rem; color: var(--ink-soft); }
.dirm-bar {
  display: block; height: .5rem; border-radius: var(--r-pill);
  background: var(--paper-cream); border: 1px solid var(--rule); overflow: hidden;
}
.dirm-bar i { display: block; height: 100%; background: var(--navy); }
.dirm-bar-num {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem;
  color: var(--ink-faint); text-align: right; font-variant-numeric: tabular-nums;
}

/* ---------- what NBOP is and is not saying ---------- */

.dirm-saying { margin-top: 1.75rem; }
.dirm-saying h3 { font-size: 1rem; }
.dirm-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.25rem; }
.dirm-two h4 {
  margin: 0 0 .4rem; font-size: .68rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-faint); font-family: var(--ui);
}
.dirm-two ul { margin: 0; padding-left: 1.1rem; }
.dirm-two li { margin: 0 0 .4rem; font-size: .9rem; color: var(--ink-soft); line-height: 1.55; }

@media (max-width: 40rem) {
  .dirm { width: 100vw; max-width: 100vw; max-height: 100vh; border-radius: 0; border: 0; }
  .dirm-foot { justify-content: stretch; }
  .dirm-foot .action { flex: 1 1 auto; text-align: center; }
}

/* The dialog appears at once rather than growing into place. Nothing here
   animates, so there is nothing for reduced motion to turn off. */
