@charset "UTF-8";

/*
 * Part I encyclopedia layout bridge.
 * Keeps the existing archive markup and content while matching portal.css.
 */
:root {
  --forest: #56684f;
  --forest-deep: #354839;
  --ground: #f3f0e7;
  --accent: #56684f;
  --shadow: 0 15px 45px rgba(43, 52, 39, .065);
}

body {
  background: var(--ground);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

button,
input { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 3px solid #a7bda0;
  outline-offset: 4px;
}

.wrap {
  width: min(1120px, calc(100% - 40px));
  max-width: none;
  padding: 0;
}

header {
  z-index: 40;
  background: rgba(255, 253, 248, .96);
  backdrop-filter: blur(16px);
}

.head {
  min-height: 79px;
  gap: 24px;
}

.brand {
  display: grid;
  grid-template-columns: 43px auto;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  flex: 0 0 auto;
}

.brand::before {
  content: "余";
  grid-column: 1;
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 1px solid #b6c0b0;
  border-radius: 50%;
  background: #edf2ea;
  color: var(--forest-deep);
  font: 22px Georgia, "Yu Mincho", serif;
}

.brand b {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  font-size: 1rem;
  letter-spacing: .08em;
  line-height: 1.4;
}

.brand small {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  color: var(--muted);
  font-size: .58rem;
  letter-spacing: .2em;
  line-height: 1.6;
}

.headnav {
  align-items: center;
  justify-content: flex-end;
  gap: 17px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}

.headnav .pill {
  flex: 0 0 auto;
  padding: 3px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #62675f;
  font-size: .72rem;
  font-weight: 650;
  white-space: nowrap;
}

.headnav .pill:hover { color: var(--forest-deep); }

.headnav .pill.on {
  padding: 8px 13px;
  border: 1px solid #bac6b5;
  border-radius: 24px;
  background: transparent;
  color: var(--forest-deep);
}

.reading-scope {
  width: min(1080px, calc(100% - 40px));
  margin: 24px auto 0;
  border-radius: 2px;
  font-size: .78rem;
}

.reading-scope strong { font-size: .8rem; }

.hero,
.personHero {
  padding: 66px 0 58px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(130deg, #fbf9f3, #e9efe6);
}

.heroBox,
.personBox {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.heroBox { padding: 0; }
.personBox { padding: 0; gap: 23px; }

.hero h1,
.personBox h1 {
  margin: 9px 0 18px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(2.1rem, 4.7vw, 3.7rem);
  font-weight: 550;
  line-height: 1.5;
  letter-spacing: .045em;
}

.hero p,
.personBox .lead {
  max-width: 780px;
  color: #5d685c;
  font-size: .88rem;
  line-height: 2.1;
}

.breadcrumb {
  margin-bottom: 27px;
  font-size: .67rem;
}

.eyebrow {
  font-size: .69rem;
  font-weight: 750;
  letter-spacing: .23em;
}

.scope,
.canonbar {
  max-width: 900px;
  margin-top: 22px;
  padding: 16px 18px;
  border-radius: 2px;
  font-size: .76rem;
}

.canonbar { background: rgba(255, 253, 248, .72); }

.sigil,
.locationMark,
.natureMark,
.toolMark,
.loreMark,
.mapMark,
.searchMark {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #edf2ea;
}

section { padding: 42px 0; }

.titleRow { margin-bottom: 22px; }

.titleRow h2,
.panel h2,
.episodeChapterHead h2,
.milestoneBody h2 {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-weight: 550;
  letter-spacing: .035em;
}

.titleRow h2 { font-size: clamp(1.55rem, 3vw, 2rem); }
.titleRow span { font-size: .68rem; }

.grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.card {
  padding: 23px 24px;
  border-radius: 3px;
  box-shadow: var(--shadow);
  transition: border-color .2s, transform .2s;
}

.card:hover {
  border-color: #a7b5a0;
  transform: translateY(-3px);
}

.card .kind { font-size: .66rem; letter-spacing: .14em; }
.card h3 { margin: 8px 0 9px; font-size: 1.06rem; line-height: 1.6; }
.card p { color: var(--muted); font-size: .76rem; line-height: 1.9; }

.tags { gap: 7px; margin-top: 15px; }

.tag,
.meta span,
.statusline span,
.route a,
.route span,
.timelineLegend span,
.mapLegend span,
.searchBadge,
.searchKind,
.episodeTag {
  border-radius: 2px;
}

.contentGrid { gap: 20px; }

.panel {
  padding: 26px 28px;
  border-radius: 3px;
  box-shadow: var(--shadow);
}

.panel h2 { margin-bottom: 17px; font-size: 1.25rem; }
.panel p { font-size: .79rem; line-height: 1.95; }

.facts { gap: 13px; }
.fact { padding: 9px 0 9px 14px; }
.fact b { font-size: .78rem; }
.fact span { font-size: .75rem; line-height: 1.85; }

.relation { padding: 14px 0; }
.relation b { font-size: .77rem; }
.relation span { font-size: .72rem; line-height: 1.75; }

.event { grid-template-columns: 88px 1fr; gap: 13px; }
.ep { border-radius: 2px; font-size: .68rem; }
.event div:last-child { font-size: .76rem; line-height: 1.85; }

.notice {
  padding: 18px 20px;
  border: 0;
  border-left: 3px solid var(--gold);
  border-radius: 0;
  background: #f6f0e5;
  color: #665c4e;
  font-size: .75rem;
}

.nextGrid { gap: 11px; }
.next { padding: 15px 17px; border-radius: 3px; }
.next b { font-size: .77rem; }
.next span { font-size: .67rem; }

.sourceLink,
.narouBtn,
.filterBtn,
.crossFilter {
  border-radius: 2px;
}

.episodeTools,
.crossTools,
.episodeRow,
.milestoneBody,
.timelineEnd,
.mapViewport,
.mapDisclaimer,
.searchResult,
.emptySearch,
.indexItem,
.growthStep,
.miniFact {
  border-radius: 3px;
}

.episodeTools,
.crossTools { top: 91px; }

.episodeRow { padding: 15px 17px; }
.episodeMain h3 { font-size: .88rem; }
.episodeMeta { font-size: .64rem; }

.searchResult,
.indexItem { padding: 17px 19px; }
.searchResult h2 { font-size: .9rem; }
.searchResult p,
.indexItem span { font-size: .7rem; }

footer {
  margin-top: 58px;
  padding: 46px 0 50px;
  border-top: 1px solid #cfd7c9;
  background: #e8ede4;
  color: #657063;
  font-size: .67rem;
}

footer .wrap::before {
  content: "森野余白";
  display: block;
  color: var(--ink);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 1.2rem;
  letter-spacing: .1em;
}

.footerLinks {
  gap: 14px 22px;
  margin: 20px 0 24px;
}

.footerLinks a { color: #455744; font-size: .71rem; }

@media (min-width: 760px) {
  .personBox { grid-template-columns: 92px minmax(0, 1fr); }
  .contentGrid { grid-template-columns: minmax(0, 1.55fr) minmax(270px, .72fr); }
}

@media (max-width: 1040px) {
  .head { display: block; padding-block: 12px; }
  .headnav {
    justify-content: flex-start;
    width: 100%;
    padding: 9px 0 4px;
  }
  .episodeTools,
  .crossTools { top: 116px; }
}

@media (max-width: 700px) {
  .wrap,
  .reading-scope { width: min(100% - 32px, 1120px); }
  .head { min-height: 0; }
  .brand { grid-template-columns: 39px auto; column-gap: 11px; }
  .brand::before { width: 39px; height: 39px; font-size: 20px; }
  .headnav { gap: 13px; }
  .headnav .pill { font-size: .69rem; }
  .headnav .pill.on { padding: 7px 11px; }
  .reading-scope { margin-top: 18px; padding: 12px 14px; }
  .hero,
  .personHero { padding: 43px 0 40px; }
  .hero h1,
  .personBox h1 { font-size: clamp(2rem, 10vw, 2.5rem); }
  .hero p,
  .personBox .lead { font-size: .82rem; }
  .scope,
  .canonbar { padding: 14px 15px; }
  section { padding: 31px 0; }
  .titleRow { display: block; }
  .titleRow span { display: block; margin-top: 6px; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .card { padding: 20px; }
  .panel { padding: 21px; }
  .event { grid-template-columns: 72px 1fr; gap: 10px; }
  .episodeTools,
  .crossTools { top: 112px; }
  footer { margin-top: 38px; padding-block: 38px 42px; }
}

/* Shared site wording and hierarchy used by the Part II header. */
.archive-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, .96);
  backdrop-filter: blur(16px);
}
.archive-header-inner {
  min-height: 79px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.archive-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.archive-brand-mark {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 1px solid #b6c0b0;
  border-radius: 50%;
  background: #edf2ea;
  color: var(--forest-deep);
  font: 22px Georgia, "Yu Mincho", serif;
}
.archive-brand-text strong {
  display: block;
  font-size: 1rem;
  letter-spacing: .08em;
  line-height: 1.5;
}
.archive-brand-text small {
  display: block;
  color: var(--muted);
  font-size: .58rem;
  letter-spacing: .2em;
  line-height: 1.6;
}
.archive-primary {
  display: flex;
  align-items: center;
  gap: 23px;
  color: #62675f;
  font-size: .76rem;
  font-weight: 650;
}
.archive-primary a { white-space: nowrap; }
.archive-primary a:hover,
.archive-primary a[aria-current="page"] { color: var(--forest-deep); }
.archive-primary .archive-current {
  padding: 9px 15px;
  border: 1px solid #bac6b5;
  border-radius: 24px;
  color: var(--forest-deep);
}
.archive-mobile-menu { display: none; }
.archive-subnav {
  border-bottom: 1px solid var(--line);
  background: #f8f7f2;
}
.archive-subnav .headnav {
  min-height: 48px;
  justify-content: flex-start;
  gap: 18px;
  padding: 7px 0;
}
.archive-subnav .headnav .pill { font-size: .71rem; }
.archive-subnav .headnav .pill.on { padding: 5px 11px; }
@media (max-width: 880px) {
  .archive-primary { gap: 13px; font-size: .69rem; }
}
@media (max-width: 700px) {
  .archive-header-inner { min-height: 70px; }
  .archive-primary { display: none; }
  .archive-mobile-menu { display: block; position: relative; }
  .archive-mobile-menu summary {
    cursor: pointer;
    list-style: none;
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: 8px 14px;
    font-size: .75rem;
  }
  .archive-mobile-menu summary::-webkit-details-marker { display: none; }
  .archive-mobile-menu nav {
    position: absolute;
    top: 43px;
    right: 0;
    z-index: 42;
    min-width: 210px;
    display: grid;
    gap: 2px;
    padding: 12px;
    border: 1px solid var(--line);
    background: var(--paper);
    box-shadow: var(--shadow);
  }
  .archive-mobile-menu:not([open]) nav { display: none; }
  .archive-mobile-menu a { padding: 10px 9px; font-size: .78rem; }
  .archive-subnav .headnav { min-height: 42px; gap: 13px; }
  .episodeTools,
  .crossTools { top: 80px; }
}
