/* ===== CSS Variables ===== */
:root {
  --ink: #1a1a1c;
  --sub: #56595f;
  --faint: #8c8f96;
  --line: #e6e6e7;
  --line2: #f0f0f1;
  --bg: #ffffff;
  --soft: #f7f7f5;
  --accent: #34506e;
}

/* ===== Base ===== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--ink);
  line-height: 1.6;
  letter-spacing: .01em;
}
::selection { background: #e7ebef; }
a { color: inherit; }

/* ===== Navigation ===== */
.nav-item {
  display: inline-block;
  padding: 8px 2px 7px;
  background: transparent;
  color: var(--sub);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  letter-spacing: .03em;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.nav-item:hover {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ===== Mobile menu ===== */
.mobile-menu-btn { display: none; }
.mobile-menu { display: none; }
.mobile-menu.is-open { display: block; }
.mobile-nav-item {
  display: block;
  width: 100%;
  text-align: left;
  border-bottom: 1px solid var(--line2);
  padding: 14px 2px;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: .03em;
}
.mobile-nav-item:hover { color: var(--accent); }

/* ===== Hover utilities ===== */
.hover-dark:hover { background: #26384c !important; }
.hover-soft:hover { background: var(--soft) !important; }
.hover-accent:hover { color: var(--accent) !important; }
.hover-accent-border:hover { color: var(--accent) !important; border-color: var(--accent) !important; }
.hover-ink-border:hover { border-color: var(--ink) !important; }

/* ===== Post body typography ===== */
.post-body h2 {
  font-family: 'Noto Serif JP', serif;
  font-weight: 600;
  font-size: 22px;
  color: var(--ink);
  letter-spacing: .04em;
  margin: 40px 0 16px;
  line-height: 1.6;
}
.post-body h3 {
  font-family: 'Noto Serif JP', serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: .03em;
  margin: 32px 0 12px;
}
.post-body p {
  font-size: 15px;
  line-height: 2.2;
  color: var(--sub);
  margin: 0 0 24px;
}
.post-body a {
  color: var(--ink);
  text-underline-offset: 3px;
}
.post-body a:hover { color: var(--accent); }
.post-body ul, .post-body ol {
  font-size: 14px;
  line-height: 2;
  color: var(--sub);
  padding-left: 1.5em;
  margin: 0 0 20px;
}
.post-body img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 48px 0;
}
.pagination a, .pagination span {
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
  letter-spacing: .04em;
}
.pagination a:hover { border-color: var(--ink); }

/* ===== Tag page post cards ===== */
.post-card {
  display: grid;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding: 26px 4px;
  color: inherit;
}
.tag-layout-news .post-card {
  grid-template-columns: 120px 150px 1fr auto;
  align-items: baseline;
  gap: 24px;
}
.tag-layout-news .pc-date { font-size: 13px; color: var(--faint); letter-spacing: .04em; }
.tag-layout-news .pc-cat { font-size: 12px; color: var(--accent); letter-spacing: .04em; }
.tag-layout-news .pc-title { font-size: 14.5px; color: var(--ink); line-height: 1.7; }
.tag-layout-news .pc-excerpt { display: none; }
.tag-layout-news .pc-arrow { color: var(--faint); font-size: 14px; }

.tag-layout-year .post-card {
  grid-template-columns: 120px 1fr auto;
  align-items: baseline;
  gap: 20px;
}
.tag-layout-year .pc-date { display: none; }
.tag-layout-year .pc-cat {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.tag-layout-year .pc-title {
  display: block;
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.75;
  margin-bottom: 5px;
}
.tag-layout-year .pc-excerpt {
  display: block;
  font-size: 12px;
  color: var(--faint);
  line-height: 1.65;
}
.tag-layout-year .pc-arrow { color: var(--faint); font-size: 14px; }

/* ===== Research year navigation & category tabs ===== */
.research-year-btn {
  display: inline-block;
  padding: 10px 22px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-family: 'Noto Serif JP', serif;
  letter-spacing: .05em;
  border-radius: 2px;
  transition: border-color .15s, background .15s;
}
.research-year-btn:hover { border-color: var(--ink); background: var(--soft); }

.research-tab {
  background: none;
  border: 1px solid var(--line);
  padding: 7px 18px;
  font-size: 13px;
  color: var(--faint);
  cursor: pointer;
  border-radius: 2px;
  font-family: 'Noto Sans JP', sans-serif;
  letter-spacing: .03em;
  transition: color .15s, border-color .15s, background .15s;
}
.research-tab:hover { color: var(--ink); border-color: var(--ink); }
.research-tab.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ===== Responsive ===== */
@media (min-width: 861px) {
  .mobile-menu { display: none !important; }
}

@media (max-width: 860px) {
  body { overflow-x: hidden; }

  .desktop-nav { display: none !important; }
  .mobile-menu-btn { display: flex !important; }
  .site-header-bar { height: 60px !important; }

  .rsp [style*="margin:0 auto"],
  .rsp [style*="margin: 0 auto"] {
    max-width: 100% !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .rsp [style*="width: 1186px"], .rsp [style*="width:1186px"],
  .rsp [style*="width: 1141px"], .rsp [style*="width:1141px"],
  .rsp [style*="width: 1114px"], .rsp [style*="width:1114px"] {
    width: auto !important; height: auto !important;
  }
  .rsp [style*="width: 1114px"], .rsp [style*="width:1114px"] {
    flex-direction: column !important;
  }

  .rsp [style*="display:grid"], .rsp [style*="display: grid"] {
    grid-template-columns: 1fr !important;
  }

  .rsp [style*="gap:64px"], .rsp [style*="gap: 64px"],
  .rsp [style*="gap:56px"], .rsp [style*="gap: 56px"],
  .rsp [style*="gap:48px"], .rsp [style*="gap: 48px"],
  .rsp [style*="gap:44px"], .rsp [style*="gap: 44px"] { gap: 26px !important; }

  .rsp [style*="border-right:1px solid var(--line)"] {
    border-right: 0 !important; border-bottom: 1px solid var(--line) !important;
  }
  .rsp [style*="border-left:1px solid var(--line)"] { border-left: 0 !important; }

  .rsp [style*="position:sticky"] { position: static !important; }

  .rsp [style*="font-size:50px"] { font-size: 28px !important; line-height: 1.45 !important; }
  .rsp [style*="font-size:38px"] { font-size: 25px !important; }
  .rsp [style*="font-size:29px"] { font-size: 22px !important; }
  .rsp [style*="font-size:28px"] { font-size: 22px !important; }
  .rsp [style*="font-size:26px"] { font-size: 21px !important; }
  .rsp [style*="font-size:24px"] { font-size: 20px !important; }
  .rsp [style*="font-size:22px"] { font-size: 19px !important; }
  .rsp [style*="font-size:20px"] { font-size: 17px !important; }

  .rsp [style*="padding:96px 32px 64px"], .rsp [style*="padding: 96px 32px 64px"] {
    padding-top: 44px !important; padding-bottom: 36px !important;
  }

  .rsp .schedule-scroll { overflow-x: hidden; }
  .rsp .schedule-scroll [style*="repeat(5, 1fr)"],
  .rsp .schedule-scroll [style*="repeat(5,1fr)"] {
    grid-template-columns: 36px repeat(5, minmax(0, 1fr)) !important;
  }
  .rsp .schedule-scroll [style*="padding: 16px"] { padding: 9px 1px !important; font-size: 11.5px !important; }
  .rsp .schedule-scroll [style*="padding: 20px 16px"] { padding: 12px 2px !important; font-size: 10.5px !important; }
  .rsp .schedule-scroll [style*="padding: 20px 12px"] { padding: 12px 1px !important; font-size: 11px !important; }
}

@media (max-width: 860px) and (min-width: 581px) {
  .rsp [style*="repeat(4,1fr)"], .rsp [style*="repeat(3,1fr)"] {
    grid-template-columns: 1fr 1fr !important;
  }
}
