/* =========================================
   components.css
   - Cards / Buttons / Sidebar widgets
========================================= */

/* -----------------------------------------
   1. Cards（共通）
----------------------------------------- */

.card {
  background-color: var(--jp-color-surface, #ffffff);
  border-radius: 0;
  border: 1px solid var(--jp-color-border-subtle, #e5e7eb);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 8px 24px rgba(15,23,42,0.04);
}

.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}

/* News Card thumbnail: 800x500 → 16/10 */
.card-thumb img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

.card-body {
  padding: 0.75rem 0.9rem 0.9rem;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--jp-color-text-sub, #6b7280);
  margin-bottom: 0.3rem;
}

.card-title {
  font-size: 0.98rem;
  margin: 0 0 0.3rem;
  font-weight: 600;
}

.card-excerpt {
  font-size: 0.85rem;
  color: #4b5563;
}

/* 不要な上書き（削除）
.card--news .card-thumb img { height: 200px; }
*/

/* -----------------------------------------
   2. Sidebar Widgets
----------------------------------------- */

.sidebar-widget {
  background: var(--jp-color-surface, #ffffff);
  border-radius: 0;
  padding: 1rem 1.1rem;
  box-shadow: var(--jp-shadow-soft, 0 10px 30px rgba(15,23,42,0.03));
  margin-bottom: 1.25rem;
}

.sidebar-widget-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

/* -----------------------------------------
   3. Sidebar Small Card (最新記事4件)
   hero-static.php と構造を統一
----------------------------------------- */

.small-card {
  display: flex;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.small-card-thumb img {
  width: 90px;
  aspect-ratio: 3 / 2;   /* 300x200 */
  object-fit: cover;
  border-radius: 0;
}

.small-card-info time {
  display: block;
  font-size: 0.75rem;
  color: var(--jp-color-text-muted, #6b7280);
  margin-bottom: 0.15rem;
}

.small-card-title {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.35;
}

/* -----------------------------------------
   4. Buttons
----------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 1.1rem;
  border-radius: 0;
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--jp-color-primary, #2563eb);
  color: #fff;
}

.btn-primary:hover {
  background-color: #1e40af;
}

/* -----------------------------------------
   5. Badges
----------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 0;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-category {
  background-color: var(--jp-color-primary-soft, #dbeafe);
  color: var(--jp-color-primary, #2563eb);
}

.badge-new {
  background-color: #fef2f2;
  color: #b91c1c;
}

/* -----------------------------------------
   6. News List (card とは別系統)
----------------------------------------- */

/* NEWS 一覧のグリッド */
.news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

/* NEWS 単体コンポーネント本体 */
.news-item {
  background-color: var(--jp-color-surface, #ffffff);
  border: 1px solid var(--jp-color-border-subtle, #e5e7eb);
  box-shadow: var(--jp-shadow-card, 0 8px 24px rgba(15,23,42,0.04));
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* クリック範囲全体 */
.news-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

/* 共通サムネイルコンテナ */
.thumb {
  overflow: hidden;
}

/* 共通サムネイル画像（四角） */
.thumb img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

/* NEWS 専用のサムネイル比率など */
.thumb--news img {
  aspect-ratio: 16 / 10;
}

/* テキスト部分 */
.news-body {
  padding: 0.75rem 0.9rem 0.9rem;
}

.news-meta {
  font-size: 0.8rem;
  color: var(--jp-color-text-sub, #6b7280);
  margin-bottom: 0.3rem;
}

.news-title {
  font-size: 0.98rem;
  margin: 0 0 0.3rem;
  font-weight: 600;
}

.news-excerpt {
  font-size: 0.85rem;
  color: #4b5563;
}

/* 余裕があれば hover でタイトルだけ軽く強調 */
.news-link:hover .news-title {
  color: var(--jp-color-primary, #1d4ed8);
}
