
/* Visor del portfolio del CV — estilos acotados, sin reemplazar el tema Desmond. */
.cv-gallery-trigger { cursor: zoom-in; }
.cv-gallery-viewer, .cv-gallery-viewer * { box-sizing: border-box; }
.cv-gallery-viewer[hidden] { display: none !important; }
.cv-gallery-viewer {
  position: fixed; inset: 0; z-index: 2147483000;
  padding: clamp(8px, 1.8vw, 26px);
  background: rgba(14, 17, 19, .88);
  color: #383838; font-family: Lato, Arial, sans-serif;
  font-size: 14px; line-height: 1.45;
  display: flex; align-items: center; justify-content: center;
}
.cv-gallery-viewer__panel {
  display: flex; flex-direction: column; overflow: hidden;
  width: min(100%, 1560px); height: min(100%, 980px);
  border: 1px solid #d8d8d8; border-radius: 2px;
  background: #f9f9f9;
  box-shadow: 0 16px 60px rgba(0,0,0,.32);
}
.cv-gallery-viewer__toolbar {
  min-height: 58px; display: flex; align-items: center; flex-wrap: wrap;
  justify-content: space-between; gap: 10px;
  padding: 8px clamp(10px, 2.2vw, 25px);
  border-bottom: 1px solid #e1e1e1; background: #fff;
}
.cv-gallery-viewer__heading { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cv-gallery-viewer__eyebrow { color: #848484; font-weight: 700; font-size: 10px; letter-spacing: .15em; text-transform: uppercase; }
.cv-gallery-viewer__title { color: #242424; font-weight: 700; font-size: 15px; line-height: 1.3; }
.cv-gallery-viewer__tools { display: flex; gap: 5px; align-items: center; }
.cv-gallery-viewer__button {
  display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center;
  width: 37px; height: 36px; border: 1px solid #dadada; border-radius: 2px;
  background: #fff; color: #464646; cursor: pointer; font-family: inherit;
  font-size: 20px; font-weight: 400; line-height: 1;
  transition: background-color .15s ease, border-color .15s ease;
}
.cv-gallery-viewer__button:hover { background: #ededed; border-color: #aaa; }
.cv-gallery-viewer__button:focus-visible { outline: 2px solid #555; outline-offset: 2px; }
.cv-gallery-viewer__button:disabled { opacity: .4; cursor: default; }
.cv-gallery-viewer__button--reset { width: auto; min-width: 61px; padding: 0 8px; font-size: 12px; font-weight: 700; }
.cv-gallery-viewer__button--close { margin-left: 7px; font-size: 24px; }
.cv-gallery-viewer__stage {
  position: relative; overflow: hidden; flex: 1 1 auto; min-height: 0;
  background: #191a1c; touch-action: none; user-select: none; -webkit-user-select: none;
  cursor: default;
}
.cv-gallery-viewer__stage.is-zoomed { cursor: grab; }
.cv-gallery-viewer__stage.is-dragging { cursor: grabbing; }
.cv-gallery-viewer__image[hidden], .cv-gallery-viewer__message[hidden] { display:none !important; }
.cv-gallery-viewer__image {
  position: absolute; left: 50%; top: 50%; display: block;
  max-width: none; max-height: none; margin: 0;
  object-fit: contain; pointer-events: none;
  transform-origin: center center; will-change: transform;
  -webkit-user-drag: none;
}
.cv-gallery-viewer__arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 1; width: 42px; height: 56px;
  border: 1px solid rgba(255,255,255,.25); border-radius: 2px;
  background: rgba(25,26,28,.76); color: #fff; font-size: 30px;
}
.cv-gallery-viewer__arrow:hover { background: rgba(60,60,60,.88); border-color: rgba(255,255,255,.6); }
.cv-gallery-viewer__arrow--previous { left: clamp(9px,2vw,23px); }
.cv-gallery-viewer__arrow--next { right: clamp(9px,2vw,23px); }
.cv-gallery-viewer__message {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  max-width: 80%; text-align: center; color: #ddd; font-size: 14px;
  pointer-events: none;
}
.cv-gallery-viewer__footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 15px; min-height: 48px; padding: 9px clamp(10px, 2.2vw, 25px);
  color: #6d6d6d; background: #fff; border-top: 1px solid #e1e1e1;
  font-size: 12px;
}
.cv-gallery-viewer__description { flex: 1 1 auto; min-width: 0; }
.cv-gallery-viewer__counter { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; }
.cv-gallery-viewer__help { display: block; font-size: 11px; color: #929292; margin-top: 2px; }
.cv-gallery-viewer__panel:fullscreen { width: 100%; height: 100%; max-width: none; max-height: none; }
@media (max-width: 720px) {
  .cv-gallery-viewer { padding: 0; }
  .cv-gallery-viewer__panel { width: 100%; height: 100%; border: 0; border-radius: 0; }
  .cv-gallery-viewer__toolbar { min-height: 54px; flex-wrap: nowrap; }
  .cv-gallery-viewer__title { font-size: 12px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cv-gallery-viewer__eyebrow { font-size: 9px; }
  .cv-gallery-viewer__tools { gap: 3px; }
  .cv-gallery-viewer__button { width: 31px; height: 32px; font-size: 18px; }
  .cv-gallery-viewer__button--reset { min-width: 49px; width: auto; padding: 0 4px; font-size: 11px; }
  .cv-gallery-viewer__button--fullscreen { display: none; }
  .cv-gallery-viewer__button--close { margin-left: 1px; }
  .cv-gallery-viewer__arrow { width: 31px; height: 46px; font-size: 24px; }
  .cv-gallery-viewer__footer { min-height: 48px; }
  .cv-gallery-viewer__help { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cv-gallery-viewer__button { transition: none; }
}



/* Portfolio estilo Pinterest: disposición masonry con columnas CSS nativas.
   Fotografías completas, sin recortes ni espacios verticales artificiales.
   No requiere biblioteca externa ni altera el visor Desmond. */
.o-grid.o-grid--gallery.cv-masonry {
  display: block !important; /* Anula el grid/flex de Desmond solo aquí. */
  column-count: 2;
  column-gap: 16px;
  column-fill: balance;
  padding: 0 !important;
  margin: 0 !important;
  width: 100%;
}
.o-grid.o-grid--gallery.cv-masonry::before,
.o-grid.o-grid--gallery.cv-masonry::after {
  display: none !important; /* Neutraliza clearfix de las columnas originales. */
  content: none !important;
}
.o-grid.o-grid--gallery.cv-masonry > .o-grid__col-sm-6 {
  float: none !important;
  clear: none !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 0 16px !important;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  box-sizing: border-box;
}
.o-grid.o-grid--gallery.cv-masonry .c-image-overlay {
  display: block;
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  position: relative;
}
.o-grid.o-grid--gallery.cv-masonry .c-image-overlay > img {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  margin: 0;
}
@media (max-width: 767px) {
  .o-grid.o-grid--gallery.cv-masonry { column-count: 1; }
}
