/*
 Theme Name:   JG Twenty Twenty-Five Child
 Theme URI:    https://jesusgranada.com
 Description:  Tema hijo para jesusgranada.com — portfolio de fotografía de arquitectura. Basado en Twenty Twenty-Five con tipografía Cormorant Garamond + Inter, paleta neutral editorial y plantillas personalizadas para Proyectos, Publicaciones y Actividades.
 Author:       Jesús Granada
 Author URI:   https://jesusgranada.com
 Template:     twentytwentyfive
 Version:      10.1
 License:      GNU General Public License v2 or later
 License URI:  https://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  jg-twentytwentyfive-child
*/

/* ================================================
   FRONT PAGE — jesusgranada.com
   Hero grid + positioning + doors + explore
   ================================================ */

/* === HERO GRID === */
.jg-hero {
  position: relative;
}
.jg-hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  width: 100%;
  height: 100vh;
  gap: 2px;
}
.jg-hero-img {
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  display: block;
  text-decoration: none;
  cursor: pointer;
}
.jg-hero-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10,10,10,0.2);
  transition: background 0.6s ease;
}
.jg-hero-img:hover::after {
  background: rgba(10,10,10,0.02);
}
.jg-hero-span2 {
  grid-row: span 2;
}
.jg-hero-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.2rem;
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.68rem;
  font-weight: 200;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.65);
  z-index: 2;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.jg-hero-img:hover .jg-hero-caption {
  opacity: 1;
}

/* === POSITIONING === */
.jg-positioning {
  border-bottom: none;
}
.jg-positioning .wp-block-separator {
  width: 40px;
  border-bottom: 1px solid var(--wp--preset--color--gris-claro);
  opacity: 1;
}

/* === DOORS (hover effect) === */
.jg-door {
  transition: background-color 0.4s ease;
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.jg-door:hover {
  background-color: var(--wp--preset--color--gris-claro) !important;
}
.jg-door .wp-block-button.is-style-outline .wp-block-button__link {
  border-color: var(--wp--preset--color--gris-medio);
  color: var(--wp--preset--color--negro);
  transition: all 0.3s ease;
}
.jg-door:hover .wp-block-button.is-style-outline .wp-block-button__link {
  border-color: var(--wp--preset--color--negro);
}

/* === EXPLORE LINKS === */
.jg-explore-links {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.jg-explore-links a {
  color: var(--wp--preset--color--negro);
  text-decoration: none;
  font-family: var(--wp--preset--font-family--cormorant-garamond);
  font-size: 1.1rem;
  font-weight: 300;
  padding: 0.5rem 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.jg-explore-links a:hover {
  border-bottom-color: var(--wp--preset--color--gris-medio);
}
.jg-count {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.6rem;
  font-weight: 400;
  color: var(--wp--preset--color--gris-medio);
  margin-left: 0.2rem;
  vertical-align: super;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .jg-hero-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1.5fr 1fr 1fr;
  }
  .jg-hero-span2 {
    grid-column: span 2;
    grid-row: span 1;
  }
  .jg-positioning h1 {
    font-size: 2rem !important;
  }
  .jg-door-commission {
    border-right: none !important;
  }
  .jg-door {
    min-height: 35vh;
  }
  .jg-explore-links {
    gap: 1.2rem;
  }
}

@media (max-width: 480px) {
  .jg-hero-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
    height: 100svh;
  }
  .jg-hero-span2 {
    grid-column: span 1;
  }
}

/* === SEARCH BAR (front page) === */
.jg-search-form {
  display: flex;
  align-items: center;
  max-width: 480px;
  margin: 0 auto;
  border-bottom: 1px solid var(--wp--preset--color--gris-claro, #e8e6e3);
  transition: border-color 0.3s ease;
}
.jg-search-form:focus-within {
  border-bottom-color: var(--wp--preset--color--gris-medio, #767676);
}
.jg-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.9rem;
  font-weight: 200;
  color: var(--wp--preset--color--negro, #1a1a1a);
  padding: 0.8rem 0;
}
.jg-search-input::placeholder {
  color: var(--wp--preset--color--gris-medio, #999);
  font-weight: 200;
}
.jg-search-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--wp--preset--color--gris-medio, #999);
  transition: color 0.3s ease;
}
.jg-search-btn:hover {
  color: var(--wp--preset--color--negro, #1a1a1a);
}

/* === DOORS: constrain to 1200px === */
.jg-doors > .wp-block-columns {
  max-width: 1200px;
  margin: 0 auto;
}

/* === HERO: reduce gap between header and images === */
.jg-hero {
  margin-top: -0.5rem !important;
}

/* === SINGLE: CTA separator + email === */
.jg-cta-separator-top {
  width: 60px;
  height: 1px;
  background: var(--wp--preset--color--gris-claro, #e8e6e3);
  margin: clamp(40px, 6vw, 80px) auto 1.5rem;
}
.jg-cta-label {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wp--preset--color--gris-medio, #999);
  text-align: center;
  margin-bottom: 0.4rem;
}
.jg-cta-email {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.8rem;
  font-weight: 300;
  text-align: center;
}
.jg-cta-email a {
  color: var(--wp--preset--color--negro, #1a1a1a);
  text-decoration: none;
  border-bottom: 1px solid var(--wp--preset--color--gris-claro, #e8e6e3);
  padding-bottom: 1px;
  transition: border-color 0.3s ease;
}
.jg-cta-email a:hover {
  border-bottom-color: var(--wp--preset--color--negro, #1a1a1a);
}

/* === SINGLE: Dark CTA boxes === */
.jg-boxes-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 3vw, 32px);
  max-width: 800px;
  margin: 0 auto;
}
.jg-box {
  border: 1px solid rgba(255,255,255,0.12);
  padding: clamp(24px, 4vw, 48px) clamp(20px, 3vw, 36px);
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s ease;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.jg-box:hover {
  border-color: rgba(255,255,255,0.35);
}
.jg-box-icon {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 1rem;
}
.jg-box-title {
  font-family: var(--wp--preset--font-family--cormorant-garamond);
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 300;
  color: #fff;
  margin-bottom: 0.8rem;
  line-height: 1.2;
}
.jg-box-desc {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.75rem;
  font-weight: 200;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}
.jg-box-action {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.3s ease;
}
.jg-box:hover .jg-box-action { color: #fff; }
.jg-box-action .arrow {
  font-size: 0.85rem;
  transition: transform 0.3s ease;
}
.jg-box:hover .jg-box-action .arrow {
  transform: translateX(3px);
}
@media (max-width: 600px) {
  .jg-boxes-container { grid-template-columns: 1fr; }
}

/* ── Explore links larger in footer ── */
.jg-explore-links a {
  font-size: 1.4rem;
}
.jg-count {
  font-size: 0.65rem;
}

/* ── Light variant of CTA boxes (footer) ── */
.jg-boxes-light .jg-box {
  border-color: rgba(0,0,0,0.08);
}
.jg-boxes-light .jg-box:hover {
  border-color: rgba(0,0,0,0.25);
}
.jg-boxes-light .jg-box-icon {
  color: #999;
}
.jg-boxes-light .jg-box-title {
  color: #1a1a1a;
}
.jg-boxes-light .jg-box-desc {
  color: #767676;
}
.jg-boxes-light .jg-box-action {
  color: #999;
}
.jg-boxes-light .jg-box:hover .jg-box-action {
  color: #1a1a1a;
}

/* ── Rights notice: project line ── */
.jg-cta-project {
  font-family: var(--wp--preset--font-family--cormorant-garamond);
  font-size: 1.1rem;
  font-weight: 300;
  text-align: center;
  color: var(--wp--preset--color--gris-oscuro, #333);
  margin: 0.3rem 0 1rem;
  line-height: 1.4;
}

/* ── Header search toggle (lupa) ── */
.jg-search-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--wp--preset--color--negro, #1a1a1a);
  opacity: 0.5;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
}
.jg-search-toggle:hover {
  opacity: 1;
}

/* ── Header search overlay ── */
.jg-search-overlay {
  border-bottom: 1px solid var(--wp--preset--color--gris-claro, #e8e6e3);
  padding: 1rem 2rem;
  background: #fff;
}
.jg-search-overlay[hidden] {
  display: none;
}
.jg-search-header {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}
.jg-search-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  color: var(--wp--preset--color--gris-medio, #767676);
  padding: 0 4px;
  line-height: 1;
  transition: color 0.3s ease;
}
.jg-search-close:hover {
  color: var(--wp--preset--color--negro, #1a1a1a);
}

/* ── Footer search (margin top for spacing) ── */
.jg-search-footer {
  margin-top: 2rem;
}

/* ── Search input visible border ── */
.jg-search-form {
  border-bottom: 1px solid #d4d2cf;
}
.jg-search-form:focus-within {
  border-bottom-color: #999;
}

/* ── Publication type links under title ── */
.jg-pub-types {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  justify-content: flex-start;
  margin-top: 0.8rem;
  margin-bottom: 2rem;
}
.jg-pub-types a {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--wp--preset--color--gris-medio, #767676);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: border-color 0.3s, color 0.3s;
}
.jg-pub-types a:hover {
  color: var(--wp--preset--color--negro, #1a1a1a);
  border-bottom-color: var(--wp--preset--color--negro, #1a1a1a);
}

/* ── Rights notice: unified typography ── */
.jg-cta-separator-top {
  width: 40px;
  height: 1px;
  background: #d4d2cf;
  margin: clamp(48px, 6vw, 80px) auto 1.8rem;
}
.jg-cta-label {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.72rem;
  font-weight: 200;
  letter-spacing: 0.04em;
  text-transform: none;
  color: #999;
  text-align: center;
  margin: 0 0 0.2rem;
}
.jg-cta-project {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.82rem;
  font-weight: 300;
  text-align: center;
  color: #333;
  margin: 0 0 1.2rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
}
.jg-cta-email {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.72rem;
  font-weight: 200;
  text-align: center;
  color: #999;
  margin: 0;
}
.jg-cta-email a {
  color: #333;
  text-decoration: none;
  border-bottom: 1px solid #d4d2cf;
  padding-bottom: 1px;
  transition: border-color 0.3s ease;
}
.jg-cta-email a:hover {
  border-bottom-color: #333;
}

/* ── Language switcher ── */
.jg-lang-switch {
  display: inline-flex;
  align-items: center;
  margin-left: 0.4rem;
}
.jg-lang-switch a {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  color: var(--wp--preset--color--gris-medio, #767676);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.3s ease;
}
.jg-lang-switch a:hover {
  color: var(--wp--preset--color--negro, #1a1a1a);
}

/* ── Language switcher ── */
.jg-lang-switch {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.01em;
  white-space: nowrap;
  margin-left: 0.5rem;
}
.jg-lang-active {
  color: var(--wp--preset--color--negro, #1a1a1a);
}
.jg-lang-inactive {
  color: var(--wp--preset--color--gris-medio, #767676);
  text-decoration: none;
  transition: color 0.3s ease;
}
.jg-lang-inactive:hover {
  color: var(--wp--preset--color--negro, #1a1a1a);
}
.jg-lang-switch a {
  text-decoration: none;
}

/* ── Tipologías page grid ── */
.jg-tipologias-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.jg-tipologia-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.7rem 1rem 0.7rem 0;
  border-bottom: 1px solid #eee;
  text-decoration: none;
  color: var(--wp--preset--color--negro, #1a1a1a);
  transition: background-color 0.2s ease;
}
.jg-tipologia-item:hover {
  background-color: #fafafa;
}
.jg-tipologia-name {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.85rem;
  font-weight: 300;
}
.jg-tipologia-count {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.6rem;
  font-weight: 400;
  color: var(--wp--preset--color--gris-medio, #767676);
  margin-left: 0.5rem;
}
@media (max-width: 768px) {
  .jg-tipologias-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .jg-tipologias-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Lang switcher fix: match menu size + spacing ── */
.jg-lang-switch {
  font-size: 1rem !important;
  margin-left: 1.5rem !important;
  font-weight: 300;
  letter-spacing: 0.02em;
}
.jg-lang-active {
  font-weight: 400;
}

/* ── Lang separator ── */
.jg-lang-sep {
  color: var(--wp--preset--color--gris-medio, #767676);
  padding: 0 0.15em;
  font-weight: 200;
}

/* ==========================================================
   MAP PAGE — v10: Absolute map, normal-flow header
   Strategy:
   - .jg-map-page is the 100vh containing block
   - Header stays in NORMAL FLOW (same position as every page)
   - Map content is ABSOLUTE, covering the full viewport
   - Header floats above the map via z-index
   - No body background hacks needed
   ========================================================== */

/* 1. Wrapper: sized to viewport, positioning context */
.jg-map-page {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

/* 2. Header: normal flow, transparent, above the map */
.jg-map-page > header.wp-block-template-part {
  position: relative;
  z-index: 10;
}

.jg-map-page > header.wp-block-template-part,
.jg-map-page > header.wp-block-template-part > .wp-block-group,
.jg-map-page > header.wp-block-template-part .wp-block-group,
.jg-map-page > header.wp-block-template-part .jg-utility-bar {
  background: transparent !important;
  background-color: transparent !important;
}

/* 3. Map content: absolute, covers the ENTIRE wrapper from top:0 */
.jg-map-page .wp-block-post-content,
.jg-map-page .entry-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  margin: 0 !important;
}

/* 4. Map plugin containers: fill their parent completely */
.jg-map-page .codespacing_progress_map_area,
.jg-map-page .cspm_main_map_container,
.jg-map-page [id^="cspm_mapCanvas"] {
  height: 100% !important;
  width: 100% !important;
}

/* 5. Override WP navigation white backgrounds on map page */
.jg-map-page .wp-block-navigation__responsive-container.has-base-background-color,
.jg-map-page .wp-block-navigation__submenu-container.has-base-background-color {
  background: transparent !important;
  background-color: transparent !important;
}

/* ── Homepage only: extra spacing between header and content ── */
body.home header.wp-block-template-part .alignwide {
  padding-bottom: 50px !important;
}

/* ── Bilingual: show/hide by html lang (global) ── */
html[lang^="en"] .jg-lang-es { display: none !important; }
html[lang^="es"] .jg-lang-en { display: none !important; }
html:not([lang^="en"]):not([lang^="es"]) .jg-lang-en { display: none !important; }
