/*
 * Estilos base de Distrito 360. Propshaft carga todos los archivos de esta carpeta
 * en orden alfabético, así que los tokens definidos aquí están disponibles en el resto.
 */

:root {
  /* Paleta de marca Distrito 360: usar solo estos colores (y sus transparencias) */
  --color-verde-bosque: #044537;  /* Color dominante: sobriedad, solidez institucional */
  --color-verde-vital: #8ec045;   /* Acento y energía: el diferenciador visual */
  --color-aurora: #f4ede5;        /* Aurora Pálida: fondo cálido, contraste suave */
  --color-negro: #000000;         /* Textos principales y contraste fuerte */
  --color-gris: #cccccc;          /* Textos secundarios (sobre fondos oscuros) y elementos de apoyo */
  --color-blanco: #ffffff;        /* Espacio y claridad */

  /* Usos derivados de la paleta */
  --color-text-muted: rgba(0, 0, 0, 0.6);          /* Negro 60%: texto secundario sobre fondos claros */
  --color-border: var(--color-gris);
  --color-border-inverse: rgba(255, 255, 255, 0.12);

  --font-display: "Sofia Sans", system-ui, sans-serif;
  --font-body: "Roboto", system-ui, sans-serif;

  --container: 1240px;
  --gutter: 24px;
  --navbar-height: 86px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Los enlaces a secciones (#contacto) no quedan tapados por el navbar fijo */
  scroll-padding-top: var(--navbar-height);
}

body {
  margin: 0;
  background: var(--color-blanco);
  color: var(--color-verde-bosque);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ol, ul, address {
  margin: 0;
}

ol, ul {
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
}

/* El atributo hidden debe ganar aunque la clase defina display */
[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(var(--container), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

/* Eyebrow: etiqueta en mayúsculas con línea verde */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-verde-bosque);
}

.eyebrow::after {
  content: "";
  width: 44px;
  height: 1px;
  background: var(--color-verde-vital);
}

.eyebrow--light {
  font-weight: 600;
  color: var(--color-blanco);
}

.eyebrow--light::after {
  width: 48px;
  height: 2px;
}

.eyebrow--muted {
  color: var(--color-text-muted);
  letter-spacing: 2px;
}

.eyebrow--muted::after {
  width: 48px;
}

.eyebrow--plain {
  font-weight: 400;
  color: var(--color-negro);
}

.eyebrow--short {
  gap: 8px;
  letter-spacing: 1px;
}

.eyebrow--short::after {
  width: 24px;
  height: 2px;
}

.eyebrow--strong {
  font-size: 13px;
  letter-spacing: 1.5px;
}

.eyebrow--light.eyebrow--strong {
  font-weight: 800;
}

.eyebrow--light.eyebrow--plain {
  color: var(--color-blanco);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw + 16px, 52px);
  font-weight: 600;
  line-height: 1.1;
  color: var(--color-verde-bosque);
}

.section-title--dark {
  color: var(--color-negro);
}

.text-accent {
  color: var(--color-verde-vital);
}

/* Migas de pan */
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--color-gris);
}

.breadcrumbs a {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.breadcrumbs a:hover {
  color: var(--color-verde-bosque);
  text-decoration-color: currentColor;
}

.breadcrumbs [aria-current] {
  font-weight: 500;
  color: var(--color-negro);
}

.breadcrumbs--light ol,
.breadcrumbs--light [aria-current] {
  color: var(--color-gris);
}

.breadcrumbs--light [aria-current] {
  color: var(--color-blanco);
}

.breadcrumbs--light a:hover {
  color: var(--color-verde-vital);
}

/* Enlace con flecha (p. ej. "Ver todos los proyectos") */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--color-verde-vital);
}

.link-arrow::after {
  content: "→";
  transition: transform 0.2s ease;
}

.link-arrow:hover::after {
  transform: translateX(4px);
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease, filter 0.2s ease;
}

.btn--ghost {
  width: min(280px, 100%);
  padding: 16px 28px;
  border: 1px solid rgba(142, 192, 69, 0.2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-blanco);
}

.btn--ghost:hover {
  background: rgba(0, 0, 0, 0.7);
}

.btn--primary {
  padding: 12px 24px;
  border-radius: 8px;
  background: var(--color-verde-vital);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-verde-bosque);
}

.btn--primary:hover,
.btn--submit:hover {
  filter: brightness(1.08);
}

.btn--dark {
  width: min(280px, 100%);
  height: 40px;
  padding: 0 28px;
  border: 1px solid rgba(142, 192, 69, 0.2);
  border-radius: 8px;
  background: var(--color-verde-bosque);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-blanco);
}

.btn--dark:hover {
  filter: brightness(1.2);
}

.btn--block {
  width: 100%;
}

/* Navbar — Figma navbar2 (266:111) */
/* Fijo arriba al hacer scroll */
.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px max(100px, (100% - var(--container)) / 2);
  background: var(--color-negro);
}

.navbar__logo {
  flex-shrink: 0;
  width: 295px;
  height: 54px;
}

.navbar__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.navbar__links {
  display: flex;
  flex: 0 1 676px;
  align-items: center;
  justify-content: center;
  gap: 35px;
}

.navbar__link {
  border-bottom: 2px solid transparent;
  font-family: var(--font-display);
  font-size: 20px;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--color-blanco);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.navbar__link:hover {
  color: var(--color-verde-vital);
}

.navbar__link.is-active {
  border-bottom-color: var(--color-verde-vital);
  font-weight: 700;
  color: var(--color-verde-vital);
}

/* Botón hamburguesa (solo móvil/tablet) */
.navbar__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.navbar__toggle-bar {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--color-blanco);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.navbar.is-open .navbar__toggle-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.navbar.is-open .navbar__toggle-bar:nth-child(2) {
  opacity: 0;
}

.navbar.is-open .navbar__toggle-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Transiciones entre páginas (Turbo + View Transitions API) */
/* El navbar queda fijo; solo el contenido hace un fundido con un leve ascenso. */
.navbar {
  view-transition-name: navbar;
}

::view-transition-old(root) {
  animation: page-fade-out 160ms ease-in both;
}

::view-transition-new(root) {
  animation: page-fade-in 380ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes page-fade-out {
  to {
    opacity: 0;
  }
}

@keyframes page-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* Primera carga: el contenido entra con el mismo efecto (el navbar aparece fijo desde el inicio) */
html:not([data-navigated]) body > main,
html:not([data-navigated]) body > .site-footer {
  animation: page-fade-in 600ms cubic-bezier(0.2, 0.7, 0.2, 1) 80ms both;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*),
  html body > main,
  html body > .site-footer,
  .lightbox[open],
  .lightbox[open]::backdrop {
    animation: none !important;
  }
}

/* Barra de carga de Turbo (aparece si una página tarda) con el color de la marca */
.turbo-progress-bar {
  height: 3px;
  background-color: var(--color-verde-vital);
}

/* Footer */
.site-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  padding-block: 40px;
  padding-inline: max(99px, (100% - var(--container)) / 2) max(40px, (100% - 1360px) / 2);
  border-top: 1px solid var(--color-border);
  background: var(--color-blanco);
  color: var(--color-verde-bosque);
  font-size: 14px;
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 400px;
}

.site-footer__logo {
  position: relative;
  width: 206px;
  height: 38px;
  overflow: hidden;
}

.site-footer__logo img {
  position: absolute;
  top: -0.41%;
  left: -4.32%;
  width: 100%;
  height: 126.64%;
  max-width: none;
}

.site-footer__brand p {
  font-weight: 500;
  line-height: 1.5;
  opacity: 0.8;
}

.site-footer__col {
  display: flex;
  flex: 0 1 300px;
  flex-direction: column;
  gap: 16px;
}

.site-footer__col--narrow {
  flex-basis: 200px;
}

.site-footer__title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

.site-footer__contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-footer__email {
  font-weight: 600;
}

.site-footer address {
  font-style: normal;
  opacity: 0.8;
}

.site-footer__legal {
  margin-top: 8px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: normal;
}

.site-footer__legal:hover {
  color: var(--color-verde-bosque);
}

.site-footer__social {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.site-footer__social span {
  opacity: 0.8;
}

@media (max-width: 1200px) {
  .navbar {
    padding-inline: 40px;
  }

  .navbar__logo {
    width: 220px;
    height: 40px;
  }

  .navbar__links {
    gap: 24px;
  }

  .site-footer {
    padding-inline: 40px;
  }
}

@media (max-width: 960px) {
  :root {
    --navbar-height: 68px;
  }

  .navbar {
    padding: 12px 40px;
  }

  .navbar__toggle {
    display: flex;
  }

  /* Panel desplegable bajo la barra */
  .navbar__links {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 40px 24px;
    border-top: 1px solid var(--color-border-inverse);
    background: var(--color-negro);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  }

  .navbar.is-open .navbar__links {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .navbar__link {
    padding: 16px 0;
    border-bottom: 1px solid var(--color-border-inverse);
  }

  .navbar__link:last-child {
    border-bottom: 0;
  }

  .navbar__link.is-active {
    border-bottom-color: var(--color-border-inverse);
    box-shadow: inset 3px 0 0 var(--color-verde-vital);
    padding-left: 14px;
  }

  .site-footer {
    flex-direction: column;
    padding: 40px var(--gutter);
  }

  .site-footer__col,
  .site-footer__col--narrow {
    flex: none;
  }
}

@media (max-width: 560px) {
  .navbar {
    gap: 12px;
    padding-inline: var(--gutter);
  }

  .navbar__logo {
    width: 180px;
    height: 34px;
  }

  .navbar__links {
    padding-inline: var(--gutter);
  }

  .navbar__link {
    font-size: 18px;
  }
}
