/* ============================================================
   Section formatting
   ------------------------------------------------------------
   Loaded AFTER home.css so these rules win. Purely additive:
   nothing here moves or hides existing content.

   Sections previously ran together with no divider, and several
   shared one <section> wrapper, so it was never clear where one
   ended or which of the thirteen you were in.
   ============================================================ */

/* The gold rule that opens every section. It sits just above the
   section head as its own element, so no existing layout moves. */
.sec-rule {
  position: relative;
  height: 3px;
  margin: 54px 0 26px;
  background: var(--gold, #f4b547);
  border-radius: 2px;
  scroll-margin-top: 120px;
}

.sec-rule::after {
  content: attr(data-sec-eyebrow);
  position: absolute;
  top: 12px;
  left: 0;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--gold, #f4b547);
  white-space: nowrap;
}

/* Count and charter reference, written in by section-format.js */
.sec-meta {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin: 30px 0 0;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11.5px;
  color: var(--paper-dim, #8fa3b5);
}

.sec-meta .sec-charter {
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  font-size: 11px;
  white-space: nowrap;
}

/* A section title that opens the browse panel. Kept as a button so
   it is reachable by keyboard, but styled to match the h2 it replaces. */
.sec-open {
  display: inline-block;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-bottom: 2px dashed rgba(255, 255, 255, 0.22);
}

.sec-open:hover,
.sec-open:focus-visible {
  border-bottom-color: var(--gold, #f4b547);
  outline: none;
}

.sec-open-hint {
  display: block;
  margin-top: -6px;
  margin-bottom: 10px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--paper-dim, #8fa3b5);
  opacity: 0.75;
}

/* ---- Marquees pause on click ------------------------------------
   Clicking a scrolling strip freezes it so a logo can actually be
   read or clicked; clicking again lets it run. Hover-pause alone
   does nothing on a touchscreen. */

.ticker-track.is-paused,
.logo-wall.is-paused .logo-wall-track,
.logo-wall-track.is-paused,
.section-visual-rail.is-paused .rail-track,
.section-visual-rail.is-paused > * {
  animation-play-state: paused !important;
}

.marquee-hint {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--paper-dim, #8fa3b5);
  opacity: 0.6;
}

/* ---- Back to top ------------------------------------------------ */

#wwbafa-totop {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--gold, #f4b547);
  color: #071420;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

#wwbafa-totop.show { display: flex; }
#wwbafa-totop:hover { background: #ffd47e; }

/* ---- Browse and search panel ------------------------------------ */

#wwbafa-browse {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  padding: 28px 16px;
  overflow-y: auto;
  background: rgba(3, 14, 10, 0.9);
}

#wwbafa-browse.open { display: block; }

.wb-card {
  max-width: 1000px;
  margin: 0 auto;
  padding: 22px;
  border-radius: 16px;
  background: #0a241b;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.wb-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.wb-head h3 {
  flex: 1;
  margin: 0;
  font-size: 22px;
  color: var(--paper, #f3f0e7);
}

.wb-count {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  color: var(--paper-dim, #8fa3b5);
}

.wb-search {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: var(--paper, #f3f0e7);
  font: inherit;
  font-size: 15px;
  box-sizing: border-box;
}

.wb-search:focus {
  outline: none;
  border-color: var(--gold, #f4b547);
}

.wb-chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 14px 0 18px;
}

.wb-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--paper-dim, #8fa3b5);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: 0.07em;
  cursor: pointer;
}

.wb-chip.on {
  background: var(--gold, #f4b547);
  border-color: var(--gold, #f4b547);
  color: #071420;
  font-weight: 700;
}

.wb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 12px;
}

.wb-tile {
  display: block;
  padding: 12px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.24);
  text-align: center;
  text-decoration: none;
  color: inherit;
}

.wb-tile:hover { border-color: var(--gold, #f4b547); }

.wb-tile .wb-box {
  width: 52px;
  height: 52px;
  margin: 0 auto 8px;
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #071420;
  font-weight: 700;
}

.wb-tile img { width: 40px; height: 40px; object-fit: contain; }

.wb-tile .wb-nm {
  display: block;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wb-tile .wb-tier {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: var(--gold, #f4b547);
}

.wb-empty {
  padding: 26px 0;
  text-align: center;
  font-size: 14px;
  color: var(--paper-dim, #8fa3b5);
}

/* Short sections at the foot of the page can never scroll far enough
   to reach the highlight line without this runway. */
body { padding-bottom: 38vh; }

/* ---- Phones ------------------------------------------------------ */

@media (max-width: 760px) {
  .sec-rule { margin: 38px 0 30px; scroll-margin-top: 64px; }
  .sec-rule::after { font-size: 10px; letter-spacing: 0.12em; }
  .sec-meta { margin-top: 26px; font-size: 11px; gap: 10px; }
  .sec-meta .sec-charter { margin-left: 0; }
  .sec-open-hint { font-size: 10px; }

  /* Pills scroll sideways rather than stacking into a wall */
  .section-jump-pills {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .section-jump-pills::-webkit-scrollbar { display: none; }
  .section-jump-pill { white-space: nowrap; flex: 0 0 auto; }

  #wwbafa-totop { right: 14px; bottom: 14px; width: 42px; height: 42px; }
  .wb-card { padding: 16px; }
  .wb-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 9px; }
  .wb-tile .wb-box { width: 44px; height: 44px; }
  .wb-tile img { width: 34px; height: 34px; }
  body { padding-bottom: 30vh; }
}
