/* NOR/Rust section nav redesign - same visual treatment as the
   Alienated World hub's nav (fixed position, background matches the
   page instead of a flat color, thick black separator, no blur), but
   keeps this site's own existing nav CONTENT as-is (wipe countdown,
   Discord/Play Now, account login, hub-back-link) - this is a styling
   pass, not a structural redesign. Loaded only by includes/header.php,
   so it never reaches Aliens3dprint or the hub page, which have their
   own separate stylesheets for their own nav treatments.

   Background is the SAME starfield image as the main/hub page (not
   this page's own bg.jpg) - by request, this nav treatment is meant to
   carry over to every page site-wide eventually, so every nav should
   show the one unified image rather than each page's own distinct
   background. Unfaded (no gradient), matching how the hub itself shows
   it at full strength. */
.nor-navbar.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background-color: transparent;
  background-image: url("../image/alienated-world-page-bg-v2.jpg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: top center;
  background-attachment: fixed;
  backdrop-filter: none;
  border-bottom: none;
}

/* Fixed nav is out of normal flow, so the page needs equivalent top
   clearance or content starts out hidden underneath it. Padding goes
   on body (not .page-wrap) since some pages' first element after <nav>
   is .hero (Rust.php, Dashboard.php) rather than .page-wrap (News,
   Rules, Servers, Schedule, Staff) - body padding pushes whichever one
   comes first down uniformly, so it works for both.

   Also carries the same unified starfield background as the nav above
   (and the hub/Aliens3dprint/Coding pages) down the WHOLE page now, not
   just the nav strip - this is the "every page site-wide eventually"
   the comment above was already anticipating. Full strength, no dark
   gradient fade, matching how the hub/Aliens3dprint/Coding pages show
   it. Scoped to .nor-body (set on includes/header.php's own <body> tag)
   rather than the bare element, so this stylesheet being loaded
   elsewhere later doesn't silently repaint some other page's body. */
.nor-body {
  padding-top: 158px;
  background-image: url("../image/alienated-world-page-bg-v2.jpg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: top center;
  background-attachment: fixed;
}

/* Rust.php's own "Welcome to NoobsOnTheRun" panel - carries a themed
   background image (image/alienated-world-rust-sunset.png) instead of
   the plain flat panel every other page uses. Lighter overlay than the
   site's shared .88/.94/1 opacity gradient so the art actually reads
   instead of mostly disappearing into black. Scoped to this one panel,
   not .panel generally, so every other page's plain panels are
   untouched. */
.rust-welcome-panel {
  background-image:
    linear-gradient(180deg, rgba(10,13,10,.25) 0%, rgba(10,13,10,.4) 100%),
    url("../image/alienated-world-rust-sunset.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

/* At wider widths, lock the panel to the image's own aspect ratio
   (1671x941) instead of stretching full-width with the image
   letterboxed/cropped inside - "cover" fills it cleanly edge to edge
   once the box itself is shaped to match, with zero cropping since the
   box ratio equals the image ratio exactly. Capped to a smaller
   max-width than the page-wrap so the whole panel sits a bit smaller
   rather than stretching full width. Text stays single-column (the
   original layout) so it doesn't crowd/overlap the artwork. Only above
   700px - at narrow/mobile widths this ratio would squash the panel far
   too short for 7 bullets + a stats row, so it falls back to plain
   auto-height (cover crops the image there instead, same as any normal
   background-image) rather than force a cramped, clipped box. */
@media (min-width: 700px) {
  .rust-welcome-panel {
    aspect-ratio: 1671 / 941;
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 32px;
    overflow: hidden;
  }
}

/* Same hero-badge sizing as .coding-hero-img (css/coding.css, used by
   Coding.php/RecoveryTool.php) - this stylesheet is what's actually
   loaded on Dashboard.php/Rust.php though, so the same pixel value is
   duplicated here rather than reaching across to a stylesheet those
   pages don't load. */
.nor-hero-img {
  display: block;
  width: 100%;
  max-width: 460px;
  margin: 0 auto 1em;
}

/* New square badge brand image needs its own sizing - style.css's
   default .topnav .brand img height (34px) was sized for the old wide
   banner.png. Matches the hub page's own brand logo height (84px) so
   it doesn't visibly change size between the two. */
.nor-navbar.topnav .brand img {
  height: 84px;
  width: auto;
}

/* Hamburger stays gated behind this same circular button at every
   screen width now, not just mobile - matching the hub's own nav
   treatment (css/hub.css) instead of showing the hex buttons directly
   on a wide desktop window. Shared style.css's plain .nav-toggle-label
   only shows below 860px - this scoped version overrides that to stay
   visible always. */
.nor-navbar .nav-toggle-label {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .6);
  border: 1px solid var(--accent-border);
  box-shadow:
    0 0 10px rgba(57, 255, 20, .5),
    inset 0 0 10px rgba(57, 255, 20, .18);
  font-size: 24px;
  margin-left: auto;
}
/* Clicking this same circle again already closes the menu (it's just
   the checkbox's own <label>, toggling it back off) - swapping to an
   explicit X while open makes that obvious instead of relying on the
   visitor guessing a hamburger icon is clickable twice. */
.nav-toggle:checked ~ .nor-navbar .nav-toggle-label,
.nor-navbar .nav-toggle:checked ~ .nav-toggle-label {
  font-size: 0;
}
.nav-toggle:checked ~ .nor-navbar .nav-toggle-label::after,
.nor-navbar .nav-toggle:checked ~ .nav-toggle-label::after {
  content: "\2715";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

/* Gated behind the hamburger at desktop widths too (not just the
   existing <861px collapse further down) - hidden by default, shown
   only once the checkbox is checked, same as the hub page. !important
   because shared style.css's ".topnav .nav-links" (two classes) and
   this file's own unconditional ".nor-navbtns { display:flex }" above
   would otherwise both win outright over a plain display:none here. */
@media (min-width: 861px) {
  /* Without this, the shared style.css .topnav's justify-content:
     space-between would float the hamburger at a different horizontal
     spot depending on whether .nor-navbtns is present in the layout
     (none vs. flex) - margin-left:auto on the label pins it to the far
     right consistently either way, same fix hub.css/aliens-public-nav.css
     needed for the identical reason. */
  .nor-navbar.topnav { justify-content: flex-start; }
  .nor-navbtns { display: none !important; }
  .nav-toggle:checked ~ .nor-navbar .nor-navbtns,
  .nor-navbar .nav-toggle:checked ~ .nor-navbtns {
    display: flex !important;
  }
}

/* Black outline around the wipe countdown text (keeps its existing
   green color/glow, just adds legibility against the busier starfield
   nav background now behind it) - scoped to .nor-navbar specifically
   (higher specificity than the shared style.css rule) so this doesn't
   also change the same countdown's look in the hub page's hover
   tooltip, which still sits on a plain solid background.
   -webkit-text-stroke draws the outline on the glyph itself
   (anti-aliased, smooth at any size) instead of stacking several hard
   copies of the text via text-shadow - that stacking approach got
   visibly jagged/fuzzy once the label's font-size was small relative
   to the 2px offset. Broadly supported (Chrome/Edge/Safari/Firefox). */
.nor-navbar .wipe-countdown-time {
  -webkit-text-stroke: 1.5px #000;
  text-shadow: 0 0 10px rgba(57, 255, 20, .8);
  font-size: 32px;
}

.nor-navbar .wipe-countdown-label {
  color: #fff !important;
  font-size: 19px;
  font-weight: 700;
  -webkit-text-stroke: 0.6px #000;
}

/* Swap the visual stacking order (time on top, label below) without
   touching the markup/DOM order, so screen readers still get "Next
   Wipe" announced before the time. Pushed further right (and bigger,
   above) than the original placement right next to the brand mark -
   by request, so it reads as its own focal point in the bar rather
   than crowding the logo. */
.nor-navbar .wipe-countdown {
  display: flex;
  flex-direction: column-reverse;
  margin-left: 80px;
}

@media (max-width: 860px) {
  body {
    padding-top: 128px;
  }
}

/* ---------- Hexagon nav buttons ---------- */
/* Same button style/art as the hub page (hexbtn-unlit.png/hexbtn-lit.png,
   true hexagon via clip-path, press ripple via js/nor-nav.js), under
   its own .nor- prefixed classes rather than reusing hub.css's
   .hub-navbtn etc. directly - hub.css isn't loaded on NOR pages, and
   keeping each section's nav CSS self-contained matches how aliens.css/
   hub.css/nor-nav.css are already split one-per-section. */
.nor-navbtns {
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (min-width: 861px) {
  .nor-navbtns {
    padding: 6px 8px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(0, 0, 0, .45));
    border: none;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .15),
      inset 0 -1px 0 rgba(0, 0, 0, .4),
      0 0 22px rgba(57, 255, 20, .12);
  }
}

.nor-icon {
  display: inline-flex;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: inherit;
}
.nor-icon svg { width: 100%; height: 100%; }
.nor-icon img { width: 100%; height: 100%; object-fit: contain; }

.nor-navitem {
  position: relative;
  display: flex;
}

.nor-navbtn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 92px;
  padding: 12px 14px;
  clip-path: polygon(12% 0, 88% 0, 100% 50%, 88% 100%, 12% 100%, 0 50%);
  text-decoration: none;
  transition: transform .15s ease;
}

.nor-navbtn-icon-only {
  min-width: 72px;
}
.nor-navbtn-icon-only .nor-icon {
  width: 28px;
  height: 28px;
}

.nor-navbtn-label {
  position: relative;
  z-index: 1;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .5px;
  text-transform: uppercase;
  white-space: nowrap;
  color: #eef1ec;
}

.nor-navbtn .nor-icon {
  position: relative;
  z-index: 1;
}

@media (min-width: 861px) {
  .nor-navbtn {
    background-color: transparent;
    background-image: url("../image/hexbtn-unlit.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }

  .nor-navbtn::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("../image/hexbtn-lit.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
  }

  .nor-navbtn:hover,
  .nor-navbtn.active {
    background-color: transparent;
    border-color: transparent;
    box-shadow: none;
  }

  /* style.css's shared .topnav a.active rule outranks .nor-navbtn.active
     on specificity (two classes + an element beats two classes alone),
     so border-color:transparent above was silently losing - same issue
     as the hub page. !important forces off the resulting green
     underline, which is redundant on top of the hex art's own lit
     active state anyway. */
  .nor-navbtn.active {
    border-bottom: none !important;
  }

  .nor-navbtn:hover::before,
  .nor-navbtn.active::before,
  .nor-navbtn.is-pressed::before {
    opacity: 1;
  }

  /* Icon-only on desktop (the requested look for Discord/Play Now) -
     the label still exists in the markup for mobile's row layout,
     just hidden here. */
  .nor-navbtn-icon-only .nor-navbtn-label {
    display: none;
  }
}

/* Click-press feedback (see js/nor-nav.js) - same expanding-ring ripple
   as the hub's hexagon buttons, clipped to the same hexagon shape since
   clip-path applies to pseudo-element paint too. */
.nor-navbtn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
}

.nor-navbtn.is-pressed {
  animation: nor-navbtn-punch .19s ease-out;
}
.nor-navbtn.is-pressed::after {
  animation: nor-navbtn-ripple .45s ease-out;
}

@keyframes nor-navbtn-punch {
  0% { transform: scale(1); }
  45% { transform: scale(.91); box-shadow: 0 0 26px rgba(57, 255, 20, .85); }
  100% { transform: scale(1); }
}

@keyframes nor-navbtn-ripple {
  0% { transform: translate(-50%, -50%) scale(0); opacity: .65; }
  100% { transform: translate(-50%, -50%) scale(16); opacity: 0; }
}

/* Mobile: same collapsed-sliver fix as the hub page - only add the
   panel border/background once :checked actually expands the menu,
   never while collapsed to max-height:0 (a border still paints as a
   visible line at zero height otherwise). Hexagon clipping also drops
   to a flat row, same reasoning as the hub page - a clipped hexagon
   reads badly stretched across a full-width row. */
@media (max-width: 860px) {
  .nav-toggle:checked ~ .nor-navbtns {
    background: var(--bg-elevated-solid);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius);
    padding: 8px;
    margin-top: 8px;
  }

  .nor-navbtns {
    flex-direction: column;
    align-items: stretch;
  }

  .nor-navitem { width: 100%; }

  .nor-navbtn {
    clip-path: none;
    flex-direction: row;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    gap: 14px;
    border-radius: 10px;
    background: rgba(47, 180, 255, .05);
    border: 1px solid rgba(47, 180, 255, .35);
  }

  .nor-navbtn:hover,
  .nor-navbtn.active {
    background: var(--accent-soft);
    border-color: var(--accent);
  }

  .nor-navbtn-label { text-transform: none; font-size: 15px; }

  .nor-navbtn::before {
    content: "\276F";
    margin-left: auto;
    font-size: 14px;
    color: inherit;
  }

  .nor-navbtn-icon-only {
    min-width: 0;
  }
}
