/* Single post content headings */
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content h2,
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__title {
  position: relative;
  margin: 2.7em 0 1.1em;
  padding: 0.62em 0.95em 0.66em;
  background: var(--vgf-tint, #e6eef8);
  border: 0;
  border-radius: 4px;
  color: #00377f;
  font-size: 20px !important;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -.01em;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content h2::before,
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__title::before {
  /* テーマ側が ::before に上下の罫線を引いているので、ここで打ち消す */
  content: none;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content h3 {
  position: relative;
  margin: 2.1em 0 0.75em;
  padding: 0 0 0 0.72em;
  border: 0;
  color: #1b2733;
  font-size: clamp(17px, .4vw + 15px, 19.5px);
  font-weight: 700;
  line-height: 1.6;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.26em;
  width: 3px;
  height: 1.1em;
  background: #00377f;
  border-radius: 9999px;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content h4 {
  position: relative;
  margin: 1.9em 0 0.8em;
  padding: 0.2em 0 0.2em 1.05em;
  background: transparent;
  border: 0;
  color: #333;
  font-weight: 700;
  line-height: 1.7;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content h4::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.82em;
  width: 0.52em;
  height: 2px;
  background: #00377f;
}

@media (max-width: 767px) {
  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content h2,
  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__title {
    margin-top: 2.35em;
    padding: 0.58em 0.85em 0.62em;
  }

  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content h3 {
    margin-top: 1.95em;
    padding-left: 0.68em;
  }
}

body #content .post_content .btn.raised.accent-bc.strong {
  border-radius: var(--vg-top-radius-pill, 4px);
}

/* Anchor offset for fixed header */
html {
  scroll-padding-top: 112px;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content h2,
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content h3,
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content h4,
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content [id] {
  scroll-margin-top: 112px;
}

@media (max-width: 1100px) {
  html {
    scroll-padding-top: 104px;
  }

  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content h2,
  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content h3,
  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content h4,
  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content [id] {
    scroll-margin-top: 104px;
  }
}

@media (max-width: 767px) {
  html {
    scroll-padding-top: 92px;
  }

  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content h2,
  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content h3,
  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content h4,
  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content [id] {
    scroll-margin-top: 92px;
  }
}

/* 番号つきの箇条書き：数字が本文より左へはみ出さないよう、字下げを持たせる */
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content ol:not([class]) {
  margin: 1.2em 0 1.8em;
  padding-left: 1.9em;
  list-style: decimal outside;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content ol:not([class]) > li {
  padding-left: 0.25em;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content ol:not([class]) > li + li {
  margin-top: 0.7em;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content ol:not([class]) > li::marker {
  color: #00377f;
  font-weight: 700;
}

/* Single post standard lists */
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content > ul:not([class]),
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content :not(.vg-before-toc-cta):not(.p-toc__list):not(.p-toc) > ul:not([class]) {
  margin: 1.2em 0 1.8em;
  padding: 20px 24px;
  list-style: none;
  background: #fff;
  border: 1px solid rgba(0, 55, 127, 0.18);
  border-radius: 2px;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content > ul:not([class]) > li,
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content :not(.vg-before-toc-cta):not(.p-toc__list):not(.p-toc) > ul:not([class]) > li {
  position: relative;
  display: block; /* grid だと「<strong>見出し</strong>：本文」のように中身が複数あると崩れるため、点は絶対配置にする */
  padding-left: 1.34em;
  margin: 0;
  color: #333;
  line-height: 1.65;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content > ul:not([class]) > li + li,
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content :not(.vg-before-toc-cta):not(.p-toc__list):not(.p-toc) > ul:not([class]) > li + li {
  margin-top: 0.28em;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content > ul:not([class]) > li::before,
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content :not(.vg-before-toc-cta):not(.p-toc__list):not(.p-toc) > ul:not([class]) > li::before {
  content: "";
  position: absolute;
  left: 0.07em;
  top: 0.6em;
  width: 0.48em;
  height: 0.48em;
  background: var(--button-main-color, #00377f);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(0, 55, 127, 0.12);
}

@media (max-width: 767px) {
  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content > ul:not([class]),
  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content :not(.vg-before-toc-cta):not(.p-toc__list):not(.p-toc) > ul:not([class]) {
    padding: 16px 18px;
  }

  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content > ul:not([class]) > li,
  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content :not(.vg-before-toc-cta):not(.p-toc__list):not(.p-toc) > ul:not([class]) > li {
    line-height: 1.6;
  }
}

/* Latest posts block outside the top page */
body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts {
  display: grid !important;
  gap: 10px;
  margin: 1.15em 0 1.7em;
  padding: 0 !important;
  list-style: none !important;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts > li {
  position: relative;
  display: grid !important;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 0 !important;
  padding: 8px 12px 8px 8px !important;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(0, 55, 127, 0.16);
  border-radius: 8px;
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts > li:hover {
  border-color: rgba(0, 55, 127, 0.42);
  cursor: pointer;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts > li::before,
body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts > li::after {
  display: none !important;
  content: none !important;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts__featured-image {
  float: none !important;
  margin: 0 !important;
  width: 94px !important;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(0, 55, 127, 0.08);
}

body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts__featured-image img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
  transition: transform 0.28s ease, filter 0.28s ease, opacity 0.28s ease;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts > li:hover .wp-block-latest-posts__featured-image img {
  transform: scale(1.06);
  filter: saturate(1.06) contrast(1.04);
  opacity: 0.92;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts__post-title {
  position: relative;
  z-index: 1;
  display: -webkit-box;
  color: #333;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.52;
  text-decoration: none !important;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts__post-title:hover,
body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts > li:hover .wp-block-latest-posts__post-title {
  color: var(--button-main-color, #00377f);
  text-decoration: none !important;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts__card-link {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
  overflow: hidden;
  text-indent: -9999px;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-latest-posts {
  background-color: transparent !important;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-latest-posts > li {
  background-color: #fff !important;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .c-widget ul li a:hover {
  background: transparent;
}

@media (max-width: 767px) {
  body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts {
    gap: 9px;
  }

  body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts > li {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
    padding: 8px 10px 8px 8px !important;
  }

  body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts__featured-image {
    width: 88px !important;
  }

  body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts__post-title {
    font-size: 0.76rem;
    line-height: 1.48;
    -webkit-line-clamp: 3;
  }
}

body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-latest-posts__post-title {
  -webkit-line-clamp: 2;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts > li {
  min-height: 82px;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts__post-title {
  word-break: break-word;
  overflow-wrap: anywhere;
}

@media (max-width: 767px) {
  body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts__post-title {
    -webkit-line-clamp: 2;
  }
}

body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts > li {
  padding: 0 12px 0 0 !important;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts__featured-image {
  align-self: stretch;
  height: 100%;
  border-radius: 8px 0 0 8px;
}

@media (max-width: 767px) {
  body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts > li {
    padding: 0 10px 0 0 !important;
  }
}

body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-heading,
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .c-widget__title {
  position: relative;
  margin: 0 0 14px;
  padding: 0 0 0 14px;
  color: #333;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-heading::before,
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .c-widget__title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  width: 4px;
  height: 1.2em;
  background: var(--button-main-color, #00377f);
  border-radius: 9999px;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-latest-posts > li {
  min-height: 120px;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-latest-posts__featured-image {
  width: 104px !important;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-latest-posts__post-title {
  -webkit-line-clamp: 4;
  line-height: 1.45;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts > li {
  transition-duration: 0.08s;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .wp-block-latest-posts__featured-image img {
  transition-duration: 0.12s;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-heading,
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .c-widget__title {
  padding-left: 18px;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-heading::before,
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .c-widget__title::before {
  left: 4px;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-latest-posts__post-title {
  display: -webkit-box !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: none;
  padding-bottom: 0.15em;
}

/* ============================================================
   サイドバー：カテゴリ一覧（タグピル型）
============================================================ */
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-categories,
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .widget_categories ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-categories li,
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .widget_categories ul li {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  font-weight: normal !important;
  list-style: none !important;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-categories li a,
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .widget_categories ul li a {
  display: inline-flex !important;
  align-items: center;
  padding: 6px 14px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #00377f !important;
  background: #ffffff !important;
  border: 1.5px solid #cad8e6 !important;
  border-radius: 9999px !important;
  text-decoration: none !important;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
  line-height: 1.4;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-categories li a:hover,
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .widget_categories ul li a:hover {
  background: #00377f !important;
  color: #ffffff !important;
  border-color: #00377f !important;
}

/* カテゴリの記事数（(5) など）の表示調整 */
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-categories .cat-count,
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .widget_categories .cat-count,
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-categories li > span {
  display: inline-block;
  margin-left: 4px;
  font-size: 11px;
  opacity: 0.7;
}

/* 階層カテゴリの子は1段下げる：折り返しで自然に並ぶ */
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-categories li ul,
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .widget_categories ul li ul {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  width: 100% !important;
  margin: 8px 0 0 12px !important;
  padding: 0 !important;
}


/* Content-end CTA outside the top page */
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta {
  margin: 3em 0;
  color: #333;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__ceo {
  position: relative;
  margin: 1.35em 0 1.5em;
  overflow: hidden;
  border-radius: 10px;
  background: #eef2f6;
}
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__ceo-img {
  display: block;
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  object-position: center 32%;
  margin: 0;
  border-radius: 0;
}
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__ceo-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 46px 22px 18px;
  background: linear-gradient(to top, rgba(0, 42, 97, .92) 0%, rgba(0, 42, 97, .72) 42%, rgba(0, 42, 97, 0) 100%);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__ceo-cap span {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: rgba(255, 255, 255, .86);
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__quotes {
  display: grid;
  gap: 8px;
  margin: 0 0 1.45em;
  padding: 18px 20px;
  border: 1px solid rgba(0, 55, 127, 0.18);
  border-radius: 2px;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__quote {
  position: relative;
  margin: 0;
  padding-left: 1.1em;
  color: #333;
  font-weight: 700;
  line-height: 1.65;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__quote::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 0.42em;
  height: 0.42em;
  background: var(--button-main-color, #00377f);
  border-radius: 50%;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__lead {
  margin: 0 0 1.15em;
  color: #333;
  line-height: 1.9;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__lead-strong {
  color: #333;
  font-weight: 700;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content ul.vg-after-content-cta__points {
  display: grid;
  gap: 8px;
  margin: 1.4em 0;
  padding: 18px 20px;
  list-style: none !important;
  background: #fafcfd;
  border: 1px solid rgba(0, 55, 127, 0.18);
  border-radius: 10px;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__points li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  margin: 0;
  padding: 0;
  color: #333;
  font-weight: 700;
  line-height: 1.65;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__points li::before {
  display: none !important;
  content: none !important;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__points .material-icons-round {
  margin-top: 0.1em;
  color: var(--button-main-color, #00377f);
  font-size: 19px;
  line-height: 1;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__note {
  margin: 1.35em 0 1.1em;
  color: #333;
  line-height: 1.85;
}

@media (max-width: 767px) {
  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta {
    margin: 2.4em 0;
  }

  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__image {
    margin: 1.1em 0 1.25em;
    border-radius: 8px;
  }

  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__quotes,
  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content ul.vg-after-content-cta__points {
    padding: 15px 16px;
    border-radius: 8px;
  }

  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__lead,
  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__note {
    line-height: 1.75;
  }
}


/* Article body list background */
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content > ul:not([class]),
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content :not(.vg-before-toc-cta):not(.vg-after-content-cta):not(.p-toc__list):not(.p-toc) > ul:not([class]) {
  background-color: rgba(0, 55, 127, 0.03);
}


/* Match content-end quote list with article body list */
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__quotes {
  gap: 0.28em;
  margin: 0 0 1.45em;
  padding: 18px 22px;
  background-color: rgba(0, 55, 127, 0.03);
  border: 1px solid rgba(0, 55, 127, 0.18);
  border-radius: 10px;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__quote {
  display: grid;
  grid-template-columns: 0.9em minmax(0, 1fr);
  column-gap: 0.75em;
  align-items: baseline;
  padding-left: 0;
  font-weight: 400;
  line-height: 1.65;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__quote::before {
  position: static;
  width: 0.48em;
  height: 0.48em;
  align-self: center;
  background: var(--button-main-color, #00377f);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(0, 55, 127, 0.12);
  transform: translateY(-0.08em);
}

@media (max-width: 767px) {
  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .vg-after-content-cta__quotes {
    padding: 16px 18px;
  }
}


/* Sidebar latest posts card refinement */
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-latest-posts {
  gap: 8px;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-latest-posts > li {
  min-height: 78px;
  grid-template-columns: 102px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 0 12px 0 0 !important;
  border-color: rgba(0, 55, 127, 0.14);
  border-radius: 7px;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-latest-posts__featured-image {
  width: 102px !important;
  aspect-ratio: 4 / 3;
  border-radius: 7px 0 0 7px;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-latest-posts__post-title {
  display: -webkit-box !important;
  color: #333;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.48;
  letter-spacing: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(1.48em * 3);
}

body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-latest-posts > li:hover .wp-block-latest-posts__post-title {
  color: var(--button-main-color, #00377f);
}

@media (max-width: 767px) {
  body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-latest-posts > li {
    min-height: 76px;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
  }

  body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-latest-posts__featured-image {
    width: 96px !important;
  }

  body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-latest-posts__post-title {
    font-size: 0.7rem;
    line-height: 1.45;
    -webkit-line-clamp: 3;
    max-height: calc(1.45em * 3);
  }
}


/* サイドバー新着記事タイトル：line-clamp で省略（...） */
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-latest-posts__post-title {
  display: -webkit-box !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  max-height: none;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.78rem;
  line-height: 1.55;
  padding-bottom: 0;
}

@media (max-width: 767px) {
  body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-latest-posts__post-title {
    -webkit-line-clamp: 3;
    max-height: none;
    line-height: 1.5;
  }
}


/* before-TOC CTA：薄い青の情報エリア（親グラデが透けないよう不透明指定） */
.vg-before-toc-cta__info {
  background-color: #fafcfd !important;
}

.vg-before-toc-cta__points {
  background-color: transparent;
}


/* 目次のリスト（子テーマで組み立てているもの） */
.p-toc .p-toc__list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: vgtoc;
}

.p-toc .p-toc__list > li {
  position: relative;
  padding-left: 1.9em;
  counter-increment: vgtoc;
}

.p-toc .p-toc__list > li + li {
  margin-top: 10px;
}

.p-toc .p-toc__list > li::before {
  content: counter(vgtoc);
  position: absolute;
  left: 0;
  top: 0.08em;
  display: grid;
  place-items: center;
  width: 1.45em;
  height: 1.45em;
  border-radius: 50%;
  background: rgba(0, 55, 127, 0.1);
  font-family: var(--vgf-en, inherit);
  font-size: 0.78em;
  font-weight: 700;
  line-height: 1;
  color: #00377f;
}

.p-toc .p-toc__childList {
  margin: 8px 0 0;
  padding: 0 0 0 0.2em;
  list-style: none;
}

.p-toc .p-toc__childList li {
  position: relative;
  padding-left: 1em;
  font-size: 0.94em;
}

.p-toc .p-toc__childList li + li {
  margin-top: 6px;
}

.p-toc .p-toc__childList li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 1px;
  background: rgba(0, 55, 127, 0.4);
}

.p-toc .p-toc__list a {
  color: #253241;
  text-decoration: none;
  line-height: 1.65;
  transition: color 0.2s;
}

.p-toc .p-toc__list a:hover {
  color: #00377f;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 記事とサイドバーの2カラムは、本文が狭くなりすぎる前に縦積みへ切り替える
   （767px まで2カラムだと、本文もサイドバーも読みにくい幅になる）*/
@media (max-width: 900px) {
  body #content.l-content {
    display: block !important;
  }

  body #content.l-content > #main_content,
  body #content.l-content > #main,
  body #content.l-content > #sidebar {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body #content.l-content > #sidebar {
    margin-top: 56px;
  }

  body #fix_sidebar {
    position: static !important;
  }
}

/* 追尾サイドバー（資料ダウンロードのバナー）
   ・ヘッダーに隠れない位置で止める
   ・親の #sidebar が中身の高さしかないと、記事の途中で追尾が終わってしまう。
     サイドバーの列を本文と同じ高さまで伸ばして、最後まで付いてくるようにする */
@media (min-width: 1024px) {
  .l-content {
    align-items: stretch;
  }

  #sidebar {
    align-self: stretch;
  }

  #fix_sidebar {
    position: sticky;
    /* ヘッダー66px＋その下の帯42px＋余白24px。帯と重ならない位置で止める */
    top: calc(var(--wp-admin--admin-bar--height, 0px) + 132px) !important;
  }
}


/* Sidebar fixed banner radius */
#fix_sidebar .widget_media_image,
#fix_sidebar .wp-block-image,
#fix_sidebar .wp-block-image img {
  border-radius: 10px;
}

#fix_sidebar .widget_media_image,
#fix_sidebar .wp-block-image {
  overflow: hidden;
}

#fix_sidebar .wp-block-image img {
  display: block;
  width: 100%;
}


/* Sidebar media banners and search radius */
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .widget_media_image,
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-image,
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-image img,
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .widget_media_image img {
  border-radius: 10px;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .widget_media_image,
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-image {
  overflow: hidden;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-search__inside-wrapper {
  overflow: hidden;
  border-radius: 10px;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-search__input {
  border-radius: 10px 0 0 10px;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-search__button {
  border-radius: 0 10px 10px 0;
}


/* Round SANGO article buttons consistently */
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .btn.flat2,
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content .btn.grad3,
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content a.btn.flat2,
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content a.btn.grad3 {
  border-radius: var(--vg-top-radius-pill, 4px) !important;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


/* Sidebar banner hover feedback */
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .widget_media_image img,
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-image img {
  transition: filter 0.12s ease;
}

body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .widget_media_image a:hover img,
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-image a:hover img,
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .widget_media_image img:hover,
body :where(#body_wrap):not(.page-template-page-vg-top) .l-sidebar .wp-block-image img:hover {
  filter: brightness(1.06);
}


/* Keep before-TOC CTA soft on mobile */
@media (max-width: 767px) {
  .vg-before-toc-cta__bg,
  .vg-before-toc-cta__content {
    background: #fafcfd !important;
  }

  .vg-before-toc-cta__title-main {
    color: var(--button-main-color, #00377f) !important;
  }

  .vg-before-toc-cta__title-sub {
    color: #333 !important;
  }
}


/* Tablet tuning for before-TOC CTA */
@media (min-width: 768px) and (max-width: 900px) {
  .vg-before-toc-cta__container {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.92fr);
  }

  .vg-before-toc-cta__content {
    padding: 28px 24px;
  }

  .vg-before-toc-cta__title-main {
    font-size: clamp(1.02rem, 2.4vw, 1.16rem);
    line-height: 1.55;
  }

  .vg-before-toc-cta__title-sub {
    margin-top: 10px;
    font-size: 0.9rem;
    line-height: 1.75;
  }

  .vg-before-toc-cta__info {
    padding: 22px 24px 26px;
  }

  .vg-before-toc-cta__points li {
    font-size: 0.92rem;
    line-height: 1.45;
  }
}


/* Remove top padding from before-TOC CTA info on mobile */
@media (max-width: 767px) {
  .vg-before-toc-cta__info {
    padding-top: 0 !important;
  }
}



/* ------------------------------------------------------------
   ブロックエディターで書いた箇条書きは class="wp-block-list" が付くため、
   class なしのとき（上の指定）と同じ見た目になるようにする
   ------------------------------------------------------------ */
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content ul.wp-block-list {
  margin: 1.2em 0 1.8em;
  padding: 20px 24px;
  list-style: none;
  background: rgba(0, 55, 127, 0.03);
  border: 1px solid rgba(0, 55, 127, 0.18);
  border-radius: 2px;
}
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content ul.wp-block-list > li {
  position: relative;
  display: block;
  margin: 0;
  padding-left: 1.34em;
  color: #333;
  line-height: 1.65;
  list-style: none;
}
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content ul.wp-block-list > li + li {
  margin-top: 0.28em;
}
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content ul.wp-block-list > li::before {
  content: "";
  position: absolute;
  left: 0.07em;
  top: 0.6em;
  width: 0.48em;
  height: 0.48em;
  background: var(--button-main-color, #00377f);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(0, 55, 127, 0.12);
}
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content ol.wp-block-list {
  margin: 1.2em 0 1.8em;
  padding-left: 1.9em;
  list-style: decimal outside;
}
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content ol.wp-block-list > li {
  padding-left: 0.25em;
}
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content ol.wp-block-list > li + li {
  margin-top: 0.7em;
}
body :where(#body_wrap):not(.page-template-page-vg-top) .post_content ol.wp-block-list > li::marker {
  color: #00377f;
  font-weight: 700;
}

@media (max-width: 767px) {
  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content ul.wp-block-list {
    padding: 16px 18px;
  }
  body :where(#body_wrap):not(.page-template-page-vg-top) .post_content ul.wp-block-list > li {
    line-height: 1.6;
  }
}

/* スマホ・小さめタブレット（〜766px）は記事下に回るサイドバーにも左右の余白を付ける（2026-10-26）
   767px 以上は .l-container 側で余白が付くので対象外 */
@media (max-width: 766px) {
  /* 上の (max-width: 900px) の padding: 0 !important を上書きするため !important */
  body #content.l-content > #sidebar {
    box-sizing: border-box;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}
