/* src/components/basic/XWUIBarSiteFooter/XWUIBarSiteFooter.css */
/* XWUIBarSiteFooter · reusable site-shell footer.
 *
 * Mirrors XWUIBarSiteHeader's contract for page-width / gutter:
 *   --xwui-bar-site-footer-max-width   inner content max-width
 *   --xwui-bar-site-footer-px          horizontal gutter
 *
 * Both are READ with a fallback where they are used, so they work however the
 * footer was mounted and wherever a host sets them: on the tag, on the
 * `.xwui-bar-site-footer` class, on a wrapper, or on :root. They used to be
 * defined only on the `xwui-bar-site-footer` tag below, so a footer built into
 * a plain host element had no gutter and no max width, and a rule on the class
 * could not change them. The tag block stays: a host that sets the variables on
 * the tag (the shell does) keeps working, and the tag still carries the defaults
 * for anything that reads them from outside.
 */

xwui-bar-site-footer {
  display: block;
  width: 100%;
  --xwui-bar-site-footer-max-width: 1200px;
  --xwui-bar-site-footer-px: clamp(1rem, 3vw, 2.5rem);
}

.xwui-bar-site-footer {
  width: var(--xwui-bar-site-footer-width, 100%);
  margin: var(--xwui-bar-site-footer-margin, 0);
  padding-inline: var(--xwui-bar-site-footer-px, clamp(1rem, 3vw, 2.5rem));
  background: var(--xwui-bar-site-footer-bg, var(--bg-secondary, var(--bg-app)));
  border-radius: var(--xwui-bar-site-footer-radius, 0);
  /* --text-tertiary is 3.22:1 on this surface in the light theme; the theme
     documents it as a non-text colour. Everything the footer prints is real
     text, so it takes --text-secondary (4.63:1). */
  color: var(--text-secondary);
}
.xwui-bar-site-footer.is-bordered {
  border-top: var(--xwui-bar-site-footer-border, 1px solid var(--border-light));
}

.xwui-bar-site-footer__inner {
  max-width: var(--xwui-bar-site-footer-max-width, 1200px);
  margin-inline: auto;
  width: 100%;
  display: grid;
  gap: var(--spacing-xl, 2rem);
  grid-template-columns: 1.5fr repeat(3, 1fr);
  padding-block: 2.25rem;
}
.xwui-bar-site-footer__inner--bottom {
  padding-top: 1.25rem;
  padding-bottom: 1.5rem;
  display: block;
}

.xwui-bar-site-footer__brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
  overflow: visible;
}
.xwui-bar-site-footer__brand-link xwui-logo {
  display: inline-flex;
  min-height: 28px;
  overflow: visible;
}
.xwui-bar-site-footer__brand-desc {
  color: var(--text-secondary);
  margin-top: 0.75rem;
  max-width: 32ch;
  line-height: 1.5;
}
.xwui-bar-site-footer__brand-desc a {
  color: var(--accent-primary);
}

.xwui-bar-site-footer__col-title {
  font-size: 0.85rem;
  /* Same ink as the links now, so the heading keeps its rank by weight. */
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 0.75rem;
}
.xwui-bar-site-footer__col-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.4rem;
}
.xwui-bar-site-footer__col-link {
  /* A bare inline link in a list is about 20px tall; WCAG 2.5.8 wants a 24px
     target. inline-flex lets min-block-size apply to the link itself. */
  display: inline-flex;
  align-items: center;
  min-block-size: 24px;
  color: var(--text-secondary);
  text-decoration: none;
}
.xwui-bar-site-footer__col-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* Newsletter + social row - spans every grid column so it reads as its own
 * band under brand+columns regardless of how many columns are present. */
.xwui-bar-site-footer__extra {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--spacing-lg, 1.5rem);
  margin-top: 0.5rem;
}

.xwui-bar-site-footer__newsletter-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}
.xwui-bar-site-footer__newsletter-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.xwui-bar-site-footer__social {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.xwui-bar-site-footer__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* The 18px icon is the whole link; pad the target out to 24px. */
  min-block-size: 24px;
  min-inline-size: 24px;
  color: var(--text-secondary);
  text-decoration: none;
}
.xwui-bar-site-footer__social-link:hover {
  color: var(--text-primary);
}

.xwui-bar-site-footer__bottom {
  border-top: 1px solid var(--border-light);
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

@media (max-width: 860px) {
  .xwui-bar-site-footer__inner {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .xwui-bar-site-footer__inner {
    grid-template-columns: 1fr;
  }
}
