.fgp-page {
  background: #fff;
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 18px 40px;
}

.fgp-header {
  margin-bottom: 18px;
}

.fgp-title {
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 8px;
}

.fgp-author {
  font-size: 13px;
  color: #666;
  margin: 0 0 8px;
}

.fgp-meta {
  font-size: 14px;
  color: #666;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.fgp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.fgp-item {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.fgp-item img {
  width: 100%;
  height: auto;
  display: block;
}

.fgp-loading {
  text-align: center;
  color: #666;
  padding: 18px 0;
  font-size: 14px;
}

.fgp-error {
  color: #b00020;
  background: #fff5f5;
  border: 1px solid #ffd6d6;
  padding: 12px 14px;
  border-radius: 10px;
}


/* thumb strip momentum (更好滑動) */
.lg-thumb-outer{overflow-x:auto !important; -webkit-overflow-scrolling: touch;}
.lg-thumb{display:flex !important;}
.lg-thumb-item{flex:0 0 auto;}


/* Lightbox close button (top-right) */
.fgp-lg-close{
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 99999;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 24px;
  line-height: 44px;
  text-align: center;
}

/* Avoid click-through after close; keep overlay capturing taps */
.lg-backdrop, .lg-outer { pointer-events: auto; }



/* Keep thumbnail strip always visible */
.lg-thumb-outer{
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto !important;
}

/* iOS: only disable callout on UI (允許長按圖片儲存) */
.lg-toolbar, .lg-sub-html, .lg-counter, .lg-icon, .lg-next, .lg-prev, .lg-thumb-outer{
  -webkit-touch-callout: none;
}
.lg-img-wrap img, .lg-image{
  -webkit-touch-callout: default;
}



/* Prevent iOS text selection on UI (保留照片長按儲存) */
.lg-toolbar, .lg-sub-html, .lg-counter, .lg-actions, .lg-thumb-outer, .lg-thumb-outer * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
/* 允許照片本體長按（儲存圖片） */
.lg-img-wrap, .lg-img-wrap * {
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
}


/* iOS: 防止整頁被選取/跳出查詢工具列，但保留照片長按儲存 */
.lg-outer, .lg-outer *:not(img){
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

.lg-outer img{
  -webkit-user-select: auto !important;
  user-select: auto !important;
  -webkit-touch-callout: default !important; /* allow long-press save */
}
