/* Footer component, Tonic-inspired three-column spread */

.footer {
  background: var(--surface-elevated);
  color: var(--ink-body);
  padding: var(--sp-9) var(--sp-7) var(--sp-5);
  border-top: 1px solid var(--border-hairline);
}

.footer__inner {
  width: 100%;
  max-width: none;
}

/* --- Top: brand block (logo stacked above editorial paragraph) --- */
.footer__brand-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-6);
  max-width: 600px;
  margin-bottom: var(--sp-8);
}

.footer__brand-logo {
  height: 44px;
  width: auto;
  margin: 0;
  align-self: flex-start;
  display: block;
}

.footer__brand-copy {
  font-family: var(--f-sans);
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-body);
  margin: 0;
  max-width: 64ch;
}

.footer__brand-copy em {
  font-family: var(--f-serif-italic);
  font-style: italic;
  color: var(--ink-heading);
  font-size: 1.05em;
}

/* --- Main row: columns left, social middle, newsletter right --- */
.footer__main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--sp-7);
  align-items: flex-start;
  margin-bottom: var(--sp-8);
}

.footer__columns {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: var(--sp-7);
}

.footer__columns--two { grid-template-columns: repeat(2, auto); }
.footer__columns--four { grid-template-columns: repeat(4, auto); }

.footer__col-title {
  font-family: var(--f-sans);
  font-size: 11px;
  font-weight: var(--w-medium);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 var(--sp-4) 0;
}

.footer__col-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.footer__col-list a {
  font-family: var(--f-sans);
  font-size: 14px;
  color: var(--ink-heading);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer__col-list a:hover {
  color: var(--accent);
}

.footer__social {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  justify-self: center;
  padding-top: 28px;
}

.footer__social a {
  color: var(--ink-mute);
  transition: color 0.2s ease;
  display: inline-flex;
}

.footer__social a:hover {
  color: var(--accent);
}

/* --- Newsletter block, bottom right --- */
.footer__newsletter {
  max-width: 340px;
  justify-self: end;
  text-align: right;
}

.footer__newsletter-heading {
  font-family: var(--f-serif-display);
  font-weight: var(--w-regular);
  font-size: clamp(20px, 1.6vw, 26px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink-heading);
  margin: 0 0 var(--sp-5) 0;
  max-width: 22ch;
  margin-left: auto;
}

.footer__newsletter-heading em {
  font-family: var(--f-serif-italic);
  font-style: italic;
}

.footer__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: var(--accent-on);
  padding: 14px 24px;
  border-radius: var(--r-pill);
  font-family: var(--f-sans);
  font-size: 12px;
  font-weight: var(--w-medium);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s ease;
  margin-bottom: var(--sp-3);
}

.footer__cta:hover {
  background: var(--accent-hover);
}

.footer__cta--ghost {
  background: transparent;
  color: var(--ink-heading);
  border: 1px solid var(--border-hairline);
}

.footer__cta--ghost:hover {
  background: var(--ink-heading);
  color: var(--surface-canvas);
  border-color: var(--ink-heading);
}

.footer__cta svg {
  width: 14px;
  height: 14px;
}

/* --- Bottom bar --- */
.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border-hairline);
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.footer__copyright {
  font-family: var(--f-sans);
  font-size: 12px;
  color: var(--ink-mute);
}

.footer__legal-links {
  display: flex;
  gap: var(--sp-5);
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer__legal-links a {
  font-family: var(--f-sans);
  font-size: 12px;
  color: var(--ink-mute);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer__legal-links a:hover {
  color: var(--ink-heading);
}

/* --- FFM dark variant --- */
[data-brand="ffm"] .footer--dark {
  background: var(--p-charcoal);
  border-top-color: rgba(255, 255, 255, 0.08);
}

[data-brand="ffm"] .footer--dark .footer__brand-copy,
[data-brand="ffm"] .footer--dark .footer__col-list a,
[data-brand="ffm"] .footer--dark .footer__newsletter-heading {
  color: var(--p-oatmeal);
}

[data-brand="ffm"] .footer--dark .footer__brand-copy em {
  color: var(--p-gold-mid);
}

[data-brand="ffm"] .footer--dark .footer__col-title,
[data-brand="ffm"] .footer--dark .footer__copyright,
[data-brand="ffm"] .footer--dark .footer__legal-links a,
[data-brand="ffm"] .footer--dark .footer__social a {
  color: rgba(246, 244, 241, 0.5);
}

[data-brand="ffm"] .footer--dark .footer__bottom {
  border-color: rgba(255, 255, 255, 0.1);
}

[data-brand="ffm"] .footer--dark .footer__brand-logo {
  filter: brightness(0) invert(1);
}

[data-brand="ffm"] .footer--dark .footer__cta--ghost {
  color: var(--p-oatmeal);
  border-color: rgba(255, 255, 255, 0.2);
}

[data-brand="ffm"] .footer--dark .footer__cta--ghost:hover {
  background: var(--p-oatmeal);
  color: var(--p-charcoal);
}

/* --- Responsive --- */
@media (max-width: 960px) {
  .footer {
    padding: var(--sp-8) var(--sp-5) var(--sp-5);
  }
  .footer__brand-row {
    grid-template-columns: 1fr;
    gap: var(--sp-5);
  }
  .footer__main {
    grid-template-columns: 1fr;
    gap: var(--sp-7);
  }
  .footer__columns {
    gap: var(--sp-6);
  }
  .footer__social {
    justify-self: flex-start;
    padding-top: 0;
  }
  .footer__newsletter {
    justify-self: flex-start;
    text-align: left;
    max-width: 100%;
  }
  .footer__newsletter-heading {
    margin-left: 0;
  }
  .footer__bottom {
    justify-content: center;
    text-align: center;
  }
  .footer__legal-links {
    flex-basis: 100%;
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .footer__columns {
    grid-template-columns: 1fr 1fr;
  }
  .footer__columns--two,
  .footer__columns--four {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 400px) {
  .footer__columns,
  .footer__columns--two,
  .footer__columns--four {
    grid-template-columns: 1fr;
  }
}
