/* ——————————————————————————————
   nBUN Work v2 Projects Grid
   （基於你目前的 v3.5.1 safe build）
—————————————————————————————— */

:root{
  --nbun-black:#111;
  --nbun-white:#fff;
  --nbun-duo-shadow:#fc71e4;
  --nbun-duo-highlight:#fcfcfc;
}

.nbunpg-root{
  width:100%;
  max-width:100%;
  margin:0;
  padding:0;
  overflow-x:hidden;
  background:#f2f5f5;
}

.nbunpg-grid{
  display:grid !important;
  width:100%;
  margin:0;
  padding:0;
  gap:0;
  grid-auto-flow:row dense;
  justify-items:stretch;
  align-items:start;
}

@media (min-width:1440px){
  .nbunpg-grid{ grid-template-columns:repeat(4,1fr); }
}
@media (min-width:768px) and (max-width:1439px){
  .nbunpg-grid{ grid-template-columns:repeat(4,1fr); }
}
@media (max-width:767px){
  .nbunpg-grid{ grid-template-columns:repeat(3,1fr); }
}
.nbunpg-grid .grid-sizer{ display:none !important; }

.nbunpg-card{
  display:block;
  position:relative !important;
  color:inherit;
  text-decoration:none;
  background:#f2f5f5;
  box-sizing:border-box;
  overflow:hidden;
  margin:0 !important;
  left:auto !important;
  top:auto !important;
  transform:none !important;
  transition:none !important;
  width:auto !important;
  float:none !important;
}

.nbunpg-card .thumb{
  position:relative;
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:25% 10% 25% 10% !important;
  background:#f2f5f5;
  overflow:hidden;
  border:0;
  cursor:pointer;
}

.nbunpg-card.w2 .thumb{
  padding:12.5% 10% 12.5% 10% !important;
}

.nbunpg-card .thumb img{
  display:block;
  width:100%;
  height:auto;
  object-fit:contain;
  object-position:center;
  transform:none !important;
  filter:url('#nbunDuotone') !important;
  opacity:.96;
  transition:
    filter .35s ease-out,
    opacity .35s.ease-out !important;
}

.nbunpg-card .meta-line::before{
  content:"";
  position:absolute;
  left:0; right:0; top:0;
  height:1px;
  background:var(--nbun-black);
  opacity:0.9;
}
.nbunpg-card .meta-line::after{
  content:"";
  position:absolute;
  left:0; top:0;
  height:25px;
  border-left:1px solid var(--nbun-black);
  opacity:0.9;
}

.nbunpg-card .meta-line{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  position:absolute;
  inset:0 0 auto 0;
  padding-top:6px;
  z-index:5;
}

.nbunpg-card .meta-left{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:0;
}

.nbunpg-card .meta-label.title{
  background:#f2f5f5;
  color:#0e0e0e;
  font-size:13px;
  font-weight:600;
  padding:0 14px;
  border-radius:2px;
  text-decoration:none !important;
}

.nbunpg-card .meta-sub.category{
  background:#f2f5f5 !important;
  color:#777;
  font-size:12px;
  padding:0 14px;
  border-radius:0 0 2px 2px !important;
  border:0 !important;
  box-shadow:none !important;
  -webkit-appearance:none;
  appearance:none;
  text-decoration:none !important;
  cursor:pointer;
  line-height:inherit;
}
.nbunpg-card .meta-sub.category:hover,
.nbunpg-card .meta-sub.category:active,
.nbunpg-card .meta-sub.category:focus{
  background:transparent !important;
  color:inherit !important;
  text-decoration:none !important;
  outline:none;
}

.nbunpg-card .meta-index{
  font-size:13px;
  font-weight:600;
  background:#f2f5f5;
  color:#000;
  padding:2px 14px;
  border-radius:10px;
  text-decoration:none !important;
}

@media (max-width:767px){
  .nbunpg-card .meta-index{
    font-size:10px;
    padding:0 8px;
    border-radius:0;
  }
}

@media (max-width:767px){
  .nbunpg-card .meta-left{ display:none; }
  .nbunpg-card .meta-index{
    position:relative;
    left:0;
    background:transparent;
    padding:0 8px;
    font-size:10px;
    text-decoration:none !important;
  }
  .nbunpg-card .meta-line::after{ height:20px; }
}

.nbunpg-root .nbunpg-filters{
  position:fixed;
  left:50%;
  bottom:calc(14px + env(safe-area-inset-bottom, 0px));
  transform:translateX(-50%);
  background:rgba(255,255,255,.5);
  -webkit-backdrop-filter:blur(8px);
  backdrop-filter:blur(8px);
  border-radius:9999px;
  box-shadow:0 6px 18px rgba(0,0,0,.08);
  display:inline-flex;
  gap:6px;
  padding:8px 12px;
  overflow:hidden;
  background-clip:padding-box;
  -webkit-background-clip:padding-box;
  white-space:nowrap;
  z-index:9998;
  max-width:calc(100vw - 60px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  width:max-content;
}

.nbunpg-root .nbunpg-filters button{
  background:#000;
  color:#fff;
  border:0;
  border-radius:9999px;
  padding:10px 24px;
  font-size:16px;
  font-weight:500;
  cursor:pointer;
  transition:.25s;
}
.nbunpg-root .nbunpg-filters button:hover,
.nbunpg-root .nbunpg-filters button.is-active{
  background:#fff;
  color:#000;
}

@media (max-width:767px){
  .nbunpg-root .nbunpg-filters{
    bottom:calc(18px + env(safe-area-inset-bottom, 0px));
    padding:6px 8px;
    gap:4px;
    transform:translateX(-50%);
    max-width:calc(100vw - 40px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    padding-left:calc(8px + env(safe-area-inset-left, 0px));
    padding-right:calc(8px + env(safe-area-inset-right, 0px));
  }
  .nbunpg-root .nbunpg-filters button{
    padding:8px 12px;
    font-size:12px;
  }
}

html,body{
  overflow-x:hidden;
}

.nbunpg-overlay{
  position:fixed;
  inset:0;
  z-index:9999;
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:0;
  pointer-events:none;
  transition:opacity .24s.ease-out;
}
.nbunpg-overlay.is-open{
  opacity:1;
  pointer-events:auto;
}

.nbunpg-overlay-bg{
  position:absolute;
  inset:0;
  background:rgba(255,255,255,.72);
  -webkit-backdrop-filter:blur(20px);
  backdrop-filter:blur(20px);
}

.nbunpg-modal{
  position:relative;
  z-index:2;
  max-width:min(100vw - 40px, 1200px);
  max-height:min(100vh - 40px, 820px);
  display:flex;
  align-items:center;
  justify-content:center;
  transform:scale(.96);
  opacity:0;
  transition:
    transform .32s cubic-bezier(.19,1,.22,1),
    opacity .32s ease-out;
}
.nbunpg-overlay.is-open .nbunpg-modal{
  transform:scale(1);
  opacity:1;
}

.nbunpg-modal-imgwrap{
  position:relative;
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:28px;
  box-sizing:border-box;
}

.nbunpg-modal-img-main{
  max-width:min(100%, 1100px);
  max-height:calc(100vh - 160px);
  width:auto;
  height:auto;
  object-fit:contain;
  display:block;
  background:transparent;
  filter:drop-shadow(0 18px 45px rgba(0,0,0,.22));
}

.nbunpg-modal-counter{
  position:absolute;
  right:32px;
  bottom:28px;
  z-index:3;
  font-size:12px;
  font-weight:500;
  color:#fff;
  text-shadow:0 0 6px rgba(0,0,0,.45);
}

.nbunpg-modal-close{
  position:absolute;
  right:22px;
  top:22px;
  z-index:4;
  width:40px;
  height:40px;
  border:0;
  border-radius:999px;
  background:rgba(17,17,17,.92);
  color:#fff;
  font-size:24px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.nbunpg-modal-close:hover{
  opacity:.9;
}

.nbunpg-modal-arrow{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:40px;
  height:40px;
  border-radius:999px;
  border:0;
  background:rgba(17,17,17,.9);
  color:#fff;
  font-size:20px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 10px 25px rgba(0,0,0,.25);
}
.nbunpg-modal-prev{ left:18px; }
.nbunpg-modal-next{ right:18px; }

@media (max-width:600px){
  .nbunpg-modal{
    max-width:calc(100vw - 24px);
    max-height:calc(100vh - 32px);
  }
  .nbunpg-modal-imgwrap{
    padding:18px;
  }
  .nbunpg-modal-img-main{
    max-height:calc(100vh - 96px);
  }
  .nbunpg-modal-counter{
    right:20px;
    bottom:20px;
    font-size:11px;
  }
  .nbunpg-modal-arrow{
    width:34px;
    height:34px;
    font-size:18px;
  }
}

.nbunpg-modal-caption{
  display:none;
}
.nbunpg-modal-btn{
  display:none;
}

.nbunpg-card.w2{
  grid-column: span 2;
}
@media (max-width:767px){
  .nbunpg-card.w2{
    grid-column: span 2;
  }
}

html.nbunpg-locked,
body.nbunpg-locked{
  overflow:hidden !important;
  height:100%;
}
