/*
 * Section menus on phones and tablets (public/js/section-nav.js), shared by the portal and the
 * console. Swipeable tabs and the section picker take over at 1040 px and below; the class
 * `sn-bp-860` moves that to 860 px. The page's own left menu takes `sn-wide` and hides then.
 *
 * Set on the page if needed: --sn-top (the sticky offset under its header; default 0) and
 * --sn-bg (the page colour behind the sticky strip; default the GFE page blue).
 * Selected is filled navy with white text. Focus never draws an outer ring: a tab or button
 * changes its own border, as the interface standard asks.
 */
.sn-strip,
.sn-pn,
.sn-picker {
  display: none;
}

.sn-in-r {
  animation: sn-in-r 0.22s ease-out;
}
.sn-in-l {
  animation: sn-in-l 0.22s ease-out;
}
@keyframes sn-in-r {
  from {
    transform: translateX(40px);
    opacity: 0.5;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes sn-in-l {
  from {
    transform: translateX(-40px);
    opacity: 0.5;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sn-in-r,
  .sn-in-l {
    animation: none;
  }
}

.sn-ic {
  flex: none;
}

/* The strip: every tab visible, nothing to scroll sideways. */
.sn-strip {
  position: sticky;
  top: var(--sn-top, 0px);
  z-index: 15;
  gap: 4px;
  padding: 8px 0 10px;
  background: var(--sn-bg, #f2f8fd);
}
.sn-strip a {
  flex: 1 0 auto;
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 4px 8px;
  border: 1px solid #828997;
  border-radius: 999px;
  background: #ffffff;
  color: #111111;
  font: 600 13px/1.15 var(--font-body, 'Inter', system-ui, sans-serif);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}
.sn-strip a.on {
  border-color: #14213d;
  background: #14213d;
  color: #ffffff;
}
.sn-strip a:focus-visible {
  outline: none;
  border-color: #14213d;
  box-shadow: inset 0 0 0 1px #14213d;
}
.sn-strip a.on:focus-visible {
  box-shadow: inset 0 0 0 2px #e6b84a;
}

/* Previous and Next under the section. */
.sn-pn {
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}
.sn-pn-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 48%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #828997;
  border-radius: 4px;
  background: #ffffff;
  color: #14213d;
  font: 600 14px/1.2 var(--font-body, 'Inter', system-ui, sans-serif);
  text-decoration: none;
}
.sn-pn-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sn-pn-btn:hover {
  background: #f3f4f6;
}
.sn-pn-btn:focus-visible {
  outline: none;
  border: 2px solid #14213d;
  padding: 0 13px;
}

/* The picker: one button showing the current section, sticky under the header. */
.sn-picker {
  position: sticky;
  top: var(--sn-top, 0px);
  z-index: 15;
  padding: 8px 0 10px;
  background: var(--sn-bg, #f2f8fd);
}
.sn-pick-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #828997;
  border-radius: 4px;
  background: #ffffff;
  color: #111111;
  font: 16px/1.2 var(--font-body, 'Inter', system-ui, sans-serif);
  text-align: left;
  cursor: pointer;
}
.sn-pick-btn:focus-visible {
  outline: none;
  border: 2px solid #14213d;
  padding: 0 13px;
}
.sn-pick-l {
  color: #666d7a;
  font-size: 13px;
  font-weight: 500;
}
.sn-pick-btn b {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

/* The sheet: a bottom sheet on a phone, a centred dialog on a tablet. */
.sn-sheet,
.sn-leave {
  width: min(480px, calc(100vw - 32px));
  max-height: min(80vh, 640px);
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  color: #111111;
  font-family: var(--font-body, 'Inter', system-ui, sans-serif);
  box-shadow: 0 8px 24px rgb(20 33 61 / 16%);
}
.sn-sheet::backdrop,
.sn-leave::backdrop {
  background: rgb(17 17 17 / 55%);
}
.sn-sheet-h {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 8px 20px;
  background: #ffffff;
}
.sn-sheet-h h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.sn-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #111111;
  cursor: pointer;
}
.sn-close:hover {
  background: #f3f4f6;
}
.sn-close:focus-visible {
  outline: none;
  border-color: #14213d;
}
.sn-sheet-b {
  display: flex;
  flex-direction: column;
  padding: 0 12px 16px;
}
.sn-g {
  padding: 14px 8px 6px;
  color: #666d7a;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sn-g:first-child {
  padding-top: 0;
}
.sn-sheet a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 12px;
  border: 2px solid transparent;
  border-radius: 6px;
  color: #111111;
  font-weight: 500;
  text-decoration: none;
}
.sn-sheet a:hover {
  background: #f3f4f6;
}
.sn-sheet a:focus-visible {
  outline: none;
  border-color: #14213d;
}
.sn-sheet a.on {
  background: #14213d;
  color: #ffffff;
  font-weight: 600;
}
.sn-sheet a.on:focus-visible {
  border-color: #e6b84a;
}
.sn-l {
  flex: 1;
  min-width: 0;
}
.sn-n {
  margin-left: auto;
  color: #666d7a;
  font-size: 12px;
  font-weight: 700;
}
.sn-n + .sn-n {
  margin-left: 0;
}
.sn-sheet a.on .sn-n {
  color: #ffffff;
}

/* Leave without saving? */
.sn-leave {
  padding: 20px;
}
.sn-leave h2 {
  margin: 0 0 6px;
  font-size: 18px;
}
.sn-leave p {
  margin: 0 0 16px;
  color: #666d7a;
}
.sn-leave-f {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sn-btn {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #828997;
  border-radius: 4px;
  background: #ffffff;
  color: #14213d;
  font: 600 15px/1.2 var(--font-body, 'Inter', system-ui, sans-serif);
  cursor: pointer;
}
.sn-btn-p {
  border-color: #14213d;
  background: #14213d;
  color: #ffffff;
}
.sn-btn:focus-visible {
  outline: none;
  border: 2px solid #14213d;
  padding: 0 15px;
}
.sn-btn-p:focus-visible {
  border-color: #e6b84a;
}

/* 1040 px and below (the default). */
@media (max-width: 1040px) {
  .sn-strip:not(.sn-bp-860),
  .sn-pn:not(.sn-bp-860) {
    display: flex;
  }
  .sn-picker:not(.sn-bp-860) {
    display: block;
  }
  .sn-wide:not(.sn-bp-860) {
    display: none !important;
  }
}

/* 860 px and below, for areas that keep their menu longer (the console's jeweller page). */
@media (max-width: 860px) {
  .sn-strip.sn-bp-860,
  .sn-pn.sn-bp-860 {
    display: flex;
  }
  .sn-picker.sn-bp-860 {
    display: block;
  }
  .sn-wide.sn-bp-860 {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .sn-strip {
    gap: 3px;
    top: var(--sn-top-phone, var(--sn-top, 0px));
  }
  .sn-picker {
    top: var(--sn-top-phone, var(--sn-top, 0px));
  }
  .sn-strip a {
    padding: 4px 3px;
    font-size: 12px;
    letter-spacing: -0.01em;
  }
  .sn-sheet {
    width: 100vw;
    max-width: 100vw;
    margin: auto 0 0;
    border-radius: 12px 12px 0 0;
  }
}

@media (forced-colors: active) {
  .sn-strip a.on,
  .sn-sheet a.on {
    border-color: Highlight;
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
  }
}
