/* Footer styles shared by every shell.js consumer.
 * shared.css imports this file; standalone pricing pages link it directly.
 * Page-specific framing stays here so spacing and responsive rules have one owner.
 * Requires the page's theme variables, body font, border-box reset, and base
 * .brand/.brand-logo rules (provided by shared.css or pricing's page styles).
 * Markup: .site-footer > .container > .footer-grid contains the four link
 * columns and .footer-brand-col. The container anchors the standard logo;
 * the home AI variant positions it against .footer-grid instead.
 */

.site-footer .brand {
  width: 98px;
  min-width: 98px;
  height: 32px;
}

.site-footer .brand-logo { width: 98px; }

.site-footer {
  position: relative;
  border-top: 0;
  padding: 0 0 58px;
  color: var(--muted);
  margin-top: 96px;
  background: #fff;
}

body[data-page="leaderboard"] .site-footer,
body[data-page="blog"] .site-footer,
body[data-page="home"] .site-footer,
body[data-page="login"] .site-footer,
body[data-page="changelog"] .site-footer,
body[data-page="privacy"] .site-footer {
  margin-top: 0;
  padding-top: 32px;
}

.site-footer > .container {
  position: relative;
  width: min(100%, var(--container));
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.site-footer::before {
  content: "";
  position: absolute;
  left: var(--gutter, 48px);
  right: var(--gutter, 48px);
  top: 0;
  height: 1px;
  background: rgba(0,0,0,.06);
  pointer-events: none;
}

.site-footer--with-ai-ask::before { content: none; }

.footer-grid {
  display: grid;
  grid-template-columns: minmax(176px, 216px) repeat(3, minmax(112px, 132px));
  column-gap: clamp(40px, calc(10vw - 55px), 89px);
  row-gap: 32px;
  padding-top: 28px;
  justify-content: start;
  align-items: start;
}

.footer-col-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

.footer-col-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col-links a {
  display: block;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.footer-col-links a:hover { color: var(--olive-dark); }

.footer-subsection {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgba(0, 0, 0, .06);
}

.footer-brand-col {
  position: absolute;
  right: 0;
  bottom: 58px;
}

.site-footer--with-ai-ask .footer-grid {
  position: relative;
  padding-top: 40px;
}

.site-footer--with-ai-ask .footer-brand-col {
  top: 40px;
  bottom: auto;
}

.site-footer .brand { margin-bottom: 28px; }

.footer-ai-ask {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 24px 0 28px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.footer-ai-ask__label {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.footer-ai-ask__providers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.footer-ai-ask__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  transition: color .15s ease, transform .15s ease;
}

.footer-ai-ask__link::before {
  content: "";
  position: absolute;
  inset: 2px;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: background-color .15s ease, border-color .15s ease;
}

.footer-ai-ask__link:hover {
  color: var(--olive-dark);
  transform: translateY(-1px);
}

.footer-ai-ask__link:hover::before {
  background: var(--olive-soft);
  border-color: rgba(119, 134, 71, .3);
}

.footer-ai-ask__link:active { transform: translateY(0); }

.site-footer .footer-ai-ask__link:focus-visible { outline-offset: 0; }

.footer-ai-ask__link svg {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.footer-ai-ask__link .footer-ai-ask__icon--chatgpt {
  width: 24px;
  height: 24px;
}

.footer-legal {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(0,0,0,.06);
}

.footer-legal p {
  margin: 0;
  color: var(--soft);
  font-size: 12.5px;
  line-height: 1.45;
}

@media (max-width: 920px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 24px; }
  .footer-brand-col { display: none; }
}

@media (max-width: 560px) {
  .site-footer { padding-bottom: 38px; }
  .footer-grid {
    width: min(100%, 260px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 20px;
  }
  .footer-col-links a { font-size: 12.5px; }
  .footer-subsection {
    margin-top: 22px;
    padding-top: 18px;
  }
  .footer-ai-ask {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 22px 0 24px;
  }
  .site-footer--with-ai-ask .footer-grid { padding-top: 32px; }
}

/* Focus must also work on pages that do not load shared.css. */
.site-footer a:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 3px;
}

/* Pricing keeps its existing page framing and inherited 1.6 line height.
 * Its content container is narrower than the footer, so do not inherit it.
 * These overrides also preserve its mobile 56px bottom padding and 13px links.
 */
body[data-page="pricing"] .site-footer {
  margin-top: 0;
  padding: 32px 0 56px;
}
body[data-page="pricing"] .site-footer::before {
  left: 0;
  right: 0;
}
body[data-page="pricing"] .site-footer > .container {
  width: min(1152px, calc(100vw - 48px));
  max-width: none;
  padding: 0;
}
body[data-page="pricing"] .footer-grid { padding-top: 0; }
body[data-page="pricing"] .footer-col-links a {
  font-size: 13px;
  line-height: inherit;
}
body[data-page="pricing"] .site-footer .brand-logo { transform: none; }
