/*
  Continental Media — global footer styles.
  Namespaced under .cm-footer. Depends on assets/css/tokens.css.
  See footer.html for the full direction-contract comment.

  Contrast (verified, WCAG AA, against --cm-color-bg #0a0b0d):
    - nav/contact links, white at 82% opacity      -> 13.15:1
    - tagline, white at 70% opacity                -> 9.71:1
    - column titles / copyright, white at 50%      -> 5.33:1
    - --cm-blue-500 hover accent (same choice as
      testimonials/case-study's own dark-ground accent) -> 5.11:1
  All comfortably clear of the 4.5:1 floor for normal text.
*/

.cm-footer {
  background: var(--cm-color-bg);
  color: var(--cm-color-fg);
  font-family: var(--cm-font-body);
  font-size: 0.9375rem;
}

.cm-footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(3.5rem, 8vh, 5.5rem) var(--cm-gutter) clamp(2rem, 5vh, 3rem);
}

/* ---------- Closing CTA band ---------- */

.cm-footer__cta {
  max-width: 640px;
  margin: 0 0 clamp(2.5rem, 6vh, 3.5rem);
}

.cm-footer__cta-eyebrow {
  margin: 0 0 0.9em;
  font-family: var(--cm-font-body);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.cm-footer__cta-title {
  margin: 0 0 1.75rem;
  font-family: var(--cm-font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.cm-footer__cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--cm-font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  color: var(--cm-color-on-accent);
  background: var(--cm-color-accent);
  border: 1.5px solid var(--cm-color-accent);
  border-radius: var(--cm-radius-sm);
  padding: 0.95em 1.5em;
  text-decoration: none;
  transition:
    background-color var(--cm-duration-fast) var(--cm-ease-out),
    border-color var(--cm-duration-fast) var(--cm-ease-out),
    transform var(--cm-duration-fast) var(--cm-ease-out);
}

.cm-footer__cta-arrow {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--cm-duration-fast) var(--cm-ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .cm-footer__cta-button:hover {
    background: var(--cm-color-accent-hover);
    border-color: var(--cm-color-accent-hover);
  }

  .cm-footer__cta-button:hover .cm-footer__cta-arrow {
    transform: translate(2px, -2px);
  }
}

.cm-footer__cta-button:focus-visible {
  outline: 2px solid var(--cm-color-fg);
  outline-offset: 3px;
}

.cm-footer__cta-button:active {
  transform: translateY(1px);
}

@media (prefers-reduced-motion: reduce) {
  .cm-footer__cta-button:hover .cm-footer__cta-arrow {
    transform: none;
  }
}

.cm-footer__divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
  margin-bottom: clamp(2.5rem, 6vh, 3.5rem);
}

/* ---------- Column grid ---------- */

.cm-footer__grid {
  display: grid;
  grid-template-columns: minmax(200px, 1.15fr) repeat(4, minmax(120px, 1fr));
  gap: clamp(1.75rem, 3.5vw, 3rem);
}

.cm-footer__col-title {
  margin: 0 0 1.1rem;
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.cm-footer__link-list,
.cm-footer__contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cm-footer__link-list a,
.cm-footer__contact-list a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  overflow-wrap: break-word;
  transition: color var(--cm-duration-fast) var(--cm-ease-out);
}

.cm-footer__link-list a:hover,
.cm-footer__contact-list a:hover {
  color: var(--cm-blue-500);
}

.cm-footer__link-list a:focus-visible,
.cm-footer__contact-list a:focus-visible,
.cm-footer__logo-link:focus-visible {
  outline: 2px solid var(--cm-blue-500);
  outline-offset: 3px;
}

/* "Ver todos los proyectos" — the one list item that leaves its column
   (Proyectos recientes names 3 deep links, this one points at the
   /proyectos index itself), so it carries its own small arrow affordance
   and a bolder weight rather than reading as a 4th sibling project. */
.cm-footer__link-list-more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

.cm-footer__link-list-more-arrow {
  flex: none;
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--cm-duration-fast) var(--cm-ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .cm-footer__link-list-more:hover .cm-footer__link-list-more-arrow {
    transform: translate(1px, -1px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cm-footer__link-list-more:hover .cm-footer__link-list-more-arrow {
    transform: none;
  }
}

/* ---------- Column 1 — Identidad ---------- */

.cm-footer__col--identity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.cm-footer__logo-link {
  display: inline-block;
  line-height: 0;
  /* No visible text here (an <img>-only link), but set explicitly so
     the browser's default :visited color never has anything to apply —
     see craft-floor's "theme browser default surfaces" note. */
  color: var(--cm-color-fg);
}

.cm-footer__logo {
  display: block;
  height: 44px;
  width: auto;
}

.cm-footer__tagline {
  margin: 1.1rem 0 0;
  max-width: 26ch;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}

/* ---------- Column 4 — Contacto (contact links + social icons) ---------- */

.cm-footer__contact-list {
  margin-bottom: 1.5rem;
}

.cm-footer__social-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1rem;
}

.cm-footer__social-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: rgba(255, 255, 255, 0.7);
  transition:
    color var(--cm-duration-fast) var(--cm-ease-out),
    transform var(--cm-duration-fast) var(--cm-ease-out);
}

.cm-footer__social-list svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cm-footer__social-dot {
  fill: currentColor;
  stroke: none;
}

@media (hover: hover) and (pointer: fine) {
  .cm-footer__social-list a:hover {
    color: var(--cm-blue-500);
    transform: scale(1.1);
  }
}

.cm-footer__social-list a:focus-visible {
  outline: 2px solid var(--cm-blue-500);
  outline-offset: 3px;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .cm-footer__social-list a:hover {
    transform: none;
  }
}

/* ---------- Bottom bar ---------- */

.cm-footer__bottom {
  margin-top: clamp(2.5rem, 6vh, 3.5rem);
  padding-top: clamp(1.5rem, 4vh, 2rem);
  border-top: 0.5px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.cm-footer__copyright {
  margin: 0;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
}

.cm-footer__legal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
}

.cm-footer__legal-list a {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color var(--cm-duration-fast) var(--cm-ease-out);
}

.cm-footer__legal-list a:hover {
  color: var(--cm-blue-500);
}

.cm-footer__legal-list a:focus-visible {
  outline: 2px solid var(--cm-blue-500);
  outline-offset: 3px;
}

/* ---------- Responsive ---------- */
/* 5 columns -> identity (full width) + 2x2 -> 1 column, always in
   source order (Identidad, Sitio, Servicios, Proyectos recientes,
   Contacto), per the brief's explicit ordering. */

@media (max-width: 860px) {
  .cm-footer__grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: clamp(2.25rem, 6vw, 3rem);
  }

  .cm-footer__col--identity {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .cm-footer__grid {
    grid-template-columns: 1fr;
  }

  .cm-footer__bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .cm-footer__legal-list {
    justify-content: center;
  }
}
