/* Palette: brand canon 5 colours only (+ derived scale shades).
   bg #fcfcfc, navy #1a3152, burgundy #99114c, berry #6f1c4e, plum #442650,
   derived: navy deep #0f1f35, burgundy dark #7d0e3e. */

.npoe {
  --npoe-bg: #fcfcfc;
  --npoe-navy: #1a3152;
  --npoe-burgundy: #99114c;
  --npoe-berry: #6f1c4e;
  --npoe-plum: #442650;
  --npoe-navy-deep: #0f1f35;
  --npoe-burgundy-dark: #7d0e3e;
  --npoe-navy-12: #dde3ea;
  /* DV-02/DV-03: map line, hover tint and focus ring. */
  --npoe-map-line: #3e5068;
  --npoe-map-hover: #cbd7e5;
  --npoe-map-focus: #0f1b2b;
  --npoe-navy-06: #eef1f5;
  --npoe-burgundy-10: #f4e3eb;

  position: relative;
  left: 50%;
  width: 100vw;
  margin-left: -50vw;
  padding: 1.5rem 0 3rem;
  background: var(--npoe-bg);
  color: var(--npoe-navy);
  font-family: "Atkinson Hyperlegible", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.npoe,
.npoe *,
.npoe *::before,
.npoe *::after {
  box-sizing: border-box;
}

.npoe-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.25rem;
  min-width: 0;
}

.npoe h2,
.npoe h3,
.npoe p {
  margin-top: 0;
}

.npoe h2 {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 1.35rem;
  line-height: 1.2;
  color: var(--npoe-navy-deep);
}

.npoe-hero {
  max-width: 50rem;
  margin-bottom: 1.75rem;
}

.npoe-lede {
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--npoe-navy);
}

.npoe-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(19rem, 0.85fr);
  gap: 1.5rem;
  align-items: start;
  min-width: 0;
}

.npoe-map-panel,
.npoe-controls,
.npoe-step,
.npoe-sources {
  border: 1px solid var(--npoe-navy-12);
  border-radius: 12px;
  background: #fff;
  min-width: 0;
}

.npoe-map-panel,
.npoe-controls {
  padding: 1.1rem;
}

.npoe-section-heading {
  margin-bottom: 0.5rem;
}

.npoe-map {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 26rem;
}

.npoe-region {
  cursor: pointer;
  outline: none;
}

.npoe-region path {
  fill: var(--npoe-navy-06);
  /* DV-02: a white hairline on a near-white fill left the borders invisible
     (1.13:1). A real line carries the shape so the fills can stay light. */
  stroke: var(--npoe-map-line);
  stroke-width: 1.2;
  transition: fill 150ms ease;
}

/* DV-02: texture, not just tone — the old inland fill sat at 1.14:1 against
   its neighbours, so one of the three legend keys was invisible. */
.npoe-region-inland path {
  fill: url(#npoe-inland-hatch);
}

.npoe-region:hover path {
  fill: var(--npoe-map-hover);
}

/* DV-03: focus was a fill 1.3:1 from the selected fill, so a focused region
   and the chosen one looked the same. Focus is now a ring, never a fill. */
.npoe-region:focus-visible path {
  stroke: var(--npoe-map-focus);
  stroke-width: 3.5;
  paint-order: stroke;
}

.npoe-region:focus-visible,
.npoe-venue-dot:focus-visible {
  filter: drop-shadow(0 0 2px #fff);
}

.npoe-region.is-selected path {
  fill: var(--npoe-burgundy);
}

.npoe-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--npoe-plum);
}

.npoe-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.npoe-dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 3px;
  display: inline-block;
}

.npoe-dot-venue { background: var(--npoe-plum); border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--npoe-plum); }
.npoe-dot-inland { background: repeating-linear-gradient(45deg, var(--npoe-navy-06) 0 3px, #8397ad 3px 5px); border: 1px solid var(--npoe-map-line); }
.npoe-dot-selected { background: var(--npoe-burgundy); }

.npoe-venue-dot circle {
  fill: var(--npoe-plum);
  stroke: #fff;
  stroke-width: 2.5;
  pointer-events: all;
  cursor: pointer;
  transition: r 120ms ease;
}

.npoe-venue-dot.is-active circle,
.npoe-venue-dot:hover circle {
  fill: var(--npoe-burgundy-dark);
  r: 10;
}

.npoe-map-caption {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  color: var(--npoe-plum);
}

.npoe-side {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
  align-content: start;
}

.npoe-controls {
  display: grid;
  gap: 1rem;
}

.npoe-field {
  display: grid;
  gap: 0.35rem;
  color: var(--npoe-navy-deep);
  font-weight: 700;
}

.npoe select {
  min-height: 3rem;
  width: 100%;
  border: 1px solid var(--npoe-navy-12);
  border-radius: 8px;
  background: #fff;
  color: var(--npoe-navy);
  font: inherit;
  padding: 0.6rem 0.75rem;
}

.npoe-choice-group {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.npoe-choice-group legend {
  margin-bottom: 0.2rem;
  color: var(--npoe-navy-deep);
  font-weight: 700;
}

.npoe-choice-group label,
.npoe-check {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--npoe-navy-12);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  background: var(--npoe-bg);
  font-weight: 400;
  color: var(--npoe-navy);
}

.npoe-choice-group label small {
  color: var(--npoe-plum);
  font-size: 0.8rem;
}

.npoe-journey {
  margin-top: 1.75rem;
}

.npoe-placeholder {
  border: 1.5px dashed var(--npoe-berry);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 46rem;
}

.npoe-journey-head {
  margin-bottom: 1rem;
  max-width: 50rem;
}

.npoe-journey-sub {
  color: var(--npoe-plum);
}

.npoe-steps {
  display: grid;
  gap: 1rem;
  counter-reset: npoe-step;
}

.npoe-step {
  padding: 0;
}

.npoe-step-summary {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.25rem;
  cursor: pointer;
  list-style: none;
}

.npoe-step-summary::-webkit-details-marker {
  display: none;
}

.npoe-step-summary::after {
  content: "+";
  grid-column: 3;
  font-weight: 800;
  color: var(--npoe-burgundy);
  font-size: 1.2rem;
}

.npoe-step[open] .npoe-step-summary::after {
  content: "\2212";
}

.npoe-step-summary h3 {
  margin: 0;
}

.npoe-step-body {
  padding: 0 1.25rem 1.15rem 4.75rem;
}

.npoe-step-num {
  counter-increment: npoe-step;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--npoe-navy);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.npoe-step-num::before {
  content: counter(npoe-step);
}

.npoe-step h3 {
  font-size: 1.1rem;
  color: var(--npoe-navy-deep);
}

.npoe-step p {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.npoe-office {
  border-top: 1px solid var(--npoe-navy-06);
  padding-top: 0.6rem;
  margin-top: 0.6rem;
}

.npoe-office:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.npoe-office-name {
  font-weight: 700;
  color: var(--npoe-navy-deep);
  margin-bottom: 0.15rem;
}

.npoe-office-address {
  margin-bottom: 0.4rem;
}

.npoe-office-list {
  margin: 0 0 0.5rem;
  padding-left: 1.2rem;
}

.npoe-office-list li {
  margin-bottom: 0.25rem;
}

.npoe-badge {
  display: inline-flex;
  align-items: center;
  margin: 0 0.4rem 0.5rem 0;
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.npoe-badge-ok { background: var(--npoe-navy); color: #fff; }
.npoe-badge-rule { background: var(--npoe-navy-06); color: var(--npoe-navy-deep); }
.npoe-badge-src { background: var(--npoe-burgundy-10); color: var(--npoe-burgundy-dark); }
.npoe-badge-todo { background: var(--npoe-navy-06); color: var(--npoe-plum); border: 1px dashed var(--npoe-plum); }

.npoe-source-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin: 0.25rem 0 0.25rem;
  border-radius: 8px;
  background: var(--npoe-burgundy);
  color: #fff;
  padding: 0.55rem 0.9rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

.npoe-source-link:hover,
.npoe-source-link:focus {
  background: var(--npoe-burgundy-dark);
  color: #fff;
}

.npoe-detail {
  font-size: 0.92rem;
  color: var(--npoe-plum);
}

.npoe-nojs,
.npoe-sources {
  margin-top: 1.75rem;
}

.npoe-nojs details {
  border-bottom: 1px solid var(--npoe-navy-12);
  padding: 0.55rem 0;
}

.npoe-nojs summary {
  min-height: 44px;
  cursor: pointer;
  font-weight: 700;
}

.npoe-sources {
  padding: 1.1rem;
}

.npoe-sources ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0;
  padding-left: 1.2rem;
}

.npoe-sources a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--npoe-burgundy-dark);
}

@media (max-width: 860px) {
  .npoe {
    padding: 1rem 0 2.5rem;
    overflow-x: hidden;
  }

  .npoe-inner {
    padding: 0 1rem;
  }

  .npoe-shell {
    grid-template-columns: 1fr;
  }

  .npoe-map {
    min-height: 22rem;
  }

  .npoe-step {
    grid-template-columns: 2.1rem minmax(0, 1fr);
    padding: 1rem;
  }

  .npoe * {
    overflow-wrap: anywhere;
  }
}


/* La rotta: nautical course plot beside the map */
.npoe-rotta {
  border: 1px solid var(--npoe-navy-12);
  border-radius: 12px;
  background: #fff;
  padding: 1.1rem 1.1rem 0.9rem;
}

.npoe-rotta-title {
  margin: 0 0 0.75rem;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--npoe-navy-deep);
}

.npoe-rotta-track {
  position: relative;
  margin: 0;
  padding: 0 0 0 1.1rem;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.npoe-rotta-track::before {
  content: "";
  position: absolute;
  left: calc(1.1rem + 0.8rem - 1px);
  top: 0.9rem;
  bottom: 0.9rem;
  border-left: 2px dashed var(--npoe-navy-12);
}

.npoe-wp {
  opacity: 0;
  transform: translateY(6px);
  animation: npoe-wp-in 320ms ease forwards;
}

@keyframes npoe-wp-in {
  to { opacity: 1; transform: none; }
}

.npoe-wp-btn {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  border: 0;
  background: none;
  padding: 0.3rem 0.2rem;
  text-align: left;
  font: inherit;
  color: var(--npoe-navy);
  cursor: pointer;
  border-radius: 8px;
}

.npoe-wp-btn:hover,
.npoe-wp-btn:focus-visible {
  background: var(--npoe-navy-06);
}

.npoe-wp-mark {
  position: relative;
  z-index: 1;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  border: 2px solid var(--npoe-navy);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.npoe-wp-mark::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--npoe-navy);
}

.npoe-wp.is-fact .npoe-wp-mark { border-color: var(--npoe-burgundy); }
.npoe-wp.is-fact .npoe-wp-mark::after { background: var(--npoe-burgundy); }
.npoe-wp.is-calendar .npoe-wp-mark { border-style: dashed; border-color: var(--npoe-plum); }
.npoe-wp.is-calendar .npoe-wp-mark::after { background: var(--npoe-plum); }
.npoe-wp.is-pending .npoe-wp-mark { border-style: dashed; border-color: var(--npoe-plum); }
.npoe-wp.is-pending .npoe-wp-mark::after { background: transparent; }

.npoe-wp-text {
  display: grid;
  min-width: 0;
}

.npoe-wp-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--npoe-plum);
}

.npoe-wp-answer {
  font-weight: 700;
  color: var(--npoe-navy-deep);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.npoe-wp.is-fact .npoe-wp-answer { color: var(--npoe-burgundy-dark); }

.npoe-rotta-hint {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: var(--npoe-plum);
}

@media (prefers-reduced-motion: reduce) {
  .npoe-wp { animation: none; opacity: 1; transform: none; }
}

/* DV-01: the region-level answer shown before a province is picked. */
.npoe-region-answer,
.npoe-region-next {
  border: 1px solid var(--npoe-line, #dde3ea);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  margin-top: 1rem;
  background: #fff;
}

.npoe-region-answer h3,
.npoe-region-next h3 {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
}

.npoe-region-answer p {
  margin: 0 0 0.6rem;
}

.npoe-province-picker {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
  padding: 0;
}

.npoe-province-chip {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--npoe-line, #dde3ea);
  border-radius: 9999px;
  background: #fff;
  padding: 0.45rem 0.9rem;
  color: inherit;
}

.npoe-province-chip:hover,
.npoe-province-chip:focus-visible {
  border-color: var(--npoe-burgundy, #99114c);
  color: var(--npoe-burgundy, #99114c);
}

/* DV-10: the dots carry a click handler, so they are controls and must show
   focus and be reachable. The same list is rendered as text below the map. */
.npoe-venue-dot {
  cursor: pointer;
}

.npoe-venue-dot:focus-visible circle {
  stroke: var(--npoe-map-focus);
  stroke-width: 4;
}

.npoe-venue-list {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
}

.npoe-venue-list summary {
  cursor: pointer;
  color: var(--npoe-plum, #4a2545);
}

.npoe-venue-list ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
}
