/* ==============================================
   SHARED SUBPAGE STYLES
   Pages 02–10 (everything except 01_top.html)
   ============================================== */

/* --- Subpage Background: white → #F8F8FC gradient --- */
body {
  background: linear-gradient(180deg, #FFFFFF 0%, #F8F8FC 520px) no-repeat;
  background-color: #F8F8FC;
}

/* --- Section Label: Line type (overrides base.css dot type) --- */
.section-label {
  font-family: var(--f-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- News Badge (detail page header) --- */
/* カラー定義は base.css の .news-badge--* / .news-preview-badge--* で共有 */
.news-badge {
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.04em;
  padding: 4px 14px;
  border-radius: var(--r-full);
}

/* --- Text Link --- */
.text-link {
  font-family: var(--f-ja);
  font-size: 16px;
  font-weight: 500;
  color: var(--c-accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.3s var(--ease);
}
.text-link-back {
  color: var(--c-text-2);
  transition: color 0.3s var(--ease);
}
.text-link-back:hover { color: var(--c-accent); }

/* --- Page Hero --- */
.page-hero {
  padding: 136px 0 40px;
  background: transparent;
  position: relative;
  overflow: hidden;
}
.page-hero-inner {
  position: relative;
  z-index: 1;
}
.page-hero .section-label {
  justify-content: flex-start;
}
.page-hero-title {
  font-family: var(--f-ja);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.4;
  color: var(--c-text);
  margin-bottom: 16px;
}
.page-hero-sub {
  font-size: 16px;
  color: var(--c-text-2);
  line-height: var(--lh-body);
}
/* All pages now use .section-label + .page-hero-title + .page-hero-sub */

/* --- Breadcrumb (detail pages: 05, 07, 09) --- */
.breadcrumb-bar {
  padding-top: 100px;
  padding-bottom: 0;
}
.breadcrumb {
  font-family: var(--f-body);
  font-size: 14px;
  color: var(--c-text-3);
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--c-text-2); }
.breadcrumb a:hover { color: var(--c-accent); }
.breadcrumb .sep { margin: 0 8px; color: var(--c-border); font-size: 12px; }
.breadcrumb .current { color: var(--c-text-3); }

/* --- Card Meta (list pages: 04, 06) --- */
.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

/* --- List Section + Card Grid (list pages: 04, 06, 08) --- */
.list-section {
  padding: 40px 0 100px;
  background: transparent;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* --- Filter Tabs (06, 08) --- */
.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.filter-tab {
  font-family: var(--f-ja);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.02em;
  padding: 8px 22px;
  border-radius: var(--r-full);
  border: 1px solid var(--c-border);
  color: var(--c-text-2);
  background: var(--c-surface);
  cursor: pointer;
  transition: color 0.3s var(--ease), background 0.3s var(--ease);
}
.filter-tab:hover {
  border-color: var(--c-accent-line);
  color: var(--c-text);
}
.filter-tab.is-active {
  background: var(--c-dark);
  color: var(--c-text-inv);
  border-color: var(--c-dark);
  font-weight: 500;
}

/* --- Pagination (list pages: 04, 06, 08) --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 64px;
}
.pagination a {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-body);
  font-size: 16px;
  font-weight: 500;
  color: var(--c-text-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}
.pagination a:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
  background: var(--c-accent-muted);
}
.pagination a.is-active {
  background: var(--c-dark);
  color: var(--c-text-inv);
  border-color: var(--c-dark);
}
.pagination a.pg-arrow {
  color: var(--c-text-3);
  font-size: 16px;
}
.pagination a.pg-arrow:hover {
  color: var(--c-accent);
}

/* --- Article Meta (detail pages: 05, 07) --- */
.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--f-body);
  font-size: 14px;
  color: var(--c-text-3);
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.article-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--c-border);
}

/* --- Article Layout (detail pages: 05, 07) --- */
.article-layout {
  display: flex;
  gap: 64px;
  padding-bottom: 24px;
}
.article-main {
  flex: 1;
  min-width: 0;
  max-width: 720px;
}
.article-title {
  font-family: var(--f-ja);
  font-size: clamp(26px, 3.5vw, 36px);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.03em;
  color: var(--c-text);
  margin-bottom: 16px;
}

/* --- Article Subtitle (works, news, magazine detail pages) --- */
/* タイトル直下に表示。一覧・サムネイルには出力しない。
   未入力時はPHP側で要素ごと非出力（:emptyは保険） */
.article-subtitle {
  font-family: var(--f-body);
  font-size: 16px;
  font-weight: 700;
  line-height: var(--lh-body);
  color: var(--c-text-2);
  margin-bottom: 28px;
}
.article-subtitle:empty { display: none; }

/* --- Article Body Typography (05, 07, 09) --- */
.article-body,
.news-body {
  font-family: var(--f-ja);
  font-size: 16px;
  line-height: var(--lh-body);
  color: var(--c-text-2);
  overflow-wrap: break-word;
}
.article-body h2,
.news-body h2 {
  font-family: var(--f-ja);
  font-size: 24px;
  font-weight: 700;
  color: var(--c-text);
  margin: 56px 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--c-border);
  letter-spacing: 0.03em;
  line-height: 1.5;
}
.article-body h2:first-child,
.news-body h2:first-child { margin-top: 0; }
.article-body h3,
.news-body h3 {
  font-family: var(--f-ja);
  font-size: 18px;
  font-weight: 700;
  color: var(--c-text);
  margin: 40px 0 16px;
  line-height: 1.5;
}
.news-body h3:first-child { margin-top: 0; }
.article-body p,
.news-body p { margin-bottom: 24px; }
.article-body ul,
.news-body ul {
  margin: 0 0 24px 0;
  padding-left: 0;
}
.article-body li,
.news-body li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  color: var(--c-text-2);
}
.article-body li::before,
.news-body li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-accent);
  opacity: 0.6;
}

/* Ordered List */
.article-body ol,
.news-body ol {
  margin: 0 0 24px 0;
  padding-left: 0;
  counter-reset: ol-counter;
  list-style: none;
}
.article-body ol > li,
.news-body ol > li {
  counter-increment: ol-counter;
  position: relative;
  padding-left: 28px;
  margin-bottom: 8px;
  color: var(--c-text-2);
}
.article-body ol > li::before,
.news-body ol > li::before {
  content: counter(ol-counter) '.';
  position: absolute;
  left: 0;
  top: 3px;
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  opacity: 1;
  font-family: var(--f-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--c-accent);
}

/* Inline links */
.article-body a:not(.btn),
.news-body a:not(.btn) {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.3s var(--ease);
  word-break: break-all;
  overflow-wrap: break-word;
}
.article-body a:not(.btn):hover,
.news-body a:not(.btn):hover {
  text-decoration: none;
}
/* 外部リンクアイコン（target="_blank" に自動付与） */
.article-body a[target="_blank"]:not(.btn)::after,
.news-body a[target="_blank"]:not(.btn)::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 3px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  vertical-align: middle;
  position: relative;
  top: -1px;
  flex-shrink: 0;
}

/* Blockquote */
.article-body blockquote,
.news-body blockquote {
  position: relative;
  background: var(--c-bg-alt);
  border-left: 3px solid var(--c-accent);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 32px 36px;
  margin: 32px 0;
  text-align: left;
}
.article-body blockquote p,
.news-body blockquote p {
  font-family: var(--f-ja);
  font-size: 16px;
  color: var(--c-text);
  line-height: var(--lh-body);
  margin-bottom: 0;
  text-align: left;
}
.article-body .annotation,
.news-body .annotation {
  display: block;
  font-size: 13px;
  color: var(--c-text-3);
  margin-top: 8px;
  text-align: left;
}
.article-body blockquote cite,
.news-body blockquote cite {
  display: block;
  font-size: 12px;
  color: var(--c-text-3);
  font-style: normal;
  font-weight: 500;
  margin-top: 12px;
}

/* --- Article Point Box --- */
.article-point-box {
  background: var(--c-accent-muted);
  border-left: 3px solid var(--c-accent);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 28px 32px;
  margin: 32px 0;
}
.article-point-title {
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--c-accent);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}
.article-point-box p {
  font-size: 15px !important;
  color: var(--c-text-2) !important;
  line-height: 1.8 !important;
  margin: 0 !important;
}

/* --- News Contact Box (Common) --- */
.news-contact {
  background: var(--c-accent-muted);
  border-radius: var(--r-md);
  padding: 28px 32px;
  margin: 32px 0;
}
.news-contact p {
  font-size: 16px !important;
  color: var(--c-text-2) !important;
  line-height: 1.8 !important;
  margin-bottom: 0 !important;
}
.news-contact strong {
  color: var(--c-text) !important;
  font-weight: 700 !important;
}

/* --- Figure & Caption --- */
.article-body figure,
.news-body figure {
  margin: 32px 0;
}
.article-body figure img,
.news-body figure img {
  width: 100%;
  height: auto;
  border-radius: var(--r-md);
  display: block;
}
.article-body figcaption,
.news-body figcaption {
  font-size: 13px;
  color: var(--c-text-3);
  margin-top: 12px;
  text-align: center;
  line-height: 1.6;
}

/* --- Table Scroll Wrapper --- */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 32px 0;
  /* スクロール余地があるときだけ端にシャドウが出る純CSSヒント */
  background-image:
    linear-gradient(to right, #fff, transparent),
    linear-gradient(to left,  #fff, transparent),
    radial-gradient(farthest-side at 0 50%,   rgba(0,0,0,.07), transparent),
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.07), transparent);
  background-position: left, right, left, right;
  background-size: 32px 100%, 32px 100%, 14px 100%, 14px 100%;
  background-repeat: no-repeat;
  background-attachment: local, local, scroll, scroll;
}
.article-body .table-scroll table,
.news-body .table-scroll table {
  margin: 0;
  width: auto;
  min-width: 100%;
}
@media (max-width: 768px) {
  .table-scroll th,
  .table-scroll td {
    min-width: 118px;
  }
}
.table-scroll.has-scroll {
  padding-bottom: 8px;
}

/* --- Table --- */
.article-body table,
.news-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 32px 0;
}
.article-body table th,
.article-body table td,
.news-body table th,
.news-body table td {
  padding: 12px 16px;
  border: 1px solid var(--c-border-light);
  text-align: left;
}
.article-body table th,
.news-body table th {
  background: var(--c-accent-muted);
  border-bottom: 2px solid var(--c-accent-border);
  font-weight: 600;
  color: var(--c-text);
  font-size: 14px;
}
.article-body table td,
.news-body table td {
  background: #fff;
  color: var(--c-text-2);
  word-break: break-all;
  overflow-wrap: break-word;
}

/* --- Note (注釈・番号付き注釈) --- */
.article-body .article-note,
.news-body .article-note {
  list-style: none;
  padding: 16px 0 0;
  margin: 32px 0 40px;
  border-top: 1px solid var(--c-border-light);
}
.article-body .article-note > li,
.news-body .article-note > li {
  position: relative;
  padding-left: 16px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--c-text-2);
  margin-bottom: 6px;
}
.article-body .article-note > li::before,
.news-body .article-note > li::before {
  content: '＊';
  position: absolute;
  left: 0;
  top: 0;
  width: auto;
  height: auto;
  background: none;
  border-radius: 0;
  opacity: 1;
  color: inherit;
  font-weight: normal;
}
/* 番号付き注釈 */
.article-body .article-note--numbered,
.news-body .article-note--numbered {
  counter-reset: note-counter;
}
.article-body .article-note--numbered > li,
.news-body .article-note--numbered > li {
  list-style: none;
  counter-increment: note-counter;
  padding-left: 28px;
}
.article-body .article-note--numbered > li::before,
.news-body .article-note--numbered > li::before {
  content: '＊' counter(note-counter);
}

/* --- Box / Background (枠・背景) --- */
.article-box {
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 28px 32px;
  margin: 32px 0;
}
.article-bg {
  background: var(--c-accent-muted);
  border-radius: var(--r-md);
  padding: 28px 32px;
  margin: 32px 0;
}
.article-box > *:last-child,
.article-bg > *:last-child {
  margin-bottom: 0;
}

/* --- Sidebar (detail pages: 05, 07) --- */
.article-sidebar {
  width: 280px;
  flex-shrink: 0;
}
.sidebar-sticky {
  position: sticky;
  top: 100px;
}
.sidebar-block {
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 28px;
  margin-bottom: 24px;
  background: var(--c-surface);
}
.sidebar-block-cta {
  background: var(--c-accent-muted);
  border-color: var(--c-accent-line);
}
.sidebar-title {
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-text-3);
  margin-bottom: 16px;
}
.sidebar-block-cta .sidebar-title {
  color: var(--c-accent);
}
.sidebar-desc {
  font-size: 14px;
  color: var(--c-text-2);
  line-height: 1.8;
  margin-bottom: 24px;
}
.sidebar-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 12px 20px;
  border-radius: var(--r-full);
  font-family: var(--f-ja);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  transition: all 0.3s var(--ease);
}
.sidebar-btn:last-child { margin-bottom: 0; }
.sidebar-btn-primary {
  background: var(--c-accent);
  color: var(--c-text-inv);
}
.sidebar-btn-primary:hover {
  background: var(--c-dark-card);
  box-shadow: 0 4px 16px rgba(0,179,174,0.20);
}
.sidebar-btn-outline {
  background: var(--c-surface);
  color: var(--c-accent);
  border: 1px solid var(--c-accent-line);
}
.sidebar-btn-outline:hover {
  border-color: var(--c-accent);
}

/* --- Related Section (detail pages: 05, 07, 09) --- */
.related-section {
  background: transparent;
  padding: 100px 0;
}
.related-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 48px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
/* Uses .insight-card from base.css */

/* --- Article Placeholder (detail pages: 05, 07) --- */
.article-placeholder {
  width: 100%;
  height: 280px;
  background: var(--c-surface);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-3);
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin: 32px 0;
  position: relative;
  overflow: hidden;
}

/* --- Share Icon (07, 09) --- */
.share-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  background: var(--c-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-3);
  cursor: pointer;
}
.share-icon:hover {
  background: var(--c-dark);
  color: var(--c-text-inv);
}

/* --- Share Bar (detail pages: 07, 09) --- */
.share-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 0;
  border-top: 1px solid var(--c-border);
  margin-top: 56px;
  margin-bottom: 40px;
}
.share-bar-label {
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-3);
  margin-right: 4px;
}

/* --- Inline CTA (detail pages: 07, 09) --- */
.inline-cta {
  background: linear-gradient(135deg, #0D9488, #0F766E);
  border-radius: var(--r-lg);
  padding: 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.inline-cta-content { position: relative; }
.inline-cta h4 {
  font-family: var(--f-ja);
  font-weight: 700;
  font-size: 20px;
  color: var(--c-text-inv);
  margin-bottom: 8px;
  letter-spacing: 0.03em;
}
.inline-cta p {
  font-size: 16px;
  color: var(--c-text-inv-2);
  margin-bottom: 24px;
}
.inline-cta-btns {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* ==============================================
   SHARED SUBPAGE RESPONSIVE
   ============================================== */
@media (max-width: 1024px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .article-layout { gap: 40px; }
  .article-sidebar { width: 240px; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .page-hero { padding: 128px 0 24px; }
  .page-hero-title { font-size: 28px; }

  .breadcrumb-bar { padding-top: 88px; }

  .list-section { padding: 24px 0 80px; }
  .card-grid { grid-template-columns: 1fr; gap: 24px; }

  .filter-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; -webkit-overflow-scrolling: touch; gap: 8px; }
  .filter-tab { flex-shrink: 0; font-size: 14px; padding: 8px 18px; }

  .article-layout { flex-direction: column; gap: 48px; padding-bottom: 16px; }
  .article-sidebar { width: 100%; position: static; }
  .sidebar-sticky { position: static; }
  .sidebar-block { margin-bottom: 16px; }
  /* SP: サイドバーのCTAはインラインCTAと重複するため非表示 */
  .sidebar-block-cta { display: none; }

  .article-meta { gap: 8px; }
  .article-title { font-size: 24px; }
  .article-subtitle { margin-bottom: 20px; }
  .article-body { font-size: 16px; line-height: 1.9; }
  .article-body h2,
  .news-body h2 { font-size: 20px; margin: 40px 0 16px; }
  .article-body h3 { font-size: 16px; }
  .article-body blockquote,
  .news-body blockquote { padding: 24px 28px; }
  .news-body { font-size: 16px; line-height: 1.9; }
  .news-body h3 { font-size: 16px; margin: 32px 0 12px; }

  .related-section { padding: 80px 0; }
  .related-grid { grid-template-columns: 1fr; }
  .related-header { flex-direction: column; align-items: flex-start; gap: 16px; }

  .article-placeholder { height: 200px; }

  .inline-cta { padding: 36px 24px; }
  .inline-cta-btns { flex-direction: column; }
}

@media (max-width: 480px) {
  .pagination a { width: 36px; height: 36px; font-size: 12px; }
}
