/* 共通の参考書紹介記事テンプレート用スタイル */

.yt-reference-layout {
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 2vw, 2.5rem);
  align-items: center;
  width: 105%;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
  box-sizing: border-box;
  margin: 0 auto;
}

.article-ad {
  display: none;
  width: clamp(160px, 15vw, 220px);
  flex: 0 1 clamp(160px, 15vw, 220px);
}

.article-ad ins.adsbygoogle {
  display: block;
  width: 100%;
}

.article-ad-inline {
  width: min(100%, 360px);
  margin: 3rem auto;
  display: flex;
  justify-content: center;
}

.article-ad-inline--middle {
  margin-block: 3.5rem;
}

.article-ad-inline ins.adsbygoogle {
  display: block;
  width: 100%;
  min-height: 280px;
}

/* --- 関連参考書スライダー --- */
.article-related {
  margin-top: clamp(3rem, 5vw, 4rem);
  padding: clamp(1.75rem, 3vw, 2.5rem);
  border-radius: 22px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(30, 144, 255, 0.12);
  position: relative;
}

.article-related__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(1.25rem, 2vw, 1.75rem);
}

.article-related__title {
  margin: 0;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  color: #0f2a59;
  letter-spacing: 0.02em;
}

.article-related__controls {
  display: flex;
  gap: 0.5rem;
}

.article-related__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid rgba(30, 64, 175, 0.25);
  background-color: #ffffff;
  color: #1e3a8a;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.article-related__nav:hover:not(:disabled),
.article-related__nav:focus-visible:not(:disabled) {
  background-color: #1e3a8a;
  color: #ffffff;
  transform: translateY(-1px);
}

.article-related__nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.article-related__carousel {
  display: flex;
  gap: clamp(1rem, 2vw, 1.5rem);
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(30, 64, 175, 0.35) rgba(148, 163, 184, 0.2);
}

.article-related__carousel::-webkit-scrollbar {
  height: 6px;
}

.article-related__carousel::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.18);
  border-radius: 999px;
}

.article-related__carousel::-webkit-scrollbar-thumb {
  background-color: rgba(30, 64, 175, 0.35);
  border-radius: 999px;
}

.article-related__item {
  flex: 0 0 clamp(160px, 26vw, 210px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: clamp(1rem, 2vw, 1.25rem);
  border-radius: 18px;
  background-color: #ffffff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
  text-decoration: none;
  color: #1f2937;
  scroll-snap-align: start;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-related__item:hover,
.article-related__item:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 16px 28px rgba(37, 99, 235, 0.18);
}

.article-related__thumbnail {
  width: clamp(120px, 20vw, 150px);
  height: clamp(120px, 20vw, 150px);
  border-radius: 14px;
  background-color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.article-related__name {
  margin: 0;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  color: #0f172a;
}

@media (max-width: 768px) {
  .article-related__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .article-related__controls {
    align-self: flex-end;
  }
}

.yt-reference-article {
  width: min(100%, 820px);
  margin: 0;
  padding: 2.5rem 2.25rem 3.25rem;
  background-color: #ffffff;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.08);
  border-radius: 20px;
  box-sizing: border-box;
  overflow-x: auto;
}

@media (min-width: 1200px) {
  .yt-reference-layout {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: clamp(1.5rem, 2vw, 2.5rem);
    max-width: min(1180px, 100%);
  }

  .article-ad {
    display: flex;
    justify-content: center;
  }

  .article-ad--left {
    justify-content: flex-end;
  }

  .article-ad--right {
    justify-content: flex-start;
  }

  .yt-reference-article {
    flex: 1 1 clamp(620px, 52vw, 760px);
    width: clamp(620px, 52vw, 760px);
    max-width: clamp(620px, 52vw, 780px);
  }
}

.article-header {
  position: relative;
  margin-bottom: 2.5rem;
  padding: 2.75rem 2.5rem 2.5rem;
  border-radius: 24px;
  overflow: hidden;
  color: #ffffff;
  background: linear-gradient(135deg, #1e90ff 0%, #406cff 55%, #7c3aed 100%);
  box-shadow: 0 20px 40px rgba(30, 64, 175, 0.2);
}

.article-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.35), transparent 55%),
              radial-gradient(circle at bottom left, rgba(255, 255, 255, 0.25), transparent 50%);
  opacity: 0.9;
  pointer-events: none;
}

.article-header h1 {
  position: relative;
  margin: 0 0 1rem;
  font-size: clamp(2rem, 2.8vw, 2.6rem);
  letter-spacing: 0.02em;
  text-shadow: 0 8px 18px rgba(15, 23, 42, 0.35);
  z-index: 1;
}

.article-header .reference-meta {
  position: relative;
  z-index: 1;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 500;
}

.article-header .reference-meta span {
  position: relative;
  padding-left: 0.9rem;
}

.article-header .reference-meta span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.75);
  transform: translateY(-50%);
}

.article-toc {
  position: relative;
  margin-bottom: 2.75rem;
  padding: 1.75rem 2.2rem 1.85rem;
  border-radius: 22px;
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(30, 144, 255, 0.18);
}

.article-toc::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 18px;
  border: 1px dashed rgba(30, 144, 255, 0.25);
  pointer-events: none;
}

.article-toc h2 {
  position: relative;
  margin: 0 0 1rem;
  font-size: 1.2rem;
  color: #0f2a59;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.article-toc ol {
  position: relative;
  margin: 0;
  padding-left: 1.4rem;
  color: #1f2937;
  z-index: 1;
}

.article-toc li {
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.article-toc a {
  color: #1e3a8a;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.article-toc a:hover,
.article-toc a:focus {
  color: #0f74d1;
  text-decoration: underline;
}

.featured-book {
  width: 100%;
  margin: 2.5rem 0;
}

.featured-book--top {
  margin-bottom: 3rem;
}

.featured-book--bottom {
  margin-top: 3.25rem;
}

.featured-book .book-item {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: linear-gradient(135deg, rgba(248, 250, 255, 0.98), #ffffff);
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 22px;
  padding: 1.65rem 1.85rem;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
  box-sizing: border-box;
}

.featured-book .book-content {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.featured-book .book-image {
  flex: 0 0 140px;
  height: 185px;
  border-radius: 18px;
  border: 1px solid rgba(99, 102, 241, 0.25);
  background: linear-gradient(135deg, rgba(224, 231, 255, 0.75), rgba(224, 242, 254, 0.9));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 6px 16px rgba(79, 70, 229, 0.12);
}

.featured-book .book-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.featured-book .book-info {
  flex: 1 1 auto;
}

.featured-book .book-info h3 {
  margin: 0 0 0.8rem;
  font-size: clamp(1.3rem, 2.1vw, 1.45rem);
  color: #0f2a59;
  letter-spacing: 0.02em;
}

.featured-book .book-info p {
  margin: 0;
  line-height: 1.7;
  color: #1f2937;
  font-size: 0.95rem;
}

.featured-book .book-link {
  align-self: flex-start;
  padding: 0.85rem 2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #fef08a, #facc15);
  color: #1f2937;
  border: 1px solid rgba(234, 179, 8, 0.6);
  box-shadow: 0 12px 22px rgba(250, 204, 21, 0.25);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.featured-book .book-link:hover,
.featured-book .book-link:focus {
  text-decoration: none;
  color: #1f2937;
  box-shadow: 0 16px 26px rgba(250, 204, 21, 0.35);
}

.summary-table {
  margin-bottom: 3rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.summary-table h2,
.youtube-section h2,
.callout-box h2,
.article-latest h2 {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding-left: 1.75rem;
  font-size: clamp(1.25rem, 2.1vw, 1.5rem);
  color: #0d3b66;
  letter-spacing: 0.015em;
}

.summary-table h2::before,
.youtube-section h2::before,
.callout-box h2::before,
.article-latest h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(135deg, #1e90ff, #7c3aed);
  transform: translateY(-50%) rotate(45deg);
  box-shadow: 0 10px 18px rgba(30, 64, 175, 0.2);
}

.summary-table table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  overflow-x: auto;
  table-layout: fixed;
}

.summary-table th,
.summary-table td {
  border: 1px solid #d1d5db;
  padding: 0.85rem;
  text-align: left;
  font-size: 0.95rem;
  word-break: break-word;
}

.summary-table th {
  background-color: #e8f1ff;
  color: #0f172a;
  font-weight: 600;
}

.summary-table tbody tr:nth-child(even) {
  background-color: #f8fbff;
}

.youtube-section {
  margin-bottom: 3rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.youtube-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.youtube-section h2 {
  margin-bottom: 0.85rem;
}

.youtube-section h3 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  color: #1e3a8a;
  font-weight: 700;
  padding-left: 1rem;
  border-left: 3px solid rgba(30, 144, 255, 0.4);
}

.video-meta {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: #475569;
}

.video-meta p {
  margin: 0.25rem 0;
}

.video-meta a {
  color: #0f74d1;
  text-decoration: none;
  font-weight: 600;
}

.video-meta a:hover,
.video-meta a:focus {
  text-decoration: underline;
}

.video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  margin-bottom: 1.25rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-summary {
  background-color: #f9fafb;
  border-radius: 12px;
  padding: 1.25rem;
  line-height: 1.7;
  color: #1f2937;
}

.video-summary strong {
  color: #0f172a;
}

.callout-box {
  background: linear-gradient(135deg, rgba(224, 242, 254, 0.92), rgba(219, 234, 254, 0.85));
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 18px;
  padding: 1.75rem 1.75rem 1.5rem;
  margin: 3.25rem 0 2.25rem;
  box-shadow: 0 12px 30px rgba(30, 64, 175, 0.08);
}

.callout-box ul {
  margin: 0;
  padding-left: 1.2rem;
}

.callout-box li {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

@media (max-width: 1024px) {
  .yt-reference-article {
    padding: 2.25rem 1.75rem 3rem;
  }

  .article-header {
    padding: 2.5rem 2.1rem 2.25rem;
  }
}

@media (min-width: 1100px) {
  .yt-reference-layout {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 2.5rem;
  }

  .article-ad {
    display: flex;
    justify-content: center;
    position: sticky;
    top: 110px;
    width: clamp(200px, 19vw, 360px);
  }

  .yt-reference-article {
    width: min(100%, 820px);
    flex: 0 1 820px;
    padding: 3rem 3rem 3.5rem;
  }
}

.article-latest {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid #e2e8f0;
}

.article-latest ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 3px solid rgba(30, 144, 255, 0.3);
  overflow-x: hidden;
}

.article-latest li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.6rem;
  border-radius: 12px;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.article-latest li:hover {
  background-color: rgba(30, 144, 255, 0.08);
  transform: translateX(4px);
}

.article-latest li:last-child {
  margin-bottom: 0;
}

.article-latest-date {
  color: #1e90ff;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  min-width: 5.6rem;
}

.article-latest a {
  color: #1f2937;
  text-decoration: none;
  font-weight: 600;
  line-height: 1.4;
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.article-latest a:hover,
.article-latest a:focus {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .yt-reference-layout {
    gap: 1.25rem;
  }

  .yt-reference-article {
    padding: 1.5rem 1rem 2.5rem;
  }

  .article-header {
    padding: 2.1rem 1.35rem 1.9rem;
    border-radius: 20px;
  }

  .article-header .reference-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .article-toc {
    padding: 1.35rem 1.2rem 1.45rem;
    border-radius: 16px;
  }

  .video-summary {
    padding: 1rem;
  }

  .article-latest {
    padding-top: 2rem;
  }

  .article-latest ul {
    border-left: none;
  }

  .article-latest li {
    padding: 0.6rem 0;
    margin-bottom: 0.5rem;
    align-items: flex-start;
  }

  .article-latest-date {
    min-width: auto;
  }

  .featured-book {
    margin: 2.1rem 0;
  }

  .featured-book .book-item {
    padding: 1.35rem 1.45rem;
    border-radius: 20px;
  }

  .featured-book .book-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.1rem;
  }

  .featured-book .book-image {
    width: 100%;
    max-width: 240px;
    height: 185px;
    margin: 0 auto;
  }

  .featured-book .book-link {
    width: min(100%, 180px);
    padding: 0.65rem 1.4rem;
    font-size: 0.95rem;
    margin: 0 auto;
    text-align: center;
    display: inline-flex;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .yt-reference-layout {
    align-items: stretch;
  }

  .yt-reference-article {
    padding: 1.35rem 0.85rem 2.35rem;
    border-radius: 18px;
  }

  .article-header {
    padding: 1.85rem 1.05rem 1.65rem;
  }

  .article-header h1 {
    font-size: clamp(1.6rem, 6vw, 2rem);
  }

  .article-header .reference-meta {
    font-size: 0.9rem;
  }

  .article-toc {
    padding: 1.15rem 0.95rem 1.3rem;
  }

  .article-toc h2 {
    font-size: 1.05rem;
  }

  .article-toc ol {
    padding-left: 0.85rem;
  }

  .summary-table table {
    min-width: 0;
  }

  .summary-table table,
  .summary-table thead,
  .summary-table tbody,
  .summary-table th,
  .summary-table td,
  .summary-table tr {
    display: block;
    width: 100%;
  }

  .summary-table thead {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
  }

  .summary-table tr {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    background-color: #ffffff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.07);
  }

  .summary-table tr:last-child {
    margin-bottom: 0;
  }

  .summary-table td {
    border: none;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.6rem 0;
    position: relative;
    font-size: 0.92rem;
    color: #1f2937;
    word-break: break-word;
    overflow-wrap: anywhere;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }

  .summary-table td:last-child {
    border-bottom: none;
  }

  .summary-table td::before {
    content: attr(data-label);
    position: static;
    transform: none;
    font-weight: 600;
    color: #0f172a;
    font-size: 0.78rem;
    letter-spacing: 0.01em;
    text-transform: none;
    white-space: normal;
    line-height: 1.45;
    display: block;
  }
}

@media (max-width: 420px) {
  .summary-table td {
    padding: 0.55rem 0;
    font-size: 0.9rem;
  }

  .summary-table td::before {
    font-size: 0.74rem;
  }
}