/* 게시판 목록 — 테이블 레이아웃 */
.guestbook-list {
  margin-top: 0.5rem;
}

.gb-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  margin: 0 12px;
}

.gb-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-family: 'IBM Plex Sans', 'Noto Sans KR', 'Poppins', sans-serif;
  font-size: 0.84rem;
}

.gb-table thead {
  background: #fff;
}

.gb-table th {
  padding: 11px 8px;
  font-weight: 700;
  font-size: 0.8rem;
  text-align: center;
  white-space: nowrap;
  background-color: #f8f9fb !important;
  color: #333 !important;
  border-bottom: 1px solid #e8ecf0;
  letter-spacing: 0.02em;
}

.gb-table th.col-title {
  text-align: center;
}

.gb-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e8ecf0;
  text-align: center;
  vertical-align: middle;
  color: #333;
  font-size: 0.84rem;
}

.gb-table tbody tr:hover {
  background: rgba(43, 108, 176, 0.06);
}

.gb-table tbody tr:last-child td {
  border-bottom: none;
}

.gb-table th.col-num,
.gb-col-num {
  min-width: 58px;
  width: 58px;
  max-width: 58px;
  white-space: nowrap;
  padding-left: 10px;
  padding-right: 10px;
}

.gb-table th.col-views,
.gb-col-views {
  min-width: 68px;
  width: 68px;
  max-width: 68px;
  white-space: nowrap;
  padding-left: 8px;
  padding-right: 8px;
}

.gb-table td.gb-col-num {
  color: #1a56db !important;
  font-weight: 700;
  font-size: inherit;
}

.gb-col-title {
  text-align: left !important;
  padding-left: 10px !important;
  max-width: 320px;
  overflow: hidden;
}

.gb-title-cell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  min-width: 0;
}

.gb-col-title a {
  color: #222;
  text-decoration: none;
  font-weight: 500;
  font-family: 'Noto Sans KR', 'Poppins', sans-serif;
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.gb-img-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  cursor: default;
}

.gb-img-icon {
  display: block;
  flex-shrink: 0;
}

.gb-col-title a:hover {
  color: #4a90e2;
  text-decoration: underline;
}

.gb-col-author {
  color: #5a5e61;
  font-size: inherit;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gb-col-date {
  color: #787c7e;
  font-size: inherit;
  white-space: nowrap;
}

.gb-table td.gb-col-views {
  color: #1a56db !important;
  font-weight: 600;
  font-size: inherit;
  white-space: nowrap;
}

.gb-meta-views {
  color: #1a56db;
  font-weight: 600;
}

.gb-col-likes,
.gb-col-share {
  white-space: nowrap;
}

.gb-like-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.gb-col-likes .gb-like-count {
  display: inline-block;
  min-width: 1.4em;
  font-weight: 700;
  font-size: 0.85rem;
  color: #1a4480;
  line-height: 1;
}

.gb-like-btn.is-active,
.gb-like-btn:disabled {
  background: #2b6cb0;
  border-color: #2b6cb0;
  color: #fff;
  cursor: default;
  opacity: 1;
}

.gb-like-btn:disabled:hover {
  background: #2b6cb0;
  border-color: #2b6cb0;
  color: #fff;
}

.gb-share-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.gb-share-x,
.gb-share-email {
  text-decoration: none;
  min-width: 28px;
  padding: 0 6px;
  font-weight: 600;
}

.gb-share-x:hover {
  background: #000;
  border-color: #000;
  color: #fff;
}

.gb-share-email:hover {
  background: #2b6cb0;
  border-color: #2b6cb0;
  color: #fff;
}

.gb-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  background: #f6f8fa;
  color: #444;
  font-size: 0.72rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.gb-action-btn:hover {
  background: #e8f0fe;
  border-color: #2b6cb0;
  color: #2b6cb0;
}

.gb-action-btn.is-active {
  background: #2b6cb0;
  border-color: #2b6cb0;
  color: #fff;
}

.gb-empty-row td {
  text-align: center !important;
  padding: 32px 16px !important;
  color: #888;
}

/* 모바일 전용 — 2줄 카드형 (thead 숨김, 메타 줄) */
.gb-col-meta-mobile {
  display: none;
}

@media (max-width: 767px) {
  .guestbook-container {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    background-color: #fff !important;
  }

  .guestbook-list {
    margin-left: 0;
    margin-right: 0;
  }

  .gb-table-wrap {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    overflow-x: visible;
    background: #fff;
  }

  .gb-table {
    min-width: 0;
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
  }

  /* 테이블 헤더(번호·제목·일자·조회·Likes) 숨김 */
  .gb-table thead {
    display: none;
  }

  .gb-table tbody tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 4px;
    row-gap: 4px;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #f5f5f5;
  }

  .gb-table tbody tr:hover {
    background: rgba(43, 108, 176, 0.04);
  }

  .gb-table tbody td {
    border-bottom: none;
    padding: 0;
    text-align: left;
    vertical-align: middle;
  }

  /* 번호 | (제목 + 메타) | likes (모바일: 공유 버튼 숨김) */
  .gb-col-num {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: center;
    justify-self: center;
    width: auto !important;
    min-width: 1.25rem !important;
    max-width: none !important;
    padding: 0 6px 0 0 !important;
    color: #1a56db !important;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
  }

  .gb-col-num::after {
    content: none;
  }

  .gb-col-title {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    width: auto !important;
    max-width: none !important;
    padding: 0 !important;
    overflow: hidden;
  }

  .gb-title-cell {
    display: block;
    min-width: 0;
  }

  .gb-col-title a {
    font-size: 13px;
    font-weight: 500;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    position: relative;
    z-index: 1;
  }

  .gb-col-likes {
    grid-column: 3;
    grid-row: 1;
    width: auto !important;
    min-width: 0 !important;
    padding: 0 !important;
    position: relative;
    z-index: 3;
    transform: translateX(-5px);
  }

  .gb-like-wrap {
    gap: 3px;
    justify-content: flex-end;
    position: relative;
    z-index: 3;
  }

  .gb-col-likes .gb-like-btn {
    min-width: 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 4;
  }

  .gb-col-likes .gb-like-count {
    min-width: 0.8em;
    font-size: 11px;
    color: #1a4480;
  }

  .gb-col-share {
    display: none !important;
  }

  .gb-col-share .gb-share-group {
    gap: 2px;
    flex-wrap: nowrap;
  }

  .gb-col-share .gb-action-btn {
    min-width: 26px;
    width: 26px;
    height: 26px;
    padding: 0;
    font-size: 0.68rem;
    line-height: 1;
  }

  /* 2줄: 작성자 | 날짜 | 조회수 (제목 아래, 번호 오른쪽 열) */
  .gb-col-meta-mobile {
    display: block !important;
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    margin: 0;
    padding: 0 !important;
    font-size: 11px;
    font-weight: 400;
    color: #999;
    line-height: 1.35;
    letter-spacing: -0.01em;
  }

  /* 개별 열 숨김 */
  .gb-col-author,
  .gb-col-date,
  .gb-col-views,
  .gb-col-share {
    display: none !important;
    pointer-events: none !important;
  }

  .gb-img-badge {
    display: none;
  }

  .gb-empty-row td {
    display: block !important;
    width: 100%;
    padding: 24px 16px !important;
  }
}
