/* ============================================================
   PORTFOLIO SIDEBAR LAYOUT — carloscastroarias.com style
   Agregar en: /wp-content/themes/astra-child/sidebar-portfolio.css
   Estética: blanco puro, negro, tipografía fina, máximo minimalismo
   ============================================================ */

/* ── Variables — extraídas del sitio original ───────────────── */
:root {
  --spt-sidebar-width: 220px;
  --spt-sidebar-bg: #ffffff;
  --spt-sidebar-text: #000000;
  --spt-sidebar-text-muted: #999999;
  --spt-sidebar-border: #e8e8e8;
  --spt-content-bg: #ffffff;
  --spt-topbar-height: 50px;
  --spt-nav-font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --spt-nav-size: 12px;
  --spt-nav-tracking: 0.08em;
  --spt-transition: 0.2s ease;
}

/* ── Reset Astra ────────────────────────────────────────────── */
body.sidebar-portfolio-template {
  margin: 0;
  padding: 0;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.sidebar-portfolio-template #masthead,
body.sidebar-portfolio-template #colophon,
body.sidebar-portfolio-template .ast-above-header-wrap,
body.sidebar-portfolio-template .ast-below-header-wrap {
  display: none !important;
}

body.sidebar-portfolio-template #page {
  padding: 0 !important;
  margin: 0 !important;
}

body.sidebar-portfolio-template .ast-container {
  max-width: none !important;
  padding: 0 !important;
}

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

/* ── SIDEBAR ────────────────────────────────────────────────── */
.spt-sidebar {
  width: var(--spt-sidebar-width);
  min-width: var(--spt-sidebar-width);
  background: var(--spt-sidebar-bg);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  border-right: 1px solid var(--spt-sidebar-border);
  scrollbar-width: none;
  -ms-overflow-style: none;
  transition: transform var(--spt-transition);
}

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

/* ── Marca ──────────────────────────────────────────────────── */
.spt-brand {
  padding: 40px 28px 28px;
}

.spt-brand__link {
  text-decoration: none;
  display: block;
}

.spt-brand__link img {
  max-width: 130px;
  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);
  line-height: 1.4;
  text-transform: uppercase;
}

.spt-brand__tagline {
  margin: 8px 0 0;
  font-family: var(--spt-nav-font);
  font-size: 11px;
  font-weight: 300;
  color: var(--spt-sidebar-text-muted);
  letter-spacing: 0.03em;
  line-height: 1.5;
}

/* ── Navegación ─────────────────────────────────────────────── */
.spt-nav {
  flex: 1;
  padding: 4px 0 20px;
}

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

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

/* Links — idénticos al menú original del sitio */
.spt-nav__list > li > a {
  display: block;
  padding: 6px 28px;
  font-family: var(--spt-nav-font);
  font-size: var(--spt-nav-size);
  font-weight: 400;
  color: #000000;
  text-decoration: none;
  letter-spacing: var(--spt-nav-tracking);
  text-transform: uppercase;
  transition: color var(--spt-transition);
  line-height: 1.4;
}

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

/* Ítem activo — subrayado fino como estilo editorial */
.spt-nav__list .current-menu-item > a,
.spt-nav__list .current_page_item > a,
.spt-nav__list .current-menu-ancestor > a {
  color: #000000;
  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 {
  display: block;
  padding: 5px 28px 5px 40px;
  font-family: var(--spt-nav-font);
  font-size: 11px;
  font-weight: 400;
  color: #888888;
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: none;
  transition: color var(--spt-transition);
}

.spt-nav__list .sub-menu a:hover {
  color: #000000;
}

/* ── Selector de idioma (EN | ES) ───────────────────────────── */
.spt-lang {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 28px 0;
  font-family: var(--spt-nav-font);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

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

.spt-lang__sep {
  color: #dddddd;
  font-size: 10px;
}

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

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

.spt-sidebar__footer a:hover {
  color: #000000;
}

.spt-widget__title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #cccccc;
  margin: 0 0 6px;
  font-family: var(--spt-nav-font);
}

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

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

/* ── Overlay mobile — blanco traslúcido, coherente con el sitio ─ */
.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);
}

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

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

/* 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 {
  font-family: var(--spt-nav-font);
  font-size: 11px;
  font-weight: 400;
  color: #000000;
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Área de contenido */
.spt-page-content {
  flex: 1;
  width: 100%;
}

/* Elementor override */
.spt-page-content .elementor-section-wrap,
.spt-page-content .e-con-inner {
  max-width: 100% !important;
}

.spt-page-content .elementor > .elementor-inner > .elementor-section-wrap > .elementor-section,
.spt-page-content .elementor > .elementor-inner > .elementor-section-wrap > .e-con {
  width: 100% !important;
  max-width: 100% !important;
}

/* ── Tablet ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --spt-sidebar-width: 190px; }

  .spt-brand { padding: 30px 20px 22px; }
  .spt-nav__list > li > a { padding: 6px 20px; }
  .spt-sidebar__footer { padding: 20px 20px 28px; }
  .spt-lang { padding-left: 20px; }
}

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

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

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

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

  .spt-overlay {
    display: block;
    pointer-events: none;
  }

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