/* =========================================================
   ID7D - Templos
   single-templo.php
   ========================================================= */


/* Hero */

.single-templo .templo-hero {
  padding: clamp(4rem, 8vw, 7rem) 0;
  background: var(--hero-bg);
  color: #fff;
}

.single-templo .templo-hero-copy h1 {
  color: #fff;
}

.single-templo .templo-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.single-templo .templo-hero-copy h1 {
  max-width: 760px;
  margin: 0.75rem 0 1rem;
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  line-height: 1.05;
}

.single-templo .templo-hero-content {
  max-width: 640px;
  margin: 1.25rem 0 1.75rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
  line-height: 1.75;
}

.single-templo .templo-hero-content p {
  margin-bottom: 0.85rem;
}

.single-templo .templo-hero-content p:last-child {
  margin-bottom: 0;
}


/* Location badges */

.single-templo .templo-location {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}

.single-templo .templo-location a,
.single-templo .templo-location span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
  font-weight: 700;
}

.single-templo .templo-location i {
  color: var(--sky);
}


/* Main image */

.single-templo .templo-hero-media {
  position: relative;
}

.single-templo .templo-image {
  width: 100%;
  aspect-ratio: 950 / 700;
  border-radius: 1.75rem;
  background-color: #0f172a;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: var(--shadow-lg, 0 24px 70px rgba(15, 23, 42, 0.18));
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.single-templo .templo-image-placeholder {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top left, rgba(25, 170, 219, 0.28), transparent 32%),
    linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(15, 23, 42, 0.05));
}

.single-templo .templo-image-placeholder i {
  font-size: 4rem;
  color: var(--color-primary);
  opacity: 0.75;
}


/* Related temples */

.single-templo .templo-related-section {
  background: var(--section-bg-1, #f8fafc);
}

.single-templo .templo-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.single-templo .templo-related-card {
  border-radius: 1.25rem;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm, 0 16px 45px rgba(15, 23, 42, 0.08));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.single-templo .templo-related-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md, 0 20px 60px rgba(15, 23, 42, 0.12));
}

.single-templo .templo-related-link {
  display: grid;
  grid-template-columns: 150px 1fr;
  min-height: 92px;
  color: inherit;
  text-decoration: none;
}

.single-templo .templo-related-thumb {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 92px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.single-templo .templo-related-placeholder {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top left, rgba(25, 170, 219, 0.24), transparent 35%),
    linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(15, 23, 42, 0.04));
}

.single-templo .templo-related-placeholder i {
  font-size: 1.8rem;
  color: var(--color-primary);
  opacity: 0.8;
}

.single-templo .templo-related-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
}

.single-templo .templo-related-content strong {
  color: var(--text-main);
  line-height: 1.25;
}

.single-templo .templo-related-content small {
  color: var(--text-muted);
  font-weight: 700;
}


/* Dark mode */

html[data-theme="dark"] .single-templo .templo-related-section {
  background: #0f172a;
}

html[data-theme="dark"] .single-templo .templo-related-card {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(148, 163, 184, 0.18);
}


/* Responsive */

@media (max-width: 1100px) {
  .single-templo .templo-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .single-templo .templo-hero-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .single-templo .templo-related-grid {
    grid-template-columns: 1fr;
  }

  .single-templo .templo-related-link {
    grid-template-columns: 130px 1fr;
  }
}

@media (max-width: 640px) {
  .single-templo .templo-hero {
    padding: 3.5rem 0;
  }

  .single-templo .templo-image {
    aspect-ratio: 950 / 700;
    border-radius: 1.25rem;
  }

  .single-templo .templo-location {
    gap: 0.55rem;
  }
}



/* =========================================================
   Templos - ajustes finales autorizados
   ========================================================= */

/* Mantiene el single limpio cuando el contenido es breve */
.single-templo .templo-hero-copy {
  align-self: center;
}

/* Evita que textos mínimos se vean demasiado sueltos */
.single-templo .templo-hero-content {
  max-width: 620px;
}

/* Mejora separación del botón cuando hay poco contenido */
.single-templo .templo-hero-content + .hero-actions {
  margin-top: 1.75rem;
}

/* Si no hay contenido, mantiene aire antes del CTA */
.single-templo .templo-location + .hero-actions {
  margin-top: 1.5rem;
}

/* Imagen de templo: proporción real 950x700 */
.single-templo .templo-image {
  aspect-ratio: 950 / 700;
}

/* Relacionados: útil cuando hay muchos templos */
.single-templo .templo-related-section {
  padding-top: clamp(3.5rem, 7vw, 5.5rem);
  padding-bottom: clamp(3.5rem, 7vw, 5.5rem);
}

.single-templo .templo-related-grid {
  margin-top: 1.75rem;
}

/* Paginación dentro de relacionados */
.single-templo .templo-related-section .id7d-pagination {
  margin-top: clamp(2rem, 4vw, 2.75rem);
}

/* Títulos largos en cards relacionadas */
.single-templo .templo-related-content strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Miniaturas 310x150 */
.single-templo .templo-related-thumb {
  aspect-ratio: 310 / 150;
}

/* Dark mode: sección relacionada con más contraste */
html[data-theme="dark"] .single-templo .templo-related-section {
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 34%),
    linear-gradient(180deg, #0f172a, #0b1120);
}

/* Responsive fino */
@media (max-width: 960px) {
  .single-templo .templo-hero-copy {
    order: 2;
  }

  .single-templo .templo-hero-media {
    order: 1;
  }
}

@media (max-width: 700px) {
  .single-templo .templo-related-link {
    grid-template-columns: 120px 1fr;
  }

  .single-templo .templo-related-thumb {
    min-height: 82px;
  }
}

@media (max-width: 480px) {
  .single-templo .templo-related-link {
    grid-template-columns: 1fr;
  }

  .single-templo .templo-related-thumb {
    width: 100%;
    min-height: auto;
    aspect-ratio: 310 / 150;
  }

  .single-templo .templo-related-content {
    padding: 1rem;
  }
}




/* =========================================================
   Archive templo
   ========================================================= */

.archive-templo .templo-archive-hero {
  padding: clamp(4rem, 8vw, 6.5rem) 0 clamp(3rem, 6vw, 5rem);
  background: var(--hero-bg);
  color: #fff;
}

.archive-templo .templo-archive-hero h1 {
  max-width: 760px;
  margin: 0.75rem 0 1rem;
  font-size: clamp(2.3rem, 5vw, 4.4rem);
  line-height: 1.05;
  color: #fff;
}

.archive-templo .templo-archive-hero p {
  max-width: 680px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.08rem;
  line-height: 1.75;
}

.archive-templo .templo-archive-section {
  background: var(--section-bg-default, #ffffff);
}

.archive-templo .templo-archive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
}

.archive-templo .templo-archive-card {
  border-radius: 1.25rem;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm, 0 16px 45px rgba(15, 23, 42, 0.08));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.archive-templo .templo-archive-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md, 0 20px 60px rgba(15, 23, 42, 0.12));
}

.archive-templo .templo-archive-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.archive-templo .templo-archive-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 310 / 150;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.archive-templo .templo-archive-placeholder {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top left, rgba(25, 170, 219, 0.24), transparent 35%),
    linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(15, 23, 42, 0.04));
}

.archive-templo .templo-archive-placeholder i {
  font-size: 2.25rem;
  color: var(--color-primary);
  opacity: 0.8;
}

.archive-templo .templo-archive-content {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem;
}

.archive-templo .templo-archive-content strong {
  color: var(--text-main);
  line-height: 1.25;
  font-size: 1.02rem;
}

.archive-templo .templo-archive-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.archive-templo .templo-archive-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.archive-templo .templo-archive-meta i {
  color: var(--color-primary);
}

.archive-templo .templo-empty-state {
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3rem);
  text-align: center;
  border-radius: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm, 0 16px 45px rgba(15, 23, 42, 0.08));
}

.archive-templo .templo-empty-state i {
  margin-bottom: 1rem;
  font-size: 3rem;
  color: var(--color-primary);
}

.archive-templo .templo-empty-state p {
  color: var(--text-muted);
}

/* Dark mode */

html[data-theme="dark"] .archive-templo .templo-archive-section {
  background:
    radial-gradient(circle at bottom right, rgba(25, 170, 219, 0.08), transparent 34%),
    linear-gradient(180deg, #0b1120, #0f172a);
}

html[data-theme="dark"] .archive-templo .templo-archive-card,
html[data-theme="dark"] .archive-templo .templo-empty-state {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] .archive-templo .templo-archive-meta span {
  background: rgba(59, 130, 246, 0.14);
  color: #cbd5e1;
}

/* Responsive */

@media (max-width: 1100px) {
  .archive-templo .templo-archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .archive-templo .templo-archive-grid {
    grid-template-columns: 1fr;
  }

  .archive-templo .templo-archive-hero {
    padding: 3.5rem 0 3rem;
  }
}



/* =========================================================
   Filtros / navegación de templos
   ========================================================= */

.templo-filtros {
  padding: clamp(2.75rem, 5vw, 4.5rem) 0;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 36%),
    var(--section-bg-default, #ffffff);
}

.templo-filtros .container {
  width: min(100% - 32px, var(--container-max, 1200px));
  margin-inline: auto;
}

.templo-filtros-inner {
  width: 100%;
  padding: clamp(1.35rem, 3vw, 2.25rem);
  border-radius: 1.6rem;
  background: var(--surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm, 0 16px 45px rgba(15, 23, 42, 0.08));
}

.templo-filtros-heading {
  max-width: 760px;
  margin-bottom: 1.75rem;
}

.templo-filtros-heading h2 {
  margin: 0.35rem 0 0;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  line-height: 1.15;
}

.templo-filtros-heading p {
  margin: 0.7rem 0 0;
  color: var(--text-muted);
  line-height: 1.7;
}

.templo-filtros-group {
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.templo-filtros-group + .templo-filtros-group {
  margin-top: 1.5rem;
}

.templo-filtros-group h3 {
  margin: 0 0 0.85rem;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.templo-filtros-paises,
.templo-distritos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.templo-pais-link,
.templo-distritos a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.52rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.07);
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.templo-pais-link:hover,
.templo-distritos a:hover,
.templo-pais-link:focus-visible,
.templo-distritos a:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.42);
  background: rgba(37, 99, 235, 0.12);
  color: var(--color-primary);
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.12);
  outline: none;
}

.templo-filtros-distritos-group {
  padding: 1.25rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(37, 99, 235, 0.12);
  background:
    radial-gradient(circle at top left, rgba(25, 170, 219, 0.13), transparent 34%),
    rgba(37, 99, 235, 0.055);
}

.templo-distritos a {
  min-height: 2.1rem;
  padding: 0.45rem 0.7rem;
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.16);
  color: var(--text-muted);
  font-size: 0.78rem;
}


/* Dark mode */

html[data-theme="dark"] .templo-filtros {
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 34%),
    linear-gradient(180deg, #0b1120, #0f172a);
}

html[data-theme="dark"] .templo-filtros-inner {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] .templo-filtros-group {
  border-top-color: rgba(148, 163, 184, 0.16);
}

html[data-theme="dark"] .templo-filtros-group h3 {
  color: #f8fafc;
}

html[data-theme="dark"] .templo-pais-link,
html[data-theme="dark"] .templo-distritos a {
  background: rgba(30, 41, 59, 0.92);
  border-color: rgba(148, 163, 184, 0.16);
  color: #e5e7eb;
}

html[data-theme="dark"] .templo-pais-link:hover,
html[data-theme="dark"] .templo-distritos a:hover,
html[data-theme="dark"] .templo-pais-link:focus-visible,
html[data-theme="dark"] .templo-distritos a:focus-visible {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(96, 165, 250, 0.48);
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.18);
}

html[data-theme="dark"] .templo-filtros-distritos-group {
  background:
    radial-gradient(circle at top left, rgba(25, 170, 219, 0.12), transparent 34%),
    rgba(30, 41, 59, 0.64);
  border-color: rgba(148, 163, 184, 0.16);
}


/* Responsive */

@media (max-width: 640px) {
  .templo-filtros {
    padding: 2.25rem 0;
  }

  .templo-filtros .container {
    width: min(100% - 24px, var(--container-max, 1200px));
  }

  .templo-filtros-inner {
    padding: 1.15rem;
    border-radius: 1.25rem;
  }

  .templo-filtros-heading {
    margin-bottom: 1.35rem;
  }

  .templo-filtros-paises,
  .templo-distritos {
    gap: 0.45rem;
  }

  .templo-pais-link,
  .templo-distritos a {
    min-height: 2.1rem;
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
  }

  .templo-filtros-distritos-group {
    padding: 1rem;
  }
}




/* =========================================================
   Modal imagen templo
   ========================================================= */

.single-templo .templo-image-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 1.75rem;
  background: transparent;
  cursor: zoom-in;
  text-align: inherit;
}

.single-templo .templo-image-button .templo-image {
  display: block;
}

.single-templo .templo-image-zoom {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(12px);
  font-size: 0.82rem;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
}

.single-templo .templo-modal[hidden] {
  display: none;
}

.single-templo .templo-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 3vw, 2rem);
}

.single-templo .templo-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(10px);
}

.single-templo .templo-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(100% - 32px, var(--container-max, 1200px));
  max-width: var(--container-max, 1200px);
  padding: clamp(0.75rem, 2vw, 1rem);
  border-radius: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border-color);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.35);
}

.single-templo .templo-modal-image {
  width: 100%;
  aspect-ratio: 950 / 700;
  border-radius: 1.25rem;
  background-color: #0f172a;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.single-templo .templo-modal-close {
  position: absolute;
  top: -0.75rem;
  right: -0.75rem;
  z-index: 2;
  width: 2.75rem;
  height: 2.75rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.22);
  cursor: pointer;
}

.single-templo .templo-modal-close:hover {
  color: var(--color-primary);
}

/* Dark mode */

html[data-theme="dark"] .single-templo .templo-modal-dialog,
html[data-theme="dark"] .single-templo .templo-modal-close {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] .single-templo .templo-modal-close {
  color: #f8fafc;
}

/* Responsive */

@media (max-width: 640px) {
  .single-templo .templo-image-zoom {
    right: 0.75rem;
    bottom: 0.75rem;
    font-size: 0.76rem;
  }

  .single-templo .templo-modal-dialog {
    width: min(100% - 20px, var(--container-max, 1200px));
    border-radius: 1.25rem;
  }

  .single-templo .templo-modal-image {
    border-radius: 1rem;
  }

  .single-templo .templo-modal-close {
    top: 0.5rem;
    right: 0.5rem;
  }
}
