/* ================================================================
   TERRITÓRIO MLS — Editorial Footer
   SEO hub · Navigation fallback · Brand trust layer
   Mobile-first. CSS-only accordion. No JS dependencies.
   ================================================================ */

/* ── Scoped reset ── */
.tmls-footer *,
.tmls-footer *::before,
.tmls-footer *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.tmls-footer {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.tmls-footer a {
  text-decoration: none;
  transition: color 0.2s ease;
}

.tmls-footer ul {
  list-style: none;
}

/* ── Container ── */
.tmls-footer__container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ================================================================
   NEWSLETTER CTA
   ================================================================ */
.tmls-footer__newsletter {
  background: #161a1f;
  padding: 40px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tmls-footer__newsletter .tmls-footer__container {
  text-align: center;
}

.tmls-footer__newsletter-heading {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
  line-height: 1.4;
}

.tmls-footer__newsletter-form {
  display: flex;
  gap: 8px;
  max-width: 440px;
  margin: 0 auto;
}

.tmls-footer__newsletter-input {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s;
}

.tmls-footer__newsletter-input::placeholder {
  color: #6b7280;
}

.tmls-footer__newsletter-input:focus {
  border-color: #4da3ff;
}

.tmls-footer__newsletter-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #0f1115;
  background: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.tmls-footer__newsletter-btn:hover {
  background: #e5e7eb;
}

/* ================================================================
   MAIN FOOTER GRID
   ================================================================ */
.tmls-footer__main {
  background: #0f1115;
  padding: 48px 0 40px;
}

.tmls-footer__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 32px;
}

/* ── Column ── */
.tmls-footer__col {
  min-width: 0;
}

/* ── Headings ── */
.tmls-footer__heading {
  margin-bottom: 14px;
}

.tmls-footer__toggle {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  cursor: default;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.4;
}

/* Chevron hidden on desktop */
.tmls-footer__chevron {
  display: none;
}

/* ── Links ── */
.tmls-footer__links li {
  margin-bottom: 2px;
}

.tmls-footer__links a {
  display: inline-block;
  font-size: 13px;
  line-height: 1.8;
  color: #d1d5db;
}

.tmls-footer__links a:hover {
  color: #4da3ff;
}

/* ── See all ── */
.tmls-footer__see-all {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #4da3ff;
  letter-spacing: 0.02em;
}

.tmls-footer__see-all:hover {
  color: #79bcff;
}

/* ================================================================
   BOTTOM BAR
   ================================================================ */
.tmls-footer__bottom {
  background: #0a0c0f;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tmls-footer__bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.tmls-footer__copyright {
  font-size: 12px;
  color: #6b7280;
}

.tmls-footer__legal {
  display: flex;
  gap: 20px;
}

.tmls-footer__legal a {
  font-size: 12px;
  color: #6b7280;
}

.tmls-footer__legal a:hover {
  color: #d1d5db;
}

/* ================================================================
   TABLET — 2-column collapse
   ================================================================ */
@media (max-width: 1024px) {
  .tmls-footer__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 28px 24px;
  }
}

/* ================================================================
   MOBILE — Accordion
   ================================================================ */
@media (max-width: 640px) {

  .tmls-footer__newsletter-heading {
    font-size: 16px;
  }

  .tmls-footer__newsletter-form {
    flex-direction: column;
  }

  .tmls-footer__grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .tmls-footer__col {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .tmls-footer__col:last-child {
    border-bottom: none;
  }

  /* Toggle becomes interactive */
  .tmls-footer__toggle {
    cursor: pointer;
    padding: 14px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
  }

  .tmls-footer__heading {
    margin-bottom: 0;
  }

  .tmls-footer__chevron {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-right: 2px solid #6b7280;
    border-bottom: 2px solid #6b7280;
    transform: rotate(45deg);
    transition: transform 0.25s ease;
    flex-shrink: 0;
  }

  .tmls-footer__toggle[aria-expanded="true"] .tmls-footer__chevron {
    transform: rotate(-135deg);
  }

  /* Collapse links by default */
  .tmls-footer__links,
  .tmls-footer__see-all {
    display: none;
  }

  .tmls-footer__toggle[aria-expanded="true"] ~ .tmls-footer__links,
  .tmls-footer__toggle[aria-expanded="true"] ~ .tmls-footer__see-all {
    display: block;
    padding-bottom: 14px;
  }

  /* Bottom bar stack */
  .tmls-footer__bottom-inner {
    flex-direction: column;
    text-align: center;
  }

  .tmls-footer__legal {
    justify-content: center;
  }
}

/* ================================================================
   GENERATEPRESS OVERRIDES
   Hide GP default footer when our footer is present.
   ================================================================ */
.tmls-footer ~ .site-footer,
body:has(.tmls-footer) .site-info {
  display: none !important;
}

/* Ensure no double spacing from GP content container */
body:has(.tmls-footer) .site-content {
  padding-bottom: 0;
}
