/* Lectura en PC de las páginas de tema (los elementos los crea pc-temas.js).
   Solo desde 1100 px. Por debajo, la página queda exactamente como antes. */
.pc-prevnext, .pc-arriba, .pc-tutor-btn, .pc-tutor-panel{ display:none; }

@media (min-width:1100px){
  :root{ --pc-panel:clamp(340px, 30vw, 440px); }

  /* Columna de unos 760 px, centrada, y todo un 12,5 % más grande
     (párrafos de 16 a 18 px; títulos, cajas y figuras en proporción) */
  .wrap{ max-width:808px; transition:margin-left .25s ease; }
  .wrap > *{ zoom:1.125; }

  /* Con el tutor abierto, el texto se aparta a la izquierda para no quedar tapado (no cambia de línea ni de sitio al bajar) */
  body.pc-tutor-abierto .wrap{ margin-left:max(0px, calc((100vw - var(--pc-panel) - 808px) / 2)); }

  /* ---- Tema anterior / siguiente ---- */
  .pc-prevnext{
    display:flex;
    gap:14px;
    margin-top:48px;
    padding-top:24px;
    border-top:1px solid var(--line);
  }
  .pc-prevnext a{
    flex:1 1 0;
    display:flex;
    flex-direction:column;
    gap:3px;
    padding:14px 18px;
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:12px;
    text-decoration:none;
    color:var(--ink);
  }
  .pc-prevnext a.pc-next{ text-align:right; margin-left:auto; }
  .pc-prevnext a.pc-prev:only-child{ flex-grow:0; flex-basis:50%; }
  .pc-prevnext a.pc-next:only-child{ flex-grow:0; flex-basis:50%; }
  .pc-pn-label{ font-size:13px; font-weight:600; color:var(--teal); }
  .pc-pn-title{ font-family:'Fraunces', serif; font-size:19px; font-weight:500; }
  .pc-prevnext a:hover{ background:var(--teal-soft); border-color:var(--teal); }
  .pc-prevnext a:focus-visible{ outline:2px solid var(--teal); outline-offset:2px; }

  /* ---- Botones fijos: tutor (abajo a la derecha) y volver arriba (encima) ---- */
  .pc-tutor-btn{
    display:inline-flex;
    align-items:center;
    gap:9px;
    position:fixed;
    right:24px;
    bottom:24px;
    z-index:900;
    font-family:'Source Sans 3', sans-serif;
    font-size:16px;
    font-weight:600;
    color:#fff;
    background:var(--teal);
    border:0;
    border-radius:28px;
    padding:13px 20px 13px 16px;
    box-shadow:0 6px 20px rgba(19,42,40,0.28);
    cursor:pointer;
  }
  .pc-tutor-btn svg{ width:22px; height:22px; }
  .pc-tutor-btn:hover{ filter:brightness(1.1); }
  .pc-tutor-btn:focus-visible, .pc-arriba:focus-visible, .pc-tutor-close:focus-visible{ outline:3px solid var(--amber); outline-offset:2px; }
  body.pc-tutor-abierto .pc-tutor-btn{ display:none; }

  .pc-arriba{
    display:inline-flex;
    align-items:center;
    gap:6px;
    position:fixed;
    right:24px;
    bottom:86px;
    z-index:900;
    font-family:'Source Sans 3', sans-serif;
    font-size:14.5px;
    font-weight:600;
    color:var(--teal);
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:22px;
    padding:9px 16px;
    box-shadow:0 4px 14px rgba(19,42,40,0.14);
    cursor:pointer;
    opacity:0;
    visibility:hidden;
    transform:translateY(8px);
    transition:opacity .2s ease, transform .2s ease, visibility .2s;
  }
  .pc-arriba.visible{ opacity:1; visibility:visible; transform:none; }
  .pc-arriba:hover{ background:var(--teal-soft); }
  body.pc-tutor-abierto .pc-arriba{ right:calc(var(--pc-panel) + 24px); bottom:24px; }

  /* ---- Panel lateral del tutor ---- */
  .pc-tutor-panel:not([hidden]){
    display:flex;
    flex-direction:column;
    position:fixed;
    top:0;
    right:0;
    bottom:0;
    width:var(--pc-panel);
    z-index:950;
    background:var(--bg);
    border-left:1px solid var(--line);
    box-shadow:-10px 0 30px rgba(19,42,40,0.14);
    animation:pc-tutor-entra .22s ease;
  }
  @keyframes pc-tutor-entra{ from{ transform:translateX(30px); opacity:0; } to{ transform:none; opacity:1; } }
  .pc-tutor-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:18px 18px 14px 22px;
    border-bottom:1px solid var(--line);
  }
  .pc-tutor-title{ font-family:'Fraunces', serif; font-size:21px; font-weight:500; margin:0; color:var(--ink); }
  .pc-tutor-close{
    width:38px;
    height:38px;
    border-radius:50%;
    border:1px solid var(--line);
    background:var(--panel);
    color:var(--ink);
    font-size:16px;
    cursor:pointer;
    flex-shrink:0;
  }
  .pc-tutor-close:hover{ background:var(--teal-soft); }
  .pc-tutor-body{ flex:1; overflow-y:auto; padding:18px; }
  /* El bloque del tutor, dentro del panel: el mismo, un poco más grande */
  .pc-tutor-body .ask-card{ margin-top:0; zoom:1.06; }
}

/* ---- Pantallas anchas (desde 1400 px): tutor siempre abierto en una columna fija a la derecha ----
   Texto (808 px con sus márgenes) + hueco (24 px) + tutor (400 px) = 1232 px; se centra lo visible (texto + tutor). */
@media (min-width:1400px){
  body.pc-tutor-fijo .wrap{ margin-left:max(0px, calc((100% - 1256px) / 2)); }
  body.pc-tutor-fijo .pc-tutor-panel:not([hidden]){
    top:24px;
    bottom:auto;
    right:auto;
    left:calc(max(0px, (100% - 1256px) / 2) + 832px);
    width:400px;
    max-height:calc(100vh - 48px);
    background:transparent;
    border:0;
    box-shadow:none;
    animation:none;
  }
  body.pc-tutor-fijo .pc-tutor-head{ border-bottom:0; padding:16px 4px 10px; }
  body.pc-tutor-fijo .pc-tutor-close{ display:none; }
  body.pc-tutor-fijo .pc-tutor-body{ padding:0 0 4px; }
  body.pc-tutor-fijo .pc-tutor-body .ask-card{ zoom:1.08; }
  /* "Arriba", abajo a la derecha de la columna del tutor (no tapa el texto) */
  body.pc-tutor-fijo .pc-arriba{ right:calc(max(0px, (100% - 1256px) / 2) + 24px); bottom:24px; }
}
