
:root{
  --bg:#f7f8fb;
  --surface:#ffffff;
  --text:#18202a;
  --muted:#667085;
  --line:#e4e7ec;
  --accent:#1f4f8f;
  --accent-soft:#eaf2fb;
  --warn:#8a4b08;
  --warn-soft:#fff4e5;
  --ok:#176b4d;
  --ok-soft:#eaf8f1;
  --shadow:0 10px 30px rgba(16,24,40,.07);
  --radius:18px;
  --max:1180px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--text);
  background:var(--bg);
  line-height:1.68;
}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
.wrap{width:min(var(--max),calc(100% - 32px));margin:auto}
.site-header{
  position:sticky;top:0;z-index:20;
  background:rgba(255,255,255,.93);
  backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line);
}
.header-inner{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:13px 0}
.brand{font-weight:800;color:var(--text);letter-spacing:-.02em}
.brand small{display:block;font-weight:500;color:var(--muted);font-size:.74rem}
.nav{display:flex;gap:16px;align-items:center;font-size:.94rem}
.hero{
  padding:72px 0 44px;
  background:linear-gradient(180deg,#ffffff 0%,#f7f8fb 100%);
}
.kicker{
  display:inline-block;padding:6px 10px;border-radius:999px;
  background:var(--accent-soft);color:var(--accent);font-weight:700;font-size:.8rem;
}
h1{font-size:clamp(2.4rem,6vw,4.6rem);line-height:1.02;letter-spacing:-.045em;margin:18px 0 18px}
.hero p.lead{font-size:clamp(1.1rem,2vw,1.35rem);max-width:800px;color:#344054}
.hero-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:26px}
.btn{
  display:inline-flex;align-items:center;justify-content:center;
  padding:11px 16px;border-radius:12px;border:1px solid var(--line);
  background:var(--surface);color:var(--text);font-weight:700;
}
.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}
.btn:hover{text-decoration:none;transform:translateY(-1px)}
.section{padding:44px 0}
.grid{display:grid;grid-template-columns:repeat(12,1fr);gap:18px}
.card{
  background:var(--surface);border:1px solid var(--line);
  border-radius:var(--radius);padding:22px;box-shadow:var(--shadow);
}
.card h3,.card h4{margin-top:0}
.span-4{grid-column:span 4}.span-6{grid-column:span 6}.span-8{grid-column:span 8}.span-12{grid-column:span 12}
.profile-box label{display:block;font-weight:700;margin-bottom:8px}
.profile-box select{width:100%;padding:12px;border-radius:10px;border:1px solid var(--line);background:#fff;font-size:1rem}
.profile-note{color:var(--muted);font-size:.92rem}
.part{margin:36px 0}
.part-title{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;border-bottom:1px solid var(--line);padding-bottom:10px}
.part-title h2{margin:0;letter-spacing:-.02em}
.chapter-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:16px}
.chapter-link{
  display:block;padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--surface);
  color:var(--text)
}
.chapter-link:hover{border-color:#b9c8dc;text-decoration:none;box-shadow:var(--shadow)}
.chapter-link small{display:block;color:var(--muted);margin-bottom:3px}
.reader-layout{display:grid;grid-template-columns:280px minmax(0,760px);gap:40px;align-items:start;padding:38px 0 70px}
.sidebar{position:sticky;top:82px}
.sidebar .card{box-shadow:none;padding:16px}
.sidebar h3{font-size:1rem;margin:0 0 12px}
.toc{list-style:none;padding:0;margin:0}
.toc li{margin:7px 0}
.toc a{color:#475467;font-size:.93rem}
.article{
  background:var(--surface);border:1px solid var(--line);border-radius:22px;padding:clamp(24px,4vw,52px);
  box-shadow:var(--shadow);
}
.article .eyebrow{color:var(--accent);font-weight:800;font-size:.86rem;text-transform:uppercase;letter-spacing:.06em}
.article h1{font-size:clamp(2.1rem,5vw,3.5rem);margin:10px 0 8px}
.article h2{margin-top:38px;line-height:1.2;letter-spacing:-.02em}
.article h3{margin-top:28px}
.article p{font-size:1.06rem}
.article .intro{font-size:1.18rem;color:#344054}
.callout{
  border-left:4px solid var(--accent);background:var(--accent-soft);
  padding:18px 20px;border-radius:0 14px 14px 0;margin:28px 0
}
.callout.warn{border-color:var(--warn);background:var(--warn-soft)}
.callout.ok{border-color:var(--ok);background:var(--ok-soft)}
.callout strong{display:block;margin-bottom:4px}
.path{
  display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:24px 0
}
.path span{padding:8px 10px;border-radius:10px;background:#f2f4f7;border:1px solid var(--line);font-weight:700;font-size:.9rem}
.path b{color:#98a2b3}
.chapter-nav{display:flex;justify-content:space-between;gap:12px;margin-top:38px;padding-top:24px;border-top:1px solid var(--line)}
.progress-wrap{height:4px;background:#eef2f6;position:sticky;top:59px;z-index:19}
.progress-bar{height:100%;width:0;background:var(--accent)}
.footer{padding:30px 0 60px;color:var(--muted);font-size:.9rem}
.hidden-by-profile{display:none}
.badge{
  display:inline-block;padding:4px 8px;border-radius:999px;background:#f2f4f7;color:#475467;font-size:.76rem;font-weight:700
}
.master-list li{margin:8px 0}
@media(max-width:900px){
  .reader-layout{grid-template-columns:1fr}
  .sidebar{display:none}
  .span-4,.span-6,.span-8{grid-column:span 12}
}
@media(max-width:720px){
  .nav a:not(.keep){display:none}
  .chapter-list{grid-template-columns:1fr}
  .hero{padding-top:46px}
  .article{border-radius:0;border-left:0;border-right:0}
  .wrap.reader{width:100%}
}
@media print{
  .site-header,.progress-wrap,.sidebar,.chapter-nav,.footer{display:none!important}
  body{background:white}
  .reader-layout{display:block;padding:0}
  .article{border:0;box-shadow:none;padding:0}
  a{color:inherit;text-decoration:none}
}

.profile-callout{
  margin:24px 0;
  border:1px solid var(--line);
  border-radius:16px;
  padding:18px 20px;
  background:#fbfcfe;
}
.profile-callout .profile-label{
  display:inline-block;
  margin-bottom:8px;
  padding:4px 8px;
  border-radius:999px;
  background:#eef2f6;
  color:#475467;
  font-size:.76rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.profile-callout h3{
  margin:0 0 8px;
  font-size:1.08rem;
}
.profile-callout p:last-child{margin-bottom:0}
.profile-hint{
  margin:12px 0 24px;
  padding:12px 14px;
  border-radius:12px;
  background:#f8fafc;
  border:1px dashed #cbd5e1;
  color:#475467;
  font-size:.92rem;
}

.milestone-list{
  display:grid;
  gap:14px;
  margin:26px 0 32px;
}
.milestone{
  display:grid;
  grid-template-columns:90px 1fr;
  gap:18px;
  padding:18px 0;
  border-bottom:1px solid var(--line);
}
.milestone:last-child{border-bottom:0}
.milestone-year{
  font-size:1.08rem;
  font-weight:900;
  color:var(--accent);
}
.milestone h3{margin:0 0 5px}
.milestone p{margin:0;color:#475467;font-size:1rem}
.experience{
  margin:32px 0;
  border:1px solid #d7dee8;
  border-radius:18px;
  background:linear-gradient(180deg,#fbfcfe,#f7f9fc);
  padding:24px;
}
.experience .experience-kicker{
  display:inline-block;
  font-size:.76rem;
  font-weight:900;
  letter-spacing:.05em;
  text-transform:uppercase;
  color:#344054;
  margin-bottom:8px;
}
.experience h3{margin:0 0 12px;font-size:1.28rem}
.experience p{font-size:1.02rem}
.sources-box{
  margin-top:38px;
  padding-top:24px;
  border-top:1px solid var(--line);
}
.sources-box h2{margin-top:0}
.sources-box ol{padding-left:22px}
.sources-box li{margin:10px 0;color:#475467}
.sources-box a{word-break:break-word}
.chapter-bridge{
  margin-top:34px;
  padding:22px;
  border-radius:16px;
  background:#111827;
  color:#f9fafb;
}
.chapter-bridge strong{display:block;margin-bottom:7px}
.chapter-bridge p{margin:0;color:#e5e7eb}
@media(max-width:620px){
  .milestone{grid-template-columns:1fr;gap:4px}
}


/* ===== UI v14: perfiles + navegación móvil ===== */

/* Important: profile blocks must NEVER remain visible after a profile reset. */
[data-profile].hidden-by-profile,
.profile-callout.hidden-by-profile{
  display:none !important;
}

.profile-callout{
  position:relative;
  margin:24px 0;
  border:1px solid #b9cbe2;
  border-left:5px solid var(--accent);
  border-radius:16px;
  padding:20px 22px;
  background:#f4f8fd;
  box-shadow:0 6px 18px rgba(31,79,143,.06);
}
.profile-callout .profile-label{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-bottom:10px;
  padding:6px 10px;
  border-radius:999px;
  background:var(--accent);
  color:#fff;
  font-size:.75rem;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.035em;
}
.profile-callout h3{margin:2px 0 8px}

.profile-status{
  display:flex;
  align-items:center;
  gap:9px;
  width:max-content;
  max-width:100%;
  margin:14px 0 20px;
  padding:7px 11px;
  border:1px solid #b9cbe2;
  border-radius:999px;
  background:var(--accent-soft);
  color:var(--accent);
  font-size:.82rem;
  font-weight:800;
}
.profile-status[hidden]{display:none !important}
.profile-status::before{
  content:"Perfil:";
  color:#52677f;
  font-weight:700;
}

#readerProfile,[data-profile-select]{
  font:inherit;
  min-height:44px;
}

/* Mobile menu */
.menu-toggle{
  display:none;
  width:44px;
  height:44px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fff;
  color:var(--text);
  cursor:pointer;
  align-items:center;
  justify-content:center;
  padding:0;
}
.menu-toggle span,
.menu-toggle::before,
.menu-toggle::after{
  content:"";
  display:block;
  width:20px;
  height:2px;
  background:currentColor;
  border-radius:99px;
  transition:.18s ease;
}
.menu-toggle span{margin:4px 0}
.menu-toggle[aria-expanded="true"] span{opacity:0}
.menu-toggle[aria-expanded="true"]::before{transform:translateY(6px) rotate(45deg)}
.menu-toggle[aria-expanded="true"]::after{transform:translateY(-6px) rotate(-45deg)}

.mobile-menu{
  display:none;
}

@media(max-width:720px){
  .header-inner{
    padding:10px 0;
  }
  .brand{
    font-size:.93rem;
    max-width:calc(100% - 58px);
  }
  .brand small{font-size:.68rem}
  .nav{display:none !important}
  .menu-toggle{display:flex}

  .mobile-menu{
    position:fixed;
    top:65px;
    right:16px;
    left:16px;
    z-index:40;
    display:none;
    padding:10px;
    border:1px solid var(--line);
    border-radius:16px;
    background:#fff;
    box-shadow:0 18px 50px rgba(16,24,40,.18);
  }
  .mobile-menu.is-open{
    display:block;
  }
  .mobile-menu a{
    display:block;
    padding:12px 13px;
    border-radius:10px;
    color:var(--text);
    font-weight:700;
  }
  .mobile-menu a:hover{
    background:#f4f7fb;
    text-decoration:none;
  }
  body.menu-open::after{
    content:"";
    position:fixed;
    inset:65px 0 0;
    z-index:30;
    background:rgba(16,24,40,.18);
  }
  .site-header{z-index:50}
  .mobile-menu{z-index:60}

  .profile-callout{
    padding:17px;
    border-radius:14px;
  }
  .profile-status{
    width:100%;
    border-radius:12px;
    align-items:flex-start;
  }
}


/* ===== UI v15: estado activo de perfil + cache busting ===== */
html[data-reader-profile]:not([data-reader-profile="none"]) #readerProfile,
html[data-reader-profile]:not([data-reader-profile="none"]) [data-profile-select]{
  border-color:var(--accent) !important;
  background:var(--accent-soft) !important;
  color:var(--accent);
  font-weight:800;
  box-shadow:0 0 0 3px rgba(31,79,143,.08);
}

html[data-reader-profile="none"] #readerProfile,
html[data-reader-profile="none"] [data-profile-select]{
  background:#fff !important;
  color:var(--text);
  font-weight:500;
  box-shadow:none;
}

.profile-status{
  margin-top:12px !important;
  margin-bottom:20px !important;
  background:#dfeeff !important;
  border:1px solid #8fb1dc !important;
  color:#173f73 !important;
  box-shadow:0 4px 12px rgba(31,79,143,.08);
}
.profile-status::before{
  content:"Perfil de lectura:";
  color:#51657e;
  font-weight:750;
}

.profile-callout{
  background:#f0f6fd !important;
  border-color:#a9c2df !important;
  border-left:5px solid var(--accent) !important;
}
.profile-callout .profile-label{
  background:var(--accent) !important;
  color:#fff !important;
}

/* Defensive desktop rules: mobile UI must never leak into desktop layout */
@media(min-width:721px){
  .menu-toggle,
  .mobile-menu{
    display:none !important;
  }
}

/* More explicit mobile header layout */
@media(max-width:720px){
  .site-header .header-inner{
    min-height:58px;
  }
  .menu-toggle{
    display:flex !important;
    flex-direction:column;
  }
  .mobile-menu{
    display:none !important;
  }
  .mobile-menu.is-open{
    display:block !important;
  }
}


/* ===== UI v16: índice completo, submenú Leer y scroll lateral ===== */

/* Desktop Leer dropdown */
.nav-dropdown{
  position:relative;
  display:inline-flex;
  align-items:center;
}
.nav-dropbtn{
  border:0;
  background:transparent;
  color:var(--accent);
  font:inherit;
  cursor:pointer;
  padding:8px 4px;
}
.nav-dropbtn::after{
  content:"▾";
  margin-left:5px;
  font-size:.72em;
}
.nav-dropdown-menu{
  position:absolute;
  top:calc(100% + 9px);
  right:0;
  z-index:90;
  display:none;
  width:min(760px,85vw);
  max-height:72vh;
  overflow:auto;
  padding:18px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
  box-shadow:0 20px 50px rgba(16,24,40,.18);
  grid-template-columns:repeat(2,minmax(260px,1fr));
  gap:18px;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu{
  display:grid;
}
.read-part{
  min-width:0;
}
.read-part strong{
  display:block;
  margin-bottom:7px;
  color:var(--text);
  font-size:.82rem;
}
.read-part a{
  display:block;
  padding:5px 0;
  line-height:1.25;
  font-size:.82rem;
  color:#315d96;
}

/* Sidebar scroll on desktop */
.reader > aside,
.reader .sidebar{
  position:sticky;
  top:92px;
  align-self:start;
  max-height:calc(100vh - 112px);
  overflow:hidden;
}
.chapter-toc-scroll{
  margin-top:8px;
  max-height:calc(100vh - 255px);
  overflow-y:auto;
  overscroll-behavior:contain;
  padding-right:10px;
  scrollbar-width:thin;
}
.chapter-toc-scroll a{
  display:block;
  margin:0;
  padding:7px 0;
  line-height:1.35;
}
.toc-part-title{
  margin:16px 0 5px;
  font-size:.72rem;
  font-weight:850;
  letter-spacing:.035em;
  text-transform:uppercase;
  color:#667085;
}
.toc-part-title:first-child{margin-top:4px}

/* Mobile nested read navigation */
.mobile-read-root,
.mobile-read-part{
  border:0;
}
.mobile-read-root > summary{
  padding:12px 13px;
  border-radius:10px;
  color:var(--text);
  font-weight:800;
  cursor:pointer;
  list-style:none;
}
.mobile-read-root > summary::-webkit-details-marker,
.mobile-read-part > summary::-webkit-details-marker{display:none}
.mobile-read-root > summary::after{
  content:"＋";
  float:right;
}
.mobile-read-root[open] > summary::after{content:"−"}
.mobile-read-tree{
  padding:4px 4px 10px 12px;
}
.mobile-read-part{
  margin:5px 0;
  border-left:2px solid #d9e2ee;
  padding-left:10px;
}
.mobile-read-part > summary{
  padding:8px 4px;
  font-size:.88rem;
  font-weight:800;
  cursor:pointer;
  color:#344054;
}
.mobile-read-links a{
  padding:7px 8px !important;
  font-size:.84rem;
  font-weight:600 !important;
  line-height:1.3;
  color:#315d96 !important;
}

/* Mobile sidebar content is not sticky */
@media(max-width:720px){
  .reader > aside,
  .reader .sidebar{
    position:static;
    max-height:none;
    overflow:visible;
  }
  .chapter-toc-scroll{
    max-height:none;
    overflow:visible;
    padding-right:0;
  }
  .mobile-menu{
    max-height:calc(100vh - 82px);
    overflow-y:auto;
  }
}


/* ===== Revisión editorial v20: recursos para lector no técnico ===== */
.definition-box,
.simple-example,
.work-example{
  margin:24px 0;
  padding:20px 22px;
  border-radius:16px;
}
.definition-box{
  border:1px solid #c9d7e8;
  background:#f8fbff;
}
.simple-example{
  border:1px solid #ddd6c8;
  background:#fcfaf5;
}
.work-example{
  border:1px solid #c8ddcf;
  background:#f5fbf7;
}
.definition-kicker,
.simple-example-kicker,
.work-example-kicker{
  display:inline-block;
  margin-bottom:6px;
  font-size:.74rem;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.045em;
}
.definition-kicker{color:#315d96}
.simple-example-kicker{color:#765b2f}
.work-example-kicker{color:#316746}
.definition-box h3,
.simple-example h3,
.work-example h3{
  margin:0 0 8px;
  font-size:1.17rem;
}
.definition-box p:last-child,
.simple-example p:last-child,
.work-example p:last-child{margin-bottom:0}
@media(max-width:720px){
  .definition-box,
  .simple-example,
  .work-example{padding:17px}
}



/* ===== UI v30: orientación ampliada por perfil ===== */
.profile-callout p{
  margin:0 0 10px;
  line-height:1.62;
}
.profile-callout .profile-focus{
  margin-top:13px;
  padding-top:12px;
  border-top:1px solid rgba(31,79,143,.18);
  color:#344054;
  font-size:.94rem;
}
.profile-callout .profile-focus strong{color:var(--accent)}
.profile-hint{line-height:1.5}


























/* ===== PORTADA FINAL ===== */

html,
body.cover-single-page{
  width:100%;
  height:100%;
  margin:0;
  padding:0;
  background:#04101b;
}

body.cover-single-page{
  overflow:hidden;
}

.cover-single{
  position:fixed;
  inset:0;

  width:100vw;
  height:100dvh;

  background-repeat:no-repeat;
  background-size:cover;
  background-position:center center;

  background-image:url("../assets/portada-desktop-clean-2x1-v46.jpg");
}


/* Toda la portada es clickeable */
.cover-single__surface{
  position:absolute;
  inset:0;
  z-index:1;
}


/* Botón */
.cover-single__enter{
  position:absolute;
  z-index:3;

  top:20px;
  right:20px;

  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;

  min-height:36px;
  padding:0 13px;

  border:1px solid rgba(88,222,240,.48);
  border-radius:999px;

  background:rgba(4,16,28,.42);

  color:#fff !important;
  font-size:.82rem;
  font-weight:700;

  text-decoration:none;

  box-shadow:0 7px 18px rgba(0,0,0,.22);
  backdrop-filter:blur(7px);
}


/* =========================
   MOBILE / VERTICAL
   ========================= */

@media (orientation:portrait){

  .cover-single{

    background-image:
      url("../assets/portada-mobile-hombre-v37.png");

    background-size:100% 95%;

    background-repeat:no-repeat;

    background-position:center 50%;

    background-color:#04101b;
  }


  .cover-single__enter{

    top:max(
      20px,
      calc(env(safe-area-inset-top) + 12px)
    );

    right:10px;

    min-height:31px;

    padding:0 9px;

    font-size:.72rem;
  }

}


/* Safari / iPhone */
@supports (height:100svh){

  .cover-single{
    height:100svh;
  }

}

/* ===== UI v80: enlaces sobre fondos oscuros ===== */
.chapter-bridge a,
.chapter-bridge a:visited{
  color:#93c5fd;
  text-decoration:underline;
  text-decoration-thickness:1px;
  text-underline-offset:3px;
  font-weight:700;
}
.chapter-bridge a:hover,
.chapter-bridge a:focus-visible{
  color:#ffffff;
  text-decoration-thickness:2px;
}


/* ===== Ajustes editoriales v86 ===== */
.author-hero{display:grid;grid-template-columns:minmax(220px,310px) minmax(0,1fr);gap:28px;align-items:start;margin:24px 0 30px}
.author-portrait{margin:0}
.author-portrait img{display:block;width:100%;height:auto;border-radius:18px;border:1px solid var(--line);box-shadow:var(--shadow)}
.author-portrait figcaption{margin-top:9px;color:var(--muted);font-size:.88rem;line-height:1.45}
.format-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;margin:22px 0 26px}
.format-card{padding:18px;border:1px solid var(--line);border-radius:16px;background:#fbfcfe}
.format-card h3{margin:0 0 7px;font-size:1.08rem}.format-card p:last-child{margin-bottom:0}
.download-tip{margin-top:16px;padding:14px 16px;border:1px solid #c9d8eb;border-radius:14px;background:#f6f9fd;color:#344054;max-width:980px}
.download-tip strong{display:block;margin-bottom:3px}
.chapter-bridge a,.chapter-bridge a:visited{color:#93c5fd;text-decoration:underline;text-underline-offset:3px;font-weight:700}
.chapter-bridge a:hover,.chapter-bridge a:focus-visible{color:#fff}
@media(max-width:900px){.author-hero,.format-grid{grid-template-columns:1fr}.author-portrait{max-width:390px}}


/* ===== v89: portada, redes autor y volver arriba ===== */
.cover-single__enter{
  top:auto;
  right:auto;
  left:clamp(260px,20vw,350px);
  bottom:clamp(66px,11vh,98px);
  min-height:34px;
  padding:0 14px;
  font-size:.8rem;
  background:rgba(4,16,28,.48);
}
.cover-single__enter:hover,
.cover-single__enter:focus-visible{
  text-decoration:none;
  transform:translateY(-1px);
  background:rgba(4,16,28,.62);
}
@media (orientation:portrait){
  .cover-single__enter{
    top:auto;
    right:auto;
    left:clamp(34px,7vw,74px);
    bottom:max(calc(env(safe-area-inset-bottom) + 180px), 15vh);
    min-height:34px;
    padding:0 12px;
    font-size:.76rem;
  }
}

.author-social{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:16px;
}
.social-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid #cfd9e6;
  background:#f8fbff;
  color:#24446f;
  font-size:.92rem;
  font-weight:700;
}
.social-chip svg{
  width:18px;
  height:18px;
  fill:currentColor;
  flex:0 0 auto;
}

.back-to-top{
  position:fixed;
  right:20px;
  bottom:22px;
  z-index:40;
  width:46px;
  height:46px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  border:1px solid rgba(31,79,143,.22);
  background:rgba(255,255,255,.96);
  color:var(--accent);
  box-shadow:0 12px 28px rgba(16,24,40,.16);
  text-decoration:none;
  opacity:0;
  pointer-events:none;
  transform:translateY(12px);
  transition:opacity .18s ease, transform .18s ease, box-shadow .18s ease;
  backdrop-filter:blur(8px);
}
.back-to-top.is-visible{
  opacity:1;
  pointer-events:auto;
  transform:translateY(0);
}
.back-to-top:hover,
.back-to-top:focus-visible{
  text-decoration:none;
  box-shadow:0 16px 32px rgba(16,24,40,.22);
}
.back-to-top__icon{
  font-size:1.25rem;
  font-weight:900;
  line-height:1;
}
@media(max-width:720px){
  .back-to-top{
    right:14px;
    bottom:16px;
    width:42px;
    height:42px;
  }
}


/* ===== v90: cierre editorial y continuidad ===== */
.social-chip.is-pending{opacity:.72;cursor:default}
.author-social-note{margin:8px 0 0;color:var(--muted);font-size:.86rem}
.editorial-line-card{border-left:4px solid var(--accent);background:linear-gradient(180deg,#ffffff,#f7faff)}
.editorial-line-card h2{margin:10px 0 10px}
.framework-balance{margin-top:16px}


/* ===== v91: mapa de continuidad editorial ===== */
.editorial-map{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
  margin:24px 0 28px;
}
.editorial-map__group{
  padding:20px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#fbfcfe;
}
.editorial-map__group h3{
  margin:0 0 12px;
  color:#263b57;
  font-size:1.06rem;
  line-height:1.3;
}
.editorial-map__group ul{
  margin:0;
  padding-left:20px;
}
.editorial-map__group li{
  margin:10px 0;
  color:#475467;
}
@media(max-width:900px){
  .editorial-map{grid-template-columns:1fr}
}



/* =========================================================
   PORTADA - posición definitiva del botón LEER
   ========================================================= */

.cover-single__enter{
    position:absolute;
    z-index:10;

    /* anulamos cualquier posicionamiento anterior */
    top:auto !important;
    left:auto !important;

    right:clamp(22px, 3vw, 46px);
    bottom:clamp(24px, 5vh, 48px);

    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;

    min-height:38px;
    padding:0 15px;

    border:1px solid rgba(88,222,240,.55);
    border-radius:999px;

    background:rgba(4,16,28,.58);
    backdrop-filter:blur(8px);
    -webkit-backdrop-filter:blur(8px);

    color:#fff !important;
    font-size:.82rem;
    font-weight:700;
    line-height:1;

    text-decoration:none;

    box-shadow:0 8px 22px rgba(0,0,0,.28);

    transition:
        background .18s ease,
        transform .18s ease,
        border-color .18s ease;
}

.cover-single__enter:hover,
.cover-single__enter:focus-visible{
    background:rgba(4,16,28,.78);
    border-color:rgba(88,222,240,.85);
    transform:translateY(-2px);
    text-decoration:none;
}


/* =========================================================
   PORTADA VERTICAL / MOBILE
   ========================================================= */

@media (orientation:portrait){

    .cover-single__enter{
        top:auto !important;
        left:auto !important;

        right:max(
            16px,
            calc(env(safe-area-inset-right) + 12px)
        );

        bottom:max(
            22px,
            calc(env(safe-area-inset-bottom) + 16px)
        );

        min-height:36px;
        padding:0 13px;

        font-size:.78rem;
    }

}

/* ===== v93: continuidad visual de portada en encabezados ===== */
.site-header{
  background:
    linear-gradient(90deg, rgba(248,250,252,.94), rgba(248,250,252,.88)),
    url("../assets/header-portada-v93.jpg") center 56% / cover no-repeat;
  border-bottom:1px solid rgba(31,79,143,.20);
  box-shadow:0 3px 18px rgba(16,24,40,.055);
}
.site-header .brand{
  color:#18324f;
}
.site-header .brand small{
  color:#5d6d80;
}
.site-header .nav > a,
.site-header .nav-dropbtn{
  color:#244f7d;
}
@media(max-width:720px){
  .site-header{
    background:
      linear-gradient(90deg, rgba(248,250,252,.96), rgba(248,250,252,.91)),
      url("../assets/header-portada-v93.jpg") center 58% / cover no-repeat;
  }
}


/* ===== UI v94: menú de línea editorial — cambio de navegación únicamente ===== */
.editorial-dropdown .editorial-menu{
  width:min(700px,88vw);
  grid-template-columns:1fr;
  gap:4px;
  padding:12px;
}
.editorial-book-link{
  display:grid !important;
  grid-template-columns:78px minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  padding:9px 11px !important;
  border-radius:10px;
  color:var(--text) !important;
  text-decoration:none !important;
}
.editorial-book-link:hover{background:#f4f7fb}
.editorial-book-link > span{
  color:#245a9b;
  font-size:.72rem;
  font-weight:850;
  letter-spacing:.05em;
  text-transform:uppercase;
}
.editorial-book-link > strong{
  color:var(--text);
  font-size:.85rem;
  line-height:1.25;
}
.editorial-book-link > em{
  color:#667085;
  font-size:.7rem;
  font-style:normal;
  white-space:nowrap;
}
.editorial-book-link.is-current{background:#eaf3fb}
.editorial-book-link.is-current > strong{color:#123f73}
.editorial-book-link.is-planned{opacity:.65;cursor:default}

.mobile-editorial-list > a,
.mobile-editorial-list > span{
  display:block;
  padding:8px 8px !important;
  border-radius:8px;
  font-size:.84rem;
  line-height:1.3;
}
.mobile-editorial-list > a{color:#315d96 !important;font-weight:700 !important}
.mobile-editorial-list > a.is-current{background:#eaf3fb}
.mobile-editorial-list > span{color:#667085}

@media(max-width:720px){
  .editorial-dropdown .editorial-menu{width:100%}
  .editorial-book-link{grid-template-columns:64px minmax(0,1fr)}
  .editorial-book-link > em{grid-column:2}
}


/* Referencias académicas */
.references-list{padding-left:1.25rem}
.references-list li{margin:.65rem 0;line-height:1.55}
.chapter-sources{margin-top:2.25rem;padding:1rem 1.1rem;border:1px solid var(--line);border-radius:14px;background:rgba(127,177,214,.08)}
.chapter-sources h2{margin-top:0;font-size:1.15rem}
.chapter-sources ul{margin:.5rem 0 0;padding-left:1.15rem}
.chapter-sources li{margin:.42rem 0;line-height:1.45}
