/* ===============================
   JOINARMENIA GLOBAL STYLES
   Clean, responsive & unified
================================ */

/* RESET / BASE */
body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #222;
  line-height: 1.6;
}

.ja-page-title {
  text-align: center;
  color: #2C5175;
  margin: 20px 0 40px;
  font-weight: 700;
}

/* CONTAINERS */
.ja-archive-container {
  padding: 40px 5%;
  max-width: 1400px;
  margin: auto;
}

/* SEARCH FORM */
.ja-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  margin: 30px 0;
}

.ja-search-form input,
.ja-search-form select {
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  min-width: 150px;
}

.ja-btn {
  background: #2C5175;
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.ja-btn:hover {
  background: #1f3a57;
}

/* GRID */
.ja-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

/* CARD */
.ja-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}

.ja-card:hover {
  transform: translateY(-3px);
}

/* THUMBNAIL */
.ja-thumb img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

/* CARD CONTENT */
.ja-card-content {
  padding: 20px;
  flex: 1;
}

.ja-card-content h3 {
  color: #2C5175;
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.3;
}

.ja-meta {
  color: #666;
  font-size: 14px;
  margin-bottom: 8px;
}

.ja-price {
  font-size: 20px;
  font-weight: 700;
  color: #2C5175;
  margin: 10px 0;
}

/* BUTTONS */
.ja-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.ja-btn-main {
  background: #2C5175;
  color: #fff;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
}

.ja-btn-main:hover {
  background: #1f3a57;
}

.ja-btn-call {
  background: #2e7d32;
  color: #fff;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
}

.ja-btn-call:hover {
  background: #256528;
}

/* PAGINATION */
.ja-pagination {
  margin-top: 40px;
  text-align: center;
}

.ja-no-results {
  text-align: center;
  color: #777;
  margin: 60px 0;
}

/* Fluent Forms tweaks */
.ff-el-group input,
.ff-el-group textarea {
  border-radius: 6px !important;
  border: 1px solid #ccc !important;
}

.ff_submit_btn {
  background-color: #2C5175 !important;
  border-radius: 6px !important;
  font-weight: 600;
}

.ff_submit_btn:hover {
  background-color: #1f3a57 !important;
}

/* =========================
   SINGLE AD LAYOUT
========================= */

.ja-single-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  max-width: 1200px;
  margin: auto;
  padding: 40px 5%;
}

.ja-single-left {
  background: #fff;
  padding: 30px;
  border-radius: 14px;
  box-shadow: 0 3px 10px rgba(0,0,0,.08);
}

.ja-single-image img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin-bottom: 20px;
}

.ja-single-title {
  font-size: 28px;
  color: #2C5175;
  margin: 15px 0;
}

.ja-single-price {
  font-size: 26px;
  font-weight: 800;
  color: #2C5175;
  margin-bottom: 10px;
}

.ja-single-meta {
  font-size: 14px;
  color: #777;
  margin-bottom: 20px;
}

.ja-single-content {
  line-height: 1.7;
  font-size: 16px;
}

.ja-single-sidebar {
  background: #fff;
  padding: 25px;
  border-radius: 14px;
  box-shadow: 0 3px 10px rgba(0,0,0,.08);
  height: fit-content;
}

.ja-phone-box {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}

.ja-login-btn {
  display: inline-block;
  padding: 10px 16px;
  background: #2C5175;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  margin-top: 10px;
}

.ja-login-btn:hover {
  opacity: 0.9;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 900px) {
  .ja-single-container {
    grid-template-columns: 1fr;
  }

  .ja-card-grid {
    grid-template-columns: 1fr;
  }

  .ja-search-form {
    flex-direction: column;
    align-items: stretch;
  }

  .ja-search-form input,
  .ja-search-form select,
  .ja-btn {
    width: 100%;
  }
}


.ja-single-sidebar {
  min-height: 350px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.ja-login-box {
  background: #f8f9fb;
  padding: 20px;
  border-radius: 10px;
  margin-top: 10px;
}

.ja-login-box p {
  margin-bottom: 15px;
}


/* GALERÍA SINGLE AD */
.ja-single-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
  margin-top: 25px;
}

.ja-single-gallery a {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1; /* cuadradas */
  overflow: hidden;
  border-radius: 10px;
}

.ja-single-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* recorta sin deformar */
  transition: transform .2s ease;
}

.ja-single-gallery img:hover {
  transform: scale(1.05);
}


/* Título página Ads */
.post-type-archive-ads .ja-page-title,
.post-type-archive-ads h1 {
  color: #2C5175 !important;
}


/* =========================
   JOB CARDS - ALINEACIÓN PERFECTA
========================= */

.post-type-archive-jobs .ja-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.post-type-archive-jobs .ja-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}

.post-type-archive-jobs .ja-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-type-archive-jobs .ja-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.post-type-archive-jobs .ja-buttons {
  margin-top: auto;
}



.back-link a {
    display: inline-block;
    padding: 8px 14px;
    background-color: #2C5175;
    color: #ffffff;
    border-radius: 4px;
    font-weight: 500;
    transition: 0.3s ease;
}

.back-link a:hover {
    background-color: #1f3c56;
    text-decoration: none;
}


@media (max-width: 768px) {
    .back-link {
        margin: 15px;
    }

    .back-link a {
        font-size: 15px;
    }
}


.site-title,
.site-description {
    padding-left: 20px;
    padding-right: 20px;
}


.archive-subtitle {
    text-align: center;
    margin-top: 10px;
    font-size: 16px;
    color: #ffffff;
}

.hero-subtitle-wrapper {
    position: relative;
    margin-top: -60px; /* ajusta si hace falta */
    text-align: center;
    z-index: 2;
}

.hero-subtitle {
    color: #ffffff;
    font-size: 18px;
    font-weight: 400;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.9;
}



.back-link {
    margin: 20px;
}

.back-link a {
    display: inline-block;
    color: #2C5175;
    font-weight: 600;
    text-decoration: none;
    font-size: 16px;
}

.back-link a:hover {
    text-decoration: underline;
}


@media (max-width: 768px) {
    .back-link {
        margin: 15px;
    }

    .back-link a {
        font-size: 15px;
    }
}


/* Botones estilo texto */
button,
.wp-block-button__link,
.btn,
.elementor-button {
    background: transparent !important;
    border: none !important;
    color: #2C5175 !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* Hover elegante */
button:hover,
.wp-block-button__link:hover,
.btn:hover,
.elementor-button:hover {
    text-decoration: underline;
    background: transparent !important;
}



/* Back link elegante */
.back-link {
    padding: 12px 20px;
}

.back-link a {
    display: inline-block;
    background: transparent;
    color: #2C5175;
    font-weight: 600;
    text-decoration: none;
    font-size: 15px;
}

.back-link a:hover {
    text-decoration: underline;
}


.ja-categories-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;              /* separación horizontal y vertical */
    margin: 20px 0 30px;
}

.ja-cat-btn {
    padding: 8px 16px;
    border: 1px solid #2C5175;
    border-radius: 2px;
    text-decoration: none;
    color: #2C5175;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ja-cat-btn:hover {
    background: #2C5175;
    color: #ffffff;
}


.ja-cat-btn.active {
    background: #1f3d59;
}


/* ===== HERO IMPROVEMENT ===== */

body.post-type-archive-housings div[style*="background"],
body.post-type-archive-jobs div[style*="background"],
body.post-type-archive-ads div[style*="background"] {
    position: relative;
}

body.post-type-archive-housings div[style*="background"]::before,
body.post-type-archive-jobs div[style*="background"]::before,
body.post-type-archive-ads div[style*="background"]::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.6));
    z-index: 1;
}

body.post-type-archive-housings div[style*="background"] > div,
body.post-type-archive-jobs div[style*="background"] > div,
body.post-type-archive-ads div[style*="background"] > div {
    position: relative;
    z-index: 2;
}

/* Spacing after hero */
.post-type-archive-housings main,
.post-type-archive-jobs main,
.post-type-archive-ads main {
    margin-top: 40px;
}




/* =========================================================
   FIX: JOBS + ADS igual que HOUSINGS (3 cards por fila)
   Cambios aislados: SOLO afecta archivos /jobs/ y /ads/
========================================================= */

/* Desktop/tablet: fuerza 3 columnas en Jobs y Ads */
.post-type-archive-jobs .ja-card-grid,
.post-type-archive-ads  .ja-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Mobile: 3 en fila + cards más compactas */
@media (max-width: 900px) {
  .post-type-archive-jobs .ja-card-grid,
  .post-type-archive-ads  .ja-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px;
  }

  .post-type-archive-jobs .ja-thumb img,
  .post-type-archive-ads  .ja-thumb img {
    height: 110px;
  }

  .post-type-archive-jobs .ja-card-content,
  .post-type-archive-ads  .ja-card-content {
    padding: 10px;
  }

  .post-type-archive-jobs .ja-card-content h3,
  .post-type-archive-ads  .ja-card-content h3 {
    font-size: 13px;
    line-height: 1.2;
    margin-bottom: 6px;
  }

  /* Opcional: si queda muy cargado, compactamos meta/precio */
  .post-type-archive-jobs .ja-meta,
  .post-type-archive-ads  .ja-meta {
    font-size: 12px;
    margin-bottom: 4px;
  }

  .post-type-archive-jobs .ja-price,
  .post-type-archive-ads  .ja-price {
    font-size: 14px;
    margin: 6px 0;
  }
}

/* ===== FORCE 3 COLUMNS ON MOBILE (JOBS + ADS) ===== */
@media (max-width: 900px) {
  body.post-type-archive-jobs .ja-card-grid,
  body.post-type-archive-ads  .ja-card-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  body.post-type-archive-jobs .ja-thumb img,
  body.post-type-archive-ads  .ja-thumb img {
    height: 105px !important;
  }

  body.post-type-archive-jobs .ja-card-content,
  body.post-type-archive-ads  .ja-card-content {
    padding: 10px !important;
  }

  body.post-type-archive-jobs .ja-buttons,
  body.post-type-archive-ads  .ja-buttons {
    gap: 6px !important;
  }
}

/* =========================================================
   MOBILE: FORZAR 3 COLUMNAS en JOBS + ADS (sin afectar Housing)
========================================================= */
@media (max-width: 900px) {
  html body.post-type-archive-jobs main.ja-archive-container .ja-card-grid,
  html body.post-type-archive-ads  main.ja-archive-container .ja-card-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
  }

  /* Evita que algo "empuje" el grid y lo convierta en 2 columnas */
  html body.post-type-archive-jobs .ja-card,
  html body.post-type-archive-ads  .ja-card {
    min-width: 0 !important;
  }

  /* Compactamos para que 3 entren cómodo */
  html body.post-type-archive-jobs .ja-thumb img,
  html body.post-type-archive-ads  .ja-thumb img {
    height: 105px !important;
  }

  html body.post-type-archive-jobs .ja-card-content,
  html body.post-type-archive-ads  .ja-card-content {
    padding: 10px !important;
  }

  html body.post-type-archive-jobs .ja-card-content h3,
  html body.post-type-archive-ads  .ja-card-content h3 {
    font-size: 13px !important;
    line-height: 1.2 !important;
  }
}

/* Extra: algunos temas cambian reglas a 768px */
@media (max-width: 768px) {
  html body.post-type-archive-jobs main.ja-archive-container .ja-card-grid,
  html body.post-type-archive-ads  main.ja-archive-container .ja-card-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}


/* =========================================================
   ADS: 3 columnas en móvil (igual que Housing)
========================================================= */

@media (max-width: 900px) {

  body.post-type-archive-ads .ja-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px;
  }

  body.post-type-archive-ads .ja-thumb img {
    height: 110px;
  }

  body.post-type-archive-ads .ja-card-content {
    padding: 10px;
  }

  body.post-type-archive-ads .ja-card-content h3 {
    font-size: 13px;
    line-height: 1.2;
  }

  body.post-type-archive-ads .ja-price {
    font-size: 14px;
    margin: 6px 0;
  }

  body.post-type-archive-ads .ja-meta {
    font-size: 12px;
  }
}

/* Algunos themes cambian a 768px, lo reforzamos */
@media (max-width: 768px) {
  body.post-type-archive-ads .ja-card-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}


/* =========================================================
   MOBILE (Housings + Jobs + Ads): 3 cards por fila + thumbs más altos
   Seguro: solo afecta a los 3 archives
========================================================= */

@media (max-width: 900px) {

  /* 3 columnas en las 3 páginas */
  body.post-type-archive-housings .ja-card-grid,
  body.post-type-archive-jobs     .ja-card-grid,
  body.post-type-archive-ads      .ja-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  /* Imágenes un poco más altas (más “premium”) */
  body.post-type-archive-housings .ja-thumb img,
  body.post-type-archive-jobs     .ja-thumb img,
  body.post-type-archive-ads      .ja-thumb img {
    height: 130px !important; /* antes 105–110 */
    object-fit: cover;
  }

  /* Cards más compactas para que 3 entren bien */
  body.post-type-archive-housings .ja-card-content,
  body.post-type-archive-jobs     .ja-card-content,
  body.post-type-archive-ads      .ja-card-content {
    padding: 10px !important;
  }

  body.post-type-archive-housings .ja-card-content h3,
  body.post-type-archive-jobs     .ja-card-content h3,
  body.post-type-archive-ads      .ja-card-content h3 {
    font-size: 13px !important;
    line-height: 1.2 !important;
    margin-bottom: 6px;
  }

  body.post-type-archive-housings .ja-meta,
  body.post-type-archive-jobs     .ja-meta,
  body.post-type-archive-ads      .ja-meta {
    font-size: 12px !important;
  }

  body.post-type-archive-housings .ja-price,
  body.post-type-archive-jobs     .ja-price,
  body.post-type-archive-ads      .ja-price {
    font-size: 14px !important;
    margin: 6px 0 !important;
  }
}

/* Refuerzo por si el theme cambia el grid a 768px */
@media (max-width: 768px) {
  body.post-type-archive-housings .ja-card-grid,
  body.post-type-archive-jobs     .ja-card-grid,
  body.post-type-archive-ads      .ja-card-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}



/* =========================
   SINGLE HOUSING = estilo Ads
========================= */
body.single-housings .ja-single-image { margin-bottom: 12px; }

body.single-housings .ja-single-price {
  font-size: 22px;
  font-weight: 800;
  color: #2C5175;
  margin: 6px 0 8px;
}

body.single-housings .ja-single-title {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.2;
}

body.single-housings .ja-single-meta {
  color: #666;
  font-size: 14px;
  margin-bottom: 14px;
  display: grid;
  gap: 6px;
}

/* Galería abajo: 2-3 columnas en móvil, elegante */
body.single-housings .single-housing-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
  margin-top: 18px;
}

body.single-housings .single-housing-gallery img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
}


/* =========================================================
   SINGLE: Hover también en la imagen destacada
   (Ads + Housings + Jobs) - sin afectar otras imágenes del sitio
========================================================= */

body.single-ads .ja-single-image,
body.single-housings .ja-single-image,
body.single-jobs .ja-single-image {
  overflow: hidden;
  border-radius: 12px; /* mismo look */
}

body.single-ads .ja-single-image img,
body.single-housings .ja-single-image img,
body.single-jobs .ja-single-image img {
  transition: transform .25s ease;
  display: block;
  width: 100%;
  height: auto;
}

body.single-ads .ja-single-image img:hover,
body.single-housings .ja-single-image img:hover,
body.single-jobs .ja-single-image img:hover {
  transform: scale(1.05);
}

body.single-ads .ja-single-image a:focus img,
body.single-housings .ja-single-image a:focus img,
body.single-jobs .ja-single-image a:focus img {
  transform: scale(1.05);
}


/* ===============================
   SINGLE MAIN IMAGE HOVER FIX
=============================== */

.ja-single-image {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.ja-single-image img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.35s ease;
}

.ja-single-image:hover img {
  transform: scale(1.06);
}


/* =====================================
   SINGLE MAIN IMAGE – HOVER REAL FIX
===================================== */

.ja-single-image {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  height: 320px; /* altura fija para que el zoom se note */
}

.ja-single-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.ja-single-image:hover img {
  transform: scale(1.08);
}


.ja-single-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.ja-single-gallery a {
  display: block;
  aspect-ratio: 1 / 1; /* cuadradas perfectas */
  overflow: hidden;
  border-radius: 10px;
}

.ja-single-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.ja-single-gallery a:hover img {
  transform: scale(1.05);
}


/* ===============================
   SINGLE HOUSING MEDIA (VIDEO / IMAGE)
=============================== */

.ja-single-video,
.ja-single-image {
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 12px;
}

.ja-single-video video,
.ja-single-image img {
  width: 100%;
  display: block;
  border-radius: 14px;
}


/* ===============================
   VIDEO FRAME FIJO AUTOMÁTICO
=============================== */

.ja-single-video {
  width: 100%;
  aspect-ratio: 16 / 9;   /* proporción estándar horizontal */
  overflow: hidden;
  border-radius: 14px;
}

.ja-single-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}