/* ============================================================
   VERO GALLERY — Cloudinary-backed photo system
   ============================================================ */

/* --- Admin floating toggle --- */
.vg-admin-fab{
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--ink); color: var(--bg);
  border: none; cursor: pointer;
  font-family: var(--mono);
  font-size: 18px;
  box-shadow: 0 12px 30px -10px color-mix(in oklab, var(--ink) 50%, transparent);
  display: none; /* shown via JS when user opts into admin */
  align-items: center; justify-content: center;
  transition: transform .2s ease, background .2s ease;
}
.vg-admin-fab:hover{ transform: scale(1.08); }
.vg-admin-fab.is-on{ background: var(--accent); color: var(--ink); }

.vg-admin-bar{
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 88; display: none;
  background: var(--ink); color: var(--bg);
  border-radius: 100px;
  padding: 10px 14px 10px 18px;
  align-items: center; gap: 14px;
  box-shadow: 0 16px 40px -14px color-mix(in oklab, var(--ink) 60%, transparent);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.vg-admin-bar.is-on{ display: inline-flex; }
.vg-admin-bar .vg-dot{
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); display: inline-block;
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 30%, transparent);
  animation: vgPulse 1.6s ease-in-out infinite;
}
@keyframes vgPulse{ 50%{ box-shadow: 0 0 0 8px color-mix(in oklab, var(--accent) 0%, transparent);}}
.vg-admin-bar button{
  background: color-mix(in oklab, var(--bg) 16%, transparent);
  color: var(--bg);
  border: 1px solid color-mix(in oklab, var(--bg) 25%, transparent);
  border-radius: 100px;
  padding: 8px 16px;
  font: inherit;
  cursor: pointer;
  letter-spacing: inherit;
  text-transform: inherit;
}
.vg-admin-bar button:hover{ background: color-mix(in oklab, var(--bg) 25%, transparent); }
.vg-admin-bar button.primary{
  background: var(--accent); color: var(--ink); border-color: transparent;
}
.vg-admin-bar button.primary:hover{ background: color-mix(in oklab, var(--accent) 80%, white); }

/* --- Modals --- */
.vg-modal-backdrop{
  position: fixed; inset: 0; z-index: 100;
  background: color-mix(in oklab, var(--ink) 70%, transparent);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
  animation: vgFade .2s ease;
}
.vg-modal-backdrop.is-open{ display: flex; }
@keyframes vgFade{ from{opacity:0;} to{opacity:1;} }

.vg-modal{
  background: var(--bg);
  border-radius: var(--radius-l);
  max-width: 580px; width: 100%;
  max-height: 90vh; overflow: auto;
  padding: 36px 36px 32px;
  position: relative;
  box-shadow: 0 30px 80px -30px color-mix(in oklab, var(--ink) 60%, transparent);
  animation: vgRise .25s cubic-bezier(.2,.8,.2,1);
}
@keyframes vgRise{ from{ transform: translateY(20px); opacity:0;} to{transform:none;opacity:1;}}
.vg-modal h3{
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: 32px;
  margin: 0 0 6px;
}
.vg-modal .vg-sub{
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 24px;
}
.vg-modal-close{
  position: absolute; top: 18px; right: 18px;
  background: none; border: none; cursor: pointer;
  color: var(--ink-soft);
  font-size: 22px;
  width: 36px; height: 36px;
  border-radius: 50%;
}
.vg-modal-close:hover{ background: var(--bg-2); color: var(--ink); }

.vg-field{ display: block; margin-bottom: 18px; }
.vg-field-label{
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.vg-field input[type=text],
.vg-field select{
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
}
.vg-field input[type=text]:focus,
.vg-field select:focus{
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 25%, transparent);
}
.vg-field-hint{
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 6px;
  font-style: italic;
}
.vg-checkbox{
  display: flex; align-items: center; gap: 10px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}
.vg-checkbox input{ accent-color: var(--accent); width: 18px; height: 18px; }

.vg-btn{
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 100px;
  padding: 12px 24px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  letter-spacing: .02em;
}
.vg-btn:hover{ background: color-mix(in oklab, var(--ink) 85%, var(--accent)); }
.vg-btn:disabled{ opacity: .5; cursor: not-allowed; }
.vg-btn.primary{ background: var(--accent); color: var(--ink); }
.vg-btn.primary:hover{ background: color-mix(in oklab, var(--accent) 85%, white); }
.vg-btn.ghost{ background: transparent; color: var(--ink); border: 1px solid var(--line); }
.vg-btn.ghost:hover{ background: var(--bg-2); }

.vg-actions{ display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

.vg-files-drop{
  border: 2px dashed var(--line);
  border-radius: var(--radius-m);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.vg-files-drop:hover, .vg-files-drop.drag{
  border-color: var(--accent);
  background: var(--accent-soft);
}
.vg-files-drop .pile{
  font-size: 32px;
  margin-bottom: 8px;
}
.vg-files-drop p{ margin: 4px 0; }
.vg-files-drop .hint{ font-size: 12px; color: var(--ink-soft); }
.vg-files-list{
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-soft);
  max-height: 120px;
  overflow: auto;
}
.vg-files-list .vg-fitem{ padding: 2px 0; }

.vg-progress{
  margin-top: 16px;
  background: var(--bg-2);
  border-radius: 100px;
  height: 8px;
  overflow: hidden;
}
.vg-progress > div{
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  height: 100%; width: 0;
  transition: width .3s ease;
}
.vg-progress-text{
  font-family: var(--mono); font-size: 11px;
  color: var(--ink-soft); margin-top: 8px;
  text-align: center;
}

/* --- Dynamic gallery --- */
.vg-gallery-wrap{ margin-top: 28px; }

.vg-filters{
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  justify-content: center;
}
.vg-filter{
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  border-radius: 100px;
  padding: 8px 18px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  cursor: pointer;
  transition: all .2s;
}
.vg-filter:hover{ border-color: var(--accent); color: var(--ink); }
.vg-filter.active{
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}
.vg-filter .count{
  font-size: 10px;
  opacity: .7;
  margin-left: 6px;
}

/* Layout: masonry */
.vg-gallery.layout-mosaic{
  column-count: 4;
  column-gap: 14px;
}
@media (max-width: 1100px){ .vg-gallery.layout-mosaic{ column-count: 3; }}
@media (max-width: 720px){ .vg-gallery.layout-mosaic{ column-count: 2; }}
.vg-gallery.layout-mosaic .vg-card{
  break-inside: avoid;
  margin-bottom: 14px;
}

/* Layout: grid */
.vg-gallery.layout-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.vg-gallery.layout-grid .vg-card{
  aspect-ratio: 1/1;
}
.vg-gallery.layout-grid .vg-card img{
  width: 100%; height: 100%; object-fit: cover;
}

/* Layout: events (grouped) */
.vg-events-group{
  margin-bottom: 48px;
}
.vg-events-head{
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.vg-events-head h3{
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: 26px;
  margin: 0;
}
.vg-events-head .vg-evt-meta{
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink-soft);
}

.vg-card{
  position: relative;
  border-radius: var(--radius-m);
  border: 2px solid var(--gold);
  box-sizing: border-box;
  overflow: hidden;
  background: var(--bg-2);
  cursor: zoom-in;
  display: block;
}
body[data-theme="dark"] .vg-card{
  border-color: #c9a86a !important;
}
.vg-card img{
  width: 100%;
  display: block;
  transition: transform .6s cubic-bezier(.2,.8,.2,1);
}
.vg-card:hover img{ transform: scale(1.04); }

.vg-card .vg-card-controls{
  position: absolute; top: 8px; right: 8px;
  display: none;
  gap: 4px;
  z-index: 2;
}
body.vg-admin-on .vg-card .vg-card-controls{ display: flex; }
.vg-card .vg-card-controls button{
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  display: grid; place-items: center;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px -4px rgba(0,0,0,0.2);
}
.vg-card .vg-card-controls button:hover{ background: var(--bg); }
.vg-card .vg-card-controls button.star{ color: var(--ink-soft); opacity: .75; transition: background .18s ease, color .18s ease, box-shadow .18s ease, transform .18s cubic-bezier(.2,.8,.2,1); }
.vg-card .vg-card-controls button.star:active{ transform: scale(.86); }
.vg-card .vg-feat-badge{ animation: vgFeatIn .22s cubic-bezier(.2,.8,.2,1); }
@keyframes vgFeatIn{ from{ opacity:0; transform: translateY(-4px) scale(.92); } to{ opacity:1; transform:none; } }
.vg-card .vg-card-controls button.star.is-on{ background: var(--gold); color: #fff; opacity: 1; box-shadow: 0 0 0 2px rgba(201,168,106,.45); }

.vg-card .vg-feat-badge{
  position: absolute; top: 8px; left: 8px;
  background: var(--gold);
  color: white;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  display: none;
}
body.vg-admin-on .vg-card.is-featured .vg-feat-badge{ display: block; }

.vg-card .vg-play-badge{
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  z-index: 1;
  color: white;
  font-size: 15px;
}
.vg-card .vg-play-badge::before{
  content: "";
  position: absolute;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--ink) 55%, transparent);
  backdrop-filter: blur(2px);
}
.vg-card .vg-play-badge > *{ position: relative; }

/* Theme sub-grouping (used for Pijamadas → Temáticas) */
.vg-theme-block{ margin-bottom: 56px; }
.vg-theme-head{
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
.vg-theme-eyebrow{
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.vg-theme-title{
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 36px;
  margin: 0;
  color: var(--ink);
}
.vg-events-head h4{
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: 22px;
  margin: 0;
  color: var(--ink);
}

/* Empty states */
.vg-empty{
  text-align: center;
  padding: 60px 24px;
  color: var(--ink-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius-l);
  background: color-mix(in oklab, var(--bg-2) 50%, transparent);
}
.vg-empty .icon{ font-size: 40px; margin-bottom: 12px; }
.vg-empty p{ margin: 4px 0; }
.vg-empty .primary-line{ font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--ink); }

/* --- Lightbox --- */
.vg-lightbox{
  position: fixed; inset: 0; z-index: 110;
  background: rgba(20, 12, 18, 0.94);
  display: none;
  align-items: center; justify-content: center;
  padding: 40px;
  animation: vgFade .2s ease;
}
.vg-lightbox.is-open{ display: flex; }
.vg-lightbox img,
.vg-lightbox video{
  max-width: 100%; max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.vg-lightbox-close, .vg-lightbox-nav{
  position: absolute;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  width: 48px; height: 48px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .2s;
}
.vg-lightbox-close:hover, .vg-lightbox-nav:hover{ background: rgba(255,255,255,0.2); }
.vg-lightbox-close{ top: 24px; right: 24px; }
.vg-lightbox-nav.prev{ left: 24px; top: 50%; transform: translateY(-50%); }
.vg-lightbox-nav.next{ right: 24px; top: 50%; transform: translateY(-50%); }
.vg-lightbox-caption{
  position: absolute; bottom: 82px; left: 50%; transform: translateX(-50%);
  max-width: calc(100% - 80px);
  text-align: center;
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  background: rgba(20,12,18,.78);
  padding: 7px 16px;
  border-radius: 100px;
  backdrop-filter: blur(4px);
}
.vg-lightbox-caption:empty{ display: none; }

/* Toast */
.vg-toast{
  position: fixed; bottom: 24px; left: 50%;
  transform: translate(-50%, 100px);
  background: var(--ink); color: var(--bg);
  padding: 14px 22px;
  border-radius: 100px;
  font-size: 14px;
  z-index: 200;
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 12px 30px -10px rgba(0,0,0,0.4);
}
.vg-toast.is-show{ transform: translate(-50%, 0); }
.vg-toast.error{ background: #b04848; }

/* Discreet admin entry link in footer */
.vg-admin-trigger{
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  cursor: pointer;
  background: transparent;
  border: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
  border-radius: 100px;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 5px 12px;
  margin-left: 14px;
  transition: all .2s;
}
.vg-admin-trigger:hover{
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* ---------- Visitas (panel admin) ---------- */
.vg-stats{ display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:18px 0 22px; }
.vg-stat{ background:var(--bg-2); border-radius:14px; padding:16px; text-align:center; }
.vg-stat-n{ font-size:30px; font-weight:600; line-height:1; color:var(--ink); }
.vg-stat-l{ font-size:11px; letter-spacing:.14em; text-transform:uppercase; color:var(--ink-soft); margin-top:7px; }
.vg-vrow{ display:grid; grid-template-columns:52px 1fr 40px; align-items:center; gap:10px; margin-bottom:7px; }
.vg-vday{ font-size:12px; color:var(--ink-soft); }
.vg-vbar{ height:8px; border-radius:99px; background:var(--accent); display:block; }
.vg-vn{ font-size:12px; text-align:right; color:var(--ink); }

/* ---------- Acceso a la galería desde la foto ampliada ---------- */
.vg-lb-gallery{ position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 10px; background: #fff; color: #1d1419; text-decoration: none; font-size: 14px; letter-spacing: .01em; padding: 12px 26px; border-radius: 100px; box-shadow: 0 14px 34px -14px rgba(0,0,0,.6); transition: transform .2s ease, background .2s ease; z-index: 4; }
.vg-lb-gallery span{ transition: transform .2s ease; }
.vg-lb-gallery:hover{ transform: translateX(-50%) translateY(-2px); }
.vg-lb-gallery:hover span{ transform: translateX(5px); }
@media (max-width: 620px){ .vg-lb-gallery{ bottom: 14px; font-size: 13px; padding: 10px 20px; } .vg-lightbox-caption{ bottom: 64px; } }
