/*
 * Footer component -- production styles.
 *
 * Structural properties reference only the resolved Stage 2 spacing
 * tokens -- no raw pixel value appears below. Responsive behaviour
 * follows Product Design System §5.19:
 *   - Desktop: multi-column layout (Related, Resources, Legal, Meta).
 *   - Tablet: 2 columns.
 *   - Mobile: single stacked column.
 * No CSS `order` or reverse flex-direction is used anywhere -- columns
 * are achieved purely via flex-wrap on a fixed-order source list, so
 * DOM/source order is identical to reading order at every breakpoint;
 * only the number of items per visual row changes.
 *
 * Colour (Stage 7.5 Visual Parity): dark ink surface with translucent
 * white text -- verbatim legacy `footer{background:var(--ink);
 * color:rgba(255,255,255,.4)}` pattern. Translucent-white opacities
 * are literal legacy values (not a new semantic token -- they are a
 * one-off "text over a dark surface" treatment unique to this
 * component, exactly matching the legacy source itself).
 */

@import url("../../config/tokens/tokens.generated.css");

.sr-footer {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--space-l);
  padding: var(--space-xl) var(--space-l);
  margin-top: var(--space-xxl);
  border-top: 1px solid var(--color-border);
  box-sizing: border-box;
  width: 100%;
  background: var(--color-text-primary); /* legacy footer background = ink */
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-family-body);
  font-size: var(--font-caption-size);
}

.sr-footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color var(--motion-functional-duration) var(--motion-functional-easing);
}

.sr-footer a:hover {
  color: var(--color-surface);
}

.sr-footer__group {
  flex: 1 1 calc(25% - var(--space-l)); /* four columns on wide desktop */
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
}

.sr-footer__group-heading {
  font-weight: var(--font-weight-semibold);
  color: rgba(255, 255, 255, 0.85);
}

.sr-footer__group-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.sr-footer__meta {
  flex: 1 1 calc(25% - var(--space-l));
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  color: rgba(255, 255, 255, 0.4);
}

.sr-footer__sign-out,
.sr-footer__feedback {
  flex: 0 0 auto;
  align-self: flex-start;
  min-height: 44px; /* touch target */
  padding: var(--space-xs) var(--space-s);
  color: rgba(255, 255, 255, 0.7);
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-small);
  cursor: pointer;
  transition: border-color var(--motion-functional-duration) var(--motion-functional-easing);
}

.sr-footer__sign-out:hover,
.sr-footer__feedback:hover {
  border-color: rgba(255, 255, 255, 0.5);
}

.sr-footer__roadmap-disclaimer,
.sr-footer__legal,
.sr-footer__copyright {
  flex: 1 1 100%; /* always full-width -- legal/copyright never share a column with links */
  margin: 0;
  word-break: break-word;
  color: rgba(255, 255, 255, 0.4);
}

/* --- Tablet: roughly two columns ----------------------------------------- */
@media (min-width: 768px) and (max-width: 1023px) {
  .sr-footer__group,
  .sr-footer__meta {
    flex: 1 1 calc(50% - var(--space-l));
  }
}

/* --- Mobile: single stacked column ---------------------------------------- */
@media (max-width: 767px) {
  .sr-footer {
    flex-direction: column;
  }
  .sr-footer__group,
  .sr-footer__meta {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sr-footer a,
  .sr-footer__sign-out,
  .sr-footer__feedback {
    transition: none;
  }
}
