/* ============================================================
   SIDEBAR PORTFOLIO — estilos globales
   /wp-content/themes/carloscastro/sidebar-portfolio.css
   ============================================================ */

:root {
  --spt-sidebar-width: 25%;
  --spt-sidebar-bg: #ffffff;
  --spt-sidebar-text: #000000;
  --spt-sidebar-muted: #999999;
  --spt-sidebar-border: #e8e8e8;
  --spt-nav-font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --spt-nav-size: 15px;
  --spt-nav-tracking: 0.08em;
  --spt-transition: 0.2s ease;
  --spt-topbar-height: 50px;
}

/* ── Reset global ───────────────────────────────────────────── */
body {
  margin: 0 !important;
  padding: 0 !important;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
}

/* ── Ocultar elementos de Astra ─────────────────────────────── */
.site-header, #masthead,
.site-footer, #colophon,
.ast-above-header-wrap,
.ast-below-header-wrap { display: none !important; }

/* ── Wrapper principal ──────────────────────────────────────── */
.spt-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
  padding: 10px;
}

/* ── SIDEBAR ────────────────────────────────────────────────── */
.spt-sidebar {
   width: 25%;        /* en vez de var(--spt-sidebar-width) */
  min-width: 300px;  /* mínimo para que no quede muy angosto */
  flex-shrink: 0;
  background: var(--spt-sidebar-bg);
  border-right: 1px solid var(--spt-sidebar-border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.spt-sidebar::-webkit-scrollbar { display: none; }

/* ── Brand / Logo ───────────────────────────────────────────── */
.spt-brand {
  padding: 77px 60px 24px 20px;
}

.spt-brand__link {
  display: block;
  text-decoration: none;
}
/*
.spt-brand__link img {
  max-width: 140px;
  height: auto;
  display: block;
}
*/
.spt-brand__name {
  font-family: var(--spt-nav-font);
  font-size: 12px;
  font-weight: 400;
  color: #000000;
  letter-spacing: var(--spt-nav-tracking);
  text-transform: uppercase;
  line-height: 1.4;
}

/* En móvil también se ve el logo (sin ocultarlo) */
@media (max-width: 768px) {
  .spt-brand {
    padding: 35px 25px 15px 25px;
  }
  
  .spt-brand__link img {
    max-width: 140px;
  }
}

/* Logo en móvil (más pequeño pero visible) */
@media (max-width: 768px) {
  .spt-brand {
    padding: 35px 25px 18px 25px;
  }
  
  .spt-brand__link img {
    max-width: 130px;
    height: auto;
    display: block;
  }
}

/* ── Navegación ─────────────────────────────────────────────── */



.spt-nav {
  padding: 0 0px 16px;
}

.spt-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.spt-nav__list li { margin: 0; padding: 0; }

.spt-nav__list a {
  display: block;
  padding: 6px 28px;
  font-family: var(--spt-nav-font);
  font-size: var(--spt-nav-size);
  font-weight: 500;
  color: #000000;
  text-decoration: none;
  letter-spacing: var(--spt-nav-tracking);
  transition: color var(--spt-transition);
  line-height: 1.4;
}

.spt-nav__list a:hover { color: #888888; }

.spt-nav__list .current-menu-item > a,
.spt-nav__list .current_page_item > a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* Submenú */
.spt-nav__list .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.spt-nav__list .sub-menu a {
  padding-left: 40px;
  font-size: 11px;
  color: #888888;
  text-transform: none;
}

/* ── Separador ──────────────────────────────────────────────── */
.spt-sidebar__divider {
  margin: 8px 28px 16px;
  border: none;
  border-top: 1px solid var(--spt-sidebar-border);
}

/* ── Info del proyecto (posts/proyectos individuales) ───────── */
.spt-project-info {
  padding: 0 28px;
  flex: 1;
}

.spt-back-link {
  display: inline-block;
  font-family: var(--spt-nav-font);
  font-size: 10px;
  color: var(--spt-sidebar-muted);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
  transition: color var(--spt-transition);
}

.spt-back-link:hover { color: #000000; }

.spt-project-title {
  font-family: var(--spt-nav-font);
  font-size: 13px;
  font-weight: 500;
  color: #000000;
  line-height: 1.4;
  margin: 0 0 14px;
  letter-spacing: 0.01em;
}

.spt-project-description {
  font-family: var(--spt-nav-font);
  font-size: 15px;
  font-weight: 400;
  color: #333333;
  line-height: 1.75;
}

.spt-project-description p { margin: 0 0 10px; }
.spt-project-description p:last-child { margin-bottom: 0; }

/* Metadatos */
.spt-project-meta {
  margin: 16px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--spt-sidebar-border);
  font-family: var(--spt-nav-font);
  font-size: 11px;
}

.spt-project-meta dt {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--spt-sidebar-muted);
  margin-top: 8px;
}

.spt-project-meta dt:first-child { margin-top: 0; }
.spt-project-meta dd { margin: 2px 0 0; color: #000000; }

/* ── Idioma ─────────────────────────────────────────────────── */
.spt-lang {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 28px 20px;
  font-family: var(--spt-nav-font);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: auto;
}

.spt-lang a {
  color: #cccccc;
  text-decoration: none;
  transition: color var(--spt-transition);
}

.spt-lang a:hover,
.spt-lang a.active { color: #000000; }

.spt-lang__sep { color: #dddddd; }

/* ── Footer del sidebar ─────────────────────────────────────── */
.spt-sidebar__footer {
  padding: 0 28px 28px;
  font-family: var(--spt-nav-font);
  font-size: 10px;
  color: #cccccc;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Botón cerrar mobile ────────────────────────────────────── */
.spt-sidebar__close {
  display: none;
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: #000000;
  padding: 4px;
  opacity: 0.4;
  transition: opacity var(--spt-transition);
}

.spt-sidebar__close:hover { opacity: 1; }

/* ── Overlay mobile ─────────────────────────────────────────── */
.spt-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.88);
  z-index: 99;
  opacity: 0;
  transition: opacity var(--spt-transition);
  pointer-events: none;
}

.spt-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── CONTENIDO PRINCIPAL ────────────────────────────────────── */
.spt-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  overflow-y: auto;
}

/* ── Topbar mobile ──────────────────────────────────────────── */
/* ── Topbar mobile ──────────────────────────────────────────── */
.spt-topbar {
  display: none;
  align-items: center;
  gap: 14px;
  height: var(--spt-topbar-height);
  padding: 0 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--spt-sidebar-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.spt-topbar__toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: #000000;
  padding: 4px;
  display: flex;
  align-items: center;
  opacity: 0.6;
  transition: opacity var(--spt-transition);
}

.spt-topbar__toggle:hover {
  opacity: 1;
}

.spt-topbar__brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 1;
  height: 100%;
  max-width: 180px;
}

.spt-topbar__logo,
.spt-topbar__brand img {
  display: block;
  width: auto;
  max-width: 200px;
  
  object-fit: contain;
}

.spt-topbar__text {
  font-family: var(--spt-nav-font);
  font-size: 11px;
  font-weight: 400;
  color: #000000;
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .spt-topbar {
    display: flex;
    height:100px;
  }

  .spt-topbar__logo,
  .spt-topbar__brand img {
    max-width: 200px;
    max-height: 60px;
  }
}

  .spt-nav {
    padding: 0 10px 16px !important;
  }

/* ── Imágenes en posts/proyectos ────────────────────────────── */
.sp-featured-image {
  width: 80%;
  margin: 40px auto 0;
  line-height: 0;
}

.sp-featured-image a { display: block; cursor: zoom-in; }

.sp-featured-image img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.3s ease;
}

.sp-featured-image a:hover img { opacity: 0.92; }

.sp-post-content {
  width: 80%;
  margin: 0 auto;
  padding-bottom: 60px;
}

/* Imágenes en el editor */
.sp-post-content img,
.sp-post-content .wp-block-image img,
.sp-post-content figure img,
.sp-post-content :where(img[class*=wp-image-]) {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  display: block;
}

.sp-post-content figure.wp-block-image,
.sp-post-content .wp-block-image {
  margin: 0 0 1px;
  padding: 0;
  line-height: 0;
  width: 100%;
}

/* Caption */
.sp-post-content figcaption,
.sp-post-content .wp-block-image figcaption {
  font-family: var(--spt-nav-font);
  font-size: 10px;
  color: var(--spt-sidebar-muted);
  letter-spacing: 0.04em;
  padding: 10px 0 20px;
  line-height: 1.5;
}

/* Galería shortcode */
.sp-post-content .gallery {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  padding: 0;
}

.sp-post-content .gallery-item {
  margin: 0;
  width: 100% !important;
}

.sp-post-content .gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
}

/* Galería ACF */
.sp-gallery { width: 80%; margin: 0 auto; }

.sp-gallery__item {
  margin: 0 0 1px;
  line-height: 0;
}

.sp-gallery__item a { display: block; cursor: zoom-in; }

.sp-gallery__item img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.3s ease;
}

.sp-gallery__item a:hover img { opacity: 0.92; }

.sp-gallery__caption {
  font-family: var(--spt-nav-font);
  font-size: 10px;
  color: var(--spt-sidebar-muted);
  letter-spacing: 0.04em;
  padding: 10px 0 20px;
  line-height: 1.5;
  display: block;
}

/* ── RESPONSIVE — Tablet ────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --spt-sidebar-width: 240px; }
  .spt-brand { padding: 28px 20px 20px; }
  .spt-nav__list a { padding: 6px 20px; }
  .spt-project-info { padding: 0 20px; }
  .spt-lang { padding: 16px 20px 20px; }
  .sp-featured-image, .sp-post-content, .sp-gallery { width: 88%; }
}

/* ── RESPONSIVE — Mobile ────────────────────────────────────── */
@media (max-width: 768px) {
  .spt-topbar { display: flex; }

  .spt-sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100%;
    width: 280px;
    min-width: 280px;
    transform: translateX(-100%);
    z-index: 200;
    box-shadow: none;
  }



  .spt-sidebar.is-open {
    transform: translateX(0);
    box-shadow: 2px 0 16px rgba(0,0,0,0.06);
  }

  .spt-sidebar__close { display: flex; align-items: center; justify-content: center; }
  .spt-overlay { display: block; }

  .sp-featured-image, .sp-post-content, .sp-gallery {
    width: 94%;
    margin-top: 24px;
  }
}

/* ====================== VIDEO DE FONDO FULL SIZE ====================== */
.background-video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: #000;
}

.background-video-embed,
.background-video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Video MP4 */
.background-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;           /* Esta línea es correcta */
}

/* Overlay oscuro */
.background-video-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1;
    pointer-events: none;
}

/* Contenido encima del video */
.spt-content {
    position: relative;
    z-index: 2;
    min-height: 100vh;
}

.spt-topbar {
    position: relative;
    z-index: 10;
}



/* ─────────────────────────────────────────────────────────────
   FIX MOBILE FINAL — ENTRADAS INDIVIDUALES
   Corrige contenido desplazado o bajado en single.php
   ───────────────────────────────────────────────────────────── */

@media (max-width: 768px) {

  body.single-post-page {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  body.single-post-page .spt-wrapper {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100vh !important;
    position: relative !important;
    overflow-x: hidden !important;
  }

  body.single-post-page .spt-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 280px !important;
    min-width: 0 !important;
    max-width: 85vw !important;
    height: 100vh !important;
    transform: translateX(-100%) !important;
    z-index: 200 !important;
    background: #ffffff !important;
    overflow-y: auto !important;
  }

  body.single-post-page .spt-sidebar.is-open {
    transform: translateX(0) !important;
    box-shadow: 2px 0 16px rgba(0,0,0,0.06) !important;
  }

  body.single-post-page .spt-content {
    display: block !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    flex: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
  }

  body.single-post-page .spt-topbar {
    display: flex !important;
    position: relative !important;
    top: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  body.single-post-page .sp-featured-image,
  body.single-post-page .sp-post-content,
  body.single-post-page .sp-gallery,
  body.single-post-page .sp-video-full {
    width: 94% !important;
    max-width: 94% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }

  body.single-post-page .sp-featured-image {
    margin-top: 24px !important;
  }

  body.single-post-page img,
  body.single-post-page iframe,
  body.single-post-page video {
    max-width: 100% !important;
  }

  body.single-post-page img {
    height: auto !important;
    display: block !important;
  }
}

/* ============================================================
 /* ============================================================
   VIDEO CUADRADO EN MÓVIL — PAGE VIDEO
   Mantiene escritorio igual y ajusta solo celular
   ============================================================ */

@media (max-width: 768px) {

  body.page-template-page-video,
  body.page-with-background-video {
    overflow-x: hidden !important;
    background: #ffffff !important;
  }

  body.page-template-page-video .spt-wrapper,
  body.page-with-background-video .spt-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }

  body.page-template-page-video .spt-content,
  body.page-with-background-video .spt-content {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
    background: #ffffff !important;
  }

  body.page-template-page-video .background-video-wrapper,
  body.page-with-background-video .background-video-wrapper {
    position: relative !important;
    inset: auto !important;

    width: 100% !important;
    max-width: 100% !important;

    height: auto !important;
    min-height: 0 !important;

    aspect-ratio: 1 / 1 !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow: hidden !important;
    background: #000000 !important;

    z-index: 1 !important;
    line-height: 0 !important;
    display: block !important;
  }

  body.page-template-page-video .background-video,
  body.page-with-background-video .background-video {
    position: absolute !important;
    inset: 0 !important;

    width: 100% !important;
    height: 100% !important;

    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;

    margin: 0 !important;
    padding: 0 !important;

    transform: none !important;

    object-fit: cover !important;
    object-position: center center !important;

    display: block !important;
  }

  body.page-template-page-video .background-video-embed,
  body.page-with-background-video .background-video-embed,
  body.page-template-page-video .background-video-embed iframe,
  body.page-with-background-video .background-video-embed iframe {
    position: absolute !important;
    inset: 0 !important;

    width: 100% !important;
    height: 100% !important;

    min-width: 0 !important;
    min-height: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;
    display: block !important;
    line-height: 0 !important;
  }

  body.page-template-page-video .background-video-wrapper::after,
  body.page-with-background-video .background-video-wrapper::after {
    position: absolute !important;
    inset: 0 !important;

    width: 100% !important;
    height: 100% !important;
  }

  body.page-template-page-video .sp-post-content,
  body.page-with-background-video .sp-post-content {
    margin-top: 0 !important;
  }
}

/* ============================================================
   INFORMACIÓN DEL PROYECTO ARRIBA — SOLO MÓVIL
   ============================================================ */

/* Oculta el bloque móvil en escritorio */
.spt-mobile-entry-intro {
  display: none;
}

@media (max-width: 768px) {

  /* Mostrar título y descripción dentro del contenido principal */
  body.single-post-page .spt-mobile-entry-intro,
  body.single-project-page .spt-mobile-entry-intro,
  body.single-portfolio-unified .spt-mobile-entry-intro {
    display: block !important;

    width: 94% !important;
    max-width: 94% !important;

    margin: 28px auto 0 !important;
    padding: 0 !important;

    box-sizing: border-box !important;
    font-family: var(
      --spt-nav-font,
      'Helvetica Neue',
      Helvetica,
      Arial,
      sans-serif
    ) !important;
  }

  body.single-post-page .spt-mobile-entry-title,
  body.single-project-page .spt-mobile-entry-title,
  body.single-portfolio-unified .spt-mobile-entry-title {
    margin: 0 0 20px !important;
    padding: 0 !important;

    font-family: inherit !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;

    color: #000000 !important;
    text-align: left !important;
    letter-spacing: 0 !important;
  }

  body.single-post-page .spt-mobile-entry-description,
  body.single-project-page .spt-mobile-entry-description,
  body.single-portfolio-unified .spt-mobile-entry-description {
    margin: 0 !important;
    padding: 0 !important;

    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.55 !important;

    color: #222222 !important;
    text-align: left !important;
  }

  body.single-post-page .spt-mobile-entry-description p,
  body.single-project-page .spt-mobile-entry-description p,
  body.single-portfolio-unified .spt-mobile-entry-description p {
    margin: 0 0 14px !important;
    padding: 0 !important;
  }

  body.single-post-page .spt-mobile-entry-description p:last-child,
  body.single-project-page .spt-mobile-entry-description p:last-child,
  body.single-portfolio-unified .spt-mobile-entry-description p:last-child {
    margin-bottom: 0 !important;
  }

  /* Separación entre la descripción y la primera imagen */
  body.single-post-page .spt-mobile-entry-intro + .sp-featured-image,
  body.single-project-page .spt-mobile-entry-intro + .sp-featured-image,
  body.single-portfolio-unified .spt-mobile-entry-intro + .sp-featured-image,
  body.single-post-page .spt-mobile-entry-intro + .sp-gallery,
  body.single-project-page .spt-mobile-entry-intro + .sp-gallery,
  body.single-portfolio-unified .spt-mobile-entry-intro + .sp-gallery {
    margin-top: 28px !important;
  }

  /*
   * Evita repetir título y descripción dentro del menú lateral
   * cuando se abre en móvil. El enlace de regreso permanece visible.
   */
  body.single-post-page .spt-sidebar .spt-project-title,
  body.single-post-page .spt-sidebar .spt-project-description,
  body.single-project-page .spt-sidebar .spt-project-title,
  body.single-project-page .spt-sidebar .spt-project-description,
  body.single-portfolio-unified .spt-sidebar .spt-project-title,
  body.single-portfolio-unified .spt-sidebar .spt-project-description {
    display: none !important;
  }
}