/* Rustcator.com — global header + footer.
   Reuses the --rusti-* variable names/values already established by
   rusti-new-styles.css (list/detail/upcoming-wipes pages) so the two
   stylesheets never fight over the same custom property with a different
   color when both load on the same page. --rusti-line-soft and
   --rusti-shell are genuinely new — nothing else already defines them.
*/
:root {
  --rusti-bg: #0a1017;
  --rusti-panel: #111a24;
  --rusti-border: #263443;
  --rusti-line-soft: rgba(255,255,255,.07);
  --rusti-text: #f5f7fa;
  --rusti-muted: #94a0ad;
  --rusti-accent: #ef4c3e;
  --rusti-radius-sm: 7px;
  --rusti-shell: 1480px;
}

.site-shell {
  width: min(calc(100% - 48px), var(--rusti-shell));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: relative;
  z-index: 100;
  color: var(--rusti-text);
  background:
    radial-gradient(circle at 20% -100%, rgba(239,76,62,.08), transparent 38%),
    rgba(10,16,23,.96);
  border-bottom: 1px solid var(--rusti-line-soft);
  box-shadow: 0 12px 40px rgba(0,0,0,.15);
}

.site-header__inner {
  min-height: 84px;
  display: grid;
  grid-template-columns: minmax(220px,1fr) auto minmax(220px,1fr);
  align-items: stretch;
  gap: 28px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  align-self: center;
  width: max-content;
  gap: 11px;
  color: var(--rusti-text);
  text-decoration: none;
}

.site-brand__mark,
.site-brand .custom-logo {
  display: block;
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 5px 12px rgba(0,0,0,.35));
}

.site-brand__wordmark {
  font-family: "Arial Narrow","Roboto Condensed",Impact,sans-serif;
  font-size: clamp(1.55rem,2vw,2.05rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -.035em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-brand__wordmark > span { color: var(--rusti-accent); }

.site-nav {
  display: flex;
  align-items: stretch;
  gap: 4px;
}

.site-nav__link {
  position: relative;
  min-width: 118px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c6ccd3;
  font-size: .95rem;
  font-weight: 650;
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease;
}

.site-action svg,
.site-footer__support svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.site-nav__link:hover {
  color: var(--rusti-text);
  background: rgba(255,255,255,.025);
}

.site-nav__link--active { color: var(--rusti-text); }

.site-nav__link--active::after {
  content: "";
  position: absolute;
  left: 17px;
  right: 17px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--rusti-accent);
  box-shadow: 0 -3px 14px rgba(239,76,62,.25);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Quick free-text lookup — visually a compact sibling of
   .rusto-hero-search__form (hero-search.css), scaled down to the
   header's own 42px control height (matches .site-action) rather than
   the hero's much larger touch targets. Submits a plain GET to the
   server list page, same `search` param the hero form and the list
   page's own filter form already use — no separate search endpoint. */
.site-header__search {
  justify-self: end;
  display: flex;
  align-items: center;
  align-self: center;
  height: 42px;
  max-width: 240px;
}

.site-header__search-field { flex: 1 1 auto; display: block; min-width: 0; }

.site-header__search-field input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  color: var(--rusti-text);
  background: rgba(255,255,255,.015);
  border: 1px solid var(--rusti-border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  font: inherit;
  font-size: .88rem;
  outline: none;
  transition: border-color .15s ease, background-color .15s ease;
}

.site-header__search-field input::placeholder { color: var(--rusti-muted); }

.site-header__search-field input:focus { border-color: var(--rusti-accent); }

.site-header__search:focus-within .site-header__search-submit {
  border-color: var(--rusti-accent);
}

.site-header__search-submit {
  flex: 0 0 auto;
  height: 42px;
  width: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--rusti-text);
  background: rgba(255,255,255,.015);
  border: 1px solid var(--rusti-border);
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}

.site-header__search-submit svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.site-header__search-submit:hover {
  border-color: #394453;
  background: rgba(255,255,255,.04);
}

.site-action {
  min-height: 42px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--rusti-border);
  border-radius: 8px;
  color: var(--rusti-text);
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease, background-color .15s ease;
}

.site-action:hover { transform: translateY(-1px); }

.site-action--ghost {
  color: #d7dce2;
  background: rgba(255,255,255,.015);
}

.site-action--ghost:hover {
  border-color: #394453;
  background: rgba(255,255,255,.04);
}

.site-action--primary {
  padding-inline: 18px;
  border-color: #f35b4c;
  background: linear-gradient(180deg,#f45141,#db3e31);
  box-shadow: inset 0 1px rgba(255,255,255,.13), 0 7px 20px rgba(205,53,43,.16);
}

.site-action--primary:hover {
  border-color: #ff7466;
  background: linear-gradient(180deg,#fa5949,#e34235);
}

/* Server admin platform (phase 1) — signed-in account chip, reuses
   .site-action--ghost's existing neutral styling above. */
.site-action__avatar {
  border-radius: 50%;
  object-fit: cover;
}

/* Footer */
.site-footer {
  margin-top: 64px;
  color: #c1c8d0;
  background:
    radial-gradient(circle at 5% 0%, rgba(239,76,62,.055), transparent 28%),
    #090e14;
  border-top: 1px solid var(--rusti-line-soft);
}

.site-footer__grid {
  padding: 42px 0 38px;
  display: grid;
  grid-template-columns: minmax(260px,1.7fr) repeat(3,minmax(130px,.7fr));
  gap: 50px;
}

.site-brand--footer .site-brand__mark,
.site-brand--footer .custom-logo {
  width: 48px;
  height: 48px;
}

.site-brand--footer .site-brand__wordmark { font-size: 1.65rem; }

.site-footer__tagline {
  max-width: 350px;
  margin: 17px 0 0;
  color: var(--rusti-muted);
  font-size: .9rem;
  line-height: 1.65;
}

.site-footer__section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.site-footer__section h2 {
  margin: 2px 0 6px;
  color: var(--rusti-text);
  font-size: .82rem;
  line-height: 1.2;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.site-footer__section a {
  color: #9fa8b3;
  font-size: .9rem;
  line-height: 1.35;
  text-decoration: none;
  transition: color .14s ease;
}

.site-footer__section a:hover { color: var(--rusti-text); }

.site-footer__bottom {
  min-height: 82px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 30px;
  border-top: 1px solid var(--rusti-line-soft);
  color: #7f8995;
  font-size: .8rem;
}

.site-footer__bottom p { margin: 0; }
.site-footer__legal { max-width: 640px; }

.site-footer__support {
  min-height: 38px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-self: end;
  color: #ff6a5b;
  background: rgba(239,76,62,.07);
  border: 1px solid rgba(239,76,62,.38);
  border-radius: var(--rusti-radius-sm);
  font-weight: 750;
  text-decoration: none;
  transition: background-color .14s ease, border-color .14s ease;
}

.site-footer__support:hover {
  background: rgba(239,76,62,.12);
  border-color: rgba(239,76,62,.62);
}

.site-brand:focus-visible,
.site-nav__link:focus-visible,
.site-action:focus-visible,
.site-footer a:focus-visible {
  outline: 2px solid var(--rusti-accent);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .site-header__inner {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
  }

  .site-brand__wordmark { display: none; }

  .site-nav__link {
    min-width: auto;
    padding-inline: 13px;
  }

  .site-header__search { max-width: 170px; }

  .site-footer__grid {
    grid-template-columns: 1.5fr repeat(2,1fr);
  }

  .site-footer__section:last-child { grid-column: 2; }
}

@media (max-width: 720px) {
  .site-shell { width: min(calc(100% - 28px), var(--rusti-shell)); }

  .site-header__inner { min-height: 68px; }

  .site-brand__mark,
  .site-brand .custom-logo {
    width: 45px;
    height: 45px;
  }

  .site-action--ghost { display: none; }

  /* Overrides the ghost-hide rule above — unlike the "Favorites" ghost
     action it otherwise targets, a signed-in user's only way to reach
     their dashboard is this chip, so it must survive the mobile collapse.
     Two-class selector beats .site-action--ghost's single-class one
     regardless of source order. Name still hides, matching how
     .site-action--primary collapses to icon-only right below. */
  .site-header__actions .site-action--account {
    display: inline-flex;
  }

  .site-action--account span {
    display: none;
  }

  /* Same "condensed mobile header" call as the ghost action above — the
     server list page's own filter form covers this a tap away via nav,
     so this convenience search doesn't need to fight the brand/nav for
     space once the header itself is already down to 68px. */
  .site-header__search { display: none; }

  .site-action--primary {
    min-width: 42px;
    width: 42px;
    padding: 0;
  }

  .site-action--primary span { display: none; }

  .site-nav { justify-content: center; }

  .site-nav__link { padding-inline: 10px; }

  .site-nav__link--active::after {
    left: 8px;
    right: 8px;
  }

  .site-footer { margin-top: 46px; }

  .site-footer__grid {
    padding: 34px 0;
    grid-template-columns: 1fr 1fr;
    gap: 34px 26px;
  }

  .site-footer__brand { grid-column: 1 / -1; }

  .site-footer__section:last-child { grid-column: auto; }

  .site-footer__bottom {
    padding: 24px 0;
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .site-footer__support {
    justify-self: start;
    margin-top: 7px;
  }
}

@media (max-width: 440px) {
  .site-header__inner { gap: 5px; }
  .site-nav__link { padding-inline: 7px; }

  .site-action--primary {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
  }

  .site-footer__grid { grid-template-columns: 1fr; }
}
