/* ==========================================================================
   BBS — したらば風AA掲示板
   ========================================================================== */

/* Header */
.bbs-header { margin-bottom: 16px; }
.bbs-back {
  display: inline-block;
  font-size: 13px;
  color: var(--text-link);
  margin-bottom: 10px;
}
.bbs-thread-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}
.bbs-thread-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

/* ─── Thread list ─── */
.bbs-thread-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bbs-thread-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: var(--transition);
}
.bbs-thread-row:hover {
  border-color: var(--accent);
  background: var(--accent-50);
  text-decoration: none;
}
.bbs-thread-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--accent-light);
  min-width: 40px;
  text-align: center;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}
.bbs-thread-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bbs-thread-info {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* Pager */
.bbs-pager {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin: 16px 0;
}
.bbs-pager-btn {
  display: inline-block;
  padding: 4px 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
}
.bbs-pager-btn.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ─── Posts ─── */
.bbs-posts {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.bbs-post {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
  transition: background 0.3s;
}
.bbs-post:first-child {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-top: 1px solid var(--border);
}
.bbs-post:last-child {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  border-bottom: 1px solid var(--border);
}
.bbs-post:only-child {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.bbs-post--new { animation: bbsFadeIn 0.4s ease; }
.bbs-post--highlight { background: #FFFDE7 !important; }

@keyframes bbsFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.bbs-post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
}
.bbs-post-num {
  font-weight: 700;
  color: var(--accent);
}
.bbs-post-name {
  font-weight: 600;
  color: #117A40;
}
.bbs-trip {
  color: #888;
  font-weight: 400;
  margin-left: 2px;
}
.bbs-post-date {
  color: var(--text-tertiary);
  margin-left: auto;
}

/* Admin actions (delete + BAN) */
.bbs-admin-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.2s;
}
.bbs-post:hover .bbs-admin-actions {
  opacity: 1;
}

.bbs-post-delete-btn {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  padding: 0;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  color: var(--text-tertiary);
  background: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.bbs-post-delete-btn:hover {
  color: #D32F2F;
  background: rgba(211, 47, 47, 0.08);
}

.bbs-post-ban-btn {
  flex-shrink: 0;
  padding: 0 6px;
  height: 20px;
  font-size: 10px;
  font-weight: 700;
  line-height: 20px;
  color: var(--text-tertiary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.bbs-post-ban-btn:hover {
  color: #E65100;
  background: rgba(230, 81, 0, 0.06);
  border-color: #E65100;
}

/* BAN confirm button variant */
.bbs-dialog-confirm--ban {
  background: #E65100;
  border-color: #E65100;
}
.bbs-dialog-confirm--ban:hover {
  background: #BF360C;
  border-color: #BF360C;
}

/* Checkbox label in dialog */
.bbs-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

/* AA body */
.bbs-post-body {
  font-family: "ＭＳ Ｐゴシック","MS PGothic",IPAMonaPGothic,Mona,Monapo,Saitamaar,sans-serif;
  font-size: 16px;
  line-height: 18px;
  white-space: pre;
  font-variant-ligatures: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0;
}

/* Anchor */
.bbs-anchor {
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
}
.bbs-anchor:hover { text-decoration: underline; }

/* Anchor popup */
.bbs-popup {
  position: absolute;
  z-index: 1000;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  padding: 10px 14px;
  font-size: 13px;
  pointer-events: none;
}

/* Image */
.bbs-post-image {
  margin-top: 8px;
}
.bbs-post-image img {
  max-width: 300px;
  max-height: 300px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ─── Forms ─── */
.bbs-form-wrap {
  margin-top: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.bbs-form-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
}
.bbs-form-row {
  margin-bottom: 12px;
}
.bbs-form-row label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-secondary);
}
.bbs-input {
  width: 100%;
  max-width: 400px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}
.bbs-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.bbs-textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: "ＭＳ Ｐゴシック","MS PGothic",IPAMonaPGothic,Mona,Monapo,Saitamaar,monospace;
  font-size: 16px;
  line-height: 18px;
  white-space: pre;
  resize: vertical;
  min-height: 150px;
}
.bbs-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.bbs-file { font-size: 13px; }
.bbs-file-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-left: 8px;
}
.bbs-submit {
  display: inline-block;
  padding: 8px 24px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}
.bbs-submit:hover { background: var(--accent-dark); }
.bbs-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.bbs-status { font-size: 13px; margin-top: 8px; }
.bbs-status--ok { color: #117A40; }
.bbs-status--err { color: #D32F2F; }

.bbs-locked-msg {
  text-align: center;
  padding: 20px;
  color: var(--text-tertiary);
  font-size: 14px;
}

/* ─── Header row (title + delete button) ─── */
.bbs-header-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.bbs-header-row .bbs-thread-title {
  flex: 1;
  min-width: 0;
}

/* Delete button */
.bbs-delete-btn {
  flex-shrink: 0;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #D32F2F;
  background: transparent;
  border: 1px solid #D32F2F;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  margin-top: 2px;
}
.bbs-delete-btn:hover {
  background: #D32F2F;
  color: #fff;
}

/* Short input variant */
.bbs-input--short {
  max-width: 240px;
}

/* ─── Dialog overlay ─── */
.bbs-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.bbs-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.bbs-dialog-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}
.bbs-dialog-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}
.bbs-dialog .bbs-form-row {
  margin-bottom: 16px;
}
.bbs-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.bbs-dialog-cancel {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}
.bbs-dialog-cancel:hover {
  background: var(--bg-card);
  border-color: var(--text-tertiary);
}
.bbs-dialog-confirm {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #D32F2F;
  border: 1px solid #D32F2F;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}
.bbs-dialog-confirm:hover {
  background: #B71C1C;
  border-color: #B71C1C;
}
.bbs-dialog-confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
