/* ===============================
   ブック投稿画面
================================ */
* {
  box-sizing: border-box;
}

body {
  background: #f5f8fb;
}

/* 広告枠込みの全体レイアウト */
.book-post-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 180px;
  gap: 24px;

  width: 100%;
  margin: 32px 0;
  padding: 0 24px 40px;

  box-sizing: border-box;
}

/* 中央：投稿エリア */
.book-post {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* 左右：広告エリア */
.book-post-ad {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  height: fit-content;
}

/* 広告枠 */
.ad-box {
  min-height: 600px;
  border: 2px dashed #ccc;
  border-radius: 12px;

  display: flex;
  align-items: center;
  justify-content: center;

  color: #999;
}
/* 画面幅が狭い場合は左広告を非表示 */
@media screen and (max-width: 1400px) {
  .book-post-layout {
    grid-template-columns: minmax(0, 1fr) 180px;
  }
  .book-post-ad:first-child {
    display: none;
  }

}
@media screen and (max-width: 1100px) {
  .book-post-layout {
    grid-template-columns: 1fr;
  }
  /* 右広告も消す */
  .book-post-ad {
    display: none;
  }
}

/* 投稿ボタン */
.book-register-btn {
  display: block;
  margin-bottom: 20px;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #36b58b, #42c86b);
  color: #fff;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
}

.book-register-btn:hover {
  opacity: 0.9;
}

/* 基本情報カード */
.book-info {
  background: #fff;
  padding: 28px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.book-info label {
  display: block;
  margin-top: 18px;
  margin-bottom: 6px;
  font-weight: bold;
  color: #1f2937;
}

.book-info label:first-child {
  margin-top: 0;
}

.book-info p {
  margin: 0 0 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 14px;
  font-weight: bold;
}

.book-info input,
.book-info textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d9dee7;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
}

.book-info textarea {
  min-height: 110px;
  resize: vertical;
}

.book-info input:focus,
.book-info textarea:focus {
  outline: none;
  border-color: #36b58b;
  box-shadow: 0 0 0 3px rgba(54, 181, 139, 0.15);
}

/* ===============================
   合計表示
================================ */
#book-total-area {
  margin: 20px 0;
  padding: 10px 16px;
  background: #e4f7ef;
  border-radius: 999px;
  color: #15936b;
  font-weight: bold;
  display: inline-block;
}

/* ===============================
   タブ
================================ */
.tabs {
  display: flex;
}

.tab {
  padding: 10px 16px;
  border: 1px solid #e4f7ef;
  background: #076345;
  cursor: pointer;
  font-weight: bold;
}

.tab:hover {
  background: #f3f4f6;
}

.tab.active {
  background: linear-gradient(135deg, #36b58b, #42c86b);
  color: #fff;
  border: none;
}

/* 一覧エリア */
#list-area {
  background: #fff;
  border: 1px solid #e5e9f0;
  padding: 16px;
  min-height: 300px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.04);
  overflow-x: auto;
}

/* テーブル */
#list-area table {
  width: 100%;
  min-width: 1000px;
  border-collapse: separate;
  border-spacing: 0;
}

#list-area th {
  padding: 12px 10px;
  background: #eef8f4;
  border-bottom: 1px solid #dceee7;
  color: #1f2937;
  font-size: 14px;
  text-align: left;
  white-space: nowrap;
}

#list-area td {
  padding: 12px 10px;
  border-bottom: 1px solid #eef1f5;
  font-size: 14px;
  line-height: 1.6;
  vertical-align: middle;
}

#list-area tr:last-child td {
  border-bottom: none;
}

#list-area tr:hover td {
  background: #f8fcfb;
}

.card-name-col {
  white-space: nowrap;
}

/* 枚数セレクト */
#list-area select {
  min-width: 64px;
  padding: 8px 10px;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background: #fff;
}

/* ソート可能カラム */
.sortable {
  position: relative;
  cursor: pointer;
  padding-right: 28px !important;
  white-space: nowrap;
}

.sortable::after {
  content: "▲▼";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 10px;
  pointer-events: none;
}

.sortable:hover {
  background: #f8fcfb;
}

/* スマホ */
@media screen and (max-width: 900px) {
  .book-post-layout {
    display: block;
    padding: 0 16px 40px;
  }

  .book-post-ad {
    display: none;
  }

  .book-info {
    padding: 20px;
  }

  .book-register-btn {
    width: 100%;
  }

  #book-total-area {
    display: block;
    border-radius: 12px;
    line-height: 1.8;
  }
}