:root {
  --bg: #f4f1e8;
  --panel: #fffdf8;
  --green: #07513d;
  --green-dark: #063d2f;
  --brown: #75572b;
  --gold: #b49a55;
  --text: #262d29;
  --muted: #626c66;
  --line: #d9d5c8;
  --max: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
               "Yu Gothic", "YuGothic", "Noto Sans JP", sans-serif;
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
}

img { display: block; max-width: 100%; height: auto; }

a {
  color: var(--green);
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}

a:hover { color: var(--brown); }

a:focus-visible,
button:focus-visible {
  outline: 3px solid #d49b00;
  outline-offset: 3px;
}

.container {
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  z-index: 1000;
  left: 12px;
  top: -100px;
  padding: 10px 14px;
  color: #fff;
  background: #111;
}

.skip-link:focus { top: 12px; }

.visually-hidden {
  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;
}

/* Header */
.site-header { background: #fff; }

.brand-visual {
  position: relative;
  min-height: 205px;
  background:
    url("./header-castle-earthwork.jpg") center 54% / cover no-repeat;
  overflow: hidden;
}

.brand-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg,
      rgba(255,255,255,.95) 0%,
      rgba(255,255,255,.87) 19%,
      rgba(255,255,255,.34) 40%,
      rgba(255,255,255,0) 63%);
}

.brand-copy {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 40px), var(--max));
  min-height: 205px;
  margin-inline: auto;
  display: flex;
  align-items: center;
}

.brand-home {
  display: inline-flex;
  width: min(500px, 47vw);
  flex-direction: column;
  color: var(--green-dark);
  text-decoration: none;
}

.brand-home:hover { color: var(--green-dark); }

.brand-ja {
  font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(1.75rem, 3vw, 2.7rem);
  font-weight: 600;
  letter-spacing: .11em;
  line-height: 1.25;
}

.brand-rule {
  width: 100%;
  height: 1px;
  margin: 11px 0 7px;
  background: var(--gold);
}

.brand-en {
  color: #49391f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(.72rem, 1.1vw, .95rem);
  line-height: 1.35;
  letter-spacing: .015em;
}

.global-nav {
  background: var(--green-dark);
  border-bottom: 1px solid rgba(255,255,255,.15);
}

.nav-inner {
  width: min(100%, 1380px);
  margin-inline: auto;
  display: flex;
  justify-content: center;
}

.global-nav a {
  position: relative;
  min-height: 54px;
  padding: 14px 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.global-nav a + a::before {
  content: "";
  position: absolute;
  left: 0;
  height: 20px;
  border-left: 1px solid rgba(255,255,255,.24);
}

.global-nav a:hover,
.global-nav a:focus-visible {
  background: rgba(255,255,255,.09);
  color: #fff;
}

.global-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 28%;
  right: 28%;
  bottom: 0;
  height: 3px;
  background: #d7bd68;
}

/* Main */
.page-main { padding-top: 28px; }

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .85fr);
  gap: 24px;
  align-items: start;
  padding-bottom: 34px;
}

.main-column,
.side-column {
  display: grid;
  gap: 24px;
}

.panel {
  padding: 26px 28px;
  background: var(--panel);
  border: 1px solid #e5e0d5;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(40, 48, 42, .035);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gold);
}

.section-heading.simple { justify-content: flex-start; }

h1, h2, h3 {
  color: var(--green-dark);
  font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
}

.section-heading h1,
.section-heading h2,
.publication > h2,
.activities > h2,
.related h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 600;
  letter-spacing: .035em;
}

.news-list { margin: 0; }

.news-item {
  display: grid;
  grid-template-columns: 8.5em minmax(0, 1fr);
  gap: 20px;
  padding: 14px 8px;
  border-bottom: 1px solid var(--line);
}

.news-item:last-child { border-bottom: 0; }

.news-item dt {
  color: var(--brown);
  font-family: Georgia, serif;
  font-variant-numeric: tabular-nums;
}

.news-item dd { margin: 0; }

.about p:last-child { margin-bottom: 0; }

/* Side */
.publication > h2,
.activities > h2 {
  margin-top: 0;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--green);
}

.cover-link {
  width: min(230px, 72%);
  margin: 18px auto 14px;
}

.publication h3 {
  margin: 10px 0 4px;
  font-size: 1.15rem;
}

.caption {
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.65;
}

.button {
  display: inline-block;
  min-height: 44px;
  padding: 8px 18px;
  color: #fff;
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 3px;
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  color: #fff;
  background: var(--brown);
  border-color: var(--brown);
}

.activities nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}

.activities nav a {
  min-height: 48px;
  padding: 11px 8px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.activities nav a:nth-child(odd) { border-right: 1px solid var(--line); }

/* Related / footer */
.related {
  padding: 30px 0 36px;
  background: #fbf9f3;
  border-top: 1px solid var(--line);
}

.related h2 { margin: 0 0 14px; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}

.related-grid a {
  min-height: 44px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
}

.site-footer {
  color: #eef3ef;
  background: var(--green-dark);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 36px;
  padding-top: 30px;
  padding-bottom: 24px;
}

.site-footer strong {
  font-family: "Yu Mincho", "YuMincho", serif;
  font-size: 1.15rem;
}

.site-footer p { margin: 7px 0; }

.site-footer a { color: #fff; }

.footer-contact { text-align: right; }

.small {
  color: #c9d3cc;
  font-size: .82rem;
}

.copyright {
  padding: 13px 0 17px;
  border-top: 1px solid rgba(255,255,255,.17);
  color: #c3cec7;
  font-size: .78rem;
  text-align: center;
}

@media (max-width: 900px) {
  .brand-visual,
  .brand-copy { min-height: 175px; }

  .brand-home { width: min(480px, 62vw); }

  .nav-inner {
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .global-nav a { flex: 0 0 auto; padding-inline: 21px; }

  .main-grid { grid-template-columns: 1fr; }

  .side-column {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .container,
  .brand-copy { width: min(calc(100% - 28px), var(--max)); }

  .brand-visual,
  .brand-copy { min-height: 150px; }

  .brand-visual { background-position: 58% center; }

  .brand-shade {
    background: linear-gradient(90deg,
      rgba(255,255,255,.96) 0%,
      rgba(255,255,255,.84) 48%,
      rgba(255,255,255,.10) 88%);
  }

  .brand-home { width: min(340px, 78vw); }

  .brand-ja {
    font-size: clamp(1.45rem, 7vw, 2rem);
    letter-spacing: .07em;
  }

  .brand-en { font-size: .68rem; }

  .nav-inner {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-x: visible;
  }

  .global-nav a {
    min-width: 0;
    min-height: 48px;
    padding: 10px 8px;
    border-right: 1px solid rgba(255,255,255,.18);
    border-bottom: 1px solid rgba(255,255,255,.18);
    white-space: normal;
    text-align: center;
  }

  .global-nav a:nth-child(even) { border-right: 0; }

  .global-nav a + a::before { display: none; }

  .page-main { padding-top: 18px; }

  .panel { padding: 21px 18px; }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .news-item {
    grid-template-columns: 1fr;
    gap: 1px;
    padding-inline: 0;
  }

  .side-column { grid-template-columns: 1fr; }

  .related-grid,
  .footer-grid { grid-template-columns: 1fr; }

  .footer-contact { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Standard subpage */
.subpage {
  font-size: 1rem;
  line-height: 1.75;
}

.subpage .subpage-main {
  padding-bottom: 48px;
}

.subpage .subpage-container {
  max-width: 900px;
}

nav.breadcrumb {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: .9rem;
}

nav.breadcrumb > ol {
  display: flex;
  flex-wrap: wrap;
  gap: .35em .65em;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav.breadcrumb > ol > li {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: .65em;
  overflow-wrap: anywhere;
}

nav.breadcrumb > ol > li + li::before {
  content: "\203a";
  flex: 0 0 auto;
  color: #7b847e;
}

.subpage .content-panel {
  padding: clamp(24px, 5vw, 54px);
  background: var(--panel);
  border: 1px solid #e5e0d5;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(40, 48, 42, .035);
}

.subpage .page-title-block {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gold);
}

.subpage .page-title-block h1 {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 600;
  letter-spacing: .035em;
  line-height: 1.35;
}

.subpage .lead {
  max-width: 72ch;
  margin: 18px 0 0;
  color: #46514b;
  font-size: clamp(1.05rem, 2vw, 1.18rem);
  line-height: 1.9;
}

.subpage .content-panel section + section {
  margin-top: 46px;
}

.subpage .content-panel section > h2,
.subpage .note > h2 {
  margin: 0 0 18px;
  padding: 0 0 9px;
  border-bottom: 1px solid var(--gold);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: .025em;
  line-height: 1.45;
}

.subpage .content-panel section > h3 {
  margin: 32px 0 12px;
  padding-left: 13px;
  border-left: 4px solid var(--green);
  font-size: clamp(1.18rem, 2.4vw, 1.4rem);
  font-weight: 600;
  line-height: 1.5;
}

.subpage .content-panel p,
.subpage .content-panel li {
  max-width: 72ch;
}

.subpage .content-panel p {
  margin-block: 0 1.25em;
}

.subpage .content-panel ul,
.subpage .content-panel ol {
  margin: 1em 0 1.5em;
  padding-left: 1.5em;
}

.subpage .content-panel li + li {
  margin-top: .45em;
}

.subpage .external-link::after {
  content: " \2197";
  font-size: .85em;
}

.subpage .content-figure {
  width: 100%;
  margin: 24px auto;
}

.subpage .content-figure img {
  width: 100%;
  border: 1px solid var(--line);
}

.subpage .content-figure figcaption {
  padding: 10px 2px 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.65;
}

.subpage .table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
}

.subpage .table-scroll:focus-visible {
  outline: 3px solid #d49b00;
  outline-offset: 3px;
}

.subpage .data-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: #fff;
  font-size: 1rem;
}

.subpage .data-table caption {
  padding: 11px 14px;
  color: var(--green-dark);
  background: #f1eee5;
  font-weight: 700;
  text-align: left;
}

.subpage .data-table th,
.subpage .data-table td {
  padding: 11px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.subpage .data-table tr > :last-child {
  border-right: 0;
}

.subpage .data-table tbody tr:last-child > * {
  border-bottom: 0;
}

.subpage .data-table thead th {
  color: #fff;
  background: var(--green);
}

.subpage .data-table tbody th {
  color: var(--green-dark);
  background: #f7f4ec;
  font-weight: 700;
}

.subpage .note {
  margin-top: 46px;
  padding: 20px 22px;
  background: #fff8df;
  border: 1px solid #d9c681;
  border-left: 5px solid #9b7118;
}

.subpage .note > h2 {
  margin-bottom: 8px;
  padding: 0;
  border: 0;
  color: #60450f;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
}

.subpage .note p:last-child {
  margin-bottom: 0;
}

.subpage .page-navigation {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 20px;
  margin-top: 46px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.subpage .page-navigation a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid var(--green);
  border-radius: 3px;
  font-weight: 700;
  text-decoration: none;
}

.subpage .page-navigation a:hover {
  color: #fff;
  background: var(--brown);
  border-color: var(--brown);
}

@media (max-width: 640px) {
  .subpage .subpage-main {
    padding-bottom: 28px;
  }

  .subpage .content-panel {
    padding: 24px 18px;
  }

  .subpage .page-title-block {
    margin-bottom: 30px;
    padding-bottom: 20px;
  }

  .subpage .content-panel section + section,
  .subpage .note,
  .subpage .page-navigation {
    margin-top: 36px;
  }

  .subpage .page-navigation {
    flex-direction: column;
  }

  .subpage .page-navigation a {
    justify-content: center;
  }
}

/* Update history */
.history-page .history-year + .history-year {
  margin-top: 38px;
}

.history-page .history-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-page .history-entry {
  display: grid;
  grid-template-columns: 7.2em minmax(0, 1fr);
  gap: 18px;
  max-width: none;
  padding: 12px 4px;
  border-bottom: 1px solid #ebe7dd;
}

.history-page .history-entry:first-child {
  border-top: 1px solid #ebe7dd;
}

.history-page .history-entry + .history-entry {
  margin-top: 0;
}

.history-page .history-entry time {
  color: #695022;
  font-family: Georgia, "Times New Roman", serif;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.history-page .history-description {
  min-width: 0;
  overflow-wrap: anywhere;
}

.history-page .history-detail {
  color: var(--muted);
  font-size: .9em;
}

@media (max-width: 640px) {
  .history-page .history-entry {
    grid-template-columns: 1fr;
    gap: 2px;
    padding-block: 13px;
  }
}
