/* ============================================================
   MJ Magazine — フロントエンドスタイル
   ============================================================ */

/* ─── 検索フォーム ─────────────────────────────────────────── */
.mj-search-box {
  background: #f0f7fb;
  border: 1px solid #aed6f1;
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 20px;
}

.mj-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.mj-search-input {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #b0c4d8;
  border-radius: 4px;
  outline: none;
  transition: border-color .15s;
  /* テーマの .cp_actab input ルールを上書き */
  position: static !important;
  z-index: auto !important;
  opacity: 1 !important;
  display: block;
}
.mj-search-input:focus {
  border-color: #0085ba;
  box-shadow: 0 0 0 2px rgba(0,133,186,.15);
}

.mj-search-btn,
.mj-clear-btn {
  padding: 8px 18px;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.mj-search-btn {
  background: #0085ba;
  color: #fff;
  transition: background .15s;
}
.mj-search-btn:hover   { background: #006a94; }
.mj-search-btn:disabled { background: #aaa; cursor: default; }

.mj-clear-btn {
  background: #e0e0e0;
  color: #555;
}
.mj-clear-btn:hover { background: #ccc; }

.mj-search-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: #777;
}

/* ─── 検索結果 ─────────────────────────────────────────────── */
.mj-result-count {
  font-size: 13px;
  color: #555;
  margin: 0 0 12px;
}

.mj-no-results {
  padding: 14px;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 4px;
  color: #777;
  font-size: 14px;
}

.mj-result-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mj-result-item {
  display: flex;
  flex-direction: column;
}

.mj-snippet {
  background: #fffde7;
  border-left: 3px solid #ffc107;
  padding: 8px 14px;
  font-size: 13px;
  line-height: 1.7;
  color: #444;
  margin: 0;
  border-radius: 0 4px 4px 0;
  text-align: left;
}
.mj-snippet mark {
  background: #fff176;
  font-weight: bold;
  border-radius: 2px;
  padding: 0 1px;
}

/* ─── カードグリッド（2列） ────────────────────────────────── */
.mj-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 4px;
}

/* ─── カード（横長レイアウト） ─────────────────────────────── */
.mj-card {
  position: relative;
  display: flex;
  flex-direction: row;
  border: 1px solid #dde3e8;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s, border-color .15s;
  cursor: pointer;
  min-width: 0;
}
.mj-card:hover {
  box-shadow: 0 3px 12px rgba(0,0,0,.12);
  border-color: #b0c4d8;
  text-decoration: none;
}
.mj-card--no-pdf {
  cursor: default;
  opacity: .75;
}

/* NEW バッジ */
.mj-badge-new {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 3px;
  letter-spacing: 0.06em;
  z-index: 1;
  pointer-events: none;
}

/* サムネイル（左）A4縦比率 1:1.414 */
.mj-card-thumb {
  width: 88px;
  flex-shrink: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.mj-card-thumb img {
  width: 100%;
  height: auto;          /* A4比率を保ったまま全体表示 */
  display: block;
  background: #fff;
}
.mj-card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8e8e8;
  color: #999;
  font-size: 11px;
  font-weight: bold;
  text-align: center;
  padding: 6px;
  line-height: 1.4;
}

/* 情報エリア（右） */
.mj-card-body {
  flex: 1;
  align-self: flex-start;
  padding: 9px 12px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
}

.mj-card-issue {
  font-weight: 700;
  font-size: 14px;
  color: #1a5276;
  line-height: 1.3;
}

.mj-card-date {
  font-size: 11px;
  color: #555;
}

.mj-card-titles {
  margin-top: 3px;
  padding-top: 3px;
  border-top: 1px solid #eee;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.mj-card-title-item {
  font-size: 12px;
  color: #444;
  line-height: 1.3;
}

.mj-card-no-pdf {
  font-size: 11px;
  color: #aaa;
  margin: 4px 0 0;
}

/* ─── バックナンバーアコーディオン ─────────────────────────── */
.mj-accordion-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 16px;
  padding: 10px 16px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  text-align: left;
  transition: background .15s;
}
.mj-accordion-btn:hover {
  background: #ebebeb;
  color: #333;
}

.mj-accordion-icon {
  font-size: 11px;
  margin-left: 8px;
  flex-shrink: 0;
  transition: transform .2s;
}
.mj-accordion-btn[aria-expanded="true"] .mj-accordion-icon {
  transform: rotate(180deg);
}

.mj-accordion-body {
  margin-top: 12px;
}
.mj-accordion-body[hidden] {
  display: none;
}

/* ─── ローディング ──────────────────────────────────────────── */
.mj-loading {
  text-align: center;
  padding: 20px;
  color: #888;
  font-size: 14px;
}

/* ─── レスポンシブ（タブレット・大画面スマホ） ──────────────── */
@media screen and (max-width: 640px) {
  .mj-card-grid {
    grid-template-columns: 1fr;
  }
  .mj-card-thumb {
    width: 72px;
  }
  .mj-search-input {
    min-width: 0;
  }
  .mj-card-issue {
    font-size: 13px;
  }
  .mj-card-title-item {
    font-size: 13px;
  }
}

/* ─── レスポンシブ（iPhone SE など小型スマホ） ──────────────── */
@media screen and (max-width: 480px) {
  /* 検索フォーム：縦並び */
  .mj-search-box {
    padding: 12px;
  }
  .mj-search-row {
    flex-direction: column;
    align-items: stretch;
  }
  .mj-search-btn,
  .mj-clear-btn {
    width: 100%;
    text-align: center;
    padding: 10px;
  }

  /* カードサムネイル */
  .mj-card-thumb {
    width: 60px;
  }

  /* カード本文 */
  .mj-card-body {
    padding: 8px 10px;
  }
  .mj-card-issue {
    font-size: 13px;
  }
  .mj-card-date {
    font-size: 11px;
  }
  .mj-card-title-item {
    font-size: 12px;
    -webkit-line-clamp: 2;
  }

  /* アコーディオンボタン */
  .mj-accordion-btn {
    font-size: 12px;
    padding: 10px 12px;
  }
}
