/* 『東洋音楽研究』サポートサイト
   色は表紙の号数タブ（マゼンタ）から採っています。 */
:root {
  --magenta: #8b2a7b;
  --magenta-deep: #62175a;
  --magenta-soft: #d9b3d2;
  --ink: #251c24;
  --muted: #62575f;
  --rule: #e5dae3;
  --lilac: #f7f0f6;
  --plum: #2c1829;
  --plum-text: #dccfd9;
  --mincho: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --gothic: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  --pad: clamp(20px, 5vw, 64px);
  --measure: 42em;
  --maxw: 1120px;
  --gutter: max(var(--pad), calc((100% - var(--maxw)) / 2));
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: #fff; color: var(--ink); font-family: var(--gothic); font-size: 16px; line-height: 1.85; -webkit-font-smoothing: antialiased; font-feature-settings: "palt" 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--magenta); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--magenta-deep); }
h1, h2, h3 { font-family: var(--mincho); font-weight: 700; margin: 0; line-height: 1.4; }
/* 日本語を文節単位で改行（対応ブラウザのみ） */
h1, h2, h3, .hero-lead, .panel-lead, .toc-title, .notice, .steps span, .rows dd, .faq p { word-break: auto-phrase; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--magenta); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 20; background: #fff; padding: 8px 14px; }
.muted { color: var(--muted); font-size: 14px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 13px 24px; min-height: 48px; font-family: var(--gothic); font-weight: 700; font-size: 15px; line-height: 1.4; text-decoration: none; border-radius: 2px; border: 1px solid transparent; cursor: pointer; text-align: center; }
.btn-sm { padding: 8px 18px; min-height: 38px; font-size: 14px; }
.btn-primary { background: var(--magenta); color: #fff; }
.btn-primary:hover { background: var(--magenta-deep); color: #fff; }
.btn-outline { border-color: var(--magenta); color: var(--magenta); background: #fff; }
.btn-outline:hover { background: var(--lilac); }
.btn-sub { font-size: 12px; font-weight: 500; opacity: .9; }
.btn.is-disabled { background: #b9aab6; color: #fff; cursor: not-allowed; }

/* ---------- header ---------- */
.header { border-top: 3px solid var(--magenta); position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px var(--gutter); background: rgba(255,255,255,.96); backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--rule); }
.brand { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); line-height: 1.3; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .06em; }
.brand-name { font-family: var(--mincho); font-weight: 700; font-size: 21px; letter-spacing: .08em; }
.nav { display: flex; align-items: center; gap: 26px; font-size: 14px; white-space: nowrap; }
.nav a:not(.btn) { color: var(--ink); text-decoration: none; }
.nav a:not(.btn):hover { color: var(--magenta); }

.notice { margin: 0; padding: 11px var(--gutter); background: var(--lilac); border-bottom: 1px solid var(--rule); font-size: 14px; line-height: 1.7; }
.notice::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 10px; background: var(--magenta); vertical-align: 1px; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; padding: clamp(40px, 6vw, 72px) var(--gutter); }
.hero-cover { margin: 0; }
.hero-cover img { border: 1px solid var(--rule); box-shadow: 0 14px 30px -16px rgba(44,24,41,.4); }
.hero-text { display: flex; flex-direction: column; gap: 18px; }
.hero-pub { font-size: 14px; color: var(--muted); letter-spacing: .08em; }
.hero h1 { display: flex; flex-wrap: wrap; align-items: stretch; gap: 14px 18px; }
.h1-title { font-size: clamp(42px, 6.4vw, 74px); letter-spacing: .06em; line-height: 1.1; }
.issue-tab { display: inline-flex; align-items: baseline; gap: 2px; align-self: center; padding: 4px 16px 6px; background: var(--magenta); color: #fff; font-family: var(--gothic); font-weight: 700; font-size: clamp(18px, 2vw, 22px); line-height: 1; }
.issue-tab b { font-size: clamp(36px, 4.4vw, 50px); letter-spacing: .02em; padding: 0 2px; }
.hero-meta { font-size: 14px; color: var(--muted); }
.hero-lead { font-family: var(--mincho); font-size: 17px; line-height: 2; max-width: 32em; }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding-top: 16px; border-top: 1px solid var(--rule); }
.price-label { font-size: 14px; color: var(--muted); }
.price-value { font-family: var(--mincho); font-weight: 700; font-size: 38px; line-height: 1; }
.price-value .unit { font-size: 18px; margin-left: 2px; }
.price-note { font-size: 14px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- facts ---------- */
.facts { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--rule); padding-inline: var(--gutter); }
.facts > div { padding: 18px 24px; border-right: 1px solid var(--rule); }
.facts > div:first-child { padding-left: 0; }
.facts > div:last-child { border-right: 0; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.6; }
.facts small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }

/* ---------- split sections ---------- */
.split { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 48px; padding: 64px var(--gutter); }
.split + .split { border-top: 1px solid var(--rule); }
.split-head { display: flex; flex-direction: column; gap: 8px; }
.split-head h2 { font-size: 26px; letter-spacing: .04em; }

/* table of contents */
.toc { min-width: 0; }
.toc-group { display: grid; grid-template-columns: 7em minmax(0, 1fr); gap: 20px; padding: 18px 0; border-top: 1px solid var(--rule); }
.toc-group:last-child { border-bottom: 1px solid var(--rule); }
.toc-group h3 { font-family: var(--gothic); font-size: 13px; font-weight: 700; color: var(--magenta); padding-top: 4px; }
.toc-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.toc-group li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: baseline; }
.toc-title { font-family: var(--mincho); font-size: 16.5px; line-height: 1.75; text-wrap: pretty; }
.toc-author { font-size: 14px; color: var(--muted); white-space: nowrap; }

/* ---------- buy ---------- */
.buy { background: var(--lilac); border-block: 1px solid var(--rule); padding: 64px var(--gutter); display: flex; flex-direction: column; gap: 28px; }
.buy-head { display: flex; flex-direction: column; gap: 8px; }
.buy-head h2 { font-size: 26px; letter-spacing: .04em; }
.tabs { display: none; gap: 0; border-bottom: 1px solid var(--rule); }
.js .tabs { display: flex; }
.tabs button { appearance: none; background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; padding: 12px 22px; font: inherit; font-weight: 700; font-size: 15px; color: var(--muted); cursor: pointer; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--magenta); border-bottom-color: var(--magenta); }
.panel { background: #fff; border: 1px solid var(--rule); padding: clamp(24px, 4vw, 40px); display: flex; flex-direction: column; gap: 22px; }
.panel + .panel { margin-top: 20px; }
.js .panel + .panel { margin-top: 0; }
.panel[hidden] { display: none; }
.panel-title { font-size: 22px; }
.js .panel-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.panel-lead { max-width: 48em; }
.panel-note { font-size: 14px; color: var(--muted); }
.panel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.fax { font-size: 14px; color: var(--muted); }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-block: 1px solid var(--rule); }
.steps li { counter-increment: step; display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 20px; border-right: 1px solid var(--rule); }
.steps li:first-child { padding-left: 0; }
.steps li:last-child { border-right: 0; }
.steps li::before { content: counter(step); font-family: var(--mincho); font-weight: 700; font-size: 26px; line-height: 1; color: var(--magenta); }
.steps strong { font-size: 15px; }
.steps span { font-size: 14px; color: var(--muted); line-height: 1.75; }

.rows { margin: 0; border-top: 1px solid var(--rule); }
.rows > div { display: grid; grid-template-columns: 8em minmax(0, 1fr); gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: 15px; line-height: 1.8; }
.rows dt { font-weight: 700; }
.rows dd { margin: 0; }

/* ---------- back numbers / faq ---------- */
.prose { display: flex; flex-direction: column; gap: 14px; max-width: var(--measure); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-family: var(--mincho); font-weight: 700; padding: 6px 14px; border: 1px solid var(--rule); }
.faq { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { list-style: none; cursor: pointer; padding: 16px 32px 16px 0; font-weight: 700; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--magenta); border-bottom: 2px solid var(--magenta); transform: translateY(-70%) rotate(45deg); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
@media (prefers-reduced-motion: reduce) { .faq summary::after { transition: none; } }
.faq details p { padding: 0 0 18px; color: var(--muted); font-size: 15px; max-width: var(--measure); }

/* ---------- footer ---------- */
.footer { background: var(--plum); color: var(--plum-text); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; padding: 48px var(--gutter) 56px; font-size: 14px; line-height: 1.9; }
.footer > div { display: flex; flex-direction: column; gap: 6px; }
.footer-label { font-size: 12px; color: var(--magenta-soft); }
.footer-name { font-family: var(--mincho); font-weight: 700; font-size: 17px; color: #fff; }
.footer address { font-style: normal; }
.footer a { color: #fff; }

/* ---------- 404 ---------- */
.notfound main { max-width: 34em; margin: 18vh auto; padding: 0 24px; display: flex; flex-direction: column; gap: 18px; }
.notfound h1 { font-size: 28px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .nav a:not(.btn) { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-cover { order: 2; max-width: 240px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div { padding: 14px 12px; border-bottom: 1px solid var(--rule); }
  .facts > div:nth-child(odd) { padding-left: 0; }
  .facts > div:nth-child(2n) { border-right: 0; }
  .facts > div:nth-last-child(-n+2) { border-bottom: 0; }
  .split { grid-template-columns: 1fr; gap: 24px; padding-block: 48px; }
  .buy { padding-block: 48px; }
  .steps { grid-template-columns: 1fr; }
  .steps li, .steps li:first-child { padding: 14px 0; border-right: 0; border-bottom: 1px solid var(--rule); }
  .steps li:last-child { border-bottom: 0; }
  .footer { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 560px) {
  .tabs { overflow-x: auto; }
  .tabs button { padding: 12px 14px; font-size: 14px; white-space: nowrap; }
  .toc-group, .rows > div { grid-template-columns: 1fr; gap: 6px; }
  .toc-group li { grid-template-columns: 1fr; gap: 2px; }
  .brand-name { font-size: 18px; }
}
