/* =========================================
   ベース背景（柔らかいHD2Dブルー）
========================================= */
body {
  font-family: "Noto Sans JP", sans-serif;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(210,220,255,0.55) 0%, rgba(210,220,255,0) 55%),
    radial-gradient(1200px 600px at 110% 10%, rgba(225,235,255,0.55) 0%, rgba(225,235,255,0) 55%),
    #f3f6ff;
  margin: 0;
  color: #223;
  line-height: 1.9;
}

/* =========================================
   スマホ横ズレ完全防止
========================================= */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* =========================================
   中央幅：PCだけ1080px固定 / スマホは可変
========================================= */
.wrap {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

/* =========================================
   見出し
========================================= */
.section h2 {
  font-size: 1.35rem;
  margin: 0 0 14px;
  padding-bottom: 4px;
  border-bottom: 2px solid rgba(90,120,255,0.25);
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 10px;
  word-break: break-word;
}

/* =========================================
   グリッド（カード配置）
========================================= */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}

/* =========================================
   カード（ガラス＋金ライン）
========================================= */
.card {
  position: relative;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(210,180,90,0.55);
  border-radius: 16px;
  padding: 20px 22px 26px;
  box-shadow:
    0 6px 22px rgba(0,0,40,0.08),
    inset 0 0 8px rgba(255,255,255,0.5);
  backdrop-filter: blur(4px);
  transition: .25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 12px 28px rgba(0,0,60,0.17),
    inset 0 0 10px rgba(255,255,255,0.6);
}

/* =========================================
   NEWバッジ（自動）
========================================= */
.card.new::before {
  content: "NEW";
  position: absolute;
  top: -6px;
  left: -6px;
  background: linear-gradient(135deg, #ff7575, #ff3c3c);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,230,220,0.8);
  box-shadow: 0 4px 12px rgba(255,80,80,0.35);
  z-index: 30;
}

/* =========================================
   日付（右上：金属プレート風）
========================================= */
.card::after {
  content: attr(data-date);
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: .78rem;
  padding: 3px 7px;
  color: #333;
  background: linear-gradient(180deg, #fff, #e4e4e4);
  border: 1px solid #bbb;
  border-radius: 6px;
  box-shadow: inset 0 2px 3px rgba(255,255,255,0.7);
}

/* =========================================
   カード文字
========================================= */
.card h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: 700;
}

.card .excerpt {
  margin: 0;
  color: #555;
  font-size: .92rem;
  line-height: 1.6;
}

/* =========================================
   スマホ（480px以下）最適化
========================================= */
@media (max-width: 480px) {
  .wrap {
    padding: 0 14px;
  }
  
  .grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card {
    padding: 16px 16px 20px;
  }

  .card::after {
    right: 6px;
  }

  .site-header h1 {
    font-size: 1.6rem;
    line-height: 1.35;
  }
}

/* 空のカード（中身がないカード）は非表示：全デバイス共通 */
.card:empty,
.card[data-date=""],
.card h3:empty {
  display: none !important;
}

/* スマホだけ空カードを完全非表示 */
@media (max-width: 600px) {
  .card[data-date=""],
  .card[data-date="0000-00-00"],
  .card:has(h3:empty) {
    display: none !important;
  }
}

/* カードの上下の間隔をすべて統一 */
.grid {
  gap: 22px !important;
  margin-bottom: 28px; /* 各セクションの下に一定の余白 */
}

/* セクション見出しにも一定の余白 */
.section h2 {
  margin-top: 40px;
  margin-bottom: 16px;
}
