/* Shared layout helpers used across pages. */

@import url("../js/shared/skeleton.css");
@import url("../js/shared/board-still/board-still.css");
@import url("../js/shared/nav.css");
@import url("../js/shared/blob-face.css");
@import url("../js/shared/premium-cta.css");
@import url("../js/shared/premium-offer.css?v=premium-banner-live-20261020");
@import url("../js/shared/discord-join.css");
@import url("../js/shared/access-gate.css");
@import url("../js/shared/button-preset.css?v=footer-regular-columns-20261020");

/* —— Site footer —— */
.site-footer {
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
  margin: 0;
  margin-top: auto;
  padding: 1.75rem var(--bpb-frame-edge-x, 1rem) max(3.25rem, var(--bpb-frame-edge-y, 2rem));
  background:
    linear-gradient(
      180deg,
      rgba(70, 48, 32, 0.35) 0%,
      rgba(45, 30, 20, 0.72) 100%
    );
  border-top: 2px solid rgba(60, 38, 29, 0.55);
  color: var(--bpb-parchment-light, #e2c9a8);
  font-family: var(--bpb-font-body);
}

/* Regular footer: use the same dark textured surface as Home. The Home page
   adds its curved edge mask in its own stylesheet; other pages keep the same
   texture without inheriting Home's scene-specific geometry. */
.site-footer:not(.site-footer--slim) {
  background-color: #111;
  background-image: url("../assets/theme/backgrounds/bg-dark-textured.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border-top: 0;
}

.site-footer__inner {
  width: min(74rem, calc(100vw - 2rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(11rem, 0.85fr) minmax(0, 1.25fr);
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.site-footer__brand {
  display: inline-block;
  margin: 0;
  font-family: var(--bpb-font-display);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  color: var(--bpb-label-fill, #fffaf0);
  text-decoration: none;
  transition: color 0.12s ease, filter 0.12s ease;
}

.site-footer__brand:hover {
  color: #fff;
  filter: brightness(1.08);
}

.site-footer__brand:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--bpb-gold, #eac914) 80%, transparent);
  outline-offset: 3px;
}

.site-footer__disclaimer {
  margin: 0;
  max-width: 40rem;
  font-size: 0.8rem;
  line-height: 1.35;
  text-align: center;
  color: rgba(255, 236, 220, 0.82);
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.1rem;
  font-size: 0.9rem;
}

.site-footer__nav--columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  justify-content: stretch;
  width: 100%;
  gap: 0.65rem;
  text-align: center;
}

.site-footer__nav-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.45rem;
}

.site-footer__nav--columns .site-footer__nav-link {
  width: 100%;
}

/* Distinct dialog-button colors mapped to the site's crimson, gold, forest,
   steel, and green design language. */
.site-footer__nav-link--about {
  background: color-mix(in srgb, #8b2e2e 68%, var(--bpb-dialog-ink));
}

.site-footer__nav-link--terms {
  background: color-mix(in srgb, #95621d 68%, var(--bpb-dialog-ink));
}

.site-footer__nav-link--privacy {
  background: color-mix(in srgb, #3f6b4f 68%, var(--bpb-dialog-ink));
}

.site-footer__nav-link--builds {
  background: color-mix(in srgb, #3d5a7a 72%, var(--bpb-dialog-ink));
}

.site-footer__nav-link--items {
  background: color-mix(in srgb, #4f855f 68%, var(--bpb-dialog-ink));
}

.site-footer__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 14rem);
  margin: 0 auto;
  border-radius: 0.45rem;
  line-height: 0;
}

.site-footer__logo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 8rem;
  object-fit: contain;
  filter: drop-shadow(0 0.35rem 0.6rem rgba(0, 0, 0, 0.35));
}

.site-footer__logo:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--bpb-gold, #eac914) 80%, transparent);
  outline-offset: 4px;
}

.site-footer__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 0;
  gap: 0.55rem;
  text-align: right;
}

.site-footer__meta .site-footer__brand {
  font-size: clamp(1.15rem, 1rem + 0.25vw, 1.35rem);
}

.site-footer__version {
  margin: 0;
  color: rgba(255, 236, 220, 0.84);
  font-size: 0.82rem;
  line-height: 1.2;
}

.site-footer__version span {
  color: #f2cf76;
  font-family: var(--bpb-font-display);
}

.site-footer__meta .site-footer__disclaimer {
  max-width: 20rem;
  text-align: right;
}

.site-footer__patch-link {
  align-self: flex-end;
}

.site-footer__meta .site-footer__socials {
  justify-content: flex-end;
  margin-top: 0.05rem;
}

.site-footer__nav a {
  min-height: 2.2rem;
  padding: 0.38rem 0.85rem;
}

.site-footer__socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.site-footer__social {
  display: block;
  line-height: 0;
  opacity: 0.9;
}

.site-footer__social:hover,
.site-footer__social:focus-visible {
  opacity: 1;
}

.site-footer__social img {
  display: block;
  width: 2.25rem;
  height: auto;
}

/* Slim one-line footer — dense pages (sim, items).
   Keep frame-edge inset when the leather screen chrome is on (sim zeros those tokens). */
.site-footer--slim {
  margin-top: 0;
  padding: 0.4rem var(--bpb-frame-edge-x, 1rem)
    calc(max(0.4rem, var(--bpb-frame-edge-y, 0.4rem)) + 0.4rem);
}

/* No wood frame on phone/tablet, so the footer sits on the viewport edge
   instead of keeping the 3.25rem pad that clears the desktop rim. */
@media (max-width: 1100px) {
  .site-footer {
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  }

  .site-footer--slim {
    padding-bottom: max(0.4rem, env(safe-area-inset-bottom, 0px));
  }
}

.site-footer__inner--slim {
  width: min(
    96rem,
    calc(100vw - 2 * var(--bpb-frame-edge-x, 0.75rem) - 0.5rem)
  );
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem 1.25rem;
  text-align: left;
}

.site-footer__inner--slim .site-footer__brand {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
  justify-self: start;
}

.site-footer__inner--slim .site-footer__nav {
  justify-self: center;
  flex-wrap: nowrap;
  gap: 0.3rem 0.95rem;
  font-size: 0.82rem;
  white-space: nowrap;
}

.site-footer__inner--slim .site-footer__nav a {
  min-height: 1.9rem;
  padding: 0.28rem 0.68rem;
}

.site-footer__inner--slim .site-footer__socials {
  justify-self: end;
  gap: 0.55rem;
}

.site-footer__inner--slim .site-footer__social img {
  width: 1.75rem;
}

@media (max-width: 720px) {
  .site-footer__inner:not(.site-footer__inner--slim) {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }

  .site-footer__inner:not(.site-footer__inner--slim) .site-footer__nav--columns {
    width: min(100%, 24rem);
    margin-inline: auto;
  }

  .site-footer__inner:not(.site-footer__inner--slim) .site-footer__logo {
    width: min(14rem, 72vw);
  }

  .site-footer__inner:not(.site-footer__inner--slim) .site-footer__meta {
    align-items: center;
    text-align: center;
  }

  .site-footer__inner:not(.site-footer__inner--slim) .site-footer__meta .site-footer__disclaimer {
    text-align: center;
  }

  .site-footer__inner:not(.site-footer__inner--slim) .site-footer__patch-link,
  .site-footer__inner:not(.site-footer__inner--slim) .site-footer__meta .site-footer__socials {
    align-self: center;
  }

  .site-footer__inner--slim {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 0.45rem;
  }
  .site-footer__inner--slim .site-footer__brand,
  .site-footer__inner--slim .site-footer__nav,
  .site-footer__inner--slim .site-footer__socials {
    justify-self: center;
  }

  .site-footer__inner--slim .site-footer__nav {
    flex-wrap: wrap;
    white-space: normal;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-footer__brand,
  .site-footer__logo {
    transition: none;
  }
}

/* Items catalog mobile filters - fixed button, side panel overlay */
@media (max-width: 1240px) {
  /* Fixed filters toggle button on mobile - stays on top */
  .items-filters__toggle {
    position: fixed;
    z-index: 50;
    top: 46%;
    right: 0;
    margin: 0;
    padding: 0.75rem 0.4rem;
    border: 2px solid #3c261d;
    border-right: 0;
    border-radius: 0.45rem 0 0 0.45rem;
    background: #eac914;
    color: #3c261d;
    font-family: var(--bpb-font-body);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.02em;
    writing-mode: vertical-rl;
    cursor: var(--bpb-cursor-pointer);
    box-shadow: -2px 2px 0 rgba(60, 38, 29, 0.28);
  }

/* When filters drawer is open, dim the page */
.page-items .items-layout.is-filters-open {
}

  /* Overlay backdrop when filters are open */
  .page-items .items-filters__backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 110;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(28, 16, 10, 0.48);
    cursor: var(--bpb-cursor-pointer);
  }

  /* Filter panel when open - fixed position on the right */
  .page-items .items-layout.is-filters-open .items-filters.items-filters {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    width: min(22rem, 88vw);
    max-width: 88vw;
    height: auto;
    max-height: none;
    margin: 0;
    background: #5c4030;
    transform: translateX(105%);
    transition: transform 0.2s ease;
    box-shadow: -6px 0 18px rgba(28, 16, 10, 0.28);
  }

  /* When open, slide the filter panel in */
  .page-items .items-layout.is-filters-open .items-filters.items-filters {
    transform: translateX(0);
  }

  /* Close button on the filter panel */
  .page-items .items-filters__close {
    display: grid;
    place-items: center;
    flex: 0 0 2.25rem;
    width: 2.25rem;
    height: 2.25rem;
    margin: 0;
    padding: 0;
    border: 2px solid #3c261d;
    border-radius: 0.3rem;
    background: #eac914;
    cursor: var(--bpb-cursor-pointer);
  }

  /* Count label adjustment */
  .page-items .il-filter__count {
    flex: 1 1 auto;
    min-width: 0;
  }
}
