/* =========================================================================
   WP CEO Blog — テンプレート/ショートコード共通スタイル
   テーマカラーは --c-brand を上書きすれば変えられる
   ========================================================================= */

.ceoblog {
  --c-brand:        #b40a0a;
  --c-brand-dark:   #8a0808;
  --c-text:         #1a1a1a;
  --c-text-sub:     #555;
  --c-bg-soft:      #f7f3f0;
  --c-border:       #e6e6e6;

  --space-section:  clamp(48px, 8vw, 96px);
  --radius:         12px;

  color: var(--c-text);
  font-feature-settings: "palt";
  line-height: 1.75;
}

.ceoblog__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* 画像の保存操作だけを抑止。クリックによる拡大表示は維持する。 */
.ceoblog img,
.ceoblog__lightbox img,
.single-ceo_blog .wp-lightbox-overlay img {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.ceoblog .ceoblog__image-notice {
  margin: 24px 0 32px;
  padding-top: 16px;
  border-top: 1px solid var(--c-border);
  color: var(--c-text-sub);
  font-size: 13px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

/* トップのセクション見出し。本文の左罫線見出しとは別のデザイン。 */
.ceoblog--top .ceoblog__section-title {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 clamp(28px, 4vw, 44px);
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-text);
  text-align: center;
  line-height: 1.5;
  font-family: "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif;
  font-size: clamp(23px, 2.6vw, 32px);
  font-weight: 500;
  letter-spacing: .06em;
  overflow-wrap: anywhere;
}
.ceoblog__section-label {
  display: block;
  margin-bottom: 10px;
  color: var(--c-brand);
  font-family: "Cinzel", Georgia, serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .22em;
}
.ceoblog__section-name { display: block; }
.ceoblog--top .ceoblog__section-title::before { content: none; }
.ceoblog--top .ceoblog__section-title::after {
  content: "";
  position: static;
  display: block;
  width: 48px;
  height: 1px;
  margin: 20px auto 0;
  border: 0;
  border-radius: 0;
  background: var(--c-brand);
  transform: none;
}
.ceoblog .ceoblog__profile-name::after,
.ceoblog .ceoblog__profile-intro h2::after { content: none; }

/* ============ セクション1: CEO紹介 ============ */
/* 固定ヘッダー被り対策: 最初のセクションだけ上部余白を増やす
   テーマの固定ヘッダー高さに合わせ、CSS変数 --wpcb-header-offset で上書き可 */
.ceoblog > section:first-child {
  padding-top: calc(var(--space-section) + var(--wpcb-header-offset, 80px));
}
@media (min-width: 768px) {
  .ceoblog > section:first-child {
    padding-top: calc(var(--space-section) + var(--wpcb-header-offset, 60px));
  }
}

.ceoblog__profile {
  padding: var(--space-section) 0;
  background: var(--c-bg-soft);
}

.ceoblog__profile-body { min-width: 0; }
.ceoblog__profile-intro img { max-width: 100%; height: auto; }
.ceoblog .ceoblog__profile-intro h1,
.ceoblog .ceoblog__profile-intro h2,
.ceoblog .ceoblog__profile-intro h3 { font-size: 20px; line-height: 1.5; margin: 1.5em 0 .75em; }
.ceoblog__profile-intro pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.ceoblog__top-header { padding: calc(40px + var(--wpcb-header-offset, 80px)) 0 32px; background: var(--c-bg-soft); }
.ceoblog.ceoblog__top-header { text-align: center; padding-bottom: 48px; }
.ceoblog.ceoblog__top-header h1 {
  margin: 0 0 24px; padding: 0; border: 0; background: none;
  font-family: "Cinzel", Georgia, serif; font-weight: 400;
  font-size: clamp(34px, 5vw, 56px); line-height: 1.3; letter-spacing: .12em;
}
.ceoblog.ceoblog__top-header h1::before,
.ceoblog.ceoblog__top-header h1::after { content: none; }
.ceoblog.ceoblog__top-header a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 8px 24px; border: 1px solid #d5c4bd; color: var(--c-brand);
  font-size: 13px; letter-spacing: .08em; text-decoration: none;
}
.ceoblog.ceoblog__top-header a:hover { border-color: var(--c-brand); background: #fff; }
.ceoblog.ceoblog__top-header a:focus-visible { outline: 2px solid var(--c-brand); outline-offset: 4px; }
.ceoblog__top-header a, .ceoblog__back a { color: var(--c-brand); text-decoration: underline; }
.ceoblog__top-header + .ceoblog > section:first-child { padding-top: 32px; }
.ceoblog__articles { scroll-margin-top: 100px; }

.ceoblog__top-hero { padding: 32px 0; background: var(--c-bg-soft); }
.ceoblog__top-hero img,
.ceoblog__top-hero video { display: block; width: 100%; height: auto; max-height: 75vh; object-fit: contain; }
.ceoblog__top-hero iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; }
.ceoblog__top-hero + .ceoblog__profile { padding-top: 32px; }

.ceoblog__profile-position {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--c-text);
  letter-spacing: 0.08em;
}

.ceoblog .ceoblog__profile-name {
  margin: 0 0 20px;
  font-size: clamp(24px, 3.6vw, 36px);
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
}

.ceoblog__profile-intro {
  font-size: 16px;
  line-height: 1.9;
  color: var(--c-text-sub);
}

.ceoblog__profile-intro p:first-child { margin-top: 0; }
.ceoblog__profile-intro p:last-child  { margin-bottom: 0; }

/* ============ セクション2: YouTube スライダー ============ */
.ceoblog__youtube {
  padding: var(--space-section) 0;
}

.ceoblog__youtube-slider {
  position: relative;
  padding: 0 0 56px;
}

.ceoblog__youtube-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.ceoblog__youtube-thumb {
  position: relative;
  display: block;
  aspect-ratio: auto;
  background: #000;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.2s ease;
}

.ceoblog__youtube-card:hover .ceoblog__youtube-thumb {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.ceoblog__youtube-thumb img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  opacity: 0.92;
  transition: opacity 0.3s ease;
}

.ceoblog__youtube-card:hover .ceoblog__youtube-thumb img {
  opacity: 1;
}

.ceoblog__youtube-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(48px, 4.5vw, 56px);
  height: clamp(48px, 4.5vw, 56px);
  display: grid;
  place-items: center;
  border: 1px solid rgba(60, 47, 40, 0.18);
  border-radius: 50%;
  background: rgba(250, 247, 243, 0.92);
  color: #403630;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.ceoblog__youtube-play svg { display: block; width: 18px; height: 18px; }
.ceoblog__youtube-card:hover .ceoblog__youtube-play,
.ceoblog__youtube-card:focus-visible .ceoblog__youtube-play {
  background: #faf7f3;
  border-color: rgba(180, 10, 10, 0.3);
  color: var(--c-brand);
}
.ceoblog__youtube-card:focus-visible {
  outline: 2px solid var(--c-brand);
  outline-offset: -3px;
}
@media (prefers-reduced-motion: reduce) {
  .ceoblog__youtube-play,
  .ceoblog__youtube-thumb,
  .ceoblog__youtube-thumb img { transition: none; }
}

.ceoblog__youtube-slider .swiper-button-prev,
.ceoblog__youtube-slider .swiper-button-next {
  color: var(--c-brand);
}
.ceoblog__youtube-slider .swiper-pagination-bullet-active {
  background: var(--c-brand);
}

/* ============ 記事一覧: メディア全体を表示し、タイトルは下に配置 ============ */
.ceoblog__articles { padding: var(--space-section) 0; background: #fff; }
.ceoblog__mag-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 24px; align-items: stretch; grid-auto-rows: 1fr; }
.ceoblog__mag-card { min-width: 0; background: #fff; border-bottom: 1px solid var(--c-border); }
.ceoblog__mag-card.is-hero { grid-column: span 2; }
.ceoblog__mag-grid[data-count="1"] { grid-template-columns: 1fr; }
.ceoblog__mag-grid[data-count="1"] .ceoblog__mag-card { grid-column: auto; max-width: 760px; width: 100%; }
.ceoblog__mag-grid[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ceoblog__mag-grid[data-count="2"] .ceoblog__mag-card { grid-column: auto; }
.ceoblog__mag-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--c-text); }
.ceoblog__mag-thumb { position: relative; }
.ceoblog__mag-thumb img { display: block; width: 100%; height: auto; object-fit: contain; }
.ceoblog__mag-video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; pointer-events: none; }
.ceoblog__mag-noimage { display: grid; place-items: center; aspect-ratio: 16 / 9; background: var(--c-bg-soft); color: var(--c-text-sub); font-size: 13px; letter-spacing: .15em; }
.ceoblog__mag-body { flex: 1; padding: 20px 0; }
.ceoblog__mag-date { display: block; margin-bottom: 8px; font-size: 12px; color: var(--c-brand); }
.ceoblog .ceoblog__mag-title { margin: 0; color: var(--c-text); font-size: 20px; font-weight: 700; line-height: 1.5; }
.ceoblog__mag-card.is-hero .ceoblog__mag-title { font-size: 20px; }
.ceoblog__mag-link:hover .ceoblog__mag-title { color: var(--c-brand); }
.ceoblog__mag-excerpt { margin: 12px 0 0; color: var(--c-text-sub); font-size: 14px; line-height: 1.8; }
@media (max-width: 960px) {
  .ceoblog__mag-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .ceoblog__mag-grid, .ceoblog__mag-grid[data-count="2"] { grid-template-columns: minmax(0, 1fr); }
  .ceoblog__mag-card.is-hero { grid-column: auto; }
}

.ceoblog__empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--c-text-sub);
  background: var(--c-bg-soft);
  border-radius: var(--radius);
}

/* =========================================================================
   セクション: 記事ランキング
   ========================================================================= */
.ceoblog__ranking {
  padding: var(--space-section) 0;
  background: var(--c-bg-soft);
}

.ceoblog__rank-list {
  list-style: none;
  max-width: 912px;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: 1fr;
  gap: 12px;
}

.ceoblog__rank-item { margin: 0; min-width: 0; }
.ceoblog__rank-body { display: block; min-width: 0; }

.ceoblog__rank-link {
  display: grid;
  grid-template-columns: 44px clamp(180px, 22vw, 220px) minmax(0, 1fr);
  grid-template-rows: auto;
  height: 100%;
  box-sizing: border-box;
  align-items: center;
  gap: 20px;
  padding: 16px;
  background: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--c-text);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ceoblog__rank-badge { grid-column: 1; grid-row: 1; }
.ceoblog__rank-body { grid-column: 3; grid-row: 1; }
.ceoblog__rank-thumb { grid-column: 2; grid-row: 1; }

.ceoblog__rank-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.ceoblog__rank-badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 50%;
  background: #888;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.02em;
}
.ceoblog__rank-badge[data-rank="1"] { background: linear-gradient(135deg, #f5d442, #d4a017); color: #fff; }
.ceoblog__rank-badge[data-rank="2"] { background: linear-gradient(135deg, #c0c0c0, #909090); color: #fff; }
.ceoblog__rank-badge[data-rank="3"] { background: linear-gradient(135deg, #d99363, #a86432); color: #fff; }

.ceoblog__rank-thumb { display: block; min-width: 0; }
.ceoblog__rank-thumb img { width: 100%; height: auto; object-fit: contain; display: block; }
.ceoblog__rank-noimage { display: grid; place-items: center; aspect-ratio: 4 / 3; background: #eee; color: #999; font-size: 12px; }
.ceoblog__rank-video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; pointer-events: none; }

.ceoblog__rank-date {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--c-brand);
  letter-spacing: 0.05em;
}

.ceoblog .ceoblog__rank-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 720px) {
  .ceoblog__rank-link {
    grid-template-columns: 28px clamp(96px, 29vw, 132px) minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }
  .ceoblog__rank-badge { width: 28px; height: 28px; font-size: 16px; }
  .ceoblog .ceoblog__rank-title { font-size: 14px; -webkit-line-clamp: 3; }
  .ceoblog__rank-date { font-size: 11px; letter-spacing: 0; }
}

/* =========================================================================
   詳細記事: アイキャッチを動画にした場合
   ========================================================================= */
.ceoblog__article-hero--video .ceoblog__article-hero-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0;
  overflow: visible;
  background: #000;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.16);
}
.ceoblog__article-hero--video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* =========================================================================
   詳細記事: Gutenberg標準ブロックのスタイル強化
   - ギャラリーブロック (.wp-block-gallery) はcolumns属性で2/3/4列指定可
   - カラムブロック (.wp-block-columns) もそのまま使える
   - YouTube埋め込みは画像と混在可能（カラムブロック内に配置）
   ========================================================================= */
.ceoblog__article-body .wp-block-gallery {
  gap: 12px;
}
.ceoblog__article-body .wp-block-gallery .wp-block-image,
.ceoblog__article-body .wp-block-gallery figure.wp-block-image {
  margin: 0;
  border-radius: 0;
  overflow: visible;
}
.ceoblog__article-body .wp-block-gallery img,
.ceoblog__article-body .wp-block-gallery.has-nested-images figure.wp-block-image img {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  display: block;
  border-radius: 0;
}

/* クラシックエディタの [gallery] ショートコード対応
   出力HTML: <div class="gallery gallery-columns-N">...
   .gallery-columns-1 〜 .gallery-columns-9 まで列数を指定可能 */
.ceoblog__article-body .gallery {
  display: grid;
  gap: 12px;
  margin: 1.5em 0;
}
.ceoblog__article-body .gallery.gallery-columns-1 { grid-template-columns: 1fr; }
.ceoblog__article-body .gallery.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.ceoblog__article-body .gallery.gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.ceoblog__article-body .gallery.gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }
.ceoblog__article-body .gallery.gallery-columns-5 { grid-template-columns: repeat(5, 1fr); }
.ceoblog__article-body .gallery.gallery-columns-6 { grid-template-columns: repeat(6, 1fr); }
.ceoblog__article-body .gallery.gallery-columns-7 { grid-template-columns: repeat(7, 1fr); }
.ceoblog__article-body .gallery.gallery-columns-8 { grid-template-columns: repeat(8, 1fr); }
.ceoblog__article-body .gallery.gallery-columns-9 { grid-template-columns: repeat(9, 1fr); }

.ceoblog__article-body .gallery .gallery-item {
  margin: 0 !important;
  width: auto !important;        /* WP標準のインラインwidthを無効化 */
  max-width: none !important;
  padding: 0;
  float: none;                   /* WP標準のfloatを無効化 */
  display: block;
}
.ceoblog__article-body .gallery .gallery-icon {
  margin: 0;
}
.ceoblog__article-body .gallery .gallery-icon img {
  width: 100%;
  height: auto;
  display: block;
  border: 0 !important;
  border-radius: 0;
}
.ceoblog__article-body .gallery .gallery-caption {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--c-text-sub);
  line-height: 1.5;
}
.ceoblog__article-body .gallery br {
  display: none;                 /* WPが入れる謎の<br>を消す */
}

/* スマホでは多列ギャラリーを2列に圧縮 (Gutenberg/クラシック共通) */
@media (max-width: 640px) {
  .ceoblog__article-body .gallery.gallery-columns-3,
  .ceoblog__article-body .gallery.gallery-columns-4,
  .ceoblog__article-body .gallery.gallery-columns-5,
  .ceoblog__article-body .gallery.gallery-columns-6,
  .ceoblog__article-body .gallery.gallery-columns-7,
  .ceoblog__article-body .gallery.gallery-columns-8,
  .ceoblog__article-body .gallery.gallery-columns-9 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ギャラリーは表示幅から列数を決め、1枚が小さくなりすぎるのを防ぐ。
   JSなしでは通常グリッド。読み込み後は自然な高さで列ごとに積み上げる。 */
.ceoblog__gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  align-items: start;
  gap: 12px;
  margin: 1.5em 0;
}
.ceoblog__gallery.is-masonry { grid-auto-rows: 8px; grid-auto-flow: dense; }
.ceoblog__gallery-item { position: relative; min-width: 0; margin: 0; padding: 0; overflow: visible; border-radius: 0; align-self: start; }
.ceoblog__gallery-item.is-video { aspect-ratio: 16 / 9; background: #111; }
.ceoblog__gallery-item img { display: block; width: 100%; height: auto; margin: 0; border-radius: 0; object-fit: contain; }
.ceoblog__gallery-item iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* 本文・アイキャッチのコラージュ: 写真ごとの自然な比率で大小を組み合わせ、外周を揃える。 */
.ceoblog__article-body .ceoblog__gallery[data-layout="collage"] { gap: 6px; }
.ceoblog__gallery.is-mosaic { position: relative; display: block; }
.ceoblog__gallery.is-mosaic > .ceoblog__gallery-item { position: absolute; }
.ceoblog__gallery.is-mosaic .ceoblog__image-zoom { width: 100%; height: 100%; }
.ceoblog__gallery.is-mosaic .ceoblog__gallery-item img { width: 100%; height: 100%; object-fit: contain; }

/* カラムブロック */
.ceoblog__article-body .wp-block-columns {
  gap: 16px;
  margin: 1.5em 0;
}
.ceoblog__article-body .wp-block-column { min-width: 0; }
.ceoblog__article-body .wp-block-column > * { margin-top: 0; margin-bottom: 12px; }

/* YouTube/動画埋め込み: 角を切り取らずに表示 */
.ceoblog__article-body .wp-block-embed iframe,
.ceoblog__article-body figure.wp-block-embed-youtube iframe,
.ceoblog__article-body .wp-block-embed__wrapper iframe {
  border-radius: 0;
}

@media (max-width: 640px) {
  /* スマホでもカラムは並べたまま見せる（横にスクロールではなく折返し） */
  .ceoblog__article-body .wp-block-columns.is-not-stacked-on-mobile {
    flex-wrap: nowrap;
  }
}

/* =========================================================================
   詳細記事ページ (single-ceo_blog.php)
   ========================================================================= */
.ceoblog--single {
  padding: 0 0 var(--space-section);
}

.ceoblog__inner--narrow {
  max-width: 760px;
}

.ceoblog__article-header {
  padding: var(--space-section) 0 clamp(32px, 4vw, 48px);
  background: var(--c-bg-soft);
}

/* モバイルの固定ヘッダー（標準60px）の下に、日付・タイトル用の余白を確保。 */
@media (max-width: 768px) {
  .ceoblog__article-header {
    padding-top: calc(var(--wpcb-header-offset, 60px) + 32px);
  }
}

.ceoblog__article-meta {
  margin: 0 0 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--c-text-sub);
  letter-spacing: 0.05em;
}

.ceoblog__article-cat {
  display: inline-block;
  padding: 2px 10px;
  background: var(--c-brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  border-radius: 2px;
}

.ceoblog__article-title {
  margin: 0;
  font-size: clamp(24px, 3.6vw, 38px);
  font-weight: 700;
  line-height: 1.45;
  color: var(--c-text);
  overflow-wrap: anywhere;
}

.ceoblog__article-hero {
  margin: clamp(24px, 4vw, 48px) 0 0;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 24px;
  box-sizing: border-box;
  width: 100%;
}

.ceoblog__article-hero img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.ceoblog__article-body {
  padding: clamp(28px, 4vw, 48px) 0 32px;
  font-size: clamp(16px, 1.5vw, 17px);
  line-height: 1.9;
  color: var(--c-text);
  overflow-wrap: anywhere;
}

.ceoblog__article-body > * { margin-top: 0; margin-bottom: 1.5em; }
.ceoblog__article-body > *:last-child { margin-bottom: 0; }

/* 連続して挿入したギャラリーも、内部の画像と同じ12px間隔にする。 */
.ceoblog__article-body .ceoblog__gallery { margin-bottom: 12px; }
.ceoblog__article-body .ceoblog__gallery + .ceoblog__gallery { margin-top: 0; }

.ceoblog__article-body h2 {
  margin: 2em 0 .85em;
  padding-left: 12px;
  border-left: 4px solid var(--c-brand);
  font-size: clamp(21px, 2.4vw, 24px);
  font-weight: 700;
  line-height: 1.4;
}

.ceoblog__article-body h3 {
  margin: 1.8em 0 .7em;
  font-size: clamp(18px, 2vw, 20px);
  font-weight: 700;
  line-height: 1.4;
}

.ceoblog__article-body > :first-child { margin-top: 0; }
.ceoblog__article-body h2 + h3 { margin-top: 1.2em; }
.ceoblog__article-body li + li { margin-top: .4em; }
.ceoblog__article-body figcaption { font-size: 13px; line-height: 1.6; color: var(--c-text-sub); }

.ceoblog__article-body a {
  color: var(--c-brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ceoblog__article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 0;
}

.ceoblog__image-zoom { cursor: zoom-in; }
.ceoblog__gallery-item > .ceoblog__image-zoom { display: block; }
.ceoblog__image-zoom:focus-visible { outline: 3px solid #b40a0a; outline-offset: 4px; }

.ceoblog__lightbox {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 64px 24px 24px;
  border: 0;
  background: rgba(0, 0, 0, .92);
  color: #fff;
}
.ceoblog__lightbox:not([open]) { display: none; }
.ceoblog__lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.ceoblog__lightbox::backdrop { background: rgba(0, 0, 0, .6); }
.ceoblog__lightbox .ceoblog__lightbox-image { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100% - 56px); min-height: 0; object-fit: contain; }
.ceoblog__lightbox .ceoblog__lightbox-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #222;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}
.ceoblog__lightbox .ceoblog__lightbox-caption { margin: 0; font-size: 14px; line-height: 1.5; text-align: center; max-height: 44px; overflow: auto; }
.ceoblog__lightbox-caption:empty { display: none; }

.ceoblog__article-body blockquote {
  margin: 1.5em 0;
  padding: 16px 20px;
  background: var(--c-bg-soft);
  border-left: 4px solid var(--c-brand);
  color: var(--c-text-sub);
}

.ceoblog__article-nav {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--c-border);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.ceoblog__article-nav a {
  display: block;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--c-bg-soft);
  color: var(--c-text);
  text-decoration: none;
  transition: background 0.2s ease;
  overflow-wrap: anywhere;
}

.ceoblog--single .ceoblog__back { margin: 0; }
.ceoblog--single .ceoblog__back a { display: inline-flex; align-items: center; min-height: 44px; }
.ceoblog__article-nav a:focus-visible,
.ceoblog__back a:focus-visible { outline: 2px solid var(--c-brand); outline-offset: 4px; }

.ceoblog__article-nav a:hover {
  background: #efe7e1;
}

.ceoblog__article-nav-next { text-align: right; }

.ceoblog__article-nav-label {
  display: block;
  font-size: 12px;
  color: var(--c-brand);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.ceoblog__article-nav-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 560px) {
  .ceoblog__article-nav {
    grid-template-columns: 1fr;
  }
  .ceoblog__article-nav-next { text-align: left; }
}

/* テーマやブロックの切り抜き指定より優先し、メディアの四隅まで表示する。 */
.ceoblog img, .ceoblog video { max-width: 100%; height: auto; object-fit: contain !important; border-radius: 0 !important; }
.ceoblog__article-body .wp-block-gallery.has-nested-images figure.wp-block-image { flex-grow: 0; align-self: flex-start; overflow: visible; border-radius: 0; }
.ceoblog__article-body .wp-block-gallery.has-nested-images figure.wp-block-image img { flex: none; height: auto !important; aspect-ratio: auto !important; object-fit: contain !important; }
.ceoblog__article-body .wp-block-gallery.has-nested-images figure.wp-block-image figcaption { position: static; max-height: none; background: none; color: var(--c-text-sub); }
.ceoblog__article-body iframe { max-width: 100%; border-radius: 0; }

/* 記事の複数アイキャッチ。元の比率で高さを計算し、四隅まで表示する。 */
.ceoblog__hero-media { min-width: 0; }
.ceoblog__hero-media .ceoblog__gallery-item { margin: 0; padding: 0; }
.ceoblog__hero-media img { display: block; width: 100%; height: auto; box-shadow: none; }
.ceoblog__hero-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.ceoblog__hero-media--preview video, .ceoblog__hero-media--preview iframe { pointer-events: none; }
.ceoblog__hero-mosaic.ceoblog__gallery { margin: 0; gap: 6px; }
/* 一覧カードも幅を確保し、タイトルとメディアを読み取りやすくする。 */
.ceoblog__mag-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ceoblog__mag-card.is-hero { grid-column: auto; }
@media (max-width: 720px) {
  .ceoblog__mag-grid, .ceoblog__mag-grid[data-count="2"] { grid-template-columns: minmax(0, 1fr); }
}
/* 標準ギャラリーにも同じ最小幅を適用する。 */
.ceoblog__article-body .gallery[class*="gallery-columns-"] { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.ceoblog__article-body .gallery.gallery-columns-1 { grid-template-columns: minmax(0, 1fr); }
.ceoblog__article-body .wp-block-gallery.has-nested-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.ceoblog__article-body .wp-block-gallery.has-nested-images figure.wp-block-image { width: 100% !important; }
@media (max-width: 540px) {
  .ceoblog__inner, .ceoblog__article-hero { padding-left: 16px; padding-right: 16px; }
}
.ceoblog__article-body .wp-block-gallery.has-nested-images.columns-1 { grid-template-columns: minmax(0, 1fr); }

/* JSの読込前・未実行時も2列を確保。読込後は素材の比率に応じて最大3列。 */
@media (max-width: 640px) {
  .ceoblog__gallery,
  .ceoblog__article-body .gallery[class*="gallery-columns-"],
  .ceoblog__article-body .wp-block-gallery.has-nested-images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ceoblog__gallery > .ceoblog__gallery-item:only-child { grid-column: 1 / -1; }
  .ceoblog__gallery[data-cols="1"],
  .ceoblog__article-body .gallery.gallery-columns-1,
  .ceoblog__article-body .wp-block-gallery.has-nested-images.columns-1 { grid-template-columns: minmax(0, 1fr); }
}

/* 狭いカード内でも長い英数字・URLを折り返し、テーマの見出し装飾を持ち込まない。 */
.ceoblog .ceoblog__rank-title,
.ceoblog .ceoblog__mag-title { overflow-wrap: anywhere; padding: 0; border: 0; }
.ceoblog .ceoblog__rank-title::before,
.ceoblog .ceoblog__rank-title::after,
.ceoblog .ceoblog__mag-title::before,
.ceoblog .ceoblog__mag-title::after { content: none; }
.ceoblog__rank-link:focus-visible,
.ceoblog__mag-link:focus-visible { outline: 2px solid var(--c-brand); outline-offset: 4px; }

/* 記事一覧・ランキングの表紙枠を統一。中身は枠内へ等比で収める。 */
.ceoblog__mag-thumb,
.ceoblog__rank-thumb { position: relative; width: 100%; aspect-ratio: 3 / 2; background: #f7f7f7; }
.ceoblog .ceoblog__mag-thumb > .ceoblog__hero-media,
.ceoblog .ceoblog__rank-thumb > .ceoblog__hero-media {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
}
.ceoblog__mag-noimage,
.ceoblog__rank-noimage { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
.ceoblog__hero-media--preview.is-mosaic { position: relative; display: block; }
.ceoblog__hero-media--preview.is-mosaic > .ceoblog__gallery-item { position: absolute; }
.ceoblog__hero-media--preview.is-mosaic img { width: 100%; height: 100%; object-fit: contain; }
/* JavaScriptの待機中・無効時も枠からはみ出さず全体を表示する。 */
.ceoblog__hero-media--preview:not(.is-mosaic) {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 6px;
}
.ceoblog__hero-media--preview:not(.is-mosaic) > .ceoblog__gallery-item { min-height: 0; height: 100%; aspect-ratio: auto; }
.ceoblog__hero-media--preview:not(.is-mosaic) > .ceoblog__gallery-item:only-child { grid-column: 1 / -1; }
.ceoblog__hero-media--preview:not(.is-mosaic) img { height: 100%; object-fit: contain; }
