/* =========================================================
   VIEJO MAESTRO · COMPARTIR
   v1 · 2026-09-16
========================================================= */

/* ---------------------------------------------------------
   Barra de compartir en contenido
--------------------------------------------------------- */
.vm-share-bar{
  position:relative;
  margin-top:34px;
  padding:18px 0;

  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:7px;

  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
}

.vm-share-message{
  color:var(--muted);
  font-size:.76rem;
  line-height:1;
}

.vm-share-trigger{
  padding:0;
  border:0;
  background:transparent;
  color:var(--wine);

  display:inline-flex;
  align-items:center;
  gap:7px;

  font:inherit;
  font-size:.72rem;
  font-weight:800;
  letter-spacing:.08em;
  line-height:1;
  cursor:pointer;
}

.vm-share-trigger:hover,
.vm-share-trigger:focus-visible{
  color:var(--ink);
}

.vm-share-icon{
  display:block;
  width:18px;
  height:18px;
  fill:currentColor;
}

/*
 * La segunda línea de la barra ya separa de la navegación,
 * por eso evitamos una tercera línea duplicada.
 */
.article .vm-share-bar + .content-neighbors{
  margin-top:0;
  padding-top:24px;
  border-top:0;
}


/* ---------------------------------------------------------
   Menú flotante
--------------------------------------------------------- */
.vm-share-menu{
  position:fixed;
  z-index:10000;

  width:220px;
  padding:8px;

  border:1px solid var(--line);
  background:var(--paper, #f7f2e8);
  box-shadow:0 18px 50px rgba(20,16,12,.16);
}

.vm-share-menu[hidden]{
  display:none !important;
}

.vm-share-menu button,
.vm-share-menu a{
  width:100%;
  min-height:40px;
  padding:9px 11px;

  display:flex;
  align-items:center;
  gap:10px;

  border:0;
  background:transparent;
  color:var(--ink);

  font:inherit;
  font-size:.82rem;
  line-height:1.15;
  text-align:left;
  text-decoration:none;
  cursor:pointer;
}

.vm-share-menu button:hover,
.vm-share-menu button:focus-visible,
.vm-share-menu a:hover,
.vm-share-menu a:focus-visible{
  background:rgba(120,54,44,.07);
}

.vm-share-menu-icon{
  width:20px;
  min-width:20px;
  text-align:center;
  color:var(--wine);
  font-weight:800;
}

.vm-share-menu-separator{
  height:1px;
  margin:6px 4px;
  background:var(--line);
}

.vm-share-feedback{
  color:var(--wine) !important;
  font-weight:700 !important;
}


/* ---------------------------------------------------------
   /FRASES · tarjetas clickeables
--------------------------------------------------------- */
.phrase-image-open{
  width:100%;
  margin:0;
  padding:0;
  display:block;
  border:0;
  background:transparent;
  cursor:zoom-in;
}

.phrase-image-open img{
  transition:transform .2s ease, opacity .2s ease;
}

.phrase-image-open:hover img,
.phrase-image-open:focus-visible img{
  transform:scale(1.015);
  opacity:.94;
}


/* ---------------------------------------------------------
   Lightbox de frases
--------------------------------------------------------- */
.phrase-lightbox{
  position:fixed;
  inset:0;
  z-index:9990;

  display:grid;
  place-items:center;
  padding:28px;
}

.phrase-lightbox[hidden]{
  display:none !important;
}

.phrase-lightbox-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,12,10,.82);
  backdrop-filter:blur(3px);
}

.phrase-lightbox-dialog{
  position:relative;
  z-index:1;

  width:min(92vw,720px);
  max-height:92vh;

  display:flex;
  flex-direction:column;

  background:#f7f2e8;
  box-shadow:0 28px 90px rgba(0,0,0,.34);
}

.phrase-lightbox-close{
  position:absolute;
  z-index:3;
  top:10px;
  right:12px;

  width:40px;
  height:40px;

  border:1px solid rgba(255,255,255,.45);
  border-radius:50%;
  background:rgba(20,16,12,.55);
  color:#fff;

  font-size:1.8rem;
  line-height:1;
  cursor:pointer;
}

.phrase-lightbox-media{
  min-height:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#111;
  overflow:hidden;
}

.phrase-lightbox-media img{
  display:block;
  width:auto;
  max-width:100%;
  max-height:calc(92vh - 78px);
  object-fit:contain;
}

.phrase-lightbox-actions{
  flex:0 0 auto;
  padding:0 22px;
}

.vm-share-bar--lightbox{
  margin:0;
  border-top:0;
}

body.is-phrase-lightbox-open{
  overflow:hidden;
}


/* ---------------------------------------------------------
   Responsive
--------------------------------------------------------- */
@media(max-width:700px){

  .vm-share-bar{
    padding:16px 0;
  }

  .vm-share-message{
    font-size:.72rem;
  }

  .vm-share-trigger{
    font-size:.7rem;
  }

  .vm-share-menu{
    width:min(240px, calc(100vw - 28px));
  }

  .phrase-lightbox{
    padding:12px;
  }

  .phrase-lightbox-dialog{
    width:100%;
    max-height:96vh;
  }

  .phrase-lightbox-media img{
    max-height:calc(96vh - 76px);
  }

  .phrase-lightbox-actions{
    padding:0 16px;
  }

}

@media(max-width:480px){

  .vm-share-bar{
    justify-content:space-between;
    gap:12px;
  }

  .phrase-lightbox{
    padding:0;
  }

  .phrase-lightbox-dialog{
    width:100%;
    height:100%;
    max-height:none;
  }

  .phrase-lightbox-media{
    flex:1 1 auto;
  }

  .phrase-lightbox-media img{
    max-height:calc(100vh - 78px);
  }

}
