/* =========================================================
   ✅ HKCare Board UI – APP like (LIST=Card on Mobile)
   - PC: 깔끔한 테이블
   - Mobile: 목록을 카드형 리스트로 변환(제목+메타만)
   - View/Write: 카드톤 통일
========================================================= */

:root{
  --brand:#00b89c;
  --brand2:#00a58c;

  --bg:#f6fbf9;
  --card:#ffffff;

  --text:#0f172a;
  --muted:#64748b;

  --line:rgba(15,23,42,.10);
  --line2:rgba(15,23,42,.06);

  --ring: rgba(0,184,156,.28);
  --shadow:0 14px 40px rgba(2,6,23,.08);

  --r20:20px;
  --r16:16px;
  --r14:14px;
  --r12:12px;
}

/* ---- Page frame ---- */
body{
  background: linear-gradient(180deg, var(--bg), #fff 70%);
}

.page-content{
  padding: 12px 0 28px;
}

.page-content .container{
  max-width: 1024px;
  margin: 0 auto;
  background: rgba(255,255,255,.92);
  border:1px solid var(--line2);
  border-radius: var(--r20);
  box-shadow: var(--shadow);
  padding: 26px;
}

.page-content h2{
  margin: 0 0 18px;
  text-align:center;
  color: var(--brand);
  font-weight: 900;
  letter-spacing: -.3px;
  font-size: 1.45rem;
}

/* ---- Buttons ---- */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  height:42px;
  padding:0 16px;
  border-radius: 14px;
  border:1px solid transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color:#fff;
  font-weight: 900;
  text-decoration:none;
  cursor:pointer;
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
  box-shadow: 0 10px 22px rgba(0,184,156,.20);
}
.btn:hover{ transform: translateY(-1px); filter: brightness(.98); }
.btn:active{ transform:none; }
.btn:focus{ outline:none; box-shadow: 0 0 0 4px var(--ring); }

.btn-outline{
  background:#fff;
  color: var(--brand);
  border-color: rgba(0,184,156,.35);
  box-shadow: 0 10px 22px rgba(2,6,23,.05);
}
.btn-outline:hover{ background: rgba(0,184,156,.08); }

.btn-danger{
  background: linear-gradient(135deg, #ef4444, #fb7185);
  box-shadow: 0 10px 22px rgba(239,68,68,.18);
}

/* ---- Search ---- */
.board-search{
  display:grid;
  grid-template-columns: 1fr auto auto;
  gap:10px;
  margin: 10px 0 18px;
  padding:12px;
  border-radius: var(--r16);
  background:#fff;
  border:1px solid var(--line);
  box-shadow: 0 10px 22px rgba(2,6,23,.05);
}

.board-search input[type="text"]{
  width:100%;
  height:42px;
  padding:0 14px;
  border-radius: 14px;
  border:1px solid var(--line);
  background:#fff;
  color: var(--text);
  transition: box-shadow .15s ease, border-color .15s ease;
}
.board-search input[type="text"]::placeholder{ color:#94a3b8; }
.board-search input[type="text"]:focus{
  outline:none;
  border-color: rgba(0,184,156,.55);
  box-shadow: 0 0 0 4px var(--ring);
}

/* 검색 영역 안 버튼은 동일한 톤 */
.board-search button,
.board-search .btn{
  height:42px;
  border-radius: 14px;
  font-weight: 900;
}

/* ---- Table (PC) ---- */
.table-wrapper{ overflow-x:auto; }

.board-table{
  width:100%;
  border-collapse: separate;
  border-spacing:0;
  background:#fff;
  border:1px solid var(--line);
  border-radius: var(--r16);
  overflow:hidden;
  box-shadow: 0 12px 28px rgba(2,6,23,.06);
}

.board-table thead th{
  background: #f7fafc;
  color:#334155;
  font-weight:900;
  font-size:.92rem;
  padding:14px 12px;
  border-bottom:1px solid var(--line);
  text-align:center;
}

.board-table tbody td{
  padding:14px 12px;
  border-bottom:1px solid var(--line2);
  text-align:center;
  color: var(--text);
  background:#fff;
  font-weight:600;
}

.board-table tbody tr:last-child td{ border-bottom:0; }
.board-table tbody tr:hover td{ background:#f6fffd; }

.board-table td.subject{
  text-align:left;
}
.board-table td.subject a{
  display:inline-block;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#0f766e;
  font-weight: 900;
  text-decoration:none;
  letter-spacing:-.2px;
}
.board-table td.subject a:hover{ text-decoration:underline; }

/* ---- Pagination ---- */
.pagination{
  display:flex;
  gap:8px;
  justify-content:center;
  margin: 16px 0 0;
  flex-wrap:wrap;
}

.pagination a{
  min-width:40px;
  height:40px;
  padding:0 12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius: 14px;
  background:#f1f5f9;
  border:1px solid rgba(15,23,42,.08);
  color:#334155;
  text-decoration:none;
  font-weight:900;
  transition: transform .12s ease, background .12s ease;
}
.pagination a:hover{
  background:#e2e8f0;
  transform: translateY(-1px);
}
.pagination a.current{
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color:#fff;
  border-color: transparent;
}

/* ---- View (Detail) ---- */
.board-view{
  background:#fff;
  border:1px solid var(--line);
  border-radius: var(--r16);
  padding:18px;
  box-shadow: 0 12px 28px rgba(2,6,23,.06);
}

.legal-document {
  max-width: 900px;
  margin: 0 auto;
}

.legal-document__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.legal-document__meta span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f1f6ff;
  border: 1px solid #dbe7fb;
  color: #385178;
  font-size: 13px;
  font-weight: 800;
}

.legal-document__paper {
  background: #fff;
  border: 1px solid rgba(15,23,42,.14);
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(2,6,23,.10);
  padding: clamp(22px, 4vw, 48px);
  color: #2f343b;
  font-size: 16px;
  line-height: 1.78;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.legal-document__paper p {
  margin: 0 0 18px;
}

.legal-doc-title {
  margin: 0 0 28px;
  text-align: center;
  color: #333;
  font-size: 30px;
  font-weight: 900;
  line-height: 1.25;
}

.legal-effective-line {
  font-weight: 800;
}

.legal-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 34px 0 16px;
  color: #1f4e79;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.35;
}

.legal-section-title::before {
  content: "";
  flex: 0 0 4px;
  width: 4px;
  height: 30px;
  border-radius: 999px;
  background: #1f4e79;
}

.legal-lines {
  display: grid;
  gap: 5px;
}

.legal-lines span {
  display: block;
}

.legal-subtitle {
  margin: 22px 0 10px;
  font-weight: 800;
}

.legal-callout {
  margin: 10px 0 20px;
  padding: 16px 18px;
  background: #f6f8fb;
  border: 1px solid #d7dce3;
  color: #3b414a;
  line-height: 1.7;
}

.legal-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 12px 0 22px;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #cfd6df;
  background: #fff;
  font-size: 15px;
}

.legal-table th,
.legal-table td {
  padding: 13px 14px;
  border: 1px solid #cfd6df;
  text-align: left;
  vertical-align: top;
  line-height: 1.65;
}

.legal-table th {
  background: #eef3f8;
  color: #1f4e79;
  font-weight: 900;
}

.legal-info-table td:first-child {
  width: 150px;
  background: #f3f6fa;
  color: #1f4e79;
  font-weight: 900;
}

.legal-appendix {
  margin-top: 34px;
  padding: 18px 20px;
  background: #f8fbff;
  border: 1px solid #cfe0f4;
  color: #26384c;
}

.legal-appendix strong {
  display: block;
  margin-bottom: 8px;
  color: #1f4e79;
  font-size: 18px;
}

.legal-appendix p {
  margin: 0;
}

@media (max-width: 640px) {
  .legal-document__paper {
    padding: 18px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.72;
  }

  .legal-doc-title {
    font-size: 24px;
  }

  .legal-section-title {
    font-size: 17px;
    margin-top: 28px;
  }

  .legal-table {
    min-width: 620px;
    font-size: 13px;
  }
}

.board-view .view-head{
  border-bottom:1px solid var(--line2);
  padding-bottom:12px;
  margin-bottom:14px;
}

.board-view .subject{
  margin:0 0 8px;
  font-size:1.2rem;
  font-weight: 900;
  letter-spacing:-.3px;
  color: var(--text);
}

.board-view .meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  color: var(--muted);
  font-size:.9rem;
  align-items:center;
}
.board-view .meta span{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius: 999px;
  background:#f1f5f9;
  border:1px solid #e2e8f0;
}
.board-view .meta span:nth-child(2){ margin-left:auto; }

.board-view .view-content{
  line-height:1.8;
  color: var(--text);
  font-size:1rem;
}

/* actions */
.view-actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  margin-top:16px;
  flex-wrap:wrap;
}

/* ---- Write/Edit Form ---- */
.board-form{
  background:#fff;
  border:1px solid var(--line);
  border-radius: var(--r16);
  padding:18px;
  box-shadow: 0 12px 28px rgba(2,6,23,.06);
}

.board-form .form-row{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-bottom:14px;
}

.board-form label{
  font-weight:900;
  color:#334155;
  letter-spacing:-.2px;
}

.board-form input[type="text"],
.board-form textarea{
  border:1px solid var(--line);
  border-radius: 14px;
  padding:12px 12px;
  font-size:1rem;
  color: var(--text);
  background:#fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.board-form textarea{ resize:vertical; min-height: 180px; }

.board-form input:focus,
.board-form textarea:focus{
  outline:none;
  border-color: rgba(0,184,156,.55);
  box-shadow: 0 0 0 4px var(--ring);
}

.form-actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  flex-wrap:wrap;
}

/* =========================================================
   ✅ Mobile: LIST = Card (핵심)
   - 모바일에서 td를 block으로 줄줄이 보여주지 않고
     "제목 + 메타(작성자/날짜/조회)"만 카드로 노출
========================================================= */
@media (max-width: 768px){

  .page-content{ padding: 10px 0 22px; }

  .page-content .container{
    padding: 14px;
    border-radius: var(--r16);
  }

  /* 검색: 한줄 → 세로 */
  .board-search{
    grid-template-columns:1fr;
    gap:10px;
    border-radius: var(--r16);
  }
  .board-search button,
  .board-search .btn{
    width:100%;
  }

  /* ✅ 테이블을 카드로 */
  .table-wrapper{ overflow: visible; }
  .board-table{
    border:0;
    background:transparent;
    box-shadow:none;
  }
  .board-table thead{ display:none; }

  /* 행=카드 */
  .board-table tbody tr{
    display:block;
    background:#fff;
    border:1px solid var(--line);
    border-radius: var(--r16);
    padding:14px 14px 12px;
    margin:0 0 12px;
    box-shadow: 0 12px 26px rgba(2,6,23,.06);
  }

  /* 기본 td는 전부 숨김 */
  .board-table tbody td{
    display:none !important;
    border:0 !important;
    padding:0 !important;
    background:transparent !important;
    text-align:left !important;
  }

  /* ✅ 제목만 노출 */
  .board-table tbody td.subject{
    display:block !important;
    margin:0 0 10px;
  }
  .board-table tbody td.subject a{
    white-space:normal;
    overflow:visible;
    text-overflow:unset;
    font-size:1.05rem;
    line-height:1.35;
    color: var(--text);
  }

  /* ✅ 메타 3개(작성자/날짜/조회) — 기본 스킨 컬럼 기준 */
  .board-table tbody td:nth-child(3),
  .board-table tbody td:nth-child(4),
  .board-table tbody td:nth-child(5){
    display:inline-flex !important;
    align-items:center;
    gap:6px;
    margin-right:10px;
    margin-bottom:6px;
    color: var(--muted);
    font-size:.86rem;
  }

  /* 라벨 칩 */
  .board-table tbody td:nth-child(3)::before{ content:"작성자"; }
  .board-table tbody td:nth-child(4)::before{ content:"작성일"; }
  .board-table tbody td:nth-child(5)::before{ content:"조회"; }

  .board-table tbody td:nth-child(3)::before,
  .board-table tbody td:nth-child(4)::before,
  .board-table tbody td:nth-child(5)::before{
    display:inline-flex;
    align-items:center;
    height:22px;
    padding:0 8px;
    border-radius:999px;
    background:#f1f5f9;
    border:1px solid #e2e8f0;
    color:#64748b;
    font-size:.78rem;
    font-weight:900;
    letter-spacing:-.2px;
    margin-right:4px;
  }

  /* 번호(1열)는 안보이게 유지 */
  .board-table tbody td:nth-child(1){ display:none !important; }

  /* 상세/폼 버튼은 풀폭 */
  .view-actions,
  .form-actions{
    justify-content:stretch;
  }
  .view-actions .btn,
  .form-actions .btn{
    width:100%;
  }

  /* 상세 메타 줄정리 */
  .board-view .meta span:nth-child(2){ margin-left:0; }
  .board-view .meta{ gap:8px; }
}


