.article-detail-shell {
  color: #414141;
  font-family: "Noto Sans JP", "Noto Sans", sans-serif;
}

.article-detail-page {
  width: min(1200px, calc(100% - 48px));
  flex: 1 0 auto;
  margin: 0 auto;
  padding: 17px 0 60px;
}

.article-detail-page .public-breadcrumb {
  overflow: hidden;
  white-space: nowrap;
}

.article-detail-page .public-breadcrumb span[aria-current="page"] {
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-detail-heading {
  width: 800px;
  margin-top: 43px;
}

.article-detail-heading h1 {
  margin: 0;
  color: #414141;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.6;
}

.article-detail-author {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 12px 0 0;
  color: #7c7c7c;
  font-size: 14px;
  line-height: 1.6;
}

.article-detail-author :is(span, a) {
  color: #414141;
  font-weight: 700;
}

.article-detail-author a {
  color: var(--color-brand);
  text-decoration: none;
}

.article-detail-author a:hover {
  text-decoration: underline;
}

.article-detail-author small {
  display: inline-flex;
  min-height: 18px;
  align-items: center;
  border-radius: 3px;
  background: #f1f1f1;
  color: #414141;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
}

.article-detail-taxonomy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.article-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 800px) 350px;
  gap: 52px;
  align-items: start;
  margin-top: 20px;
}

.article-detail-main-column {
  min-width: 0;
}

.article-detail-cover {
  width: 800px;
  max-width: 100%;
  height: 450px;
  margin: 0;
  overflow: hidden;
  background: #7c7c7c;
}

.article-detail-cover--sp {
  display: none;
}

.article-detail-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 本文の共通スタイルは common.css の .public-rich-text。
   ここでは記事詳細固有の幅・余白と、見出しの意匠・目次アンカーの着地位置だけを指定する */
.article-detail-content {
  width: 800px;
  max-width: 100%;
  margin-top: 34px;
}

/* 記事の h2 は左に赤帯、下に罫線を敷く */
.article-detail-content h2 {
  min-height: 46px;
  border-bottom: 1px solid #414141;
  border-left: 10px solid var(--color-brand);
  line-height: 45px;
  padding-left: 11px;
  scroll-margin-top: 84px;
}

/* 目次から飛んだときに追従ヘッダーへ潜り込まないようにする */
.article-detail-content h3 {
  scroll-margin-top: 84px;
}

.article-detail-registration-wall {
  display: flex;
  width: 800px;
  max-width: 100%;
  min-height: 156px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 35px;
  border: 1px solid var(--public-warm-border);
  border-radius: 6px;
  background: var(--public-warm-background);
  padding: 24px;
  text-align: center;
}

.article-detail-registration-wall__lock {
  display: block;
  width: 16px;
  height: 16px;
  margin-bottom: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23414141' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
}

.article-detail-registration-wall h2 {
  margin: 0;
  color: #414141;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
}

.article-detail-registration-wall p {
  margin: 4px 0 14px;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.6;
}

.article-detail-registration-wall__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.article-detail-registration-wall__login {
  color: var(--color-brand);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.article-detail-registration-wall__login:hover {
  text-decoration: underline;
}

/* 法人ページへの導線カード。囲みは最新記事カードと同じ白地＋淡い枠、
   ロゴ面と誘導文言だけに暖色とブランド色を効かせる */
.article-detail-corporate {
  display: flex;
  width: 800px;
  max-width: 100%;
  align-items: center;
  gap: 18px;
  margin-top: 56px;
  border: 1px solid var(--public-warm-border);
  border-radius: 6px;
  background: #ffffff;
  color: #414141;
  padding: 18px 20px;
  text-decoration: none;
  transition: border-color 0.16s ease;
}

.article-detail-corporate:hover {
  border-color: var(--public-warm-muted);
}

.article-detail-corporate:hover strong {
  text-decoration: underline;
}

.article-detail-corporate__logo {
  display: inline-flex;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--public-warm-border);
  border-radius: 6px;
  background: var(--public-warm-background);
}

.article-detail-corporate__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.article-detail-corporate__logo-initial {
  color: var(--public-warm-muted);
  font-size: 24px;
  font-weight: 800;
}

.article-detail-corporate__body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.article-detail-corporate strong {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
}

/* 共通部品の .more-link は SP でセクション右下へ絶対配置される見出し専用なので、
   同じ赤丸矢印の意匠だけをカード内に持たせる */
.article-detail-corporate__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #555555;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.article-detail-corporate__link::after {
  content: "";
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--color-brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 10'%3E%3Cpath d='m2 1 4 4-4 4' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5'/%3E%3C/svg%3E") center / 5px 7px no-repeat;
}

.article-detail-sidebar {
  min-width: 0;
}

.article-detail-toc {
  width: 350px;
  max-width: 100%;
  max-height: 330px;
  overflow-y: auto;
  border: 1px solid var(--public-warm-border);
  background: var(--public-warm-background);
  padding: 12px 16px;
}

.article-detail-latest h2 {
  margin: 0;
  color: #414141;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.6;
}

.article-detail-toc summary {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  list-style: none;
  cursor: pointer;
}

.article-detail-toc summary::before {
  content: "";
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  background: currentColor;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='8' x2='21' y1='6' y2='6'/%3E%3Cline x1='8' x2='21' y1='12' y2='12'/%3E%3Cline x1='8' x2='21' y1='18' y2='18'/%3E%3Cline x1='3' x2='3.01' y1='6' y2='6'/%3E%3Cline x1='3' x2='3.01' y1='12' y2='12'/%3E%3Cline x1='3' x2='3.01' y1='18' y2='18'/%3E%3C/svg%3E");
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

.article-detail-toc summary::after {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  margin-left: auto;
  border-right: 1.5px solid var(--color-muted);
  border-bottom: 1.5px solid var(--color-muted);
  content: "";
  transform: rotate(-45deg);
  transition: transform 0.18s ease;
}

.article-detail-toc[open] summary::after {
  transform: rotate(45deg);
}

.article-detail-toc summary::-webkit-details-marker {
  display: none;
}

.article-detail-toc ol {
  margin: 10px 0 0;
  list-style: none;
  padding: 0;
}

.article-detail-toc li {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.9;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-detail-toc__item--sub {
  padding-left: 1em;
}

.article-detail-toc a {
  color: #737373;
  text-decoration: none;
}

.article-detail-toc a:hover {
  color: #414141;
  text-decoration: underline;
}

.article-detail-latest {
  margin-top: 25px;
}

.article-detail-latest__list {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.article-detail-latest-card {
  display: flex;
  min-height: 332px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e4e4e4;
  background: #ffffff;
  color: #414141;
  text-decoration: none;
}

.article-detail-latest-card__cover {
  display: flex;
  width: 100%;
  height: 200px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #7c7c7c;
}

.article-detail-latest-card__cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-detail-latest-card__cover .article-detail-latest-card__cover-placeholder {
  width: 24px;
  height: 24px;
  margin: auto;
  opacity: 0.45;
  object-fit: contain;
}

.article-detail-latest-card .category-pill--sm {
  align-self: flex-start;
  margin: 14px 14px 0;
}

.article-detail-latest-card strong {
  display: -webkit-box;
  overflow: hidden;
  margin: 7px 14px 0;
  color: #414141;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.article-detail-latest-card__meta {
  display: flex;
  flex-direction: column;
  margin: auto 14px 12px;
  color: #939393;
  font-size: 12px;
  line-height: 16px;
}

@media (max-width: 1240px) {
  .article-detail-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 34px;
  }

  .article-detail-toc {
    width: 300px;
  }
}

@media (max-width: 900px) {
  .article-detail-page {
    width: min(800px, calc(100% - 32px));
  }

  .article-detail-heading {
    width: 100%;
  }

  /* 2カラム時の align-items: start は縦積みでは「横方向に content 幅まで縮める」意味に
     変わるため、明示的な幅を持たない子（最新記事）が縮む。stretch で打ち消す */
  .article-detail-layout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 38px;
  }

  .article-detail-main-column,
  .article-detail-sidebar,
  .article-detail-toc {
    width: 100%;
  }

  .article-detail-sidebar {
    display: contents;
  }

  .article-detail-toc {
    order: -1;
  }

  .article-detail-latest__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .article-detail-latest-card {
    min-height: 276px;
  }

  .article-detail-latest-card__cover {
    height: 150px;
  }
}

@media (max-width: 600px) {
  .article-detail-page {
    width: 100%;
    padding: 0 15px 44px;
  }

  .article-detail-page .public-breadcrumb {
    height: 46px;
    margin: 0 -15px;
    overflow: hidden;
    padding: 0 15px;
    white-space: nowrap;
  }

  .article-detail-cover--sp {
    display: block;
    width: calc(100% + 30px);
    height: 200px;
    margin: 0 -15px;
  }

  .article-detail-cover--pc {
    display: none;
  }

  .article-detail-heading {
    margin-top: 15px;
  }

  .article-detail-heading h1 {
    font-size: 22px;
    line-height: 1.6;
  }

  .article-detail-author {
    gap: 3px 10px;
    font-size: 12px;
  }

  .article-detail-author small {
    min-height: 16px;
    font-size: 9px;
  }

  .article-detail-taxonomy {
    gap: 4px;
    margin-top: 10px;
  }

  .article-detail-taxonomy .tag-pill {
    background-position: 6px center;
    background-size: 8px 10px;
    font-size: 10px;
    line-height: 13px;
    padding: 2px 6px 2px 18px;
  }

  .article-detail-layout {
    gap: 26px;
    margin-top: 26px;
  }

  .article-detail-content {
    margin-top: 17px;
  }

  .article-detail-content h2 {
    min-height: 38px;
    line-height: 37px;
    padding-left: 9px;
    scroll-margin-top: 70px;
  }

  .article-detail-content h3 {
    scroll-margin-top: 70px;
  }

  .article-detail-toc {
    max-height: none;
    margin: 0;
    padding: 8px 20px;
  }

  .article-detail-toc summary {
    font-size: 14px;
  }

  .article-detail-toc li {
    font-size: 14px;
  }

  .article-detail-latest {
    margin-top: 0;
  }

  .article-detail-latest h2 {
    font-size: 14px;
  }

  .article-detail-latest__list {
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 24px;
    border-top: 1px solid #dedede;
  }

  .article-detail-latest-card {
    display: block;
    min-height: 100px;
    overflow: visible;
    border: 0;
    border-bottom: 1px solid #dedede;
    background: transparent;
    padding: 10px 135px 10px 0;
  }

  .article-detail-latest-card__cover {
    position: absolute;
    top: 10px;
    right: 0;
    width: 120px;
    height: 80px;
  }

  .article-detail-latest-card .category-pill--sm {
    position: static;
    margin: 0;
  }

  .article-detail-latest-card strong {
    display: block;
    min-height: 34px;
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.45;
  }

  .article-detail-latest-card__meta {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-size: 10px;
    line-height: 13px;
  }

  .article-detail-latest-card {
    position: relative;
  }

  .article-detail-corporate {
    gap: 14px;
    margin-top: 30px;
    padding: 14px 16px;
  }

  .article-detail-corporate__logo {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
  }

  .article-detail-corporate__logo-initial {
    font-size: 21px;
  }

  .article-detail-corporate strong {
    font-size: 16px;
  }

  .article-detail-corporate__link {
    font-size: 12px;
  }

  .article-detail-corporate__link::after {
    width: 14px;
    height: 14px;
  }

  .article-detail-registration-wall {
    min-height: 145px;
    padding: 16px;
  }

  .article-detail-registration-wall p {
    margin-bottom: 4px;
    font-size: 11px;
  }
}
