/* InsightRPG shell: the endorser, the top bar with its More menu, and the footer.
   The shared skeleton from the round-six brand guide, in the module's own colours.
   The folding box at the top is the only heritage blue on the site. */

/* ============================================================
   TOP: endorser line, then the product bar. Sticky as one block.
   ============================================================ */
.site-top {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 2px solid var(--rule);
}

.site-top__endorser {
  height: var(--endorser-height);
  display: flex;
  align-items: center;
  padding: 0 var(--page-gutter);
  border-bottom: 1px solid var(--rule-soft);
}

.lgp-endorser {
  color: var(--text);
  text-decoration: none;
  min-height: 24px;
}

.lgp-endorser:hover span {
  text-decoration: underline;
}

.lgp-endorser img {
  display: block;
}

.product-nav {
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0 var(--page-gutter);
}

/* The product signs with its wordmark, set in its own type */
.product-nav__brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.375rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--ink-colour);
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.product-nav__links {
  display: flex;
  gap: var(--space-6);
  list-style: none;
  margin: 0 auto 0 var(--space-4);
  padding: 0;
  max-width: none;
}

.product-nav__links li {
  margin: 0;
  padding: 0;
}

.product-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-label);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.product-nav__link:hover {
  text-decoration: underline;
}

.product-nav__link--active {
  border-bottom-color: var(--ink-colour);
}

.product-nav__right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ── More menu ── */
.more-menu {
  position: relative;
}

.more-menu__button {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px 10px;
  font-family: var(--font-label);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  border: var(--click-border);
  box-shadow: var(--click-shadow-sm);
  background: var(--surface);
  user-select: none;
}

.more-menu__button::-webkit-details-marker {
  display: none;
}

.more-menu[open] .more-menu__button {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--click-shadow);
}

.more-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 120;
  min-width: 240px;
  max-width: calc(100vw - 2 * var(--page-gutter));
  background: var(--surface);
  border: 2px solid var(--rule);
  box-shadow: 4px 4px 0 var(--rule);
  padding: var(--space-2) 0;
  font-family: var(--font-label);
  font-size: var(--text-sm);
}

.more-menu__heading {
  margin: var(--space-1) 0 0;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-2);
  max-width: none;
}

.more-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: none;
}

.more-menu__list li {
  margin: 0;
  padding: 0;
}

.more-menu__list a {
  display: block;
  padding: var(--space-2) var(--space-4);
  min-height: 36px;
  color: var(--text);
  text-decoration: none;
}

.more-menu__list a:hover,
.more-menu__list a:focus-visible {
  background: var(--wash);
  text-decoration: underline;
}

.more-menu__list a[aria-current] {
  color: var(--ink-colour);
  font-weight: 500;
}

/* The section links sit in the menu only on phones, where the bar is too narrow */
.more-menu__list--site {
  display: none;
  border-bottom: 1px solid var(--rule-soft);
  padding-bottom: var(--space-2);
}

/* ── Theme toggle ── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
}

.theme-toggle__icon--to-light { display: none; }
:root[data-theme="dark"] .theme-toggle__icon--to-light { display: block; }
:root[data-theme="dark"] .theme-toggle__icon--to-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle__icon--to-light { display: block; }
  :root:not([data-theme="light"]) .theme-toggle__icon--to-dark { display: none; }
}

/* ── Contents toggle (rules pages, phones and tablets) ── */
.product-nav__sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--surface);
  border: var(--click-border);
  box-shadow: var(--click-shadow-sm);
  color: var(--text);
  cursor: pointer;
}

.product-nav__sidebar-toggle[aria-expanded="true"] {
  background: var(--ink-colour);
  color: var(--surface);
}

@media (max-width: 63.99em) {
  .product-nav__sidebar-toggle {
    display: inline-flex;
  }
}

@media (max-width: 40em) {
  .product-nav__links {
    display: none;
  }

  .more-menu__list--site {
    display: block;
  }

  .product-nav__brand {
    font-size: 1.2rem;
  }
}

/* ============================================================
   FOOTER: black stock with cream type
   ============================================================ */
.site-footer {
  grid-area: footer;
  background: var(--rpg-black);
  color: var(--rpg-cream);
  padding: var(--space-12) var(--page-gutter) var(--space-8);
  border-top: 3px double var(--rpg-cream);
}

.site-footer__inner {
  max-width: var(--container-xl);
  margin: 0 auto;
}

.site-footer a {
  color: var(--rpg-cream);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer :focus-visible {
  outline: 3px solid var(--rpg-blue-light);
  outline-offset: 2px;
}

.site-footer__cols {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: var(--space-8);
}

.site-footer__brand p {
  font-size: var(--text-sm);
  margin: var(--space-3) 0 0;
  max-width: 30ch;
}

.site-footer__wordmark {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--text-xl);
  text-transform: uppercase;
}

.site-footer__mono {
  font-family: var(--font-label);
}

.site-footer__mono a {
  display: inline-block;
  min-height: 24px;
  padding: var(--space-1) 0;
}

.site-footer h2 {
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--rpg-cream);
  margin: 0 0 var(--space-3);
  padding: 0;
  border: none;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin: 0;
  padding: 0;
  font-size: var(--text-sm);
}

.site-footer li a {
  display: inline-block;
  min-height: 24px;
  padding: var(--space-1) 0;
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  margin-top: var(--space-10);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(243, 234, 215, 0.3);
  font-family: var(--font-label);
  font-size: var(--text-xs);
  color: var(--rpg-cream);
}

.site-footer__legal span {
  margin-right: auto;
}

.site-footer__legal a {
  display: inline-block;
  min-height: 24px;
  padding: var(--space-1) 0;
}

@media (max-width: 64em) {
  .site-footer__cols {
    grid-template-columns: 1fr 1fr;
  }
  .site-footer__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 30em) {
  .site-footer__cols {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   CROSS-PRODUCT PANELS (reading panels, the link is the clickable part)
   ============================================================ */
.lgp-cross-ctas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-6);
}

.lgp-cross-cta {
  border: 1px solid var(--rule);
  padding: var(--space-6);
  background: var(--surface-1);
  display: flex;
  flex-direction: column;
}

.lgp-cross-cta-label {
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-2);
  margin-bottom: var(--space-3);
}

.lgp-cross-cta-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--text-lg);
  text-transform: uppercase;
  color: var(--ink-colour);
  margin-bottom: var(--space-1);
}

.lgp-cross-cta-desc {
  font-size: var(--text-sm);
  color: var(--text);
  margin-bottom: var(--space-4);
}

.lgp-cross-cta-link {
  margin-top: auto;
  font-family: var(--font-label);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--link);
  display: inline-block;
  min-height: 24px;
  padding: var(--space-1) 0;
}
