﻿.project-file{
  min-height:150px;
  grid-template-columns:146px 1fr auto;
}

.file-thumb{
  width:132px;
  height:112px;
  background:#202426;
  border-radius:4px;
  overflow:hidden;
  position:relative;
  display:grid;
  place-items:center;
}

.file-thumb img,
.file-thumb canvas{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}

.file-thumb .file-icon{
  position:absolute;
  right:6px;
  bottom:6px;
  width:auto;
  height:auto;
  min-width:26px;
  padding:3px 5px;
  background:rgba(32,36,38,.92);
  border-radius:3px;
  font-size:9px;
}

.file-thumb:not(.image-thumb):not(.mesh-thumb) .file-icon{
  position:static;
  width:100%;
  height:100%;
  padding:0;
  border-radius:0;
  background:var(--dark);
  font-size:9px;
}

.file-thumb.image-thumb .file-icon,
.file-thumb.mesh-thumb.preview-ready .file-icon{
  display:none;
}

.image-thumb,
.detail-preview.has-thumb{
  cursor:zoom-in;
}

.file-thumb.preview-failed canvas{
  display:none;
}

.text-thumb{
  align-items:start;
  justify-items:stretch;
  padding:8px;
  background:#f7f8f8;
  color:#202426;
  border:1px solid #d8dcde;
  cursor:pointer;
}

.text-thumb pre{
  margin:0;
  font-family:"Consolas","SFMono-Regular",monospace;
  font-size:9px;
  line-height:1.35;
  white-space:pre-wrap;
  word-break:break-word;
  overflow:hidden;
}

.document-thumb{
  gap:8px;
  align-content:center;
  text-decoration:none;
  background:linear-gradient(180deg,#fff7f7,#fee2e2);
  border:1px solid #fecaca;
  color:#991b1b;
}

.doc-mark{
  display:grid;
  place-items:center;
  width:54px;
  height:38px;
  border-radius:4px;
  background:#cf1f32;
  color:#fff;
  font-size:16px;
  font-weight:900;
  box-shadow:0 8px 18px rgba(207,31,50,.22);
}

.document-thumb small{
  color:#6b7280;
  font-size:9px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.detail-thumb-hover-preview{
  position:fixed;
  z-index:2000;
  pointer-events:none;
  background:#202426;
  border:2px solid #fff;
  border-radius:6px;
  overflow:hidden;
  box-shadow:0 24px 80px rgba(0,0,0,.42);
}

.detail-thumb-hover-preview[hidden]{
  display:none;
}

.detail-thumb-hover-preview img,
.detail-thumb-hover-preview canvas{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}

body.viewer-open{
  overflow:hidden;
}

.image-viewer{
  position:fixed;
  inset:0;
  z-index:1000;
  background:rgba(12,14,15,.94);
  display:grid;
  place-items:center;
  padding:28px;
}

.image-viewer[hidden]{
  display:none;
}

.image-viewer figure{
  margin:0;
  width:96vw;
  height:92vh;
  display:grid;
  grid-template-rows:minmax(0,1fr) auto;
  gap:12px;
}

.image-viewer img{
  max-width:100%;
  max-height:100%;
  width:100%;
  height:100%;
  object-fit:contain;
  background:#fff;
  border-radius:4px;
  box-shadow:0 24px 80px rgba(0,0,0,.45);
}

.image-viewer figcaption{
  color:#fff;
  font-size:13px;
  line-height:1.4;
  text-align:center;
  word-break:break-word;
}

.image-viewer-close{
  position:fixed;
  top:18px;
  right:18px;
  width:42px;
  height:42px;
  border:0;
  border-radius:50%;
  background:#fff;
  color:#202426;
  font-size:28px;
  line-height:1;
  cursor:pointer;
  box-shadow:0 12px 36px rgba(0,0,0,.28);
}

.image-viewer-nav{
  position:fixed;
  top:50%;
  transform:translateY(-50%);
  width:78px;
  height:78px;
  border:0;
  border-radius:6px;
  background:rgba(255,255,255,.9);
  color:#202426;
  font-size:13px;
  font-weight:800;
  cursor:pointer;
  box-shadow:0 18px 48px rgba(0,0,0,.28);
}

.text-viewer{
  position:fixed;
  inset:0;
  z-index:1000;
  background:rgba(12,14,15,.88);
  display:grid;
  place-items:center;
  padding:28px;
}

.text-viewer[hidden]{
  display:none;
}

.text-viewer article{
  width:min(980px,94vw);
  height:min(760px,88vh);
  background:#fff;
  border-radius:6px;
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  overflow:hidden;
  box-shadow:0 24px 80px rgba(0,0,0,.45);
}

.text-viewer h3{
  margin:0;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
  font-size:14px;
}

.text-viewer pre{
  margin:0;
  padding:18px;
  overflow:auto;
  font-family:"Consolas","SFMono-Regular",monospace;
  font-size:12px;
  line-height:1.6;
  white-space:pre-wrap;
  color:#202426;
}

.text-viewer-close{
  position:fixed;
  top:18px;
  right:18px;
  width:42px;
  height:42px;
  border:0;
  border-radius:50%;
  background:#fff;
  color:#202426;
  font-size:28px;
  line-height:1;
  cursor:pointer;
}

.image-viewer-nav:hover{
  background:#fff;
}

.image-viewer-nav[hidden]{
  display:none;
}

.image-viewer-prev{
  left:22px;
}

.image-viewer-next{
  right:22px;
}

@media(max-width:560px){
  .project-file{
    grid-template-columns:116px 1fr;
  }

  .file-thumb{
    width:104px;
    height:88px;
  }

  .image-viewer{
    padding:12px;
  }

  .image-viewer figure{
    width:96vw;
    height:88vh;
  }

  .image-viewer-nav{
    width:56px;
    height:56px;
    font-size:10px;
  }

  .image-viewer-prev{
    left:10px;
  }

  .image-viewer-next{
    right:10px;
  }
}
