/* 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");
@import url("../js/shared/discord-join.css");
@import url("../js/shared/access-gate.css");

/* —— 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);
}

.site-footer__inner {
  width: min(48rem, calc(100vw - 2rem));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-align: center;
}

.site-footer__brand {
  margin: 0;
  font-family: var(--bpb-font-display);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  color: var(--bpb-label-fill, #fffaf0);
}

.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 a {
  color: var(--bpb-parchment-light, #e2c9a8);
  text-decoration: none;
}

.site-footer__nav a:hover,
.site-footer__nav a:focus-visible {
  color: var(--bpb-gold, #e8c84a);
  text-decoration: none;
}

.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)
    max(3.25rem, var(--bpb-frame-edge-y, 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.75rem, 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__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--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;
  }
}

/* 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;
  }
}
