/* ============================================
   明日のために for-tomorrow — サイドバー
   ============================================ */

/* 2カラムレイアウト */
.page-layout {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.page-layout > article,
.page-layout > .article-wrap,
.page-layout > .top-main {
  flex: 1;
  min-width: 0;
  max-width: none !important;
}

/* トップページ：サイドバー付き2カラム時はセクションの横幅をカラムに合わせる */
.top-main > .container,
.top-main > .section .container { max-width: none; }
.top-main > .section { padding-top: 40px; padding-bottom: 40px; }
/* 3カラムのカードはサイドバー併設で窮屈なので2カラムに */
.top-main .card-grid { grid-template-columns: repeat(2, 1fr); }

/* サイドバー本体（本文と一緒にスクロールする＝固定しない） */
.sidebar {
  width: 260px;
  flex-shrink: 0;
}

/* カード共通 */
.sb-card {
  background: #ffffff;
  border: 1px solid #dce8f0;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(30,58,95,.08);
}

.sb-ttl {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: #2E6DA4;
  border-bottom: 2px solid #2E6DA4;
  padding-bottom: 6px;
  margin-bottom: 12px;
}

/* プロフィール */
.sb-body {
  font-size: .84rem;
  line-height: 1.7;
  color: #1a2e3f;
  margin-bottom: 8px;
}
.sb-link {
  font-size: .8rem;
  color: #2E6DA4;
  text-decoration: none;
}
.sb-link:hover { text-decoration: underline; }

/* カテゴリ */
.sb-cats { list-style: none; margin: 0; padding: 0; }
.sb-cats li { border-bottom: 1px solid #eaf2fb; padding: 7px 0; }
.sb-cats li:last-child { border-bottom: none; }
.sb-cats a { font-size: .88rem; color: #1a2e3f; text-decoration: none; }
.sb-cats a:hover { color: #2E6DA4; }

/* 人気記事 */
.sb-posts { list-style: none; margin: 0; padding: 0; }
.sb-posts li { border-bottom: 1px solid #eaf2fb; padding: 8px 0; }
.sb-posts li:last-child { border-bottom: none; }
.sb-posts a {
  font-size: .82rem;
  color: #1a2e3f;
  text-decoration: none;
  line-height: 1.5;
  display: block;
}
.sb-posts a:hover { color: #2E6DA4; }
.sb-posts a::before { content: "▸ "; color: #2E6DA4; }

/* 広告カード */
.sb-ad { background: #fffbf5; border-color: #f0d5b0; }
.sb-ad-label {
  display: inline-block;
  font-size: .65rem;
  color: #999;
  border: 1px solid #ccc;
  padding: 1px 5px;
  border-radius: 3px;
  margin-bottom: 8px;
}
.sb-ad-ttl { font-size: .88rem; font-weight: 700; color: #1a2e3f; margin-bottom: 6px; }
.sb-ad-body { font-size: .82rem; line-height: 1.6; color: #4a6078; margin-bottom: 10px; }
.sb-cta {
  display: block;
  background: #f4845f;
  color: #fff !important;
  text-align: center;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: .84rem;
  font-weight: 700;
  text-decoration: none !important;
  transition: opacity .15s;
}
.sb-cta:hover { opacity: .85; }

/* スマホ：1カラムに戻す */
@media (max-width: 900px) {
  .page-layout {
    flex-direction: column;
    padding: 0;
  }
  .sidebar {
    width: 100%;
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

/* スマホ（狭い画面）：トップページのカードも1列に戻す（縦長防止） */
@media (max-width: 600px) {
  .top-main .card-grid { grid-template-columns: 1fr; }
}
