/* Site header and footer (templates/base.html), in the style of the Welcome
   page (static/css/landing.css): dark green, Inter, gold pill buttons.
   Loaded after the other stylesheets; everything is scoped to .site-header
   and .site-footer. */

.site-header,
.site-footer {
  --sc-green-950: #0b2a19;
  --sc-green-900: #10351f;
  --sc-gold: #c8a951;
  --sc-gold-300: #e2cd8f;
  --sc-text: rgba(255, 255, 255, 0.78);
  --sc-text-strong: #fff;
  --sc-line: rgba(255, 255, 255, 0.1);
  font-family: 'Inter', Arial, sans-serif;
}

/* ── Header ───────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(11, 42, 25, 0.94);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--sc-line);
}

.site-header .sh-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.sh-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--sc-text-strong);
  text-decoration: none;
  flex: none;
}
.sh-brand:hover { color: var(--sc-text-strong); text-decoration: none; }
.sh-brand img {
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(200, 169, 81, 0.35);
}
.sh-brand span {
  font-family: 'Inter', Arial, sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: inherit;
}

.site-header .sh-menu {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  /* undo older generic `nav` rules */
  position: static;
  height: auto;
  min-height: 0;
  padding: 0;
  background: none;
}

.site-header .sh-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 auto;
  padding: 0;
  flex: 0 1 auto;
}
.site-header .sh-links li { margin: 0; width: auto; border: 0; }
.site-header .sh-links a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--sc-text);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.site-header .sh-links a:hover { color: var(--sc-text-strong); background: rgba(255, 255, 255, 0.08); }
.site-header .sh-links a[aria-current="page"] { color: var(--sc-text-strong); background: rgba(255, 255, 255, 0.1); }

.site-header .sh-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.site-header .sh-actions form { margin: 0; }

.sh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.sh-btn:hover { text-decoration: none; }
.sh-btn:focus-visible,
.site-header a:focus-visible,
.site-header button:focus-visible,
.site-footer a:focus-visible,
.site-footer button:focus-visible { outline: 3px solid var(--sc-gold-300); outline-offset: 2px; }

.sh-btn-gold { background: var(--sc-gold); color: #1a1405; border: 0; }
.sh-btn-gold:hover { background: #d6b862; color: #1a1405; }
.sh-btn-ghost { background: transparent; color: var(--sc-text-strong); border: 1.5px solid rgba(255, 255, 255, 0.3); }
.sh-btn-ghost:hover, .sh-btn-ghost[aria-current="page"] { color: var(--sc-text-strong); border-color: rgba(255, 255, 255, 0.7); background: rgba(255, 255, 255, 0.06); }
.sh-btn-quiet { background: transparent; color: var(--sc-text); border: 0; padding: 0 12px; }
.sh-btn-quiet:hover { color: var(--sc-text-strong); }

.sh-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--sc-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
}
.sh-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sh-toggle .sh-x { display: none; }
.sh-open .sh-toggle .sh-bars { display: none; }
.sh-open .sh-toggle .sh-x { display: inline; }

/* Signed in, the menu has five links: tighten it before it collapses. */
@media (max-width: 1180px) {
  .site-header .sh-inner { gap: 16px; }
  .site-header .sh-links a { padding: 8px 10px; font-size: 0.92rem; }
  .sh-btn { padding: 0 14px; }
}

@media (max-width: 960px) {
  .site-header .sh-inner { height: 60px; padding: 0 16px; gap: 12px; }
  .sh-brand img { width: 36px; height: 36px; }
  .sh-brand span { font-size: 1.02rem; }
  .sh-toggle { display: inline-flex; }

  /* The menu becomes a panel under the header. */
  .site-header .sh-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 12px 16px 20px;
    background: var(--sc-green-950);
    border-bottom: 1px solid var(--sc-line);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.25);
  }
  .sh-open .sh-menu { display: flex; }
  .site-header .sh-links { flex-direction: column; align-items: stretch; margin: 0; gap: 2px; }
  .site-header .sh-links a { display: block; padding: 12px 14px; border-radius: 12px; font-size: 1rem; }
  .site-header .sh-actions { gap: 10px; padding-top: 12px; border-top: 1px solid var(--sc-line); }
  .site-header .sh-actions > * { flex: 1 1 0; }
  .site-header .sh-actions .sh-btn { width: 100%; min-height: 46px; }
  .site-header .sh-actions .sh-btn-quiet { border: 1.5px solid rgba(255, 255, 255, 0.18); }
}

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--sc-green-950);
  color: var(--sc-text);
  margin-top: 30px;
  padding: 0;
  width: auto;
  border-top: 1px solid var(--sc-line);
}
.site-footer .sf-inner { max-width: 1200px; margin: 0 auto; padding: 56px 24px 28px; }

.site-footer .sf-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr); gap: 48px; }
.site-footer .sf-brand p { margin: 14px 0 20px; max-width: 26em; line-height: 1.6; color: var(--sc-text); font-size: 0.95rem; }

.site-footer .sf-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.site-footer .sf-col h2 {
  margin: 0 0 14px;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sc-gold);
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer .sf-col li { margin: 0 0 10px; }
.site-footer a,
.site-footer .footer-logout-form button {
  color: var(--sc-text);
  font-size: 0.93rem;
  text-decoration: none;
  transition: color 0.15s ease;
}
.site-footer a::after { content: none; }  /* undo an older footer link underline */
.site-footer a:hover,
.site-footer .footer-logout-form button:hover { color: var(--sc-text-strong); }
.site-footer .sh-brand,
.site-footer .sh-brand:hover { color: var(--sc-text-strong); }
.site-footer .sh-btn-gold,
.site-footer .sh-btn-gold:hover { color: #1a1405; }
.site-footer .footer-logout-form { margin: 0; }
.site-footer .footer-logout-form button { background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer; }

.site-footer .sf-social { display: inline-flex; align-items: center; gap: 8px; }
.site-footer .sf-social svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.site-footer .sf-social .sf-dot { fill: currentColor; stroke: none; }

.site-footer .sf-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--sc-line);
  font-size: 0.85rem;
}
.site-footer .sf-bottom p { margin: 0; color: rgba(255, 255, 255, 0.55); }
.site-footer .sf-legal { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.site-footer .sf-legal a { font-size: 0.85rem; color: rgba(255, 255, 255, 0.62); }

@media (max-width: 900px) {
  .site-footer .sf-top { grid-template-columns: minmax(0, 1fr); gap: 36px; }
}
@media (max-width: 600px) {
  .site-footer .sf-inner { padding: 44px 20px 24px; }
  .site-footer .sf-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; }
  .site-footer .sf-bottom { flex-direction: column-reverse; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .sh-btn, .site-header .sh-links a, .site-footer a { transition: none; }
}

/* The league tab bar sits under the header; on pages without tabs it was an
   empty band (mobile.css forces it visible), so hide it when it has no links. */
html body .ribbon-nav-container:not(:has(a)) { display: none !important; }

/* Flash messages ("Score saved", "You joined …"): a slim card with an accent
   bar, in the site's type, instead of a heavy outlined box. */
main .messages { max-width: 1200px; margin: 16px auto 4px; padding: 0 20px; }
main .messages > div {
  position: relative;
  margin: 0 0 8px;
  padding: 12px 16px 12px 18px;
  border: 0;
  border-left: 4px solid currentColor;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16, 53, 31, 0.06), 0 4px 14px rgba(16, 53, 31, 0.06);
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
}
main .messages .message-success { background: #f1f8f3; color: #1a5632; }
main .messages .message-info { background: #eef6f8; color: #0c5460; }
main .messages .message-warning { background: #fdf7e6; color: #7a5200; }
main .messages .message-error { background: #fdf0f0; color: #a12622; }
