/* FabAcademy'26 — Personal / editorial theme (W3C-friendly) */

:root{
  --paper:#fcfbf8;
  --ink:#1e1e1e;
  --muted:#6b6b6b;
  --rule:#d9d6cf;

  --accent:#1f5ea8;
  --accent2:#c7352c;
  --accent3:#2a7f68;

  --radius:10px;
  --shadow: 0 10px 18px rgba(0,0,0,.06);

  --max:1050px;
  --pad:22px;

  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.68;
  background:
    linear-gradient(0deg, rgba(255,255,255,.55), rgba(255,255,255,.55)),
    radial-gradient(900px 420px at 10% -10%, rgba(199,53,44,.08), transparent 60%),
    radial-gradient(900px 420px at 90% 0%, rgba(42,127,104,.08), transparent 60%),
    repeating-linear-gradient(90deg, rgba(30,30,30,.03) 0, rgba(30,30,30,.03) 1px, transparent 1px, transparent 24px),
    var(--paper);
}

.container{
  width: min(var(--max), calc(100% - 2*var(--pad)));
  margin: 0 auto;
}

main{ padding: 26px 0 60px; }

/* Links */
a{ color: var(--accent); text-decoration: none; }
a:hover{ text-decoration: underline; }

/* Media */
img{
  max-width: 100%;
  height: auto;
  display: block;
}

/* Limit only content images */
figure img,
.section img,
.about-text img{
  max-width: 800px;
}


/* ===== Navbar ===== */
.navbar{
  border-bottom: 2px solid var(--rule);
  background: var(--paper);
}
.navbar .container{
  position: relative;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 18px;
  padding: 14px 0;
}

.nav-left{
  display:flex;
  align-items:center;
  gap: 14px;
}
.nav-left img{
  width: 38px;
  height: auto;
}
.nav-title{
  line-height: 1.1;
}
.nav-title strong{
  display:block;
  font-family: var(--sans);
  font-size: 18px;
  letter-spacing: .2px;
}
.nav-title span{
  display:block;
  font-size: 14px;
  color: var(--muted);
}

.nav-toggle{ display:none; }
.nav-burger{
  display:none;
  width: 40px;
  height: 36px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: rgba(255,255,255,.6);
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap: 5px;
  cursor:pointer;
}
.nav-burger span{
  width: 18px;
  height: 2px;
  background: var(--ink);
}

/* Nav links */
.nav-right{
  display:flex;
  gap: 14px;
}
.nav-right a{
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
}
.nav-right a:hover{ color: var(--accent2); }

@media (max-width: 720px){
  .nav-right{ display:none; }
  .nav-burger{ display:flex; }

  .nav-toggle:checked ~ .nav-right{
    display:flex;
    flex-direction:column;
    position:absolute;
    right: 0;
    top: 64px;
    min-width: 210px;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 10px;
    padding: 12px;
    box-shadow: var(--shadow);
  }
  .nav-toggle:checked ~ .nav-right a{
    padding: 8px 10px;
    border-radius: 8px;
  }
  .nav-toggle:checked ~ .nav-right a:hover{
    background: rgba(30,30,30,.04);
  }
}

/* ===== Typography examples ===== */
.hero{
  border-left: 4px solid var(--accent);
  padding-left: 16px;
  margin: 18px 0 22px;
}
.hero h1{
  font-family: var(--sans);
  font-size: 38px;
  margin: 0 0 6px;
}
.hero p{
  margin: 0;
  color: var(--muted);
}

.section{ margin: 26px 0 34px; }
.section h2{
  font-family: var(--sans);
  font-size: 22px;
  margin: 0 0 10px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 6px;
}
.section h3{
  font-family: var(--sans);
  font-size: 18px;
  margin: 18px 0 8px;
}
.section h4{
  font-family: var(--sans);
  font-size: 15px;
  margin: 16px 0 6px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

.lede{
  font-size: 18px;
  color: var(--ink);
}
.small{ font-size: 12px; color: var(--muted); }
.note{
  padding: 12px 14px;
  border-left: 4px solid var(--accent3);
  background: rgba(42,127,104,.06);
  margin: 14px 0;
}
.pullquote{
  font-style: italic;
  border-top: 1px dashed rgba(30,30,30,.25);
  border-bottom: 1px dashed rgba(30,30,30,.25);
  padding: 12px 0;
  margin: 16px 0;
}

/* ===== Cards ===== */
.card{
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: rgba(255,255,255,.55);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card + .card{ margin-top: 16px; }

/* ===== Figure ===== */
figure{ margin: 16px 0; }
figcaption{ margin-top: 6px; font-size: 13px; color: var(--muted); }


/* ===== Video frame ===== */
video{
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

.video-frame{
  width: 100%;
  margin: 16px 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow:hidden;
  background: rgba(255,255,255,.6);
  max-width: 800px;
}
.video-frame video{
  width: 100%;
  height: auto;
  display: block;
}


/* ===== Tabs (CSS-only) ===== */
.tabs input{ display:none; }
.tabs-bar{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.tabs-bar label{
  font-family: var(--sans);
  font-size: 13px;
  padding: 7px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor:pointer;
  background: rgba(255,255,255,.6);
}
.tabs-panel{ display:none; border-top: 1px solid var(--rule); padding-top: 12px; }

#t1:checked ~ .tabs-bar label[for="t1"],
#t2:checked ~ .tabs-bar label[for="t2"],
#t3:checked ~ .tabs-bar label[for="t3"]{
  border-color: rgba(31,94,168,.35);
  box-shadow: inset 0 0 0 2px rgba(31,94,168,.10);
}

#t1:checked ~ .p1{ display:block; }
#t2:checked ~ .p2{ display:block; }
#t3:checked ~ .p3{ display:block; }

/* ===== Terminal (copyable) ===== */
.terminal{
  border: 1px solid rgba(30,30,30,.16);
  border-radius: var(--radius);
  background: rgba(255,255,255,.65);
  overflow:hidden;
}
.terminal-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  background: rgba(30,30,30,.02);
}
.terminal-title{
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.copy-btn{
  font-family: var(--sans);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: rgba(255,255,255,.7);
  cursor:pointer;
}
.copy-btn:hover{ border-color: rgba(199,53,44,.35); }
.terminal pre{
  margin:0;
  padding: 12px;
  font-family: var(--mono);
  font-size: 13px;
  overflow-x:auto;
}

/* ===== Lightbox (pure CSS :target) — FIXED + navigable ===== */
.lightbox{
  display:none;
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.82);
  align-items:center;
  justify-content:center;
  padding: 18px;
  z-index: 1000;
}
.lightbox:target{ display:flex; }

.lightbox img{
  max-width: 95%;
  max-height: 95%;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}

/* Close / Prev / Next (no overlap) */
.lightbox .lb-close,
.lightbox .lb-prev,
.lightbox .lb-next{
  position:absolute;
  z-index: 1100;
  color: #fff;
  font-family: var(--sans);
  text-decoration:none;
  opacity: .9;
}

/* Close stays top-right */
.lightbox .lb-close{
  top: 14px;
  right: 14px;
  font-size: 16px;
  padding: 8px 10px;
  line-height: 1;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  background: rgba(0,0,0,.35);
}

/* Prev/Next are centered vertically on the sides */
.lightbox .lb-prev,
.lightbox .lb-next{
  top: 50%;
  transform: translateY(-50%);
  font-size: 44px;
  padding: 12px 16px;
  line-height: 1;
  border-radius: 999px;
  background: rgba(0,0,0,.25);
}

.lightbox .lb-prev{ left: 12px; }
.lightbox .lb-next{ right: 12px; }

.lightbox .lb-close:hover,
.lightbox .lb-prev:hover,
.lightbox .lb-next:hover{
  opacity: 1;
}

/* Prevent old generic anchor styling from interfering */
.lightbox > a{
  border: none;
}

/* ===== Social icons ===== */
.social-icons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.social-icons img {
  display: block;
  height: 32px;
}


/* ===== Footer ===== */
footer{
  border-top: 1px solid var(--rule);
  padding: 20px 0;
  font-size: 13px;
  color: var(--muted);
  text-align:center;
}

/* ===== About: bloques texto + foto a la derecha ===== */

.about{
  /* contenedor general, opcional */
}

/* Cada bloque es una unidad: texto + (opcional) foto */
.about-block{
  display: grid;
  grid-template-columns: 1fr 320px; /* texto + columna foto */
  gap: 18px;
  align-items: start;
  margin: 18px 0 26px;
}

/* Si un bloque no tiene foto */
.about-block--no-media{
  grid-template-columns: 1fr;
}

/* Texto del bloque */
.about-text p{
  margin: 0 0 14px;
}

/* Columna derecha: media card */
.about-media{
  /* La columna de la derecha */
}

/* Card de foto (estrecha, tipo “nota”) */
.media-card{
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: rgba(255,255,255,.55);
  box-shadow: var(--shadow);
  padding: 12px;
  max-width: 320px;
}

.media-card figure{
  margin: 0;
}

.media-card img{
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.media-card figcaption{
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

/* Card de foto (estrecha, tipo “nota”) WEEKS */
.media-card-WEEK{
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: rgba(255,255,255,.55);
  box-shadow: var(--shadow);
  padding: 12px;

  width: fit-content;   /* Se adapta al contenido (imagen) */
  max-width: 800px;     /* Límite máximo */
}

.media-card-WEEK figure{
  margin: 0;
}

.media-card-WEEK img{
  display: block;
  width: auto;          /* Usa el ancho real de la imagen */
  max-width: 100%;      /* Pero no supera el ancho de la card (800px) */
  height: auto;
  border-radius: 8px;
}

.media-card-WEEK figcaption{
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  max-width: 100%;      /* El texto respeta el ancho de la imagen */
}


/* ===== Inline image rows (multiple images on one line) ===== */

.image-row{
  display: grid;
  gap: 14px;
  margin: 14px 0 20px;
}

/* Variantes por número de columnas */
.image-row.cols-2{ grid-template-columns: repeat(2, 1fr); }
.image-row.cols-3{ grid-template-columns: repeat(3, 1fr); }
.image-row.cols-4{ grid-template-columns: repeat(4, 1fr); }

/* Cada imagen como card */
.image-row .image-card{
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: rgba(255,255,255,.55);
  box-shadow: var(--shadow);
  padding: 10px;
}

.image-row .image-card figure{
  margin: 0;
}

.image-row .image-card img{
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Caption opcional */
.image-row figcaption{
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

/* Responsive: apilar en móvil */
@media (max-width: 720px){
  .image-row.cols-2,
  .image-row.cols-3,
  .image-row.cols-4{
    grid-template-columns: 1fr;
  }
}


/* ===== Cards FabAcademy Grid ===== */

.tile-grid{
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  margin: 20px 0 10px;
}

/* Responsive */
@media (max-width: 1200px){
  .tile-grid{ grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px){
  .tile-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px){
  .tile-grid{ grid-template-columns: 1fr; }
}

/* Card */
.tile{
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
  transform: scale(1);
  transition: transform .25s ease, box-shadow .25s ease;
}

/* Hover effect */
.tile:hover{
  transform: scale(1.04);
  box-shadow: 0 16px 30px rgba(0,0,0,.18);
}

/* Overlay */
.tile::before{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.65),
    rgba(0,0,0,.15),
    transparent
  );
}

/* Text */
.tile-content{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  padding:14px;
  color:#fff;
  font-family: var(--sans);
}

.tile-title{
  font-size:18px;
  font-weight:600;
  line-height:1.2;
}

.tile-subtitle{
  font-size:13px;
  margin-top:4px;
  opacity:0;
  transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
}

/* Show subtitle on hover */
.tile:hover .tile-subtitle{
  opacity:1;
  transform: translateY(0);
}

/* Link reset */
.tile a{
  position:absolute;
  inset:0;
  z-index:2;
}


/* Variante: varias fotos apiladas dentro del mismo card */
.media-stack{
  display: grid;
  gap: 10px;
}

/* En pantallas pequeñas, apilar (texto arriba, media abajo) */
@media (max-width: 720px){
  .about-block{
    grid-template-columns: 1fr;
  }
  .media-card{
    max-width: 100%;
  }
}

/* ===== Lightbox thumbnail at 50% width ===== */

/* Contenedor del enlace a lightbox */
.lightbox-thumb{
  width: 50%;
  max-width: 400px;      /* límite razonable */
}

/* En móvil, que no quede demasiado pequeño */
@media (max-width: 720px){
  .lightbox-thumb{
    width: 100%;
    max-width: 100%;
  }
}

/* ===== Back to top button ===== */
.back-to-top{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: rgba(255,255,255,.85);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  cursor: pointer;

  /* hidden by default */
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
}

.back-to-top:hover{
  border-color: rgba(31,94,168,.35);
}

/* visible state */
.back-to-top.is-visible{
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* accessible focus */
.back-to-top:focus{
  outline: 2px solid rgba(31,94,168,.35);
  outline-offset: 3px;
}

/* ===== Weekly checklist (static, code-defined) ===== */

.checklist{
  display: grid;
  gap: 10px;
  margin: 14px 0 18px;
}

.check-item{
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: rgba(255,255,255,.55);
  box-shadow: var(--shadow);
}

/* Icon column */
.check-icon{
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.2;
}

/* Text */
.check-text{
  font-family: var(--sans);
  font-size: 14px;
}

.check-text small{
  display:block;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 13px;
  color: var(--muted);
}

/* Status label */
.check-status{
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* ===== States ===== */

/* DONE */
.check-item.done{
  border-color: rgba(42,127,104,.35);
}

.check-item.done .check-icon{
  color: var(--accent3);
  font-size: 22px;          /* más grande */
  font-weight: 600;
  line-height: 1;
}

/* Texto normal cuando está hecho */
.check-item.done .check-text{
  opacity: 1;
}

/* PENDING */
.check-item.pending .check-icon{
  color: var(--muted);
  font-size: 16px;
}


/* ===== Downloads card ===== */

.download-card{
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: rgba(255,255,255,.55);
  box-shadow: var(--shadow);
  padding: 16px;
}

.download-card h3{
  font-family: var(--sans);
  margin: 0 0 10px;
  font-size: 16px;
}

.download-list{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.download-item{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px dashed rgba(30,30,30,.22);
  border-radius: 12px;
  background: rgba(255,255,255,.45);
}

.download-item a{
  font-family: var(--sans);
  font-size: 14px;
}

.download-tag{
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  padding: 4px 8px;
  border: 1px solid rgba(30,30,30,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.6);
}

/* ===== Reference table (full width, responsive) ===== */

.table-card{
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: rgba(255,255,255,.55);
  box-shadow: var(--shadow);
  padding: 14px 16px;

  width: 100%;          /* ocupa todo el contenedor */
  overflow-x: auto;     /* scroll si es necesario */
}

.table-card h3{
  font-family: var(--sans);
  font-size: 16px;
  margin: 0 0 10px;
}

/* Table */
.ref-table{
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 13px;   /* ligeramente más compacta */
  width: 100%;
}

.ref-table th,
.ref-table td{
  padding: 6px 10px;
  border-bottom: 1px dashed rgba(30,30,30,.25);
  text-align: left;
  vertical-align: top;
  line-height: 1.35;
}

.ref-table th{
  font-weight: 600;
  font-size: 12px;
}

/* Permitir salto solo en Material y Notes */
.ref-table td:first-child,
.ref-table td:last-child{
  white-space: normal;
}

/* El resto compacto */
.ref-table td:not(:first-child):not(:last-child){
  white-space: nowrap;
}

/* Responsive safeguard */
@media (max-width: 720px){
  .table-card{
    width: 100%;
    overflow-x: auto;
  }
}

/* ===== Highlighted external link ===== */

.link-highlight{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin: 4px 0;
  border: 1px dashed rgba(30,30,30,.35);
  border-radius: 999px;
  background: rgba(255,255,255,.55);
  font-family: var(--sans);
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
}

.link-highlight::after{
  content: "↗";
  font-size: 13px;
  opacity: .7;
}

.link-highlight:hover{
  border-color: var(--accent);
  background: rgba(31,94,168,.08);
  text-decoration: none;
}

/* ===== Highlighted external link ===== */

.link-highlight{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin: 4px 0;
  border: 1px dashed rgba(30,30,30,.35);
  border-radius: 999px;
  background: rgba(255,255,255,.55);
  font-family: var(--sans);
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
}

.link-highlight::after{
  content: "↗";
  font-size: 13px;
  opacity: .7;
}

.link-highlight:hover{
  border-color: var(--accent);
  background: rgba(31,94,168,.08);
  text-decoration: none;
}
/* ===== FIX: tile subtitle visible on touch / small screens ===== */

@media (hover: none), (max-width: 720px){
  .tile .tile-subtitle{
    opacity: 1 !important;
    transform: none !important;
  }

  /* Evita "hover" raro en móviles */
  .tile:hover{
    transform: none !important;
    box-shadow: var(--shadow) !important;
  }
}


 /* Language switch */
.lang-switch{
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: -8px;
}


.lang-switch .is-active{
  border-color: var(--accent);
  background: rgba(31,94,168,.12);
  font-weight: 600;
  pointer-events: none;
}

/* Lightbox caption */
.lb-caption{
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  max-width: 90%;
  text-align: center;

  font-family: var(--sans);
  font-size: 16px;
  color: #fff;

  background: rgba(0,0,0,.55);
  padding: 10px 16px;
  border-radius: 999px;

  z-index: 1300;      /* importante: por encima de la imagen */
  pointer-events: none;
}


/* =========================================================
   CODE BLOCK (Card style, collapsible, numbered, footer)
   ========================================================= */

.codeblock{
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: rgba(255,255,255,.55);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin: 18px 0 22px;
}

/* ===== SUMMARY BAR (top) ===== */

.codeblock summary{
  list-style: none;
  cursor: pointer;
  user-select: none;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;

  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  background: rgba(30,30,30,.02);
}

/* Remove native markers completely */
.codeblock summary::-webkit-details-marker{ display:none; }
.codeblock summary::marker{ content:""; }

/* Title */
.code-title{
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* Actions container */
.code-actions{
  display:flex;
  align-items:center;
  gap: 14px;
}

/* ===== TOGGLE ===== */

.code-toggle{
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  display:inline-flex;
  align-items:center;
  gap:8px;
}

/* Arrow icon */
.code-toggle::before{
  font-size: 22px;
  line-height: 1;
  display:inline-block;
}

/* TOP BAR ICONS */
.codeblock:not([open]) summary .code-toggle::before{
  content: "▸";   /* closed */
}

.codeblock[open] summary .code-toggle::before{
  content: "▾";   /* open */
}

/* ===== COPY BUTTON ===== */

.codeblock .copy-btn{
  font-family: var(--sans);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: rgba(255,255,255,.7);
  cursor:pointer;
}

.codeblock .copy-btn:hover{
  border-color: rgba(199,53,44,.35);
}

/* ===== CODE AREA ===== */

.codewrap{
  padding: 14px;
}

/* Generated numbered code */
.code-numbered{
  font-family: var(--mono);
  font-size: 13px;
  overflow-x: auto;
  white-space: pre;
  counter-reset: line;
}

.code-line{
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  padding: 2px 0;
}

.code-line::before{
  counter-increment: line;
  content: counter(line);
  color: var(--muted);
  text-align: right;
  padding-right: 8px;
  border-right: 1px dashed rgba(30,30,30,.20);
}

/* subtle striping */
.code-line:nth-child(odd){
  background: rgba(30,30,30,.02);
}

/* preserve empty lines */
.code-line:empty::after{
  content: " ";
}

/* ===== FOOTER BAR (only when open) ===== */

.code-footer{
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 10px 14px;
  border-top: 1px solid var(--rule);
  background: rgba(30,30,30,.02);
}

.codeblock[open] .code-footer{
  display: flex;
}

/* Footer toggle always collapse */
.code-footer .code-toggle::before{
  content: "▴";
}

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

@media (max-width: 720px){
  .code-line{
    grid-template-columns: 36px 1fr;
    gap: 10px;
  }
}

/* Ensure no transforms affect the pseudo-icons */
.code-toggle::before{
  transform: none !important;
}

/* Make footer toggle feel clickable */
.code-footer .code-toggle{
  cursor: pointer;
  user-select: none;
}

/* (Optional) same for the top toggle */
.codeblock summary .code-toggle{
  cursor: pointer;
  user-select: none;
}

.code-footer-extra{
  padding: 10px 14px;
  border-top: 1px solid var(--rule);
  background: rgba(30,30,30,.02);
  display: flex;
  justify-content: flex-end;
}

.download-btn{
  font-family: var(--sans);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: rgba(255,255,255,.7);
  text-decoration: none;
  color: var(--ink);
}

.download-btn:hover{
  border-color: rgba(31,94,168,.35);
  background: rgba(31,94,168,.08);
}


/* ===== Gallery grid (N images) ===== */
.gallery{
  display: grid;
  gap: 14px;
  margin: 14px 0 20px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.gallery .image-card{
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: rgba(255,255,255,.55);
  box-shadow: var(--shadow);
  padding: 10px;
  margin: 0; /* because figure */
}

.gallery .image-card img{
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.gallery figcaption{
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

/* Optional: tighten on small screens */
@media (max-width: 720px){
  .gallery{ grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}

/* ===== JS Lightbox overlay (reuses your naming) ===== */
.lb-modal{
  display:none;
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.82);
  align-items:center;
  justify-content:center;
  padding: 18px;
  z-index: 1200;
}

.lb-modal.is-open{ display:flex; }

.lb-modal img{
  max-width: 95%;
  max-height: 85%;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}

.lb-modal .lb-close,
.lb-modal .lb-prev,
.lb-modal .lb-next{
  position:absolute;
  z-index: 1300;
  color:#fff;
  font-family: var(--sans);
  text-decoration:none;
  opacity:.9;
}

.lb-modal .lb-close{
  top: 14px;
  right: 14px;
  font-size: 16px;
  padding: 8px 10px;
  line-height: 1;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  background: rgba(0,0,0,.35);
  cursor: pointer;
}

.lb-modal .lb-prev,
.lb-modal .lb-next{
  top: 50%;
  transform: translateY(-50%);
  font-size: 44px;
  padding: 12px 16px;
  line-height: 1;
  border-radius: 999px;
  background: rgba(0,0,0,.25);
  cursor: pointer;
}

.lb-modal .lb-prev{ left: 12px; }
.lb-modal .lb-next{ right: 12px; }

.lb-modal .lb-caption{
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  max-width: 90%;
  text-align: center;
  font-family: var(--sans);
  font-size: 16px;
  color: #fff;
  background: rgba(0,0,0,.55);
  padding: 10px 16px;
  border-radius: 999px;
  z-index: 1300;
  pointer-events: none;
}



/* Two-column layout for design rules (no empty gap) */
.test-grid{
  display: grid;
  grid-template-columns: 1fr auto; /* RIGHT column = width of the thumbnail */
  gap: 24px;
  align-items: start;
  margin-top: 16px;
}

/* Make the thumbnail column consistent */
.test-grid .image-row{
  width: 320px;  /* adjust: 280–360px */
  margin: 0;
}

/* If you use .image-row.cols-4 with only 1 image, avoid 1/4 width */
.test-grid .image-row.cols-4{
  grid-template-columns: 1fr !important;
}

/* Optional: keep a nice “thumb” crop */
.test-grid .image-card img{
  max-height: 180px;     /* adjust */
  object-fit: cover;
}

/* Mobile: stack */
@media (max-width: 900px){
  .test-grid{
    grid-template-columns: 1fr;
  }
  .test-grid .image-row{
    width: 100%;
    max-width: 320px;
  }
}


/* Full width media card variant */
.media-card-WEEK.is-full{
  max-width: none;
  width: 100%;
}

.media-card-WEEK.is-full figure{
  margin: 0;
}

.media-card-WEEK.is-full img{
  width: 100%;
  height: auto;
  display: block;
}

/* ===== Video 16:9 inside .image-card (same look as image rows) ===== */
.image-card .video-16x9{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;   /* igual que las imágenes */
  overflow: hidden;
}

.image-card .video-16x9 video{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;    /* sin deformar */
}

/* ===== Sketchfab responsive embed ===== */
.sketchfab-embed-wrapper{
  max-width: 800px;     /* como tus imágenes */
}

.sketchfab-embed{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9; /* o 800/480 = 5/3 si quieres exacto */
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: rgba(255,255,255,.6);
}

.sketchfab-embed iframe{
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0;
  display: block;
}

.audio-block{
  max-width: 800px;
  margin: 16px 0;
}

.audio-block audio{
  width: 100%;
}

.audio-block figcaption{
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

/* ===== Audio cards ===== */

.audio-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin: 18px 0 24px;
}

.audio-card{
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: rgba(255,255,255,.55);
  box-shadow: var(--shadow);
  padding: 14px;
}

.audio-title{
  margin: 0 0 10px;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.3;
}

.audio-card audio{
  width: 100%;
}

/* móvil */
@media (max-width: 720px){
  .audio-grid{
    grid-template-columns: 1fr;
  }
}

/* Gallery images should fill the card width */
.gallery .image-card img{
  width: 100%;
  max-width: none;
  height: auto;
  display: block;
}

/* =========================================================
   PROMPT BLOCK (collapsible, bilingual, copyable)
   ========================================================= */

.promptblock{
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: rgba(255,255,255,.55);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin: 18px 0 22px;
}

.promptblock summary{
  list-style: none;
  cursor: pointer;
  user-select: none;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;

  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  background: rgba(30,30,30,.02);
}

.promptblock summary::-webkit-details-marker{ display:none; }
.promptblock summary::marker{ content:""; }

.prompt-title{
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}

.prompt-actions{
  display:flex;
  align-items:center;
  gap: 14px;
}

.prompt-toggle{
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  display:inline-flex;
  align-items:center;
  gap: 8px;
}

.prompt-toggle::before{
  font-size: 22px;
  line-height: 1;
  display:inline-block;
  transform: none !important;
}

.promptblock:not([open]) summary .prompt-toggle::before{
  content: "▸";
}

.promptblock[open] summary .prompt-toggle::before{
  content: "▾";
}

.promptwrap{
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.prompt-lang{
  border: 1px solid rgba(30,30,30,.10);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,.45);
}

.prompt-lang-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(30,30,30,.10);
  background: rgba(30,30,30,.02);
}

.prompt-lang-label{
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
}

.prompt-text{
  padding: 12px;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.68;
  white-space: pre-wrap;
}

.prompt-footer{
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 10px 14px;
  border-top: 1px solid var(--rule);
  background: rgba(30,30,30,.02);
}

.promptblock[open] .prompt-footer{
  display: flex;
}

.prompt-footer .prompt-toggle{
  cursor: pointer;
  user-select: none;
}

.prompt-footer .prompt-toggle::before{
  content: "▴";
}

.promptblock summary .prompt-toggle{
  cursor: pointer;
  user-select: none;
}

@media (max-width: 720px){
  .promptwrap{
    grid-template-columns: 1fr;
  }

  .prompt-lang-head{
    flex-wrap: wrap;
  }
}


/* =========================================================
   PROMPT TABS BLOCK (independent from prompt columns block)
   ========================================================= */

.prompttabsblock{
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: rgba(255,255,255,.55);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin: 18px 0 22px;
}

.prompttabsblock summary{
  list-style: none;
  cursor: pointer;
  user-select: none;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  background: rgba(30,30,30,.02);
}

.prompttabsblock summary::-webkit-details-marker{ display:none; }
.prompttabsblock summary::marker{ content:""; }

.prompttabs-title{
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}

.prompttabs-actions{
  display: flex;
  align-items: center;
  gap: 14px;
}

.prompttabs-toggle{
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.prompttabs-toggle::before{
  font-size: 22px;
  line-height: 1;
  display: inline-block;
  transform: none !important;
}

.prompttabsblock:not([open]) summary .prompttabs-toggle::before{
  content: "▸";
}

.prompttabsblock[open] summary .prompttabs-toggle::before{
  content: "▾";
}

.prompttabs-wrap{
  padding: 14px;
}

.prompttabs-nav{
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.prompttabs-tab{
  border: 1px solid var(--rule);
  background: rgba(30,30,30,.03);
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s ease;
}

.prompttabs-tab:hover{
  border-color: rgba(199,53,44,.35);
}

.prompttabs-tab.is-active{
  background: rgba(30,30,30,.08);
  border-color: rgba(30,30,30,.25);
  color: var(--text);
}

.prompttabs-panel{
  display: none;
  border: 1px solid rgba(30,30,30,.10);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,.45);
}

.prompttabs-panel.is-active{
  display: block;
}

.prompttabs-panel-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(30,30,30,.10);
  background: rgba(30,30,30,.02);
}

.prompttabs-lang-label{
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
}

.prompttabs-text{
  padding: 12px;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.68;
  white-space: pre-wrap;
}

.prompttabsblock .copy-btn{
  font-family: var(--sans);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: rgba(255,255,255,.7);
  cursor: pointer;
}

.prompttabsblock .copy-btn:hover{
  border-color: rgba(199,53,44,.35);
}

.prompttabs-footer{
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 10px 14px;
  border-top: 1px solid var(--rule);
  background: rgba(30,30,30,.02);
}

.prompttabsblock[open] .prompttabs-footer{
  display: flex;
}

.prompttabs-footer .prompttabs-toggle{
  cursor: pointer;
  user-select: none;
}

.prompttabs-footer .prompttabs-toggle::before{
  content: "▴";
}

.prompttabsblock summary .prompttabs-toggle{
  cursor: pointer;
  user-select: none;
}

@media (max-width: 720px){
  .prompttabs-panel-head{
    flex-wrap: wrap;
  }
}

/* ===== PROMPT TABS ===== */



/* ===== SCHEDULE START ===== */

.schedule-shell{
  --bg-grid:#d8d8d8;
  --bg-head:#555;
  --bg-time:#ececec;
  --grid-line:#fff;
  --fabacademy:#18a74d;
  --recitation:#4d82c3;
  --fablab:#fff200;
  --open-time:#f4b400;
  --assignment:#0c2f7a;
  --training:#ff1f1f;
  --work-row:#b8b8b8;
  --schedule-shadow:0 8px 24px rgba(0,0,0,.08);
  --schedule-radius:14px;

  max-width:1050px;
  margin:0 auto;
}

/* LAYOUT */

.schedule-title{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:16px;
  margin:0 0 18px;
  font-weight:700;
  flex-wrap:wrap;
}

.schedule-title .main{
  font-size:clamp(1.5rem,1vw + .6rem,1.5rem);
  line-height:1.05;
}

.schedule-title .week{
  font-size:clamp(1.5rem,1vw + .5rem,1.5rem);
  line-height:1.05;
  white-space:nowrap;
}

.desktop-view{display:block}
.mobile-view{display:none}

/* DESKTOP GRID */

.schedule-grid{
  display:grid;
  grid-template-columns:72px repeat(7,minmax(0,1fr)) 72px;
  grid-template-rows:50px repeat(18,34px);
  width:100%;
  min-width:0;
  background:var(--grid-line);
  border:1px solid #cfcfcf;
  gap:1px;
  position:relative;
}

.cell,
.head,
.time-slot,
.event{
  min-width:0;
}

.head{
  display:flex;
  justify-content:center;
  align-items:center;
  padding:4px 6px;
  background:var(--bg-head);
  color:#fff;
  font-size:.78rem;
  font-weight:700;
  line-height:1.15;
  text-align:center;
  overflow-wrap:anywhere;
}

.time-slot{
  display:flex;
  justify-content:center;
  align-items:center;
  padding:2px;
  background:var(--bg-time);
  color:#333;
  font-size:.78rem;
}

.time-slot.work-hour{
  background:var(--work-row);
  color:#000;
  font-weight:700;
}

.cell{
  background:var(--bg-grid);
}

.cell.work-row{
  background:var(--work-row);
}

.event{
  position:relative;
  z-index:2;
  display:flex;
  justify-content:center;
  align-items:center;
  padding:4px 5px;
  font-size:.68rem;
  font-weight:700;
  line-height:1.12;
  text-align:center;
  word-break:break-word;
  overflow:hidden;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.08);
}

.event.small{
  font-size:.64rem;
}

/* EVENT COLORS */

.event.fabacademy,
.legend-item.fabacademy,
.mobile-body.fabacademy{
  background:var(--fabacademy);
  color:#fff;
}

.event.recitation,
.legend-item.recitation,
.mobile-body.recitation{
  background:var(--recitation);
  color:#fff;
}

.event.fablab,
.legend-item.fablab,
.mobile-body.fablab{
  background:var(--fablab);
  color:#222;
}

.event.open-time,
.legend-item.open-time,
.mobile-body.open-time{
  background:var(--open-time);
  color:#222;
}

.event.assignment,
.legend-item.assignment,
.mobile-body.assignment{
  background:var(--assignment);
  color:#fff;
}

.event.training,
.legend-item.training,
.mobile-body.training{
  background:var(--training);
  color:#fff;
}

/* METRICS */

.metrics{
  display:grid;
  grid-template-columns:72px repeat(7,minmax(0,1fr)) 72px;
  width:100%;
  min-width:0;
  margin-top:10px;
  gap:8px 1px;
  align-items:center;
  font-size:.8rem;
}

.metric-label{
  padding-left:4px;
  color:#444;
  font-size:.78rem;
  font-weight:700;
}

.metric-value{
  font-size:.78rem;
  text-align:center;
}

/* LEGEND */

.legend{
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  width:100%;
  min-width:0;
  gap:2px;
  margin-top:18px;
}

.legend-item{
  padding:8px 6px;
  color:#fff;
  font-size:.78rem;
  font-weight:700;
  text-align:center;
  overflow-wrap:anywhere;
}

.legend-item.work{
  background:var(--work-row);
  color:#222;
}

.legend-note{
  margin-top:6px;
  color:#555;
  font-size:.76rem;
  text-align:center;
}

/* MOBILE */

.mobile-summary{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  margin-bottom:16px;
}

.mini-card{
  padding:12px 14px;
  background:#fff;
  border:1px solid #ddd;
  border-radius:12px;
  box-shadow:var(--schedule-shadow);
}

.mini-card strong{
  display:block;
  margin-bottom:6px;
  font-size:.95rem;
}

.days-stack{
  display:grid;
  gap:14px;
}

.day-card{
  overflow:hidden;
  background:#fff;
  border:1px solid #ddd;
  border-radius:var(--schedule-radius);
  box-shadow:var(--schedule-shadow);
}

.day-header{
  padding:12px 14px;
  background:#555;
  color:#fff;
  font-size:1rem;
  font-weight:700;
}

.day-metrics{
  display:flex;
  flex-wrap:wrap;
  gap:16px;
  padding:10px 14px;
  background:#fafafa;
  border-bottom:1px solid #eee;
  font-size:.9rem;
}

.day-timeline{
  display:grid;
  gap:10px;
  padding:12px;
}

.mobile-event{
  display:grid;
  grid-template-columns:74px 1fr;
  gap:10px;
  align-items:start;
  overflow:hidden;
  border-radius:12px;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.06);
}

.mobile-time{
  display:flex;
  justify-content:center;
  align-items:center;
  height:100%;
  padding:10px;
  background:#efefef;
  color:#333;
  font-size:.9rem;
  font-weight:700;
  line-height:1.2;
  text-align:center;
  border-right:1px solid #ddd;
}

.mobile-body{
  display:flex;
  align-items:center;
  min-height:66px;
  padding:12px;
  font-weight:700;
  line-height:1.25;
}

.mobile-legend{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:8px;
  margin-top:18px;
}

.mobile-legend .legend-item{
  border-radius:10px;
  font-size:.86rem;
}

/* RESPONSIVE */

@media (max-width:900px){
  .schedule-title{
    justify-content:center;
    text-align:center;
  }

  .schedule-title .week{
    white-space:normal;
  }

  .desktop-view{
    display:none;
  }

  .mobile-view{
    display:block;
  }
}

.desktop-summary{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
  margin:0 0 16px;
  margin-top:16px;
}

@media (max-width:900px){
  .desktop-summary{
    display:none;
  }
}

.day-header.day-toggle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  cursor:pointer;
}

.day-title{
  flex:1;
}

.day-toggle-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:32px;
  height:32px;
  padding:0;
  border:0;
  background:transparent;
  color:#fff;
  cursor:pointer;
}

.day-toggle-icon{
  display:inline-block;
  font-size:1.1rem;
  line-height:1;
  transition:transform .2s ease;
}

.day-content{
  overflow:hidden;
}

.day-card.is-collapsed .day-content{
  display:none;
}

.day-card.is-collapsed .day-toggle-icon{
  transform:rotate(-90deg);
}

/* ===== SCHEDULE END ===== */


/* =========================================================
   CONTENTS / TOC
   ========================================================= */

.toc-list > li{
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.toc-list > li:last-child{
  border-bottom: none;
}

.toc-list > li > a{
  display: inline-block;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: color .16s ease, transform .16s ease;
}

.toc-list > li > a:hover{
  color: var(--accent2);
  transform: translateX(3px);
}

/* grupos */
.toc-group{
  margin-top: 10px;
  padding-top: 6px;
}

.toc-group > a{
  font-weight: 700;
}

/* subitems */
.toc-group ul{
  margin-top: 6px;
  padding-left: 16px;
  border-left: 1px solid rgba(0,0,0,.08);
}

.toc-group ul li{
  padding: 4px 0;
}

.toc-group ul a{
  opacity: .9;
  font-size: 0.95rem;
}




/* =========================================================
   INLINE PROMPT INSIDE CODEBLOCK
   ========================================================= */

.inline-prompt{
  border-top: 1px solid var(--rule);
  background: rgba(30,30,30,.02);
}

.inline-prompt-wrap{
  padding: 14px;
}

.inline-prompt-nav{
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.inline-prompt-tab{
  border: 1px solid var(--rule);
  background: rgba(30,30,30,.03);
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s ease;
}

.inline-prompt-tab:hover{
  border-color: rgba(199,53,44,.35);
}

.inline-prompt-tab.is-active{
  background: rgba(30,30,30,.08);
  border-color: rgba(30,30,30,.25);
  color: var(--ink);
}

.inline-prompt-panel{
  display: none;
  border: 1px solid rgba(30,30,30,.10);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,.45);
}

.inline-prompt-panel.is-active{
  display: block;
}

.inline-prompt-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(30,30,30,.10);
  background: rgba(30,30,30,.02);
}

.inline-prompt-label{
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
}

.inline-prompt-text{
  padding: 12px;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.68;
  white-space: pre-wrap;
}

@media (max-width: 720px){
  .inline-prompt-head{
    flex-wrap: wrap;
  }
}

.download-btn{
  font-family: var(--sans);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: rgba(31,94,168,.08);
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.download-btn:hover{
  border-color: rgba(31,94,168,.35);
  background: rgba(31,94,168,.16);
  text-decoration: none;
}

.inline-prompt-footer{
  margin-top: 10px;
  padding: 8px 10px;
  border-top: 1px solid rgba(30,30,30,.10);
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}

/* ===== Code toggle as rounded button ===== */

.codeblock summary .code-toggle,
.code-footer .code-toggle{
  font-family: var(--sans);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: rgba(255,255,255,.7);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.codeblock summary .code-toggle:hover,
.code-footer .code-toggle:hover{
  border-color: rgba(199,53,44,.35);
  text-decoration: none;
}

/* Mantener las flechas */
.codeblock summary .code-toggle::before,
.code-footer .code-toggle::before{
  font-size: 14px;
  line-height: 1;
  display: inline-block;
  transform: none !important;
}

/* ===== Generic rounded toggle button ===== */

.toggle-btn{
  font-family: var(--sans);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: rgba(255,255,255,.7);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.toggle-btn:hover{
  border-color: rgba(199,53,44,.35);
}

/* Triangle for prompt toggle */
.toggle-btn[data-toggle-inline-prompt]::before{
  content: "▸";
  font-size: 14px;
  line-height: 1;
  display: inline-block;
  transform: none !important;
}

/* Open state */
.toggle-btn[data-toggle-inline-prompt].is-open::before{
  content: "▾";
}

.download-btn{
  font-family: var(--sans);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: rgba(255,255,255,.7);
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.download-btn:hover{
  border-color: rgba(31,94,168,.35);
  background: rgba(31,94,168,.08);
  text-decoration: none;
}




/* =========================================================
   Vertical page progress with sublevels shown only when active
   ========================================================= */

.page-progress{
  position: fixed;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  z-index: 850;

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

  padding: 14px 8px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: rgba(252,251,248,.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

/* central line */
.page-progress::before{
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: rgba(30,30,30,.12);
  z-index: 0;
}

/* one main group */
.page-progress-group{
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* sublevels hidden by default */
.page-progress-sub{
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* only show when parent group is active */
.page-progress-group.is-open .page-progress-sub{
  display: flex;
}

/* shared links */
.page-progress a{
  text-decoration: none;
  font-family: var(--sans);
  transition: all .2s ease;
}

/* main level */
.page-progress a.level-1{
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(30,30,30,.18);
  background: rgba(255,255,255,.92);

  display: grid;
  place-items: center;

  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

/* sub level */
.page-progress a.level-2{
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(30,30,30,.14);
  background: rgba(255,255,255,.88);

  display: grid;
  place-items: center;

  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}

/* hover */
.page-progress a:hover{
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.08);
}

/* current section */
.page-progress a.active{
  background: rgba(31,94,168,.14);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 4px rgba(31,94,168,.08);
}

/* sections already passed */
.page-progress a.done{
  background: rgba(42,127,104,.12);
  border-color: rgba(42,127,104,.35);
  color: var(--accent3);
}

/* mobile version: bottom bar */
@media (max-width: 720px){
  .page-progress{
    top: auto;
    bottom: 12px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: 420px;

    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;

    padding: 10px 10px 12px;
    border-radius: 18px;
  }

  .page-progress::before{
    display: none;
  }

  .page-progress-group{
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .page-progress-sub{
    flex-direction: row;
    gap: 4px;
  }

  .page-progress a.level-1{
    width: 36px;
    height: 28px;
    font-size: 10px;
  }

  .page-progress a.level-2{
    width: 22px;
    height: 22px;
    font-size: 9px;
  }
}