/* ====== Base (dark variables fallback) ====== */
.gx-sections {
  --pc-cols: 5;                  /* PC: 한 줄 카드 수 */
  --mo-cols: 2;                  /* Mobile: 한 줄 카드 수 */
  --gap: 12px;
  --wrap: var(--wrap, #2a2a33);
  --line: var(--line, #3a3a45);
  --text: var(--text, #e6e7ea);
  --muted: #a9acb3;
  --card-bg: #23232a;
  --card-hover: #2b2b34;
  --accent: var(--brand-600, #dc2626);
  padding: 8px 0 20px;
  color: var(--text);
  background: transparent;
}

.gx-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 12px;
}

/* ===== Section Title ===== */
.gx-section { margin: 20px 0 18px; }
.gx-sec-title {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0 10px;
  font-size: 18px; font-weight: 800; letter-spacing: .2px;
  color: var(--text);
}
.gx-sec-title span {
  position: relative; display: inline-block;
  padding: 6px 10px 6px 0px;
  background: var(--wrap);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.gx-sec-title span::before { content:"["; color: var(--accent); margin-right: 6px; }
.gx-sec-title span::after  { content:"]"; color: var(--accent); margin-left: 6px; }

/* ===== Vertical Grid (5 x n, 2 x n) ===== */
.gx-grid{
  display:grid;
  grid-template-columns: repeat(var(--pc-cols), minmax(0, 1fr));
  gap: var(--gap);
}
/* 모바일: 2열 */
@media (max-width: 768px){
  .gx-grid{ grid-template-columns: repeat(var(--mo-cols), minmax(0, 1fr)); }
}

/* ===== Card ===== */
.gx-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
.gx-card:hover { transform: translateY(-2px); background: var(--card-hover); border-color: #4b4f5d; }

/* 16:9 cover */
.gx-card .cover { display:block; position:relative; aspect-ratio:16/9; background:#141419; }
.gx-card .cover img { width:100%; height:100%; object-fit:cover; display:block; }

/* Title + Meta */
.gx-card .title { margin:10px 12px 6px; font-size:15px; font-weight:700; line-height:1.35; }
.gx-card .title a { color: var(--text); text-decoration:none; }
.gx-card .title a:hover { text-decoration: underline; }

.gx-card .meta {
  display:flex; align-items:center; gap:8px;
  margin:0 12px 12px; font-size:13px; color: var(--muted);
}
.gx-card .meta i { font-size:14px; margin-right:6px; opacity:.9; }
.gx-card .meta .sep { opacity:.4; }

/* 빈 목록 */
.empty-list { padding: 24px 8px; color: var(--muted); font-size: 14px; border: 1px dashed var(--line); border-radius: 12px; background: rgba(0,0,0,.08); }

/* ===== Pagination (Gnuboard get_paging) ===== */
.gx-paging{ margin-top: 18px; }
.pg_wrap{ display:flex; justify-content:center; }
.pg{ display:flex; gap:6px; flex-wrap:wrap; }

.pg a,
.pg strong{
  min-width:36px; height:36px; padding:0 10px;
  display:flex; align-items:center; justify-content:center;
  border:1px solid var(--line); border-radius:10px;
  background: var(--card-bg); color: var(--text);
  font-weight:800; line-height:1;
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.pg a:hover{ background: var(--card-hover); border-color:#4b4f5d; transform: translateY(-1px); }
.pg strong{ background: var(--accent); border-color: var(--accent); color:#fff; }

/* first/prev/next/last buttons can be narrower */
.pg .pg_start, .pg .pg_prev, .pg .pg_next, .pg .pg_end{ min-width:32px; }

/* =====================
   View (읽기) – scoped (.gxv-*)
   기존 list 스타일과 충돌 방지, style.css 맨 아래 추가
===================== */
.gxv-wrap{ padding: 10px 0 24px; color: var(--text, #e6e7ea); background: transparent; }
.gxv-container{ max-width: 1280px; margin: 0 auto; padding: 0 12px; }

.gxv-card{
  background: var(--wrap, #2a2a33);
  border: 1px solid var(--line, #3a3a45);
  border-radius: 16px;
  padding: 18px 16px;
  box-shadow: 0 10px 26px rgba(0,0,0,.22);
}

/* Title */
.gxv-title{
  margin: 6px 6px 8px;
  font-size: 22px; font-weight: 900;
  line-height: 1.45; letter-spacing: -.2px;
  color: var(--text, #e6e7ea);
}
@media (max-width: 768px){ .gxv-title{ font-size: 20px; } }

/* Meta */
.gxv-meta{
  display:flex; flex-wrap:wrap; align-items:center; gap:10px 12px;
  margin: 0 6px 12px;
  color: #a9acb3; font-size: 13px;
}
.gxv-meta .m{ display:inline-flex; align-items:center; gap:6px; }
.gxv-meta .m i{ font-size:14px; opacity:.9; }
.gxv-meta .s{ opacity:.5; }

/* Content */
.gxv-content{
  background: var(--wrap2, #24242c);
  border: 1px solid var(--line, #3a3a45);
  border-radius: 12px;
  padding: 14px;
  color: var(--text, #e6e7ea);
  font-size: 15px; line-height: 1.78;
}
.gxv-content img{ max-width:100%; height:auto; border-radius: 6px; }
.gxv-content blockquote{
  margin: 12px 0; padding: 10px 12px; border-left: 3px solid var(--brand-600, #dc2626);
  background: rgba(0,0,0,.12); border-radius: 8px;
}
.gxv-content pre, .gxv-content code{
  background: #191a1f; border: 1px solid #2c2f3a; border-radius: 8px;
}
.gxv-content pre{ padding: 12px; overflow:auto; }
.gxv-content a{ color: #9ad4ff; text-decoration: underline; }

/* Files */
.gxv-files{ margin-top: 16px; }
.gxv-files .ftitle{
  display:flex; align-items:center; gap:8px;
  margin: 0 6px 10px; font-weight: 800; font-size: 15px; color: var(--text, #e6e7ea);
}
.gxv-files .flist{ display:flex; flex-direction:column; gap:8px; margin:0; padding:0; list-style:none; }
.gxv-files .fitem{
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  background: var(--card-bg, #23232a);
  border: 1px solid var(--line, #3a3a45);
  border-radius: 12px; padding: 10px 12px;
}
.gxv-files .flink{
  display:inline-flex; align-items:center; gap:8px; color: var(--text, #e6e7ea); text-decoration:none; font-weight:700;
}
.gxv-files .flink:hover{ text-decoration: underline; }
.gxv-files .fmeta{ display:inline-flex; align-items:center; gap:10px; color:#a9acb3; font-size:12px; }

/* Actions */
.gxv-actions{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin-top: 14px; padding: 8px 6px 0;
  border-top: 1px dashed var(--line, #3a3a45);
}
.gxv-actions .left, .gxv-actions .right{ display:flex; flex-wrap:wrap; gap:8px; }

.gxv-btn{
  --bg: var(--card-bg, #23232a);
  --bd: var(--line, #3a3a45);
  --fg: var(--text, #e6e7ea);
  display:inline-flex; align-items:center; gap:8px;
  height: 36px; padding: 0 12px;
  border: 1px solid var(--bd);
  border-radius: 10px; background: var(--bg); color: var(--fg);
  font-weight: 800; font-size: 14px; text-decoration:none;
  box-shadow: 0 4px 12px rgba(0,0,0,.10);
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
}
.gxv-btn:hover{ transform: translateY(-1px); border-color: #4b4f5d; background: var(--card-hover, #2b2b34); }
.gxv-btn em{ font-style:normal; margin-left: 2px; opacity:.9; }
.gxv-btn.outline{ background: transparent; }
.gxv-btn.accent{ --bg: var(--brand-600, #dc2626); --bd: var(--brand-600, #dc2626); --fg: #fff; }
.gxv-btn.danger{ --bg: #7a1e1e; --bd: #7a1e1e; --fg: #fff; }
.gxv-btn.ghost{ background: transparent; }

/* Prev/Next */
.gxv-prevnext{
  display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:10px;
  margin-top: 16px;
}
.gxv-prevnext .item{
  display:flex; flex-direction:column; gap:6px;
  background: var(--card-bg, #23232a);
  border:1px solid var(--line, #3a3a45); border-radius: 12px;
  padding: 10px 12px; text-decoration:none; color: var(--text, #e6e7ea);
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
}
.gxv-prevnext .item:hover{ transform: translateY(-1px); border-color:#4b4f5d; background: var(--card-hover, #2b2b34); }
.gxv-prevnext .dir{ font-size:12px; color:#a9acb3; display:flex; align-items:center; gap:6px; }
.gxv-prevnext .tit{ font-weight:800; font-size:14px; line-height:1.45; }

/* Comments wrapper (spacing only) */
.gxv-comments{ margin-top: 18px; }

/* ===== Icon (SVG) normalization ===== */
svg.ico{
  width: 14px; height: 14px;
  display: inline-block;
  vertical-align: middle;
  opacity: .9;
}
.gx-card .meta svg.ico{ margin-right: 6px; }
.gxv-meta .m svg.ico{ /* meta line */ }
.gxv-btn svg.ico{ width:16px; height:16px; margin-right:8px; }
.gxv-prevnext .dir svg.ico{ width:14px; height:14px; margin-right:6px; }
.gxv-files .ftitle svg.ico,
.gxv-files .flink svg.ico{ width:16px; height:16px; margin-right:8px; }

/* Keep FA <i> rules intact for backwards-compat */
.gx-card .meta i{ font-size:14px; margin-right:6px; opacity:.9; }
.gxv-meta .m i{ font-size:14px; opacity:.9; }

/* ===== View: embed (video/iframe) ===== */
.gxv-content .gxv-embed{ margin: 8px 0; }
.gxv-content .gxv-embed .v{ width:100%; height:auto; display:block; aspect-ratio:16/9; object-fit:cover; border-radius:8px; }
.gxv-content .gxv-embed .f{ width:100%; aspect-ratio:16/9; border:0; display:block; border-radius:8px; }

/* === shim: force comment form layout (r5) === */
#bo_vc_w .gxv-form-row{display:grid !important;grid-template-columns:1fr 136px !important;gap:12px !important;align-items:start !important}
#bo_vc_w .gxv-form-actions{display:block !important}
#bo_vc_w .gxv-form-actions .gxv-btn{width:100%;height:44px;justify-content:center}
#bo_vc_w textarea{min-height:200px}

/* 폼 컨테이너는 무조건 블록(가로 배치 방지) */
#bo_vc_w.gxv-cmt-form { display:block !important; }

/* 혹시 상위가 grid라도 안내문은 항상 전체 너비 한 줄 차지 */
#bo_vc_w .gxv-note {
  display:flex !important;
  width:100% !important;
  grid-column: 1 / -1 !important;
  align-items:center; gap:8px;
  margin:0 0 10px 2px;
  font-size:13px; color:#aeb0b7;
}
#bo_vc_w .gxv-note .name { font-weight:700; color:#e6e7ea; }

/* 본 영역: 왼쪽 큰 입력칸 / 오른쪽 '등록' 버튼 한 칸 */
#bo_vc_w .gxv-form-row {
  display:grid !important;
  grid-template-columns: minmax(0, 1fr) 136px !important;
  gap:12px !important;
  align-items:start !important;
}

/* 텍스트 영역은 크게 */
#bo_vc_w textarea {
  min-height: 200px !important;
  height:auto !important;
  box-sizing:border-box !important;
  width:100% !important;
}

/* 버튼 한 개만, 우측 칼럼 가득 */
#bo_vc_w .gxv-form-actions { display:block !important; align-self:start !important; }
#bo_vc_w .gxv-form-actions .gxv-btn {
  width:100% !important; height:44px !important;
  display:flex !important; justify-content:center !important; align-items:center !important;
}

/* 모바일: 버튼은 아래로 */
@media (max-width:640px){
  #bo_vc_w .gxv-form-row { grid-template-columns: 1fr !important; }
}