/* Galería por trabajos. Conserva la cabecera y el pie de styles.css. */
body.jc-gallery-page { background: #fff; background-image: none; }
.jc-gallery { padding-block: 44px 64px; }
.jc-gallery-intro { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 32px; }
.jc-gallery-intro h1 { margin: 0; font-size: clamp(2rem, 4vw, 3rem); }
.jc-back { color: #063f59; font-weight: 700; text-decoration: underline; }
.jc-group { margin-bottom: 44px; scroll-margin-top: 180px; }
.jc-group-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 20px; border-bottom: 1px solid #dce2e5; padding-bottom: 16px; margin-bottom: 20px; }
.jc-group-heading h2 { margin: 0; padding-left: 14px; border-left: 4px solid #e58a4e; font-size: clamp(1.35rem, 2.8vw, 2rem); overflow-wrap: anywhere; }
.jc-group-count { margin: 0; color: #61747a; font-size: .9rem; }
.jc-gallery .gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.jc-gallery .tile { display: block; position: relative; overflow: hidden; aspect-ratio: 1 / 1; box-shadow: 0 10px 28px rgba(0,0,0,.10); background: #f3f3f3; cursor: zoom-in; transition: transform .15s ease; }
.jc-gallery .tile:hover { transform: translateY(-2px); }
.jc-gallery .tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.jc-gallery-empty { padding: 24px; border: 1px solid #d7e2e7; background: #f7fafb; }
@media (min-width: 576px) { .jc-gallery .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 992px) { .jc-gallery .gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .jc-gallery .gallery-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* Dialog nativo: teclado, foco y bloqueo del fondo. */
.jc-lightbox { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; padding: 70px 80px; color: #fff; background: rgba(0,0,0,.9); box-sizing: border-box; }
.jc-lightbox:not([open]) { display: none; }
.jc-lightbox[open] { display: flex; align-items: center; justify-content: center; }
.jc-lightbox::backdrop { background: rgba(0,0,0,.35); }
.jc-lightbox figure { margin: 0; max-width: 100%; text-align: center; }
.jc-lightbox img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 190px); margin-inline: auto; object-fit: contain; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.jc-lightbox figcaption { max-width: 80vw; margin: 16px auto 0; color: #fff; line-height: 1.4; overflow-wrap: anywhere; }
.jc-lightbox button { display: grid; place-items: center; position: absolute; border: 1px solid rgba(255,255,255,.35); background: rgba(0,0,0,.45); color: #fff; cursor: pointer; line-height: 1; padding: 0; width: 48px; height: 48px; }
.jc-lightbox button:hover { background: rgba(255,255,255,.16); }
.jc-lightbox .jc-lb-close { top: 16px; right: 18px; font-size: 34px; }
.jc-lightbox .jc-lb-nav { top: 50%; transform: translateY(-50%); font-size: 30px; }
.jc-lightbox .jc-lb-prev { left: 16px; }
.jc-lightbox .jc-lb-next { right: 16px; }
.jc-lightbox button[hidden] { display: none; }
@media (max-width: 576px) {
  .jc-gallery { padding-top: 30px; }
  .jc-group { scroll-margin-top: 30px; }
  .jc-lightbox { padding: 72px 10px 95px; }
  .jc-lightbox img { max-height: calc(100dvh - 220px); }
  .jc-lightbox .jc-lb-nav { top: auto; bottom: 16px; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .jc-gallery .tile { transition: none; } }
