/* Scoreboard redesign: the shell parts of Views/Shared/Sb/_Layout.cshtml. The public shell is the hand-off header
   (anonymous and signed in, with the club switcher and the phone club bar), the footer and the toast region. The
   menus, the avatar and the toasts serve the back-office shell too; its sidebar and top bar are in backoffice.css. */

.skip-link { position: absolute; left: var(--sp-4); top: -100px; z-index: 100; padding: var(--sp-3) var(--sp-4); background: var(--brand); color: var(--brand-on); font-weight: 700; border-radius: var(--r-md); }
.skip-link:focus { top: var(--sp-3); color: var(--brand-on); }
.site-main:focus { outline: none; }
/* Guide walkthrough F164: main grows into the free room of the public body column (base.css), so the footer after it
   reaches the bottom of the window on a short page. Its height is never less than its content. */
.shell--public > .site-main { flex: 1 0 auto; }

/* ============ Header ============ */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--bg-header); border-bottom: 1px solid var(--line); }
/* Public redesign (spec 4): the header of the public shell is translucent (about 82%) with the soft blur behind it. It is
   a sticky layer already, so the blur makes it no new layer; its menus keep their solid surface. */
:where(.shell--public) .site-header { background: var(--surface-glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.site-header__inner { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: var(--sp-1); min-height: var(--tap); color: var(--text); text-decoration: none; min-width: 0; }
.brand:hover { color: var(--text); }
.brand-mark { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-sm); background: var(--brand); color: var(--brand-on); font: 800 16px/1 var(--font-display); overflow: hidden; }
.brand-mark--logo { background: none; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
/* Logo integration P2: a domain without its own logo shows the Competition Manager podium mark (an inline svg with the
   symbol's viewBox), as high as the mark square was; its width follows the mark's shape. The second place takes the
   text colour. */
.brand-logo { flex: none; display: block; width: auto; height: 34px; }
.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__name { font: 700 19px/1.1 var(--font-display); letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand__portal { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
/* The links fill the header to its bottom edge (the current underline). The padding above keeps their focus ring inside
   the window while the header sticks to its top; the same padding at the bottom of a link keeps its text centred. */
.site-nav { display: flex; align-self: stretch; gap: var(--sp-1); padding-top: var(--sp-2); }
.site-nav a { white-space: nowrap; display: flex; align-items: center; padding: 0 var(--sp-4) var(--sp-2); color: var(--muted); font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--brand); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--sp-1); }
.header-actions form { margin: 0; }
@media (max-width: 760px) {
  .site-header__inner { gap: var(--sp-1); min-height: var(--header-h-phone); }
  .site-nav, .header-actions .hide-phone { display: none; }
  .brand__name { font-size: 17px; }
}

/* ============ Menus: <details class="menu"><summary class="menu__btn">...</summary><div class="menu__panel">...</div></details>
   They work without JavaScript; js/sb/portal.js closes them on an outside click and on Escape, one open at a time. */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__btn { white-space: nowrap; display: inline-flex; align-items: center; gap: var(--sp-1); min-height: var(--tap); padding: 0 var(--sp-3); border: 1px solid var(--control-border); border-radius: var(--r-md); background: var(--btn-bg); color: var(--text); font-weight: 600; cursor: pointer; }
.menu__btn:hover { background: var(--btn-bg-hover); }
.menu__btn::after { content: "\25BE"; content: "\25BE" / ""; color: var(--muted); font-size: .8em; }
.menu__btn--bare::after { content: none; }
.menu__btn--avatar { min-width: var(--tap); justify-content: center; padding: 0; border: 0; border-radius: 50%; }
.menu__panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 240px; max-width: min(92vw, 360px); padding: var(--sp-2); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.menu__panel form { margin: 0; }
.menu__label { padding: var(--sp-2) var(--sp-3) var(--sp-1); }
.menu__label .muted { overflow-wrap: anywhere; }
.menu__item { display: flex; align-items: center; gap: var(--sp-1); width: 100%; min-height: var(--tap); padding: 0 var(--sp-3); border: 0; border-radius: var(--r-md); background: none; color: var(--text); text-align: left; text-decoration: none; font-weight: 500; cursor: pointer; }
.menu__item:hover { background: var(--surface-2); color: var(--text); }
.menu__item[aria-current="true"], .menu__item[aria-current="page"], .menu__item[aria-checked="true"] { font-weight: 700; }
.menu__item[aria-current="true"]::after, .menu__item[aria-current="page"]::after, .menu__item[aria-checked="true"]::after { content: "\2713"; content: "\2713" / ""; margin-left: auto; color: var(--brand-text); }
.menu__item .flag { flex: none; width: 20px; height: 15px; }
.menu__item .muted { font-weight: 500; }
.menu__sep { height: 1px; margin: var(--sp-2) 0; background: var(--line); }
.menu__item--danger { color: var(--st-bad-fg); }
/* Guide walkthrough F97, F98 and F100: the shared competitor menu (Views/Shared/Sb/_EntryStatusMenu.cshtml). Its panel is
   a popover in the top layer, so no table, fight box or scroll area cuts it off; js/sb/entry-status.js places it at its
   button (without script the browser keeps it in the middle of the window). Each item has its hint under its own label,
   with room around it and a line between the items. */
.menu--status { display: inline-flex; }
.menu__panel.menu__panel--status { position: fixed; inset: auto; margin: 0; min-width: 270px; max-height: calc(100vh - 16px); overflow: auto; color: var(--text); }
html:not(.js) .menu__panel.menu__panel--status { inset: 0; margin: auto; }
.menu__panel--status .menu__item--status { flex-direction: column; align-items: flex-start; gap: 2px; min-height: 0; padding: 10px 12px; }
.menu__panel--status .menu__item + .menu__item { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); border-radius: 0 0 var(--r-md) var(--r-md); }
.menu__hint { display: block; font-size: var(--fs-xs); font-weight: 500; color: var(--muted); }
/* Guide walkthrough F140: a menu button (js/sb/menu-button.js): a button with a menu of links under it, such as "Add
   member" on the club Members tab. Without script the button is a plain link to a page with the same choices, so the
   arrow after its label is drawn only with script. Each choice has its help line under its label, with a line between. */
.menu-button { position: relative; display: inline-flex; }
html.js .menu-button__trigger::after { content: "\25BE"; content: "\25BE" / ""; font-size: .8em; }
.menu__panel.menu__panel--choices { width: min(92vw, 360px); }
.menu__panel--choices .menu__item { flex-direction: column; align-items: flex-start; gap: 2px; min-height: var(--tap); padding: 10px 12px; }
.menu__panel--choices .menu__item + .menu__item { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); border-radius: 0 0 var(--r-md) var(--r-md); }
.menu__panel--choices .menu__text { font-weight: 700; }
.menu__panel--choices .menu__hint { font-size: var(--fs-sm); }
@media (max-width: 760px) { .menu__item.show-phone { display: flex !important; } }
/* The theme buttons need js/sb/portal.js (js/sb/theme-start.js marks <html> with .js). */
html:not(.js) .menu__theme { display: none; }
.language-menu .flag { width: 20px; height: 15px; }

/* Club switcher (signed in, public portal). The same menu sits in the header on a desktop and in .club-bar under the
   header on a phone and a small tablet (up to 900px: below that the header has no room for it next to the site name,
   which it squeezed to 12px at 800px). The bar's padding keeps the focus ring of the full-width switcher inside the
   window and clear of the sticky header. */
.club-switch > summary { height: 48px; padding: 0 var(--sp-3) 0 6px; background: var(--surface); text-align: left; }
.club-switch__text { display: flex; flex-direction: column; min-width: 0; }
.club-switch__name { display: block; max-width: 240px; font-weight: 600; font-size: var(--fs-md); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.club-switch__role { display: block; font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }
.club-switch .menu__item { justify-content: flex-start; }
.club-switch .menu__item span { overflow-wrap: anywhere; }
.club-bar { display: none; }
/* Between 901px and 1100px the header also holds the three main links (the club guide is the third), so the club name is cut
   at 160px there and the site name keeps room (with a 240px name the site name was only 47px wide at 901px). */
@media (min-width: 901px) and (max-width: 1100px) { .club-switch__name { max-width: 160px; } }
@media (max-width: 900px) {
  .club-switch { display: none; }
  .club-bar { display: block; padding: 6px; border-bottom: 1px solid var(--line); background: var(--surface); }
  .club-bar .club-switch { display: block; }
  .club-bar .club-switch > summary { width: 100%; height: 56px; border: 0; border-radius: 0; padding-inline: var(--page-pad); }
  .club-bar .club-switch__name { max-width: none; }
  .club-bar .menu__panel { left: var(--sp-3); right: var(--sp-3); max-width: none; }
}

/* Avatar */
.avatar { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-3); color: var(--text); font: 700 14px/1 var(--font-body); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sq { border-radius: var(--r-sm); font-family: var(--font-display); font-weight: 800; }
.avatar--sm { width: 32px; height: 32px; font-size: 12px; }
.avatar--lg { width: 72px; height: 72px; font-size: 24px; }

/* Guide walkthrough F3: the menu, icon and toast close buttons have the solid button fill too, never a transparent one. */
.icon-btn { display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); padding: 0; border: 1px solid var(--control-border); border-radius: var(--r-md); background: var(--btn-bg); color: var(--text); font-weight: 700; cursor: pointer; }
.icon-btn:hover { background: var(--btn-bg-hover); }

/* ============ Footer ============ */
.site-footer { margin-top: var(--sp-16); padding: var(--sp-6) 0; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-sm); }
/* Public redesign, decision 2026-10-25 (spec 4.1): over the photo the footer is a translucent surface across the page; the
   blur is on its ::before layer (components.css, the groups of spec 4.2). */
:where(.shell--public) .site-footer { background: var(--surface-glass); }
/* Logo integration P2: the site name, a thin line and the two-line Competition Manager logo (COMPETITION in the text
   colour); they wrap on a narrow phone, so a long site name never pushes the footer wider than the screen. */
.site-footer__brand { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); min-width: 0; }
.site-footer__site { min-width: 0; overflow-wrap: anywhere; }
.site-footer__sep { flex: none; width: 1px; height: 16px; background: var(--line); }
.site-footer__logo { flex: none; display: block; width: auto; height: 30px; color: var(--text); }
/* The site links (live test P-06): plain underlined links in a row, each at least a 24px target, 44px on a phone and on
   every touch screen (pointer: coarse). */
.site-footer__nav { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.site-footer__nav a { display: inline-flex; align-items: center; min-height: 24px; }
@media (max-width: 760px) { .site-footer__nav a { min-height: 44px; } }
@media (pointer: coarse) { .site-footer__nav a { min-height: 44px; } }

/* ============ Toasts: the server's TempData message and CM.toast() share one markup ============ */
.toast-region { position: fixed; z-index: 90; right: var(--sp-4); bottom: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-1); width: min(420px, calc(100vw - 32px)); }
.toast { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: var(--sp-1); padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-4); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.toast__icon { display: grid; place-items: center; width: 24px; height: 24px; margin-top: 2px; border-radius: 50%; font-weight: 800; font-size: 13px; color: var(--bg); background: var(--st-done-fg); }
.toast--success .toast__icon { background: var(--st-ok-fg); }
.toast--warning .toast__icon { background: var(--st-warn-fg); }
.toast--error .toast__icon { background: var(--st-bad-fg); }
.toast__title { font-weight: 700; }
.toast__body { color: var(--muted); font-size: var(--fs-sm); }
.toast__close { display: grid; place-items: center; width: var(--tap); height: var(--tap); margin: calc(var(--sp-1) * -1) calc(var(--sp-1) * -1) 0 0; padding: 0; border: 1px solid var(--control-border); border-radius: var(--r-md); background: var(--btn-bg); color: var(--muted); font-size: 18px; cursor: pointer; }
.toast__close:hover { background: var(--btn-bg-hover); color: var(--text); }
@media (max-width: 760px) { .toast-region { left: var(--sp-3); right: var(--sp-3); bottom: var(--sp-3); width: auto; } }

/* ============ Guide walkthrough F163 (mockup f163-b, version 1): the data check strip ============ */
/* The full-width yellow strip right under the site header (and the phone club bar) of every public page, for a club
   user whose chosen club has competitors that wait for the data check (CompetitorCheckStripViewComponent). It scrolls
   with the page and cannot be closed. The warning icon, the first sentence in bold, the second sentence and the button
   at the right; on a phone only the first sentence and the button. The warning colours follow the theme; forced
   colours keep its edge and icon. */
.check-strip { background: var(--st-warn-bg); border-bottom: 1px solid var(--st-warn-fg); color: var(--text); }
.check-strip__in { display: flex; align-items: center; gap: var(--sp-3); min-height: 48px; padding-block: 6px; }
.check-strip__icon { flex: none; width: 20px; height: 20px; color: var(--st-warn-fg); }
.check-strip__text { flex: 1; min-width: 0; margin: 0; font-size: var(--fs-sm); }
.check-strip__text b { font-weight: 800; }
.check-strip__btn { flex: none; }
@media (max-width: 760px) {
  .check-strip__in { gap: var(--sp-2); }
  .check-strip__more { display: none; }
}
@media (forced-colors: active) {
  .check-strip { border-bottom-color: CanvasText; }
  .check-strip__icon { color: CanvasText; }
}

/* Print keeps the content only: no photo and no smoke trails behind the public shell (the whole layer is gone) and solid
   surfaces (public redesign, spec 3.2). */
@media print {
  .site-header, .club-bar, .check-strip, .site-footer, .toast-region, .skip-link { display: none !important; }
  body { background: var(--print-bg); color: var(--print-ink); }
  html:has(> body.shell--public) { background: var(--print-bg); }
  .shell--public::before { content: none; }
  .shell--public { --surface-glass: var(--surface); --surface-glass-strong: var(--bg-header); --bg-sunken-glass: var(--bg-sunken); --glass-blur: none; }
  /* F164: the paper needs no window-high column (the footer is hidden), so the body is a plain block again. */
  .shell--public { display: block; min-height: 0; }
}
