/**
 * Y888 Footer + Bottom Nav — fresh rewrite from scratch
 *
 * Covers: <site-footer>, <bottom-nav>, <back-to-top>
 * (shadow-DOM and light-DOM alike — class-based, no hashed names)
 *
 * User's explicit footer spec (2026-10-13, supersedes tokens):
 *   - footer background: #000000
 *   - side padding: 15px
 *   - 18+ badge: 0.7rem
 *   - description border: 2px solid #EB05F2
 *   - description radius: 18px
 *   - description inner padding: 20px
 *   - description text: centered
 *   - copyright row: includes "|" separator
 *
 * Everything else uses css/tokens.css (--y888-*).
 * Requires: <link rel="stylesheet" href="css/tokens.css"> before this file.
 */

/* ============================================================
 * 1. SITE FOOTER
 * ============================================================ */

site-footer {
  display: block;
  background: #000000;
}

.site-footer {
  display: block;
  background: #000000;
  color: var(--y888-text-muted);
  font-family: var(--y888-font-family);
  padding-bottom: var(--y888-space-lg);
}

/* ---- section headings ---- */
.site-footer .footer-heading {
  margin: 0 0 var(--y888-space-md);
  font-size: var(--y888-font-size-lg);
  font-weight: var(--y888-font-weight);
  color: var(--y888-text-muted);
}

/* ---- icon rows ---- */
.site-footer .footer-icons {
  display: flex;
  gap: var(--y888-space-md);
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer .footer-icons li {
  display: block;
  line-height: 0;
}

.site-footer .footer-icons img {
  display: block;
  width: 0.7rem;
  height: 0.7rem;
  object-fit: contain;
}

/* ---- 1. License Compliance: title left, 18+ badge right ---- */
.site-footer .footer-license {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px var(--y888-space-lg);
  margin-bottom: var(--y888-space-lg);
  border-bottom: thin solid var(--y888-border);
  background: #000000;
}

.site-footer .footer-license__title {
  font-size: var(--y888-font-size-lg);
  font-weight: var(--y888-font-weight);
  color: var(--y888-text-dim);
}

.site-footer .footer-license__badge {
  width: 0.7rem;
  height: 0.7rem;
  object-fit: contain;
}

/* ---- 2 & 3. Contact us / Official Channel ---- */
.site-footer .footer-contact,
.site-footer .footer-channel {
  padding: 0 15px var(--y888-space-lg);
  margin-bottom: var(--y888-space-lg);
  border-bottom: thin solid var(--y888-border);
  background: #000000;
}

/* ---- 4. Description card ---- */
.site-footer .footer-about {
  margin: 0 15px var(--y888-space-lg);
  padding: 20px;
  background: #000000;
  border: 2px solid #EB05F2;
  border-radius: 18px;
}

.site-footer .footer-about__text {
  margin: 0;
  font-size: var(--y888-font-size-sm);
  font-weight: var(--y888-font-weight);
  line-height: 1.5;
  text-align: center;
  color: var(--y888-text-muted);
}

.site-footer .footer-about__brand {
  color: var(--y888-primary);
  font-weight: var(--y888-font-weight);
}

.site-footer .footer-about__copyright {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--y888-space-sm);
  margin-top: var(--y888-space-md);
  font-size: var(--y888-font-size-sm);
  color: var(--y888-text-muted);
}

/* ============================================================
 * 2. BOTTOM NAV — fixed bottom tab bar
 * ============================================================ */

bottom-nav {
  display: block;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  width: 100%;
  height: var(--y888-nav-height);
  background-color: var(--y888-nav-bg);
  box-shadow: 0.02rem 0 0.06rem rgba(0, 0, 0, 0.1);
  font-family: var(--y888-font-family);
  z-index: 100;
}

/* keep page content clear of the fixed bar */
body {
  padding-bottom: var(--y888-nav-height);
}

.bottom-nav .nav-item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  padding: 0 0.05rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  min-width: 0;
}

.bottom-nav .nav-icon {
  position: relative;
  display: block;
  line-height: 0;
  z-index: 1;
  color: var(--y888-nav-inactive);
}

.bottom-nav .nav-icon svg {
  display: block;
  width: auto;
  height: var(--y888-nav-icon-size);
  font-size: 0.48rem;
}

/* inactive composite: gray base outline + magenta accent detail */
.bottom-nav .nav-icon__base {
  color: var(--y888-nav-inactive);
}

.bottom-nav .nav-icon__accent {
  position: absolute;
  inset: 0;
  color: var(--y888-primary);
}

/* active: full magenta glyph */
.bottom-nav .nav-icon__active {
  display: none;
  color: var(--y888-primary);
}

.bottom-nav .nav-item.is-active .nav-icon__base,
.bottom-nav .nav-item.is-active .nav-icon__accent {
  display: none;
}

.bottom-nav .nav-item.is-active .nav-icon__active {
  display: block;
}

.bottom-nav .nav-label {
  margin-top: 0.1rem;
  height: 0.6rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--y888-font-size-md);
  font-weight: var(--y888-font-weight);
  line-height: 0.3rem;
  color: var(--y888-nav-inactive);
  word-break: break-word;
}

.bottom-nav .nav-item.is-active .nav-label {
  color: var(--y888-primary);
}

/* "50-999" promo badge on Register */
.bottom-nav .nav-badge {
  position: absolute;
  top: 0;
  right: 0.1rem;
  transform: translate(100%, -50%);
  z-index: 5;
  display: inline-block;
  box-sizing: border-box;
  min-width: 0.32rem;
  max-width: 1.2rem;
  height: 0.28rem;
  padding: 0 0.08rem;
  font-size: 0.18rem;
  font-weight: 400;
  line-height: 0.28rem;
  text-align: center;
  white-space: nowrap;
  color: #fff;
  background: var(--y888-success);
  border-radius: 0.13rem 0.13rem 0.13rem 0;
}

/* keyboard focus visibility */
.bottom-nav .nav-item:focus-visible {
  outline: 2px solid var(--y888-primary);
  outline-offset: -2px;
}

/* ============================================================
 * 3. BACK TO TOP — fixed pill button, bottom-right
 * ============================================================ */

back-to-top {
  display: block;
}

.back-to-top-wrap {
  position: fixed;
  right: 0.1rem;
  bottom: 1.5rem;
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--y888-transition-fast, 300ms) ease,
    visibility var(--y888-transition-fast, 300ms);
}

.back-to-top-wrap--show {
  opacity: 1;
  visibility: visible;
}

.back-to-top {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 1.16rem;
  height: 0.56rem;
  min-height: 0.56rem;
  padding: 0 0 0 0.16rem;
  background-color: var(--y888-bg-card);
  border: thin solid var(--y888-border);
  border-radius: 0.14rem;
  box-shadow: none;
  cursor: pointer;
  font-family: var(--y888-font-family);
}

.back-to-top::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  opacity: 0.9;
  border-radius: 0.14rem;
  box-shadow: 0 0.01rem 0.1rem rgba(0, 0, 0, 0.1);
}

.back-to-top__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 0.36rem;
  min-width: 0.36rem;
  height: 0.36rem;
  margin: 0;
  background-color: var(--y888-primary);
  border-radius: 50%;
}

.back-to-top__icon svg,
.back-to-top__icon img {
  display: block;
  width: 0.15rem;
  height: 0.24rem;
}

.back-to-top__label {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  padding-left: 0.1rem;
  font-size: 0.18rem;
  font-weight: var(--y888-font-weight);
  line-height: 1;
  color: var(--y888-text);
}

/* keyboard focus visibility */
.back-to-top:focus-visible {
  outline: 2px solid var(--y888-primary);
  outline-offset: 2px;
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .back-to-top-wrap {
    transition: none;
  }
}
