/* =============================================
   THE VAULT v2 — Full-Width Modal & Lightbox
   css/modal.css
   ============================================= */

/* ══════════════════════════════════════════════
   FULL-WIDTH MODAL OVERLAY
══════════════════════════════════════════════ */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow-y: auto;
}
.modal-bg.hidden { display: none !important; }

/* ── Full-width modal container ── */
.modal-fw {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 1100px;
  position: relative;
  animation: modalIn .28s cubic-bezier(.16,1,.3,1);
  overflow: hidden;
  margin: auto;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

@keyframes modalIn {
  from { transform: scale(.96) translateY(12px); opacity: 0; }
  to   { transform: scale(1)   translateY(0);    opacity: 1; }
}

/* ── Two-column layout ── */
.modal-fw-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  min-height: 0;
  flex: 1;
}

/* ── Left: media panel ── */
.modal-fw-media {
  display: flex;
  flex-direction: column;
  background: var(--surface2);
  border-right: 1px solid var(--border);
  min-height: 0;
}

.modal-art {
  flex: 1;
  min-height: 300px;
  max-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--surface3);
}

.modal-art.has-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
  transition: transform .3s ease;
}
.modal-art.has-img img:hover { transform: scale(1.02); }

.modal-icon {
  font-size: 6rem;
  z-index: 1;
  position: relative;
  user-select: none;
  opacity: .7;
}

.modal-gradient {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: linear-gradient(0deg, var(--surface2), transparent);
  pointer-events: none;
}

.modal-img-count {
  position: absolute;
  bottom: .6rem;
  right: .75rem;
  background: rgba(10,10,15,.7);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
  padding: .2rem .65rem;
  font-size: .72rem;
  color: var(--muted);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

/* ── Thumbnail strip ── */
.modal-thumbs {
  display: flex;
  gap: .4rem;
  padding: .6rem;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-thumbs::-webkit-scrollbar { height: 4px; }
.modal-thumbs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.thumb-btn {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border: 2px solid transparent;
  border-radius: var(--r-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--surface3);
  padding: 0;
  transition: border-color .18s, transform .18s;
}
.thumb-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-btn:hover { border-color: rgba(232,184,75,.5); transform: scale(1.05); }
.thumb-btn.active { border-color: var(--accent); }

/* ── Right: info panel ── */
.modal-fw-info {
  padding: 1.75rem 1.75rem 1.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-height: 0;
}

.modal-title {
  font-family: var(--font-d);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: 2px;
  line-height: 1.05;
  margin-bottom: .25rem;
}
.modal-artist { color: var(--muted); font-size: .92rem; margin-bottom: .85rem; }

.modal-tags { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .9rem; }
.modal-tag { font-size: .72rem; padding: 3px 10px; border-radius: 8px; font-weight: 600; }
.tag-muted { background: rgba(255,255,255,.06); color: var(--muted); }

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
  margin-bottom: .9rem;
}
.modal-field label {
  font-size: .66rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 2px;
}
.modal-field span { font-size: .9rem; font-weight: 500; }

.modal-notes {
  font-size: .86rem;
  color: var(--muted);
  line-height: 1.65;
  padding: .75rem;
  background: var(--surface2);
  border-radius: var(--r-sm);
  margin-bottom: .9rem;
  border-left: 3px solid var(--border);
}

.modal-links { margin-bottom: .9rem; }
.links-title {
  font-size: .67rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: .45rem; font-weight: 600;
}
.ext-link {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem .75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: .84rem; color: var(--accent);
  transition: all .2s; margin-bottom: .35rem;
}
.ext-link:hover { border-color: var(--accent); background: rgba(232,184,75,.06); }
.ext-link-icon { font-style: normal; font-size: .88rem; }

.modal-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: auto; padding-top: .75rem; }

/* ── Close button ── */
.modal-close {
  position: absolute;
  top: .9rem; right: .9rem;
  background: rgba(10,10,15,.65);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer; font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s; z-index: 10;
}
.modal-close:hover { background: rgba(255,255,255,.15); }

/* ══════════════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════════════ */
.lightbox-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .96);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 1rem;
}
.lightbox-bg.hidden { display: none !important; }

.lb-img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  width: 100%;
  max-width: 1200px;
}

.lb-img-wrap img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--r-md);
  animation: lbFade .22s ease;
  user-select: none;
}
@keyframes lbFade { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }

/* Nav arrows */
.lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  width: 50px; height: 50px;
  border-radius: 50%;
  font-size: 1.8rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
  z-index: 10;
  line-height: 1;
}
.lb-nav:hover { background: rgba(232,184,75,.3); border-color: var(--accent); color: var(--accent); }
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }

/* Close */
.lb-close {
  position: fixed;
  top: 1rem; right: 1rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s; z-index: 10;
}
.lb-close:hover { background: rgba(224,82,82,.5); }

/* Footer: counter + dots */
.lb-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding-top: .75rem;
  flex-shrink: 0;
}
.lb-count { font-size: .8rem; color: rgba(255,255,255,.45); letter-spacing: 1px; }
.lb-dots { display: flex; gap: .4rem; }
.lb-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  border: none; background: rgba(255,255,255,.25);
  cursor: pointer; padding: 0;
  transition: background .2s, width .2s;
}
.lb-dot.active { background: var(--accent); width: 20px; border-radius: 4px; }

/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */
@media (max-width: 800px) {
  /* Stack the two-column modal vertically on mobile */
  .modal-fw-inner {
    grid-template-columns: 1fr;
  }
  .modal-fw-media {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .modal-art {
    max-height: 280px;
    min-height: 220px;
  }
  .modal-fw-info {
    padding: 1.1rem;
    max-height: 55vh;
    overflow-y: auto;
  }
  .modal-fw {
    max-height: 96vh;
    border-radius: var(--r-md);
  }
  .thumb-btn { width: 56px; height: 56px; }

  /* Lightbox on mobile */
  .lb-nav { width: 38px; height: 38px; font-size: 1.4rem; }
  .lb-prev { left: .4rem; }
  .lb-next { right: .4rem; }
  .lb-img-wrap img { max-height: 70vh; }
}

@media (max-width: 480px) {
  .modal-bg { padding: 0; align-items: flex-end; }
  .modal-fw {
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    max-height: 96vh;
  }
  .modal-art { max-height: 240px; min-height: 180px; }
  .modal-fw-info { padding: 1rem; }
  .modal-title { font-size: 1.5rem; }
  .modal-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════
   SHARE BUTTON
══════════════════════════════════════════════ */
.btn-share {
  background: transparent;
  border: 1px solid var(--pink);
  color: var(--pink);
  font-family: var(--font-b);
  font-size: .82rem;
  font-weight: 600;
  padding: .45rem 1rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.btn-share:hover {
  background: rgba(224,125,160,.12);
  box-shadow: 0 0 16px rgba(224,125,160,.2);
}

/* ══════════════════════════════════════════════
   FULLSCREEN EXPAND BUTTON (on modal hero image)
══════════════════════════════════════════════ */
.img-fullscreen-btn {
  position: absolute;
  top: .75rem;
  left: .75rem;
  background: rgba(10,10,15,.65);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  z-index: 5;
  backdrop-filter: blur(4px);
}
.img-fullscreen-btn:hover {
  background: rgba(232,184,75,.3);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.08);
}

/* ══════════════════════════════════════════════
   SOCIAL SHARE PANEL
══════════════════════════════════════════════ */
.share-panel {
  width: 100%;
  margin-top: .6rem;
  animation: sharePanelIn .22s cubic-bezier(.16,1,.3,1);
}
.share-panel.hidden { display: none; }

@keyframes sharePanelIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.share-panel-inner {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1rem;
}

.share-panel-title {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: .75rem;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
}

.share-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .65rem .5rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-b);
  font-size: .72rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all .18s;
  line-height: 1.2;
}
.share-opt svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.share-opt:hover { transform: translateY(-2px); }

/* Individual platform colours on hover */
.share-copy:hover    { border-color: var(--accent);  color: var(--accent);  background: rgba(232,184,75,.08); }
.share-x:hover       { border-color: #fff;           color: #fff;           background: rgba(255,255,255,.07); }
.share-fb:hover      { border-color: #1877f2;        color: #1877f2;        background: rgba(24,119,242,.1); }
.share-wa:hover      { border-color: #25d366;        color: #25d366;        background: rgba(37,211,102,.08); }
.share-threads:hover { border-color: var(--pink);    color: var(--pink);    background: rgba(224,125,160,.08); }
.share-email:hover   { border-color: var(--purple);  color: var(--purple);  background: rgba(160,125,232,.08); }

/* ── Responsive share grid ── */
@media (max-width: 480px) {
  .share-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-actions { flex-wrap: wrap; }
}

/* ══════════════════════════════════════════════
   MODAL EMBEDDED VIDEO PLAYER
══════════════════════════════════════════════ */
.modal-video {
  margin-bottom: .9rem;
}

.video-embed-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: #000;
}

.video-embed-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: none;
}
