/* =========================================================
   CONTACTO (se usa solo en contacto.html)
   Las tarjetas reutilizan .obra-card: mismo borde fino y misma sombra al pasar el cursor
   ========================================================= */
.tarjetas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.6rem;
  padding-top: 4rem;
  padding-bottom: 3rem;
}

.tarjeta {
  display: flex;
  flex-direction: column;
}

/* Foto con el título encima */
.tarjeta-img {
  position: relative;
  height: 200px;
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: flex-end;
  background: var(--teal-900) center / cover no-repeat;
  color: #fff;
}

.tarjeta-img::before {
  /* capa oscura para que se lea el título */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 28, 48, .15), rgba(10, 28, 48, .78));
}

.tarjeta-img h2 {
  position: relative;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}

.tarjeta-cuerpo {
  padding: 1.6rem 1.5rem 1.9rem;
  font-size: .92rem;
  line-height: 1.7;
  color: var(--gris);
}

/* Datos de contacto */
.contacto-lista {
  display: grid;
  gap: 1.3rem;
}

.contacto-lista li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.contacto-lista .icon {
  width: 22px;
  height: 22px;
  margin-top: .15rem;
  color: var(--teal-700);
}

.contacto-lista a {
  transition: color .2s;
}

.contacto-lista a:hover {
  color: var(--teal-500);
}

/* Formulario con foto (reutiliza el borde fino de las tarjetas) */
.formulario {
  padding-bottom: 4rem;
}

.formulario .titulo {
  margin-bottom: 1.5rem;
}

.form-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--linea);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.form-img {
  min-height: 380px;
  background: var(--teal-900) center / cover no-repeat;
}

.form-cuerpo {
  display: grid;
  gap: .5rem;
  align-content: start;
  padding: 2.2rem 2.4rem;
}

.form-cuerpo h3 {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--teal-900);
}

.form-cuerpo>p:not(.form-msg) {
  margin-bottom: .6rem;
  font-size: .92rem;
  color: var(--gris);
}

.form-cuerpo label {
  margin-top: .6rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--tinta);
}

.form-cuerpo input:not(.trampa),
.form-cuerpo textarea {
  width: 100%;
  padding: .85rem 1rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #eef2f4;
  font: inherit;
  font-size: .92rem;
  color: var(--tinta);
  transition: border-color .2s, background .2s, box-shadow .2s;
}

.form-cuerpo input:not(.trampa):focus,
.form-cuerpo textarea:focus {
  outline: none;
  border-color: var(--teal-500);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(23, 122, 188, .15);
}

.form-cuerpo textarea {
  min-height: 130px;
  resize: vertical;
}

.form-cuerpo .btn {
  justify-content: center;
  width: 100%;
  margin-top: 1rem;
  cursor: pointer;
}

.form-cuerpo .btn:disabled {
  opacity: .6;
  cursor: wait;
  transform: none;
}

.form-msg {
  min-height: 1.4em;
  font-size: .9rem;
}

.trampa {
  position: absolute;
  left: -9999px;
}

/* campo anti-spam oculto */

@media (max-width: 760px) {
  .form-card {
    grid-template-columns: 1fr;
  }

  .form-img {
    min-height: 220px;
  }

  .form-cuerpo {
    padding: 1.6rem 1.4rem;
  }
}

/* Botón dentro de las tarjetas (proveedor / trabajo) */
.tarjeta-cuerpo {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tarjeta-cuerpo p {
  margin-bottom: 1.4rem;
}

.tarjeta-cuerpo .btn {
  display: inline-flex;
  height: auto;
  align-self: center;
  margin-top: auto;
}

/* Desplegable de motivo (mismo aspecto que los campos de texto) */
.form-cuerpo select {
  width: 100%;
  padding: .85rem 2.6rem .85rem 1rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #eef2f4 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f7186' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right .9rem center / 14px;
  font: inherit;
  font-size: .92rem;
  color: var(--tinta);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}

.form-cuerpo select:focus {
  outline: none;
  border-color: var(--teal-500);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(23, 122, 188, .15);
}

/* Campos extra según el motivo */
.campos-extra {
  display: grid;
  gap: .5rem;
}

.campos-extra[hidden] {
  display: none;
}

/* =========================================================
   CONTACTO — OPTIMIZACIÓN PARA CELULARES
   ========================================================= */

@media (max-width: 760px) {

  /* Evita desbordamientos horizontales */
  body {
    overflow-x: clip;
  }

  /* Portada más compacta */
  .page-hero--img {
    min-height: 280px;
    padding: 120px 0 2.5rem;
    align-items: flex-end;
  }

  .page-hero--img .contenedor {
    position: relative;
    top: auto;
    width: 100%;
  }

  /* Ajusta el recorte de la fotografía */
  .hero-fondo {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background-position: center;
    background-size: cover;
  }

  /* Evita que el encabezado quede demasiado grande */
  .page-hero--img h1 {
    font-size: clamp(2rem, 7vw, 2.6rem);
    line-height: 1.15;
  }

  .page-hero--img p:not(.migas) {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  /* Tarjetas: una columna y separación uniforme */
  .tarjetas {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .tarjeta-img {
    height: 180px;
  }

  .tarjeta-img h2 {
    font-size: 1.25rem;
    line-height: 1.3;
    letter-spacing: 0.02em;
  }

  .tarjeta-cuerpo {
    padding: 1.25rem;
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .tarjeta-cuerpo .btn {
    max-width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* Formulario */
  .formulario {
    padding-bottom: 2.5rem;
  }

  .formulario .titulo {
    font-size: 1.6rem;
    margin-bottom: 1rem;
  }

  .form-card {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    border-radius: 10px;
  }

  .form-img {
    min-height: 170px;
    background-position: center;
  }

  .form-cuerpo {
    min-width: 0;
    padding: 1.25rem;
    gap: 0.55rem;
  }

  .form-cuerpo h3 {
    font-size: 1.4rem;
    line-height: 1.3;
  }

  .form-cuerpo>p:not(.form-msg) {
    font-size: 0.92rem;
    line-height: 1.65;
  }

  /* Campos de formulario */
  .form-cuerpo input:not(.trampa),
  .form-cuerpo select,
  .form-cuerpo textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 0.85rem 0.9rem;
    box-sizing: border-box;
    font-size: 16px;
    border-radius: 8px;
  }

  .form-cuerpo select {
    padding-right: 2.4rem;
  }

  .form-cuerpo textarea {
    min-height: 120px;
  }

  .form-cuerpo .btn {
    min-height: 48px;
    width: 100%;
    font-size: 1rem;
  }

  /* Evita que el captcha genere desbordamiento */
  .cf-turnstile {
    max-width: 100%;
    overflow: hidden;
  }
}

/* Ajustes adicionales para celulares pequeños */
@media (max-width: 380px) {

  .contenedor {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .page-hero--img {
    min-height: 260px;
    padding-top: 110px;
  }

  .tarjeta-cuerpo,
  .form-cuerpo {
    padding: 1rem;
  }

  .tarjeta-cuerpo .btn {
    width: 100%;
  }
}
/* Ayuda debajo del campo de adjunto */
.form-ayuda {
  display: block;
  margin-top: .3rem;
  font-size: .78rem;
  color: var(--gris);
}
