/* 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;
}



/* ===== 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;
}