/* ==========================================================================
   リニューアル案A — 下層ページ共通（TOP以外で読み込む）
   デザイン正本: clients/barrel-polish/design/2026-10-06_renewal/sub_common.py
   ページ固有のスタイルは rn-page-{名前}.css に分ける
   ========================================================================== */

/* 全幅の帯の横はみ出しはページ側で切る */
body:not(.home) { overflow-x: clip; }

/* 既存のリセットより弱い詳細度で、rn 部品の余白を素直に効かせる */
:where(.rn-page) :where(h1, h2, h3, h4, p, figure, ul, ol, dl, dd) { margin: 0; padding: 0; }
:where(.rn-page) :where(ul, ol) { list-style: none; }
:where(.rn-page) a { text-decoration: none; color: inherit; }
:where(.rn-page) img { display: block; max-width: 100%; }
.rn-page .rn-inner { position: relative; z-index: 1; }
.rn-page .rn-link--dark { color: #fff; border-bottom-color: rgba(255, 255, 255, 0.6); }
.rn-page .rn-link--dark .rn-arrow { color: var(--rn-gold-on-dark); }

/* --------------------------------------------------------------------------
   ページタイトル帯（template-parts/rn/sub-hero.php）
   切り口: 上端 x=1010/1440、60°で下へ（高さ460px）
   -------------------------------------------------------------------------- */
.rn-hero {
  --hero-h: 460px;
  --hero-top: 70.1vw;
  --hero-bot: calc(var(--hero-top) - var(--hero-h) * 0.57735);
  position: relative; min-height: var(--hero-h); background: var(--rn-ink); color: #fff; overflow: hidden;
}
.rn-hero__wm { left: -10px; bottom: -30px; font-size: clamp(120px, 15vw, 220px); -webkit-text-stroke-color: rgba(255, 255, 255, 0.07); }
.rn-hero__photo { position: absolute; inset: 0; clip-path: polygon(var(--hero-top) 0, 100% 0, 100% 100%, var(--hero-bot) 100%); }
.rn-hero__wipe { position: absolute; inset: 0; }
.rn-hero__photo img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.rn-hero__line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.rn-hero__inner { padding-top: 36px; padding-bottom: 64px; }
.rn-hero__body { max-width: min(760px, calc(var(--hero-bot) - var(--rn-pad) - 60px)); margin-top: 52px; }
.rn-hero--nophoto .rn-hero__body { max-width: 900px; }
.rn-hero .rn-label { color: var(--rn-gold-on-dark); }
.rn-hero__title { margin-top: 26px; font-size: clamp(34px, 4.4vw, 64px); line-height: 1.3; color: #fff; word-break: auto-phrase; }
.rn-hero--m .rn-hero__title { font-size: clamp(28px, 3vw, 44px); line-height: 1.45; text-wrap: balance; }
.rn-hero__lead { margin-top: 22px; font-size: 15px; line-height: 2; color: rgba(255, 255, 255, 0.84); }
.rn-hero__meta { margin-top: 22px; font-size: 13px; color: rgba(255, 255, 255, 0.72); }
.rn-hero__meta a { color: #fff; }

/* パンくず（既存の .im-breadcrumbs を帯の中で等幅の注記に） */
.rn-hero .im-breadcrumbs { margin: 0; padding: 0; background: none; border: 0; }
.rn-hero .im-breadcrumbs__list { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0; padding: 0; list-style: none; font-family: var(--rn-font-mono); font-size: 11px; letter-spacing: .06em; color: rgba(255, 255, 255, 0.7); }
.rn-hero .im-breadcrumbs__item { display: inline-flex; align-items: center; }
.rn-hero .im-breadcrumbs__item + .im-breadcrumbs__item::before { content: "/"; margin: 0 10px; color: rgba(255, 255, 255, 0.35); }
.rn-hero .im-breadcrumbs__item a { color: rgba(255, 255, 255, 0.7); text-decoration: none; }
.rn-hero .im-breadcrumbs__item a:hover { color: #fff; }
.rn-hero .im-breadcrumbs__item [aria-current] { color: #fff; }

/* ページ内リンクの帯 */
.rn-anchors { background: var(--rn-ink2); border-top: 1px solid rgba(179, 143, 45, 0.5); color: #fff; }
.rn-anchors__inner { display: flex; overflow-x: auto; scrollbar-width: none; }
.rn-anchors__inner::-webkit-scrollbar { display: none; }
.rn-anchors a { display: flex; align-items: center; gap: 12px; flex-shrink: 0; min-height: 64px; padding: 0 26px; border-left: 1px solid rgba(255, 255, 255, 0.12); font-size: 14px; font-weight: 700; color: #fff; text-decoration: none; }
.rn-anchors a:last-child { border-right: 1px solid rgba(255, 255, 255, 0.12); }
.rn-anchors a span { font-size: 11px; color: var(--rn-gold-on-dark); }
.rn-anchors a svg { width: 12px; height: 12px; color: var(--rn-gold-on-dark); }
.rn-anchors a:hover { background: rgba(255, 255, 255, 0.04); }

/* アンカー先がヘッダーの下に隠れないように */
.rn-page [id] { scroll-margin-top: 96px; }

/* --------------------------------------------------------------------------
   セクション見出し（rn_label ＋ .rn-title。右にリード）
   -------------------------------------------------------------------------- */
.rn-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.rn-head-row .rn-lead { max-width: 560px; }
.rn-title--m { font-size: clamp(28px, 3.3vw, 48px); }
.rn-title--s { font-size: clamp(24px, 2.8vw, 40px); }
.rn-align-right { text-align: right; }
.rn-section + .rn-section--same { padding-top: 0; }

/* 本文の基本（ページ本文・説明文） */
.rn-text { font-size: 15px; line-height: 2; color: var(--rn-sub-light); }
.rn-text p + p { margin-top: 1em; }
.rn-dark .rn-text { color: var(--rn-sub-dark); }

/* 写真（トンボ付き） */
.rn-photo { position: relative; overflow: hidden; background: var(--rn-paper); }
.rn-photo img { width: 100%; height: 100%; object-fit: cover; }
.rn-photo.rn-tombo::before, .rn-photo.rn-tombo::after { z-index: 1; }

/* 罫線の表（rn-base.css の .rn-spec を暗い地でも使う） */
.rn-dark .rn-spec, .rn-dark .rn-spec__row { border-color: var(--rn-line-dark); }
.rn-dark .rn-spec__key small { color: var(--rn-gold-on-dark); }
.rn-dark .rn-spec__val { color: #fff; }

/* タグ・注記 */
.rn-tag { display: inline-block; padding: 2px 8px; background: var(--rn-ink); color: #fff; font-family: var(--rn-font-mono); font-size: 10.5px; letter-spacing: .06em; line-height: 1.6; }
.rn-tag--line { background: none; border: 1px solid currentColor; color: var(--rn-ink); }
.rn-dark .rn-tag--line, .rn-tag--gold { background: none; border: 1px solid var(--rn-gold-on-dark); color: var(--rn-gold-on-dark); }
.rn-note { font-family: var(--rn-font-mono); font-size: 11px; letter-spacing: .06em; color: rgba(17, 18, 20, 0.6); }
.rn-dark .rn-note { color: rgba(255, 255, 255, 0.6); }

/* --------------------------------------------------------------------------
   記事カード（一覧・関連コンテンツ共通）
   -------------------------------------------------------------------------- */
.rn-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 24px; }
.rn-cards--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rn-card { display: flex; flex-direction: column; background: #fff; border-top: 2px solid var(--rn-ink); color: var(--rn-ink); text-decoration: none; transition: box-shadow .2s; }
.rn-card:hover { box-shadow: 0 10px 30px rgba(17, 18, 20, 0.08); }
.rn-card__img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--rn-paper); }
.rn-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.rn-card:hover .rn-card__img img { transform: scale(1.04); }
.rn-card__body { display: flex; flex-direction: column; flex: 1; padding: 20px 24px 22px; }
.rn-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-family: var(--rn-font-mono); font-size: 10.5px; letter-spacing: .06em; color: rgba(17, 18, 20, 0.6); }
.rn-card__title { margin-top: 10px; font-size: 15px; font-weight: 700; line-height: 1.7; }
.rn-card__arrow { margin-top: auto; padding-top: 14px; align-self: flex-end; }

/* 行組みの一覧（写真なし） */
.rn-list { border-bottom: 1px solid var(--rn-line-light); }
.rn-list__item { display: flex; align-items: center; gap: 0 20px; min-height: 72px; padding: 14px 0; border-top: 1px solid var(--rn-line-light); color: var(--rn-ink); text-decoration: none; transition: background .2s; }
.rn-list__item:hover { background: rgba(17, 18, 20, 0.03); }
.rn-list__date { width: 110px; flex-shrink: 0; font-family: var(--rn-font-mono); font-size: 12px; color: rgba(17, 18, 20, 0.6); }
.rn-list__title { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; line-height: 1.7; }
.rn-dark .rn-list, .rn-dark .rn-list__item { border-color: var(--rn-line-dark); color: #fff; }
.rn-dark .rn-list__date { color: rgba(255, 255, 255, 0.6); }

/* 絞り込み・タブのボタン */
.rn-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rn-chip { display: inline-flex; align-items: center; min-height: 42px; padding: 0 18px; border: 1px solid rgba(17, 18, 20, 0.25); background: transparent; color: var(--rn-ink); font: inherit; font-size: 13.5px; font-weight: 700; text-decoration: none; cursor: pointer; }
.rn-chip:hover { border-color: var(--rn-ink); }
.rn-chip.is-active, .rn-chip[aria-pressed="true"], .rn-chip[aria-selected="true"], .rn-chip[aria-current] { background: var(--rn-ink); border-color: var(--rn-ink); color: #fff; }

/* ページ送り（the_posts_pagination / paginate_links の出力） */
.rn-pager { margin-top: 56px; }
.rn-pager .nav-links, .rn-pager ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; margin: 0; padding: 0; }
.rn-pager .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 46px; padding: 0 12px; border: 1px solid rgba(17, 18, 20, 0.25); font-family: var(--rn-font-en); font-size: 16px; color: var(--rn-ink); text-decoration: none; box-sizing: border-box; }
.rn-pager .page-numbers.current { background: var(--rn-ink); border-color: var(--rn-ink); color: #fff; }
.rn-pager .page-numbers.dots { border: 0; }

/* --------------------------------------------------------------------------
   記事本文（the_content の出力。コラム・事例・固定ページ）
   -------------------------------------------------------------------------- */
.rn-prose { font-size: 16px; line-height: 2; color: var(--rn-ink); }
.rn-prose > * + * { margin-top: 1.2em; }
.rn-prose h2 { position: relative; margin-top: 2.6em; padding: 0 0 14px; border-bottom: 1px solid var(--rn-ink); font-family: var(--rn-font-head); font-weight: 900; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.5; }
.rn-prose h2::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 64px; height: 3px; background: var(--rn-gold); }
.rn-prose h3 { margin-top: 2em; padding-left: 18px; border-left: 3px solid var(--rn-gold); font-size: clamp(18px, 1.6vw, 21px); font-weight: 700; line-height: 1.6; }
.rn-prose h4 { margin-top: 1.6em; font-size: 17px; font-weight: 700; }
.rn-prose a { color: var(--rn-ink); text-decoration: underline; text-decoration-color: var(--rn-gold); text-underline-offset: 3px; }
.rn-prose ul, .rn-prose ol { padding-left: 1.4em; }
.rn-prose ul { list-style: disc; }
.rn-prose ol { list-style: decimal; }
.rn-prose li + li { margin-top: .4em; }
.rn-prose img { height: auto; }
.rn-prose figure { margin-left: 0; margin-right: 0; }
.rn-prose figcaption { margin-top: 8px; font-size: 12.5px; color: rgba(17, 18, 20, 0.6); }
.rn-prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.8; }
.rn-prose th, .rn-prose td { padding: 12px 14px; border: 1px solid var(--rn-line-light); text-align: left; vertical-align: top; }
.rn-prose th { background: var(--rn-paper); font-weight: 700; }
.rn-prose blockquote { margin-left: 0; padding: 18px 24px; border-left: 3px solid var(--rn-gold); background: var(--rn-paper); }
.rn-prose .wp-block-table, .rn-prose .table-wrap { overflow-x: auto; }

/* --------------------------------------------------------------------------
   関連コンテンツ（template-parts/related-resources.php を案Aに寄せる）
   -------------------------------------------------------------------------- */
/* 全幅の紙色の帯。中身は .rn-inner と同じ幅に収める */
.related-tabs {
  width: 100vw; margin: 0 0 0 calc(50% - 50vw); box-sizing: border-box;
  padding: clamp(64px, 8vw, 88px) max(var(--rn-pad), calc((100vw - var(--rn-max)) / 2));
  background: var(--rn-paper); border: 0; border-radius: 0;
}
.related-tabs__head { margin-bottom: 36px; }
.related-tabs__head::before { content: "§ —　Related"; display: block; margin-bottom: 22px; font-family: var(--rn-font-mono); font-size: 12px; letter-spacing: .08em; color: var(--rn-ink); }
.related-tabs__heading { font-family: var(--rn-font-head); font-weight: 900; font-size: clamp(26px, 2.8vw, 40px); line-height: 1.3; color: var(--rn-ink); }
.related-tabs__heading::before { display: none; }
.related-tabs__nav { gap: 8px; margin-bottom: 24px; }
.related-tabs__tab { min-height: 46px; padding: 0 22px; border: 1px solid rgba(17, 18, 20, 0.25); border-radius: 0; font-size: 14px; font-weight: 700; color: var(--rn-ink); background: transparent; }
.related-tabs__tab svg { display: none; }
.related-tabs__tab:hover { color: var(--rn-ink); border-color: var(--rn-ink); background: transparent; }
.related-tabs__radio:checked + .related-tabs__tab { background: var(--rn-ink); border-color: var(--rn-ink); color: #fff; }
.related-tabs__radio:focus-visible + .related-tabs__tab { outline-color: var(--rn-gold); }
.related-cards { gap: 18px; }
.related-card { border: 0; border-top: 2px solid var(--rn-ink); border-radius: 0; background: #fff; }
.related-card::before { background: var(--rn-gold); }
.related-card:hover, .related-card:focus-visible { border-color: var(--rn-ink); box-shadow: 0 10px 30px rgba(17, 18, 20, 0.08); }
.related-card__thumb { aspect-ratio: 16 / 9; background: var(--rn-paper); }
.related-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-card__body { padding: 20px 24px 6px; }
.related-card__tag { display: inline-block; padding: 0; background: none; border: 0; font-family: var(--rn-font-mono); font-size: 10.5px; letter-spacing: .06em; color: rgba(17, 18, 20, 0.6); }
.related-card__title { display: block; margin-top: 8px; font-size: 15px; font-weight: 700; line-height: 1.7; color: var(--rn-ink); }
.related-card__desc { display: block; margin-top: 8px; font-size: 13px; line-height: 1.8; color: var(--rn-sub-light); }
.related-card__arrow { padding: 0 24px 18px; text-align: right; color: var(--rn-ink); }
.related-tabs__more { margin-top: 26px; }
.related-tabs__more a { display: inline-flex; align-items: center; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--rn-ink); font-size: 14px; font-weight: 700; color: var(--rn-ink); text-decoration: none; }
@media (max-width: 900px) {
  .related-cards { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   スマホ（900px 以下）
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .rn-cards--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .rn-align-right { text-align: left; }
  .rn-hero { --hero-h: auto; min-height: 0; }
  .rn-hero__photo { position: relative; height: 52vw; min-height: 200px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 14vw)); }
  .rn-hero__line { display: none; }
  .rn-hero__inner { padding-top: 0; padding-bottom: 40px; }
  /* パンくずは写真の下に置く（明るい写真に重なって読みにくいため） */
  .rn-hero__crumbs { padding-top: 16px; }
  .rn-hero .im-breadcrumbs__list { font-size: 10px; }
  .rn-hero__title br { display: none; }
  .rn-hero__body { max-width: none; margin-top: 20px; }
  .rn-hero__title { margin-top: 16px; font-size: clamp(28px, 8vw, 40px); }
  .rn-hero--m .rn-hero__title { font-size: clamp(22px, 6.2vw, 30px); }
  .rn-hero__lead { margin-top: 14px; font-size: 14px; line-height: 1.9; }
  .rn-hero__lead br { display: none; }
  .rn-hero__wm { font-size: 110px; bottom: -20px; }
  .rn-anchors a { min-height: 52px; padding: 0 18px; font-size: 13px; }

  .rn-cards, .rn-cards--4 { grid-template-columns: 1fr; gap: 20px; }
  .rn-list__item { flex-wrap: wrap; gap: 4px 12px; }
  .rn-list__date { width: auto; }
  .rn-list__title { flex-basis: 100%; font-size: 14.5px; }
  .rn-prose { font-size: 15px; line-height: 1.95; }
  .rn-spec__row { flex-direction: column; gap: 4px; }
  .rn-spec__key { width: auto; }
}
