/* Relocation 5000 — local section navigation.
 *
 * R3C: the visual model is a PORT OF THE LIVE ВНЖ-HUB COMPONENT, not an interpretation of it.
 *
 * WHY THIS FILE WAS REWRITTEN
 * R3A shipped an active state of its own invention: an accent-tinted fill (#eaf6f1) plus an inset
 * 2px rule under the label. On the page that reads as a pressed button parked in a row of buttons,
 * which is the capsule grammar the owner had already removed from the temporary-protection pages.
 * The owner named one reference and said to take the model from the living component rather than
 * from a description of it:
 *
 *     https://okno.agency/uslugi/immigratsiya-v-portugaliyu.html   ->  .onh-secnav
 *     source owner: scripts/group-poa-price/assets/notarial-hub.css   (byte-identical to live)
 *     behaviour owner: scripts/notarial-retail/build-residence-hub-r2.mjs
 *
 * Every number below was MEASURED off that live component at 390/768/1440, not copied from its
 * source text, so that a later edit to the reference shows up here as a measured difference rather
 * than as a silent drift. The measurements are recorded in the R3C source result.
 *
 * TOKENS: THE SAME COLOURS, REACHED BY THE ROUTE THIS PAGE HAS
 * The reference resolves its palette through --ok-* (okno-card-system.css). These two pages do not
 * load that stylesheet — on them every --ok-* is undefined — so naming those tokens here would
 * silently fall back and produce a different nav. The design-system tokens these pages DO carry hold
 * the identical values, verified in the browser on both pages:
 *
 *     --ok-card-surface-quiet  #f6f8fb  ==  --okno-surface-subtle  #f6f8fb   (active + hover surface)
 *     --ok-muted               #5b6472  ==  --okno-ink-muted       #5b6472   (resting label)
 *     --ok-ink                 #33404f  ==  --okno-ink-body        #33404f   (hover label)
 *     --ok-card-line           #e7ecf3  ==  --okno-border          #e7ecf3   (hairline)
 *     --gs-teal                #0d7c6b  ==  --okno-accent          #0d7c6b   (active label, progress)
 *
 * WHAT IS DELIBERATELY NOT COPIED FROM THE REFERENCE
 *   its container (max-width 1200 / padding 24) — the rail must line up with THIS page's columns,
 *     and this page's container is okl-container (max-width 1160 / padding 20|32). The reference
 *     aligns to its own page the same way; copying its numbers would misalign ours by 4-8px.
 *   its CTA button — adding one would add a seventh control and change link behaviour. Out of scope.
 *
 * STICKY, AND WHY IT CANNOT SHIFT THE FIRST SCREEN
 * The element is a normal in-flow sibling placed after #hero. position:sticky changes nothing about
 * layout until the element's own top edge reaches the offset, so at scrollY 0 the hero's geometry —
 * H1, the 5 000 EUR panel and the primary action — is unchanged.
 *
 * THE OFFSET IS MEASURED, NOT ASSUMED
 * --okr-toc-top is written by the page runtime from the live height of header.okno-gs-hd and kept
 * current through a ResizeObserver. The values below are the fallback for the moment before the first
 * measurement and for a reader with no JavaScript: 61px mobile header, 116px desktop. A floor, never
 * the authority.
 *
 * Z-INDEX: the global header sits at 2147482000 and the floating entry at 60. This sits at 30 — above
 * page content, below both — so it can never cover the brand header or the widget launcher.
 */

#okno-relocation-toc {
  --okr-toc-top: 61px;
  position: sticky;
  top: var(--okr-toc-top);
  z-index: 30;
  background: var(--okno-canvas, #fff);
  /* One hairline, underneath, exactly as the reference. R3A also drew a border-top, which put a
     second rule directly under the global header's own edge and thickened the whole band. */
  border-bottom: 1px solid var(--okno-border, #e7ecf3);
}

/* Reading progress, 3px, as on the reference. Drawn as a pseudo-element fed by --okr-prog rather than
   as a <div class="...__prog">: <main> on these pages may carry nothing outside the okl- namespace,
   and the nav deliberately holds no classes of its own. With no JavaScript the width stays 0 and the
   strip is invisible, which is the reference's behaviour too — the line is decoration and is allowed
   to be absent. It is what makes the band's measured height match the reference exactly. */
#okno-relocation-toc::before {
  content: "";
  display: block;
  height: 3px;
  width: var(--okr-prog, 0);
  background: var(--okno-accent, #0d7c6b);
  transition: width .1s linear;
}

/* The row. okl-container keeps the rail aligned with the page's own columns; the reference's row
   height (52px, 48px on a phone) is what is adopted. */
#okno-relocation-toc .okl-container {
  display: flex;
  align-items: center;
  min-height: 52px;
}

/* The scroller. One row, never two: flex-wrap:nowrap plus overflow-x is what keeps a long RU label
   set on a single line at 320px instead of stacking into a block that would eat the viewport. */
#okno-relocation-toc ul {
  display: flex;
  flex: 1;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px; /* measured on the reference at every width; the design system has no 6px step */
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
#okno-relocation-toc ul::-webkit-scrollbar { display: none; }

#okno-relocation-toc li { flex: 0 0 auto; }

/* Plain text links. No border, no surface, no shadow at rest — the row reads as a line of words, not
   as a set of controls. */
#okno-relocation-toc a {
  display: block;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 700;
  color: var(--okno-ink-muted, #5b6472);
  text-decoration: none;
  white-space: nowrap;
}

#okno-relocation-toc a:hover {
  color: var(--okno-ink-body, #33404f);
  background: var(--okno-surface-subtle, #f6f8fb);
}

/* The location indicator, exactly the reference's: the label takes the accent colour and sits on the
   QUIET neutral surface. Not the accent-tinted fill and not the inset rule R3A used — a tinted fill
   with a rule under it is the pressed-button look the owner rejected. */
#okno-relocation-toc a[aria-current="location"] {
  color: var(--okno-accent, #0d7c6b);
  background: var(--okno-surface-subtle, #f6f8fb);
}

#okno-relocation-toc a:focus-visible {
  outline: 2px solid var(--okno-accent, #0d7c6b);
  outline-offset: 2px;
}

/* Phone: the reference tightens the row and the labels, and fades the right edge so a reader can see
   the row continues. The fade is mobile-only — on a wide screen all six labels fit and a fade over a
   label that is simply there reads as a rendering fault. */
@media (max-width: 640px) {
  #okno-relocation-toc .okl-container { min-height: 48px; }
  #okno-relocation-toc ul {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 18px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 18px), transparent);
  }
  #okno-relocation-toc a { padding: 7px 10px; font-size: 13.5px; }
}

/* Desktop: the only change is the sticky offset, because the global header is taller there. */
@media (min-width: 1000px) {
  #okno-relocation-toc { --okr-toc-top: 116px; }
}

/* Anchor landings clear the sticky header AND this nav, so a clicked heading is never hidden behind
   them. The runtime keeps --okr-scroll-offset equal to the two measured heights plus a small gap. */
#hero, #segments, #process, #choice, #bounds, #examples, #faq {
  scroll-margin-top: var(--okr-scroll-offset, 130px);
}

@media (prefers-reduced-motion: reduce) {
  #okno-relocation-toc::before { transition: none; }
}

/* ---------------------------------------------------------------------------------------------
 * R3B — the three approved photographs.
 *
 * The frame itself is the design system's (okl-frame--4x5); only the BOUND is local, and it is local
 * on purpose. The supplied originals are 4:5 portraits, and a 4:5 portrait given a whole grid column
 * becomes the loudest object on a page whose subject is a service, not a photograph. Capping the
 * width keeps each picture supporting rather than focal, and keeps a phone from handing roughly half
 * its viewport to a single image.
 *
 * Sized by attribute rather than class because <main> on these pages may carry nothing outside the
 * okl- namespace. Two slots: "intro" sits beside a full text block and can be larger; "opener" sits
 * beside a heading and stays small enough that the pair reads as one row.
 *
 * No crop, at any width: the frame ratio IS the source ratio, so object-fit:cover has nothing to cut
 * and no face can be lost. That is also why there is no object-position here — there is no choice to
 * make.
 */
[data-okr-photo] {
  width: 100%;
  max-width: 300px;
  margin-inline: auto;
}
@media (min-width: 900px) {
  [data-okr-photo="intro"] { max-width: 420px; }
  [data-okr-photo="opener"] { max-width: 320px; }
}
