:root {
  --bg: #f3f5f8;
  --paper: #ffffff;
  --text: #1c2733;
  --muted: #667085;
  --line: #d8dee7;
  --navy: #172d49;
  --navy-soft: #304b6b;
  --accent: #294b73;
  --accent-soft: #eef3f8;
  --danger: #9b2c2c;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "YuGothic", "Meiryo", sans-serif;
  line-height: 1.8;
}
button, input, textarea, select { font: inherit; }
a { color: inherit; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.site-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 42px;
}

/* ヘッダー */
.hero-banner {
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(23, 45, 73, .06);
}
.hero-banner-image { width: 100%; height: auto; display: block; }
.hero-banner.image-missing,
.hero-banner-image.image-missing { display: none; }

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
}

/* レイアウト */
.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  align-items: start;
}

.content-panel,
.side-nav {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 14px 42px rgba(23, 45, 73, .06);
}

.content-panel {
  height: calc(100vh - 230px);
  min-height: 580px;
  max-height: 780px;
  overflow-y: auto;
  padding: 34px 38px;
  scroll-margin-top: 12px;
}
.content-panel.note-active { overflow: hidden; }
.content-panel.note-active .content-section.active {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.content-section { display: none; animation: fade-in .24s ease-out; }
.content-section.active { display: block; }
.content-section p { margin: 0 0 18px; }
.content-section h3 { margin: 30px 0 12px; color: var(--navy-soft); font-size: 20px; }

.section-title,
.section-heading {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.section-title h2,
.section-heading h2 {
  margin: 0;
  color: var(--navy);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(25px, 3vw, 32px);
  letter-spacing: .07em;
  line-height: 1.45;
}

.lead { color: var(--navy); font-size: 19px; font-weight: 700; }
.policy-lead { line-height: 1.75; }
.profile-name { margin-bottom: 8px !important; color: var(--navy); font-size: 24px; font-weight: 800; }
.profile-copy { display: grid; gap: 2px; }
.profile-copy p { margin: 0; line-height: 1.65; }
.profile-copy + .profile-copy { margin-top: 22px; }

.principle-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.principle-list li {
  position: relative;
  padding: 13px 16px 13px 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafc;
}
.principle-list li::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 19px;
  width: 10px;
  height: 5px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
.principle-list strong { display: block; margin-bottom: 3px; color: var(--navy); }

.policy-grid { display: grid; gap: 15px; }
.policy-grid section {
  position: relative;
  padding: 22px 24px 20px 76px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}
.policy-grid span {
  position: absolute;
  top: 19px;
  left: 20px;
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 27px;
}
.policy-grid h3 { margin: 0 0 7px; }
.policy-grid p { margin: 0; color: #475467; }
.policy-grid section p + p { margin-top: 10px; }

/* 著書 */
.book-grid { display: grid; grid-template-columns: minmax(200px, 300px); justify-content: center; }
.book-card {
  display: grid;
  gap: 11px;
  justify-items: center;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8fafc;
  color: var(--navy);
  text-align: center;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease;
}
.book-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(23, 45, 73, .12); }
.book-card img { width: min(100%, 230px); height: auto; display: block; border-radius: 4px; box-shadow: 0 8px 22px rgba(23, 45, 73, .14); }
.book-title { font-weight: 800; line-height: 1.65; }
.book-action { color: var(--accent); font-size: 13px; font-weight: 700; }

/* NOTE */
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.note-heading { flex: 0 0 auto; min-height: 0; align-items: center; margin-bottom: 14px; padding-bottom: 11px; }
.note-logo { width: auto; max-width: min(180px, 48%); max-height: 42px; display: block; object-fit: contain; object-position: left center; }
.note-logo.image-missing { display: none; }
.section-heading a, .note-preview a { color: var(--navy); font-weight: 700; text-decoration-color: rgba(28, 48, 72, .35); text-underline-offset: 4px; }

.note-layout {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(230px, .75fr) minmax(0, 1.8fr);
  gap: 18px;
  align-items: stretch;
  overflow: hidden;
}
.note-index, .note-preview {
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.frame-label {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #f1f4f8;
  color: var(--navy-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
}
.note-item {
  width: calc(100% - 14px);
  display: grid;
  gap: 4px;
  margin: 7px;
  padding: 14px;
  border: 0;
  border-bottom: 1px solid #e7ebf0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.note-item:hover { background: #f1f5f9; }
.note-item.active { background: var(--navy); color: #fff; }
.note-item time, .note-preview time { color: var(--muted); font-size: 12px; }
.note-item.active time { color: #dfe7f0; }
.note-item strong { font-size: 14px; line-height: 1.55; }

.note-article { padding: 24px clamp(18px, 4vw, 38px) 80px; }
.note-article > time { color: var(--muted); font-size: 13px; }
.note-article > h3 {
  margin: 5px 0 20px;
  color: var(--navy);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(23px, 3vw, 31px);
  line-height: 1.5;
}
.note-cover { width: 100%; max-height: 420px; display: block; margin: 0 0 28px; border-radius: 8px; object-fit: cover; }
.note-article-body { color: #27384a; font-size: 15px; line-height: 2; overflow-wrap: anywhere; }
.note-article-body p { margin: 0 0 1.6em; }
.note-article-body h1, .note-article-body h2, .note-article-body h3, .note-article-body h4 { margin: 2.2em 0 .8em; color: var(--navy); line-height: 1.55; }
.note-article-body h2 { padding-bottom: .45em; border-bottom: 1px solid var(--line); font-size: 23px; }
.note-article-body h3 { font-size: 19px; }
.note-article-body ul, .note-article-body ol { margin: 0 0 1.6em; padding-left: 1.7em; }
.note-article-body blockquote { margin: 1.8em 0; padding: 16px 20px; border-left: 3px solid var(--navy-soft); background: #f4f7fa; color: #455568; }
.note-article-body figure { margin: 1.8em 0; }
.note-article-body img { max-width: 100%; height: auto; border-radius: 6px; }
.note-article-body figcaption { color: var(--muted); font-size: 12px; text-align: center; }
.note-article-body a { color: #205b96; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.note-article-body hr { margin: 2.4em 0; border: 0; border-top: 1px solid var(--line); }
.note-article-body pre { max-width: 100%; overflow-x: auto; padding: 16px; border-radius: 8px; background: #eef2f6; }
.article-status { padding: 22px; border-radius: 8px; background: #f3f6fa; color: var(--muted); text-align: center; }
.article-status.error { color: var(--danger); }
.note-external-link {
  display: inline-flex;
  margin-top: 24px;
  padding: 9px 15px;
  border: 1px solid var(--navy);
  border-radius: 7px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.note-external-link:hover { background: var(--navy); color: #fff; }

/* 寄付 & お問い合わせ */
.donation-box, .contact-box {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8fafc;
}
.donation-box > h3 { margin: 0 0 16px; color: var(--navy); font-size: 23px; }
.donation-notice {
  margin-bottom: 25px;
  padding: 18px 20px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: #344054;
  font-size: 13px;
  line-height: 1.7;
}
.donation-notice p { margin-bottom: 9px; }
.donation-notice p:last-child { margin-bottom: 0; }

.field-grid { display: grid; grid-template-columns: 1fr; gap: 17px; }
.form-field { display: grid; gap: 6px; }
.form-field > span:first-child { color: var(--navy); font-size: 14px; font-weight: 700; }
.form-field em {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #f7e7e5;
  color: var(--danger);
  font-size: 10px;
  font-style: normal;
  vertical-align: 1px;
}
.form-field input {
  width: 100%;
  min-width: 0;
  height: 47px;
  padding: 8px 12px;
  border: 1px solid #c5cdd8;
  border-radius: 8px;
  outline: 0;
  background: #fff;
  color: var(--text);
}
.form-field input:focus {
  border-color: var(--navy-soft);
  box-shadow: 0 0 0 3px rgba(49, 77, 109, .12);
}

.amount-input { position: relative; display: block; }
.amount-input input { padding-right: 42px; }
.amount-input b { position: absolute; top: 9px; right: 14px; color: var(--muted); font-weight: 500; }

.check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  gap: 11px;
  align-items: start;
  margin-top: 20px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}
.check-row input { width: 18px; height: 18px; margin: 4px 0 0 auto; accent-color: var(--navy); }
.check-row span { display: grid; gap: 2px; color: var(--navy); font-size: 14px; font-weight: 700; }
.check-row small { color: var(--muted); font-size: 12px; font-weight: 400; }
.nationality-check { border-color: #9eb0c4; background: #f3f6fa; }

.form-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; margin-top: 24px; }
.form-actions.single { display: flex; justify-content: flex-end; }
.form-actions.single .button-primary { min-width: 180px; }

.button-primary, .button-secondary {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.button-primary { border: 1px solid var(--navy); background: var(--navy); color: #fff; }
.button-primary:hover { border-color: var(--navy-soft); background: var(--navy-soft); }
.button-primary:disabled { border-color: #aeb4bc; background: #aeb4bc; cursor: not-allowed; }
.button-secondary { border: 1px solid #b9bdc3; background: #fff; color: var(--navy); }

.confirmation-card h3 { margin-top: 0; }
.confirmation-lead { color: var(--muted); }
.confirmation-list { margin: 0; border-top: 1px solid var(--line); }
.confirmation-list div { display: grid; grid-template-columns: 150px 1fr; border-bottom: 1px solid var(--line); }
.confirmation-list dt, .confirmation-list dd { margin: 0; padding: 12px 14px; }
.confirmation-list dt { background: #f1f4f8; color: var(--navy); font-size: 13px; font-weight: 700; }
.confirmation-list dd { overflow-wrap: anywhere; background: #fff; }

.donation-complete { padding: 12px 4px; text-align: center; }
.complete-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 25px;
}
.donation-complete h3 { margin: 0 0 4px; color: var(--navy); }
.bank-details {
  width: min(100%, 430px);
  margin: 20px auto;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-align: left;
}
.bank-details p { margin: 0 0 3px; font-size: 16px; }
.bank-details p:last-child { margin-top: 7px; color: var(--navy); font-weight: 700; }
.form-note { color: var(--muted); font-size: 13px; }
.submission-target { position: absolute; width: 1px; height: 1px; border: 0; opacity: 0; pointer-events: none; }

.contact-box > p { color: #475467; }
.email-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 22px 0 28px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.email-row span { overflow-wrap: anywhere; font-weight: 700; }
.email-row .button-primary { flex: 0 0 auto; }
.social-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 11px; }
.social-grid a {
  display: grid;
  gap: 9px;
  justify-items: center;
  padding: 15px 6px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease;
}
.social-grid a:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(40, 49, 60, .1); }
.social-icon { width: 42px; height: 42px; display: grid; place-items: center; }
.social-icon img { width: 32px; height: 32px; object-fit: contain; }

.side-nav { position: sticky; top: 24px; padding: 16px; }
.side-nav > p { margin: 0 0 10px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.side-nav button,
.side-nav .menu-external {
  width: 100%;
  height: 54px;
  display: flex;
  align-items: center;
  margin: 0 0 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.side-nav button:hover,
.side-nav .menu-external:hover { background: #eef3f8; }
.side-nav button.active { border-color: var(--navy); background: var(--navy); color: #fff; }
.side-nav .menu-external { flex-direction: column; align-items: flex-start; justify-content: center; line-height: 1.35; }
.menu-report-kicker { display: block; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .03em; }
.menu-report-main { display: block; font-size: 11px; font-weight: 700; letter-spacing: .01em; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 821px) {
  .form-field.pc-half { width: 50%; }
  .check-row.pc-two-thirds { width: 66.6667%; }
}

@media (max-width: 920px) {
  .social-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 820px) {
  .site-shell { width: min(100% - 24px, 680px); padding-top: 10px; }
  .main-layout { grid-template-columns: 1fr; }
  .side-nav { position: static; order: -1; }
  .nav-buttons-wrap { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
  .side-nav button,
  .side-nav .menu-external { margin: 0; text-align: center; }
  .side-nav .menu-external { align-items: center; justify-content: center; }
  .content-panel { height: auto; min-height: 520px; overflow: visible; padding: 27px 22px 34px; }
  .section-heading { align-items: start; flex-direction: column; }
  .content-panel.note-active { overflow: visible; }
  .content-panel.note-active .content-section.active { height: auto; display: block; }
  .note-heading { flex-direction: row; align-items: center; gap: 12px; }
  .note-logo { max-width: min(160px, 48%); max-height: 36px; }
  .note-heading a { font-size: 13px; }
  .note-layout { height: auto; display: grid; grid-template-columns: 1fr; overflow: visible; }
  .note-index { height: 320px; max-height: 320px; }
  .note-preview { height: min(68vh, 620px); min-height: 460px; }
}

@media (max-width: 580px) {
  .site-shell { width: min(100% - 20px, 540px); }
  .hero-banner { margin-bottom: 10px; border-radius: 9px; }
  .content-panel { padding: 24px 17px 30px; }
  .section-title h2, .section-heading h2 { font-size: 25px; }
  .donation-box, .contact-box { padding: 17px 14px; }
  .donation-notice { padding: 15px 14px; }
  .policy-grid section { padding: 57px 18px 18px; }
  .confirmation-list div { grid-template-columns: 1fr; }
  .confirmation-list dt { padding-bottom: 4px; }
  .confirmation-list dd { padding-top: 4px; }
  .email-row { align-items: stretch; flex-direction: column; }
  .social-grid { grid-template-columns: repeat(2, 1fr); }
  .note-article { padding: 20px 16px 80px; }
  .note-cover { max-height: 260px; }
  .note-index { height: 290px; max-height: 290px; }
  .note-preview { height: 62vh; min-height: 440px; }
  .form-actions { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

[hidden] { display: none !important; }
