/* ChromaXP — Premium footer (2026) */

.cx-footer {
  position: relative;
  margin-top: 4rem;
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-surface) 12%);
  border-top: 1px solid var(--bg-border);
  overflow: hidden;
}

.cx-footer__accent {
  height: 4px;
  background: linear-gradient(90deg, #2563eb, #7c3aed, #06b6d4, #f59e0b);
  opacity: 1;
}

.cx-footer__inner {
  max-width: 1440px;
  margin-inline: auto;
  padding: 3rem 1.25rem 2rem;
}

/* Top band */
.cx-footer__top {
  display: grid;
  gap: 2rem;
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--bg-border);
}

@media (min-width: 900px) {
  .cx-footer__top {
    /* Put the link columns directly beside brand/share (no narrow sidebar) */
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 3rem;
  }
}

.cx-footer__brand-block {
  max-width: 44rem;
}

.cx-footer__top-links {
  display: grid;
  gap: 1.25rem;
  align-content: start;
}

@media (min-width: 640px) {
  .cx-footer__top-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
  }
}

@media (min-width: 900px) {
  .cx-footer__top-links {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem 1.5rem;
  }
}

@media (min-width: 900px) {
  /* Let the left column breathe on desktop */
  .cx-footer__brand-block {
    max-width: none;
  }
}

.cx-footer__col--compact .cx-footer__heading {
  margin-bottom: 0.5rem;
}

.cx-footer__col--compact .cx-footer__list li {
  margin-bottom: 0.35rem;
}

.cx-footer__col--compact .cx-footer__list a {
  font-size: 0.8125rem;
}

.cx-footer__list-link {
  display: inline;
  padding: 0;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: color 0.15s;
}

.cx-footer__list-link:hover {
  color: #2563eb;
}

.cx-footer__top-kbd {
  margin-left: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  vertical-align: middle;
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  color: var(--text-muted);
}

.cx-footer__logo {
  display: inline-flex;
  margin-bottom: 0.75rem;
}

.cx-footer__tagline {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 1.25rem;
}

.cx-footer__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.cx-footer__trust li {
  padding: 0.3rem 0.65rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: 999px;
}

.cx-footer__social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cx-footer__social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cx-footer__social-btn:hover {
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.15);
}

.cx-footer__icon {
  width: 20px;
  height: 20px;
}

/* Newsletter */
.cx-footer__newsletter {
  padding: 1.35rem 1.5rem;
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

[data-theme='dark'] .cx-footer__newsletter {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.cx-footer__newsletter-title {
  margin: 0 0 0.35rem;
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.cx-footer__newsletter-lead {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.cx-footer__newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 480px) {
  .cx-footer__newsletter-form {
    flex-direction: row;
  }
}

.cx-footer__newsletter-input {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
  font-family: inherit;
  border: 1px solid var(--bg-border);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cx-footer__newsletter-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.cx-footer__newsletter-btn {
  padding: 0.65rem 1.15rem;
  font-size: 0.875rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s;
}

.cx-footer__newsletter-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.cx-footer__newsletter-note {
  margin: 0.65rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cx-footer__newsletter-msg {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #059669;
}

/* Link columns */
.cx-footer__grid {
  display: grid;
  gap: 1.75rem 1.25rem;
  grid-template-columns: repeat(2, 1fr);
  align-items: start;
}

@media (min-width: 640px) {
  .cx-footer__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .cx-footer__grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.cx-footer__heading {
  margin: 0 0 0.85rem;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.cx-footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cx-footer__list li {
  margin-bottom: 0.45rem;
}

.cx-footer__list a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.cx-footer__list a:hover {
  color: #2563eb;
}

/* Share row */
.cx-footer__share {
  margin-top: 2rem;
  padding: 1.15rem 1.25rem;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
}

.cx-footer__share-title {
  display: block;
  margin-bottom: 0.65rem;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.cx-footer__share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cx-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.cx-share-btn--icon {
  width: 42px;
  height: 42px;
  padding: 0;
  justify-content: center;
  gap: 0;
}

.cx-share-btn--icon .cx-share-btn__icon {
  width: 18px;
  height: 18px;
}

.cx-share-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  transform: translateY(-1px);
}

.cx-share-btn__icon {
  width: 16px;
  height: 16px;
}

.cx-share-btn .cx-footer__icon {
  width: 14px;
  height: 14px;
}

/* Bottom bar */
.cx-footer__bottom {
  max-width: 1440px;
  margin-inline: auto;
  padding: 1.5rem 1.25rem 2rem;
  text-align: center;
  border-top: 1px solid var(--bg-border);
}

.cx-footer__legal-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.65rem;
  margin-bottom: 0.85rem;
  font-size: 0.8125rem;
}

.cx-footer__legal-nav a {
  color: var(--text-secondary);
  font-weight: 600;
  text-decoration: none;
}

.cx-footer__legal-nav a:hover {
  color: #2563eb;
}

.cx-footer__dot {
  color: var(--text-muted);
}

.cx-footer__copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.65rem;
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cx-footer__credit-link {
  color: #2563eb;
  text-decoration: none;
  transition: color 0.15s;
}

.cx-footer__credit-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.cx-footer__note {
  margin: 0 auto;
  max-width: 40rem;
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* Back to top */
.cx-back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity 0.25s,
    visibility 0.25s,
    transform 0.25s;
}

.cx-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.cx-back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.5);
}

.cx-back-to-top:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.cx-back-to-top svg {
  width: 22px;
  height: 22px;
}

@media (prefers-reduced-motion: reduce) {
  .cx-back-to-top {
    transition: opacity 0.15s;
  }
}
