/* ========================================
   カラーテーマ: Cocoon準拠（水色 × 白 × グレー）
   メイン: #0095d9  プロフィール青: #1967d2
   背景: #e6ecf0  テキスト: #333
   ======================================== */

/* 全体背景 */
body {
  background: #e6ecf0;
}

/* ヘッダー画像 */
.hero-header {
  background-image: url('/img/hero.jpg');
  background-size: cover;
  background-position: center;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero-header__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 120, 180, 0.45);
}

.hero-header__content {
  position: relative;
  text-align: center;
  color: white;
}

.hero-header__title {
  font-size: 2.5rem;
  margin: 0;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4);
}

.hero-header__logo {
  max-height: 80px;
  width: auto;
}

/* ロゴ・サイト名: ヘッダー画像があるので非表示 */
body:has(.hero-header) .logo {
  display: none;
}

/* ロゴ・サイト名（記事ページ等で表示） */
.logo__title {
  color: #0095d9;
  font-weight: bold;
}

.logo__tagline {
  color: #0095d9;
}

/* container--outer の箱感を解除 */
.container--outer {
  box-shadow: none !important;
  margin: 0 auto !important;
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
}

/* ヘッダー全体: 全幅・白背景 */
.header {
  background: #fff !important;
  width: 100%;
}

/* ヘッダー画像: 全幅 */
.hero-header {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  position: relative;
}

/* ナビバー: 全幅 */
.header {
  width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
  position: relative;
}

/* メインコンテンツ幅を制限して中央寄せ */
.wrapper.flex {
  max-width: 1300px;
  margin: 0.8rem auto;
  padding: 0 0.5rem;
}

/* ナビバー: 白背景・テキスト黒（Cocoon準拠） */
.main-nav,
.menu,
nav.menu {
  background: #fff !important;
  background-color: #fff !important;
  border-bottom: none !important;
  border-top: none !important;
}

.menu__list {
  display: flex;
  justify-content: center;
  width: 100%;
  background: #fff !important;
}

.menu__link {
  color: #333 !important;
  font-weight: bold;
  font-size: 1.15rem;
  padding: 0.8rem 1.5rem !important;
}

.menu__link:hover {
  color: #0095d9 !important;
  background: #f0f8ff !important;
}

.menu__item:hover,
.menu__item--active {
  background: #f0f8ff !important;
}

/* スマホでもメニューをそのまま表示 */
@media (max-width: 768px) {
  .menu__btn {
    display: none !important;
  }
  .menu__list {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 0.85rem;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    transform: none !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .primary {
    margin-right: 0 !important;
  }
  .list__excerpt {
    display: none !important;
  }
  .list__item.post .list__meta.meta.list__meta--bottom {
    gap: 0.8rem !important;
  }
  .toc {
    margin: 1rem 0 !important;
  }
  .linkcard__description {
    display: none !important;
  }
  .linkcard {
    max-width: 100% !important;
  }
  .sidebar {
    max-width: 100% !important;
    flex: 1 0 100% !important;
    margin-top: 0.8rem;
  }
}

/* 記事一覧をカード形式に */
.list__item.post {
  border: 1px solid #dde3e8;
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 1rem;
  overflow: hidden;
  display: flex !important;
  flex-direction: column;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.list__main {
  display: flex;
  align-items: stretch;
}

.list__item.post:hover {
  box-shadow: 0 4px 12px rgba(0, 149, 217, 0.15);
  transform: translateY(-2px);
}

/* カードのタイトルサイズ */
.list__title {
  font-size: 1.10rem !important;
}

/* タイトルリンク */
.list__title a,
.post__title a,
.list__title {
  color: #333 !important;
  text-decoration: none;
}

.list__title a:hover,
.post__title a:hover {
  color: #0095d9;
}

/* 抜粋テキストを制限 */
.content.list__excerpt {
  max-height: 4.5em;
  overflow: hidden;
  position: relative;
  color: #333;
  font-size: 0.95rem;
  line-height: 1.5;
}

.content.list__excerpt::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1.5em;
  background: linear-gradient(transparent, #fff);
}

/* ボタン */
.btn,
a.btn,
.widget-social__link.btn {
  background: #0095d9 !important;
  background-color: #0095d9 !important;
  color: #fff !important;
  border-radius: 4px;
  padding: 0.4rem 1.2rem;
  font-size: 0.85rem;
  text-decoration: none;
  display: inline-block;
  margin-top: 0.8rem;
  border: none;
}

.btn:hover,
a.btn:hover {
  background: #007ab8 !important;
  background-color: #007ab8 !important;
}

/* サイドバーのタグはボタンスタイルを上書き */
.widget-taglist__icon {
  width: 14px;
  height: 14px;
  fill: #888;
  vertical-align: -2px;
  margin-right: 3px;
}

.widget-taglist__link.btn {
  background: #fff !important;
  background-color: #fff !important;
  color: #333 !important;
  border: 1px solid #0095d9 !important;
  margin-top: 0 !important;
  margin-bottom: 0.4rem !important;
  padding: 0.3rem 0.8rem !important;
  font-weight: normal !important;
}

.widget-taglist__link.btn:hover {
  background: #f0f8ff !important;
  background-color: #f0f8ff !important;
  color: #0095d9 !important;
}

/* タグの記事数カウンターを非表示 */
.widget-taglist__link .widget-taglist__count {
  display: none !important;
}

/* メタ情報 */
.list__meta,
.meta {
  font-size: 0.85rem;
  color: #333;
}

.list__meta a,
.meta a {
  color: #333 !important;
}

/* カード内テキスト部分をflexカラムに */
.list__content-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* 説明文を伸ばしてメタを下に押し込む */
.list__content-wrap .list__excerpt {
  flex: 1;
}

/* カード内メタ情報を右下に固定 */
.list__item.post .list__meta.meta.list__meta--bottom {
  text-align: right !important;
  padding-top: 0.2rem;
  border-top: none;
  display: flex !important;
  justify-content: flex-end;
  gap: 0.3rem;
  white-space: nowrap;
  width: 100%;
}

/* サイドバー内ウィジェット: カードなし、区切り線のみ */
.widget {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0 0 1.2rem 0;
  margin-bottom: 1.2rem;
  box-shadow: none;
  border-bottom: none;
}

.widget:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* ウィジェットタイトル */
.widget__title {
  border-bottom: 2px solid #0095d9;
  padding-bottom: 0.5rem;
  color: #333;
  font-size: 1.3rem;
}

/* ウィジェット内リンク・テキスト */
.widget a {
  color: #333 !important;
}

.widget a:hover {
  color: #0095d9 !important;
}

/* プロフィールウィジェット */
.profile-avatar {
  margin-bottom: 0.8rem;
}

.profile-avatar__img {
  width: 120px !important;
  height: 120px !important;
  border-radius: 50%;
  object-fit: cover;
}

.profile-name {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.widget .profile-name__link {
  color: #0095d9 !important;
  text-decoration: none;
}

.profile-name__link:hover {
  text-decoration: underline !important;
}

.profile-bio {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.6;
  margin-bottom: 0.8rem;
}

.profile-follows {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.profile-sns-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff !important;
  border: 1px solid #dde3e8;
  color: #333 !important;
  text-decoration: none !important;
  transition: background 0.2s ease, color 0.2s ease;
}

.profile-sns-btn svg {
  fill: #333;
}

.profile-sns-btn:hover {
  background: #f0f8ff !important;
}

.profile-sns-btn:hover svg {
  fill: #0095d9;
}

/* 目次 */
.toc {
  background: #fff !important;
  border: 1px solid #0095d9 !important;
  border-radius: 4px;
  padding: 1rem !important;
  margin: 1.5rem 4rem;
}

.toc__title {
  background: transparent !important;
  color: #333 !important;
  font-size: 1.2rem;
  text-align: center;
  padding: 0 0 0.8rem 0 !important;
  border: none;
}

.toc__menu,
.toc__menu ul,
.toc__menu li,
.toc__menu a {
  border: none !important;
  border-bottom: none !important;
  border-top: none !important;
}

.toc__menu a {
  color: #333 !important;
  text-decoration: none;
  font-weight: normal !important;
  font-size: 1.05rem;
}

.toc__menu a:hover {
  color: #0095d9 !important;
}

.toc__menu ul {
  list-style: decimal;
  padding-left: 1.5rem;
  margin: 0;
}

.toc__menu ul ul {
  padding-left: 1.5rem;
}

.toc__menu li {
  padding: 0;
  margin: 0;
  color: #333;
  border: none !important;
  line-height: 1.6;
  font-weight: normal !important;
  font-size: 1.05rem;
}

/* タグアイコン（外側の大きいやつ非表示） */
.tags__badge {
  display: none !important;
}

/* タグリンク内のアイコン */
.tags__link-icon {
  width: 14px;
  height: 14px;
  fill: #fff;
  vertical-align: middle;
  margin-right: 4px;
}

/* タグリスト背景リセット */
.tags,
.tags__list,
.tags__item {
  background: transparent !important;
}

/* タグ（記事内） */
.tags__item .tags__link {
  background: #fff !important;
  color: #333 !important;
  border: 1px solid #0095d9 !important;
  border-radius: 4px;
  margin-top: 0 !important;
  font-weight: normal !important;
  padding: 0.3rem 0.8rem !important;
}

.tags__item .tags__link:hover {
  background: #f0f8ff !important;
  color: #0095d9 !important;
}

/* タグ（サイドバー） */
.widget-taglist__link {
  background: #fff !important;
  color: #333 !important;
  border: 1px solid #0095d9 !important;
  border-radius: 4px;
  padding: 0.3rem 0.8rem !important;
  margin-top: 0 !important;
}

.widget-taglist__link:hover {
  background: #f0f8ff !important;
  color: #0095d9 !important;
}

/* カテゴリラベル */
.list__category {
  background: #0095d9;
  color: #fff;
}

/* フッター: 全幅・白背景 */
.footer {
  background: #fff;
  color: #666;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  position: relative;
  border: none;
  padding: 1rem 0 0.8rem;
}

.footer__inner {
  text-align: right;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer__nav {
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.footer__nav-link {
  color: #333 !important;
  text-decoration: none !important;
  padding: 0 0.6rem;
}

.footer__nav-link:hover {
  color: #0095d9 !important;
  text-decoration: underline !important;
}

.footer__nav-border {
  color: #ccc;
  font-size: 0.8rem;
}

.footer__copyright {
  font-size: 0.8rem;
  color: #888;
  text-align: right;
}

/* ページネーション（丸ボタン） */
.pagination-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin: 2rem 0;
}

.pagination-nav__item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid #0095d9;
  color: #333 !important;
  text-decoration: none;
  font-size: 1.15rem;
  background: #fff;
  transition: background 0.2s ease;
}

a.pagination-nav__item:hover {
  background: #e0f4ff;
  color: #333 !important;
}

.pagination-nav__item--active {
  background: #0095d9 !important;
  color: #fff !important;
  border-color: #0095d9;
  font-weight: bold;
  cursor: default;
}

.pagination-nav__item--active:hover {
  background: #0095d9 !important;
}

.pagination-nav__item--dots {
  border: none;
  background: #d6e8f5;
  color: #fff !important;
  font-weight: bold;
}

/* 既存のページネーション非表示 */
.pagination {
  display: none !important;
}

/* 関連記事 */
.related {
  margin: 2rem 0;
}

.related__title {
  font-size: 1.3rem;
  color: #333;
  border-bottom: 2px solid #0095d9;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

/* 記事間ナビ */
.pager {
  border-bottom: none !important;
}

.pager__link {
  color: #333 !important;
  border: none;
  border-radius: 8px;
  background: #fff;
  padding: 1rem !important;
  transition: background 0.2s ease, color 0.2s ease;
}

.pager__link:hover {
  background: #f0f8ff !important;
}

.pager__subtitle {
  color: #333 !important;
}

.pager__title {
  color: #333;
}

.pager__link:hover .pager__title,
.pager__link:hover .pager__subtitle {
  color: #0095d9 !important;
}

/* アイキャッチ画像 16:9 */
.thumbnail {
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

/* 一覧のアイキャッチ */
.list__thumbnail {
  margin: 0 15px 0 0;
  float: none !important;
  flex-shrink: 1;
  min-width: 100px;
  max-width: 300px;
  width: 30%;
}

.list__thumbnail img {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.thumbnail__image {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* アイキャッチ下のメタ情報 */
.post__meta--overlay {
  text-align: right;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  border: none;
  padding: 0;
}

/* 記事内のh2・h3 */
.post__content h2 {
  background: #f0f8ff;
  color: #333;
  padding: 1.2rem 1rem;
  margin: 2rem 0 1rem;
  font-size: 1.4rem;
  border: none;
  border-left: 5px solid #0095d9;
  border-radius: 0;
}

.post__content h3 {
  border-left: 3px solid #0095d9;
  padding: 0.3rem 0 0.3rem 0.8rem;
  margin: 1.5rem 0 0.8rem;
  font-size: 1.4rem;
  color: #333;
}

/* 記事本文の文字サイズ */
.post__content {
  font-size: 1.1rem;
  line-height: 1.8;
}

/* テーブル（Cocoon準拠） */
.post__content .table-wrap {
  overflow-x: auto;
  width: 100%;
  margin: 1.5rem 0;
}

.post__content table {
  min-width: 500px;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.post__content table th {
  background: #f0f8ff;
  color: #333;
  font-weight: bold;
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 2px solid #0095d9 !important;
  border: 1px solid #dde3e8;
}

.post__content table td {
  padding: 0.7rem 1rem;
  border: 1px solid #dde3e8;
}

.post__content table tbody tr:nth-child(even) {
  background: #f5f8fa;
}

.post__content table tbody tr:hover {
  background: unset !important;
}

.post__content table tbody tr:nth-child(even):hover {
  background: #f5f8fa !important;
}

/* 共有ボタン */
.share {
  margin: 2rem 0;
  padding: 1rem 0;
}

.share__title {
  font-size: 1rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 0.8rem;
}

.share__buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.share__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
  color: #fff !important;
}

.share__btn:hover {
  opacity: 0.8;
  color: #fff !important;
}

.share__btn--x {
  background: #000 !important;
}

.share__btn--facebook {
  background: #1877F2 !important;
}

.share__btn--hatena {
  background: #00A4DE !important;
}

.share__btn--line {
  background: #06C755 !important;
}

.share__btn--copy {
  background: #666 !important;
  color: #fff;
}

/* 引用（blockquote） */
.post__content blockquote {
  background: #f5f8fa;
  border-left: 4px solid #0095d9;
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  color: #555;
  font-style: normal;
  border-radius: 0 4px 4px 0;
}

.post__content blockquote p {
  margin: 0;
}

/* 箇条書き（目次を除く） */
.post__content > ul,
.post__content > p + ul,
.post__content ul:not(.toc__menu ul):not(#TableOfContents ul) {
  list-style-type: disc;
}

.post__content ul:not(.toc__menu ul):not(#TableOfContents ul) ul {
  list-style-type: circle;
}

.post__content ul li,
.post__content ol li {
  margin-bottom: 0.1rem;
  line-height: 1.4;
  padding: 0 !important;
}

/* コードブロック折り返し */
.post__content pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-x: auto;
}

/* 記事フッターの罫線を消す */
.post__footer,
.post__content,
.post,
article.post {
  border-bottom: none !important;
  border-top: none !important;
}

/* 序文（リード文） */
.post__lead-section {
  margin: 1.5rem 0;
  font-size: 0.95rem;
  line-height: 1.8;
  color: #444;
}

.post__lead {
  margin: 0;
}

/* コンテンツエリア: 全体を白カードで囲む */
.primary {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border: 1px solid #dde3e8;
  padding: 1.5rem 2.0rem;
  margin-right: 1.5rem;
  flex: 1 0 67% !important;
  align-self: flex-start;
}

/* サイドバー全体: 白カードで囲む */
.sidebar {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border: 1px solid #dde3e8;
  padding: 1.2rem;
  align-self: flex-start;
  flex: 1 0 30% !important;
  max-width: 30%;
}

/* メインとサイドバーの間隔 */
.wrapper.flex {
  gap: 0;
  margin-top: 0.8rem;
  margin-bottom: 0.8rem;
}

.wrapper {
  background: transparent !important;
  padding: 0.8rem !important;
}

/* サイドバー全体 */
.sidebar {
  margin-left: 0;
}

/* リンク全般 */
a {
  color: #0095d9 !important;
}

a:hover {
  color: #007ab8 !important;
}

/* サイドバー検索ウィジェット */
.widget-search .widget__title {
  display: none !important;
}

.widget-search__form {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

/* 2x2画像グリッド */
.image-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 1rem 0;
}

.image-grid-2x2 img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

@media (max-width: 768px) {
  .image-grid-2x2 {
    grid-template-columns: 1fr;
  }
}

.image-grid-2x2 p {
  margin: 0;
  padding: 0;
}

/* 2x1画像グリッド */
.image-grid-2x1 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 1rem 0;
}

.image-grid-2x1 img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.image-grid-2x1 p {
  margin: 0;
  padding: 0;
  text-align: center;
}

@media (max-width: 768px) {
  .image-grid-2x1 {
    grid-template-columns: 1fr;
  }
}

/* 3x1画像グリッド */
.image-grid-3x1 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  margin: 1rem 0;
}

.image-grid-3x1 img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.image-grid-3x1 p {
  margin: 0;
  padding: 0;
  text-align: center;
}

@media (max-width: 768px) {
  .image-grid-3x1 {
    grid-template-columns: 1fr;
  }
}

/* 3x2画像グリッド */
.image-grid-3x2 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  margin: 1rem 0;
}

.image-grid-3x2 img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.image-grid-3x2 > p {
  margin: 0;
  padding: 0;
  text-align: center;
}

@media (max-width: 768px) {
  .image-grid-3x2 {
    grid-template-columns: 1fr;
  }
}

/* 4x1画像グリッド */
.image-grid-4x1 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 0.5rem;
  margin: 1rem 0;
}

.image-grid-4x1 img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.image-grid-4x1 > p {
  margin: 0;
  padding: 0;
  text-align: center;
}

@media (max-width: 768px) {
  .image-grid-4x1 {
    grid-template-columns: 1fr 1fr;
  }
}

/* リンクカード */
.linkcard {
  display: flex;
  flex-direction: column;
  border: 1px solid #dde3e8;
  border-radius: 8px;
  overflow: hidden;
  margin: 1rem auto;
  padding: 0.75rem;
  background: #fff;
  text-decoration: none !important;
  color: #333 !important;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  max-width: 85%;
}

.linkcard:hover {
  box-shadow: 0 4px 12px rgba(0, 149, 217, 0.15);
  transform: translateY(-2px);
  color: #333 !important;
}

.linkcard__main {
  display: flex;
  align-items: stretch;
}

.linkcard__image-wrap {
  flex-shrink: 1;
  min-width: 100px;
  max-width: 300px;
  width: 30%;
  margin-right: 15px;
}

.linkcard__image-wrap img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
}

.linkcard__favicon {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  flex-shrink: 0;
}

.linkcard__content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.linkcard__title {
  font-size: 1.10rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 0.4rem;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.post__content .linkcard .linkcard__description {
  font-size: 0.85rem !important;
  color: #333 !important;
  font-weight: normal !important;
  line-height: 1.4 !important;
  flex: 1;
  overflow: hidden !important;
  max-height: calc(1.4em * 3);
}

.linkcard__domain {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-top: 0.4rem;
  font-size: 0.8rem;
  color: #888;
}

@media (max-width: 768px) {
  .linkcard__image {
    width: 120px;
  }
}
