/* ============================================================
   SECTIONS.CSS — Servicios, Proceso, Normativa, Porqué, Contacto
   permisosmunicipales.cl
   ============================================================ */


/* ══════════════════════════════════════
   SERVICIOS
   ══════════════════════════════════════ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5px;
  background: var(--gris-12);
  border: 1.5px solid var(--gris-12);
}

.service-card {
  background: var(--white);
  padding: 2.5rem 2rem;
  position: relative;
  transition: background .2s;
  cursor: default;
}
.service-card:hover               { background: var(--bg-alt); }
.service-card:hover .service-icon { color: var(--verde); }

.service-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gray-lt);
  margin-bottom: 1rem;
}
.service-icon {
  font-size: 1.8rem; margin-bottom: 1rem;
  color: var(--gris-md);
  transition: color .2s;
}
.service-card h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.35rem; color: var(--gris-dk);
  margin-bottom: 0.6rem; line-height: 1.3;
}
.service-card p {
  font-size: 0.97rem; color: var(--gray);
  line-height: 1.65;
}
.service-ref {
  margin-top: 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem; color: var(--verde);
  letter-spacing: 0.08em;
}


/* ══════════════════════════════════════
   PROCESO
   ══════════════════════════════════════ */
.proceso-track {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 920px;
  margin: 0 auto;
}

.proceso-step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 1.5rem;
  padding-bottom: 3rem;
}
.proceso-step:last-child { padding-bottom: 0; }

.step-spine {
  display: flex; flex-direction: column; align-items: center;
}
.step-dot {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--gris);
  border: 2px solid var(--verde);
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem; font-weight: 500;
  color: var(--verde-lt);
  flex-shrink: 0;
}
.step-line {
  width: 1px; flex: 1;
  background: linear-gradient(to bottom, var(--verde), rgba(0,178,134,0.1));
  min-height: 2rem; margin-top: 4px;
}
.proceso-step:last-child .step-line { display: none; }

.step-content { padding-top: 0.5rem; }
.step-content h4 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.4rem; color: var(--gris-dk);
  margin-bottom: 0.5rem;
}
.step-content p {
  font-size: 1.05rem; color: var(--gray); line-height: 1.7;
}
.step-norm {
  margin-top: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem; color: var(--verde);
  letter-spacing: 0.08em;
}


/* ══════════════════════════════════════
   NORMATIVA
   ══════════════════════════════════════ */
.normativa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.norm-card {
  border: 1px solid rgba(97,97,97,0.18);
  padding: 2rem; border-radius: 2px;
  position: relative;
  transition: border-color .2s, box-shadow .2s;
}
.norm-card:hover {
  border-color: var(--verde);
  box-shadow: 0 4px 24px var(--verde-10);
}
.norm-card::before {
  content: attr(data-code);
  position: absolute; top: 1.25rem; right: 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem; color: var(--gray-lt);
  letter-spacing: 0.1em;
}
.norm-badge {
  display: inline-block;
  background: var(--gris-dk);
  color: var(--verde-lt);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem; letter-spacing: 0.1em;
  padding: 0.2rem 0.55rem; border-radius: 2px;
  margin-bottom: 0.5rem;
}
.norm-card h4 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.05rem; color: var(--gris-dk);
  margin-bottom: 0.6rem; margin-top: 1rem;
}
.norm-card p {
  font-size: 0.83rem; color: var(--gray); line-height: 1.6;
}


/* ══════════════════════════════════════
   POR QUÉ ELEGIRNOS
   ══════════════════════════════════════ */
.porque-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem; align-items: start;
}

.porque-list {
  list-style: none;
  display: flex; flex-direction: column; gap: 2rem;
}
.porque-item {
  display: flex; gap: 1.25rem; align-items: flex-start;
}
.porque-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem; color: var(--verde);
  letter-spacing: 0.1em; padding-top: 0.15rem;
  flex-shrink: 0; width: 32px;
}
.porque-item h4 {
  font-size: 0.95rem; font-weight: 600;
  color: var(--gris-dk); margin-bottom: 0.3rem;
}
.porque-item p {
  font-size: 0.83rem; color: var(--gray); line-height: 1.6;
}

/* Panel comunas */
.comunas-panel {
  background: var(--gris-dk);
  padding: 2.5rem; border-radius: 2px;
}
.comunas-panel h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem; color: var(--verde-lt);
  letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.comunas-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.comuna-tag {
  background: var(--verde-10);
  border: 1px solid var(--verde-25);
  color: rgba(248,249,250,0.8);
  font-size: 0.75rem; padding: 0.3rem 0.75rem;
  border-radius: 2px;
}
.comunas-note {
  margin-top: 1.5rem;
  font-size: 0.78rem; color: var(--gray-lt); line-height: 1.6;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.07);
}

@media (max-width: 768px) {
  .porque-layout { grid-template-columns: 1fr; gap: 2.5rem; }
}


/* ══════════════════════════════════════
   CONTACTO
   ══════════════════════════════════════ */
.contacto-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 5rem; align-items: start;
}

.contacto-info h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.8rem; color: var(--white);
  margin-bottom: 1rem;
}
.contacto-info p {
  font-size: 0.9rem; color: rgba(248,249,250,0.65);
  line-height: 1.7; margin-bottom: 2rem;
}
.contacto-detail { display: flex; flex-direction: column; gap: 1rem; }
.c-detail-item   { display: flex; gap: 0.75rem; align-items: flex-start; }
.c-detail-icon   { font-size: 1rem; flex-shrink: 0; margin-top: 0.1rem; }
.c-detail-text {
  font-size: 0.83rem; color: rgba(248,249,250,0.7); line-height: 1.5;
}
.c-detail-text strong {
  display: block; color: var(--white);
  font-weight: 500; font-size: 0.85rem;
}

/* Formulario */
.contacto-form {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--verde-20);
  padding: 2.5rem; border-radius: 2px;
}

.form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  margin-bottom: 1rem;
}
.form-group {
  display: flex; flex-direction: column; gap: 0.4rem;
  margin-bottom: 1rem;
}
.form-group:last-of-type { margin-bottom: 0; }

label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem; color: var(--gray-lt);
  letter-spacing: 0.1em; text-transform: uppercase;
}

input, select, textarea {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--white);
  padding: 0.75rem 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem; border-radius: 2px;
  outline: none; transition: border-color .2s; width: 100%;
}
input::placeholder, textarea::placeholder { color: rgba(255,255,255,0.25); }
input:focus, select:focus, textarea:focus  { border-color: var(--verde); }
select option { background: var(--gris); color: var(--white); }
textarea      { resize: vertical; min-height: 100px; }

.form-submit {
  margin-top: 1.5rem; width: 100%;
  background: var(--verde); color: var(--white);
  padding: 0.95rem; border: none; cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  border-radius: 2px; transition: background .2s;
}
.form-submit:hover { background: var(--verde-lt); color: var(--gris-dk); }

@media (max-width: 768px) {
  .contacto-layout { grid-template-columns: 1fr; gap: 2.5rem; }
  .form-row        { grid-template-columns: 1fr; }
}


/* ══════════════════════════════════════
   PROYECTOS
   ══════════════════════════════════════ */
.proyectos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5px;
  background: var(--gris-12);
  border: 1.5px solid var(--gris-12);
}

.proyecto-card {
  position: relative;
  background: var(--gris-dk);
  overflow: hidden;
  aspect-ratio: 4/3;
  display: block;
  text-decoration: none;
  cursor: pointer;
}

/* Fallback cuando no hay imagen cargada */
.proyecto-card img[src=""] ,
.proyecto-card img:not([src]) {
  display: none;
}

.proyecto-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease, filter .4s ease;
  filter: grayscale(20%);
}

.proyecto-card:hover img {
  transform: scale(1.04);
  filter: grayscale(0%);
}

.proyecto-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(58,58,58,0.92) 0%, rgba(58,58,58,0.1) 55%, transparent 100%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.5rem;
  transition: background .3s;
}
.proyecto-card:hover .proyecto-overlay {
  background: linear-gradient(to top, rgba(0,178,134,0.88) 0%, rgba(0,178,134,0.15) 60%, transparent 100%);
}

.proyecto-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem; letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--verde-lt);
  margin-bottom: 0.3rem;
  transition: color .3s;
}
.proyecto-card:hover .proyecto-tag { color: rgba(255,255,255,0.75); }

.proyecto-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1rem; color: #fff;
  line-height: 1.25; margin-bottom: 0.5rem;
}

.proyecto-pdf-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem; letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.0);
  transition: color .3s;
  margin-top: 0.1rem;
}
.proyecto-pdf-btn::before {
  content: '↓';
  font-size: 0.75rem;
}
.proyecto-card:hover .proyecto-pdf-btn {
  color: rgba(255,255,255,0.9);
}

/* Placeholder si no hay imagen */
.proyecto-card--placeholder {
  background: var(--gris-md);
  display: flex; align-items: center; justify-content: center;
}
.proyecto-placeholder-icon {
  font-size: 2.5rem; opacity: 0.2;
}

/* Overlay siempre visible aunque no haya foto */
.proyecto-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(58,58,58,0.92) 0%, rgba(58,58,58,0.1) 55%, transparent 100%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.5rem;
  transition: background .3s;
}
/* Sin imagen: fondo completo para que el texto sea legible */
.proyecto-card:not(:has(img[complete])) .proyecto-overlay,
.proyecto-card .proyecto-overlay {
  background: linear-gradient(to top, rgba(58,58,58,0.95) 0%, rgba(58,58,58,0.4) 100%);
}

@media (max-width: 900px) {
  .proyectos-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 550px) {
  .proyectos-grid { grid-template-columns: 1fr; }
  .proyecto-card  { aspect-ratio: 16/9; }
}


/* ══════════════════════════════════════
   MOBILE — fixes generales secciones
   ══════════════════════════════════════ */
@media (max-width: 480px) {

  /* Servicios: 1 columna */
  .services-grid { grid-template-columns: 1fr; }
  .service-card { padding: 1.75rem 1.25rem; }
  .service-card h3 { font-size: 1.1rem; }
  .service-card p  { font-size: 0.85rem; }

  /* Proceso: reducir gap */
  .proceso-step { gap: 1rem; }
  .step-dot { width: 34px; height: 34px; font-size: 0.68rem; }
  .step-content h4 { font-size: 1.1rem; }
  .step-content p  { font-size: 0.9rem; }

  /* Normativa: 1 columna */
  .normativa-grid { grid-template-columns: 1fr; }
  .norm-card { padding: 1.5rem; }

  /* Por qué: stack */
  .porque-layout { grid-template-columns: 1fr; gap: 2rem; }
  .comunas-panel { padding: 1.5rem; }

  /* Contacto */
  .contacto-layout { grid-template-columns: 1fr; gap: 2rem; }
  .form-row { grid-template-columns: 1fr; }
  .contacto-form { padding: 1.5rem; }
  .contacto-social { margin-top: 1.5rem; padding-top: 1.25rem; }
  .social-label { font-size: 0.8rem; }
  .social-link { width: 36px; height: 36px; }
  .social-link svg { width: 16px; height: 16px; }

  /* Proyectos: 1 columna en móvil chico */
  .proyectos-grid { grid-template-columns: 1fr; }
  .proyecto-card { aspect-ratio: 16/9; }

  /* CTA banners */
  .section-cta { padding: 2rem 5vw; gap: 1.25rem; }
  .scta-text { font-size: 1.05rem; }
  .scta-btn { width: 100%; text-align: center; }

  /* Tipografía secciones */
  .section-title { font-size: 1.6rem; }
  .section-sub { font-size: 0.9rem; }
}

@media (max-width: 768px) {
  /* Proyectos: 2 columnas en tablet */
  .proyectos-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ══════════════════════════════════════
   TABLET — iPad (768px – 1024px)
   ══════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1024px) {

  /* Servicios: 2 columnas */
  .services-grid { grid-template-columns: repeat(2, 1fr); }

  /* Normativa: 2 columnas */
  .normativa-grid { grid-template-columns: repeat(2, 1fr); }

  /* Proyectos: 2 columnas */
  .proyectos-grid { grid-template-columns: repeat(2, 1fr); }

  /* Por qué: stack (panel comunas debajo) */
  .porque-layout { grid-template-columns: 1fr; gap: 3rem; }
  .comunas-panel { max-width: 100%; }

  /* Contacto: stack */
  .contacto-layout { grid-template-columns: 1fr; gap: 3rem; }
  .contacto-form   { max-width: 600px; }

  /* Proceso: más ancho */
  .proceso-track { max-width: 100%; }

  /* Sección padding más compacto */
  .section { padding: 5rem 6vw; }
}

/* iPad Pro landscape (1024px exacto) */
@media (min-width: 1024px) and (max-width: 1100px) {
  .services-grid    { grid-template-columns: repeat(2, 1fr); }
  .porque-layout    { gap: 3rem; }
  .contacto-layout  { gap: 3rem; }
}


/* ══════════════════════════════════════
   CONTACTO — Redes sociales
   ══════════════════════════════════════ */
.contacto-social {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.social-label {
  font-size: 1.05rem;
  font-weight: 500;
  color: rgba(248,249,250,0.8);
  margin-bottom: 1rem;
  line-height: 1.5;
}
.social-links {
  display: flex; gap: 1.25rem; flex-wrap: wrap;
}
.social-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px;
  border: 2px solid var(--verde-25);
  color: var(--verde-lt);
  border-radius: 50%;
  background: rgba(0,178,134,0.08);
  transition: background .2s, color .2s, border-color .2s, transform .2s;
  text-decoration: none;
}
.social-link svg {
  width: 28px; height: 28px;
}
.social-link:hover {
  background: var(--verde);
  border-color: var(--verde);
  color: #fff;
  transform: translateY(-3px);
}

/* Iconos sociales en el footer — protagonistas */
.footer-social {
  display: flex; gap: 1rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(0,178,134,0.15);
}
.footer-social .social-link {
  width: 52px; height: 52px;
  border: 1.5px solid rgba(0,178,134,0.3);
  color: var(--verde-lt);
  background: rgba(0,178,134,0.06);
}
.footer-social .social-link svg { width: 24px; height: 24px; }
.footer-social .social-link:hover {
  background: var(--verde);
  border-color: var(--verde);
  color: #fff;
  transform: translateY(-2px);
  transition: background .2s, border-color .2s, transform .2s;
}