:root {
  color-scheme: light;
  font-family: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  color: #25362d;
  background: #faf9f5;
  --ink: #25362d;
  --muted: #526057;
  --green: #315c46;
  --green-dark: #234635;
  --green-soft: #edf2e9;
  --line: #e1e3d9;
  --paper: #fff;
  --sand: #f0ebdd;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; line-height: 1.7; }
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: var(--green); text-underline-offset: .22em; }
a:hover { color: var(--green-dark); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #8c542a; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.48; }
.wrap { width: min(1160px, 100% - 80px); margin-inline: auto; }
.skip-link { position: absolute; z-index: 2; top: .5rem; left: .5rem; padding: .6rem; background: white; transform: translateY(-160%); }
.skip-link:focus { transform: none; }

.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.header-inner { min-height: 76px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 1.125rem; font-weight: 800; }
.brand img { flex: 0 0 36px; }
.header-inner nav { display: flex; gap: 27px; align-items: center; }
.header-inner nav a { position: relative; padding-block: .75rem; text-decoration: none; font-size: .875rem; font-weight: 700; white-space: nowrap; }
.header-inner nav a[aria-current]::after, .header-inner nav a:hover::after {
  position: absolute; inset: auto 0 .3rem; height: 2px; background: var(--green); content: "";
}

.home { padding-block: 36px 78px; }
.hero { display: grid; grid-template-columns: 0.95fr 1.05fr; overflow: hidden; border-radius: 22px; background: var(--sand); }
.hero-copy { align-self: center; padding: 47px 28px 49px clamp(28px, 4.2vw, 60px); }
.hero h1 { font-size: clamp(1.5rem, 3.4vw, 2.75rem); font-weight: 800; line-height: 1.34; letter-spacing: .01em; }
.hero h1 span { display: block; }
.hero p { max-width: 24em; margin-top: 18px; color: var(--muted); line-height: 1.95; }
.hero .button { margin-top: 24px; }
.hero-image { width: 100%; height: 100%; min-height: 390px; object-fit: cover; object-position: center 54%; }
.button { display: inline-flex; align-items: center; gap: .85rem; justify-content: center; padding: .65rem 1.1rem; border-radius: 8px; background: var(--green); color: white; text-decoration: none; font-size: .9rem; font-weight: 700; }
.button:hover, .search-form button:hover { background: var(--green-dark); color: white; }
.button span { font-size: 1.1em; }

.home-categories { margin-top: 36px; }
.section-title { font-size: 1.5rem; letter-spacing: .025em; font-weight: 800; }
.category-list { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; margin: 15px 0 0; padding: 0; list-style: none; }
.category-list li { min-width: 0; }
.category-list a {
  display: flex; justify-content: space-between; align-items: center; height: 100%; gap: 8px;
  padding: .65rem .8rem .65rem .95rem; border: 1px solid #dce5d8; border-radius: 9px;
  background: var(--green-soft); color: var(--green-dark); text-decoration: none; font-size: .875rem; font-weight: 700;
}
.category-list .arrow { font-size: 1.45rem; font-weight: 500; line-height: .9; }
.category-list a:hover, .category-list a[aria-current] { border-color: #9eaf9f; background: #e1eadf; }

.archive { margin-top: 39px; padding-top: 29px; border-top: 1px solid var(--line); scroll-margin-top: 14px; }
.archive-tools { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-block: 14px 20px; }
.search-form { width: min(100%, 430px); }
.search-form label { display: block; margin-bottom: 6px; font-size: .8125rem; font-weight: 700; }
.search-input { display: flex; min-height: 45px; }
.search-form input { min-width: 0; width: 100%; padding: .45rem .75rem; border: 1px solid #bbc6ba; border-right: 0; border-radius: 8px 0 0 8px; background: white; color: var(--ink); }
.search-form input::placeholder { color: #606a63; font-size: .875rem; }
.search-form button { padding-inline: 1.05rem; border: 0; border-radius: 0 8px 8px 0; color: white; background: var(--green); font-size: .875rem; font-weight: 700; white-space: nowrap; }
#result-count { flex: 0 0 auto; color: var(--muted); font-size: .875rem; padding-bottom: .5rem; }
.card-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.article-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.article-card > a { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--ink); }
.article-card > a:focus-visible { outline-offset: -4px; }
.article-card > a:hover h3 { color: var(--green); text-decoration: underline; }
.article-card img { width: 100%; aspect-ratio: 2.06; object-fit: cover; background: var(--sand); }
.card-copy { flex: 1; display: flex; flex-direction: column; align-items: start; padding: 16px 18px 13px; }
.category-label { display: inline-block; border-radius: 6px; padding: .18rem .58rem .22rem; background: var(--green-soft); color: var(--green-dark); font-size: .8125rem; font-weight: 700; text-decoration: none; }
.card-copy h3 { margin-top: .6rem; overflow-wrap: anywhere; font-size: 1.0625rem; line-height: 1.65; }
.card-arrow { align-self: end; margin-top: auto; padding-top: .35rem; color: var(--green); font-weight: 700; }
.empty-state { padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.empty-state button { margin-top: .5rem; background: none; border: 0; padding: 0; color: var(--green); text-decoration: underline; }

.section-page, .reading-page { padding-block: 23px 64px; }
.breadcrumb { margin-bottom: 18px; font-size: .8125rem; color: var(--muted); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .3rem .6rem; margin: 0; padding: 0; list-style: none; }
.breadcrumb li + li::before { margin-right: .6rem; color: #67766b; content: "›"; }
.reading-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(230px, 1fr); gap: 22px 24px; align-items: start; }
.article-paper { min-width: 0; background: var(--paper); padding: clamp(24px, 3vw, 42px); border-radius: 17px; border: 1px solid var(--line); }
.article-heading h1 { margin-top: 12px; font-size: clamp(1.65rem, 3vw, 2.425rem); font-weight: 800; line-height: 1.44; overflow-wrap: anywhere; }
.article-photo { margin-top: 23px; aspect-ratio: 2.22; width: 100%; object-fit: cover; background: var(--sand); border-radius: 11px; }
.article-body { margin-top: 25px; font-size: 1rem; line-height: 2; overflow-wrap: anywhere; }
.article-body p { margin-block: 0 1.1em; }
.article-body h2 { font-size: 1.42rem; padding: .5rem .7rem .55rem; border-left: 4px solid var(--green); border-radius: 0 7px 7px 0; background: var(--green-soft); margin-block: 2em .85em; scroll-margin-top: 18px; }
.article-body h3, .article-body h4 { margin-block: 1.55em .55em; }
.article-body h3 { font-size: 1.125rem; }
.article-body ul, .article-body ol { padding-inline-start: 1.55em; }
.article-body blockquote { margin: 1.2em 0; padding-left: 1em; border-left: 3px solid var(--line); }
.toc { margin: 1.65em 0; padding: .85em 1.1em; border: 1px solid var(--line); border-radius: 10px; background: #f8f9f5; }
.toc summary { font-weight: 800; cursor: pointer; }
.toc ol { margin-block: .4em .15em; }
.toc a { font-size: .9375rem; }
.article-body .table-hint { display: none; }
.table-scroll { max-width: 100%; overflow-x: auto; margin: 1.3em 0; border: 1px solid #dce2d8; border-radius: 8px; }
.table-scroll table { width: 100%; min-width: 420px; border-spacing: 0; font-size: .9375rem; line-height: 1.65; }
.table-scroll th, .table-scroll td { padding: .65em .75em; text-align: left; vertical-align: top; border-bottom: 1px solid #dce2d8; border-right: 1px solid #dce2d8; }
.table-scroll tr > :last-child { border-right: 0; }
.table-scroll tbody tr:last-child > * { border-bottom: 0; }
.table-scroll th { background: var(--green-soft); }
.table-scroll tbody tr:nth-child(even) td { background: #fafbf8; }
.reading-aside { padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.reading-aside h2 { font-size: 1rem; }
.reading-aside .category-list { grid-template-columns: minmax(0,1fr); gap: 7px; margin-top: 12px; }
.reading-navigation { grid-column: 1; }
.article-navigation { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; text-align: center; font-size: .875rem; }
.article-navigation a { padding: .65rem .3rem; border: 1px solid var(--line); border-radius: 8px; background: white; font-weight: 700; text-decoration: none; }
.article-navigation a:hover { background: var(--green-soft); }
.related { margin-bottom: 20px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.related h2 { font-size: 1.1rem; }
.related ul { margin-block: .6rem 0; padding-left: 1.15rem; }

.page-title h1 { font-size: clamp(1.7rem, 3.1vw, 2.7rem); font-weight: 800; }
.section-page .archive { margin-top: 20px; padding-top: 8px; }
.simple-layout { max-width: 820px; }
.simple-paper { margin-top: 20px; padding: 25px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.simple-paper h2, .link-list h2 { font-size: 1.125rem; }
.simple-paper h2:not(:first-child) { margin-top: 1.5rem; }
.simple-paper p + p, .simple-paper h2 + p { margin-top: .6rem; }
.link-list { display: grid; gap: 12px; margin: 20px 0 0; padding: 0; list-style: none; }
.link-list li { padding: 20px 25px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.link-list p { margin-top: .45rem; color: var(--muted); }
.link-list h2 span { font-size: .86em; }

.site-footer { border-top: 1px solid var(--line); background: var(--green-soft); }
.footer-inner { padding-block: 26px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 6px 15px; }
.footer-inner nav a, .footer-inner small { font-size: .8125rem; }
.footer-inner small { color: var(--muted); }

@media (max-width: 1020px) {
  .wrap { width: calc(100% - 48px); }
  .category-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 740px) {
  .wrap { width: calc(100% - 32px); }
  .hero-image { min-height: 305px; }
  .hero-copy { padding: 24px 18px; }
  .hero p { margin-top: 10px; }
  .hero .button { margin-top: 16px; }
  .card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .reading-grid { grid-template-columns: minmax(0, 1fr); }
  .reading-aside { grid-row: 3; }
  .reading-aside .category-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; border-radius: 15px; }
  .hero-copy { padding: 22px; }
  .hero h1 { font-size: clamp(1.48rem, 7vw, 2.15rem); }
  .hero p { font-size: .9375rem; line-height: 1.75; }
  .hero-image { min-height: 0; height: auto; aspect-ratio: 2 / 1; }
}
@media (max-width: 550px) {
  .header-inner { display: grid; justify-content: start; gap: 0; padding-top: 12px; }
  .brand { font-size: 1rem; gap: 8px; }
  .brand img { width: 32px; flex-basis: 32px; }
  .header-inner nav { gap: 19px; }
  .header-inner nav a { padding-block: .58rem; }
  .header-inner nav a[aria-current]::after, .header-inner nav a:hover::after { bottom: .2rem; }
  .home { padding-block: 18px 42px; }
  .home-categories { margin-top: 26px; }
  .section-title { font-size: 1.25rem; }
  .category-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin-top: 10px; }
  .category-list a { padding: .57rem .57rem .57rem .65rem; min-height: 44px; font-size: .8125rem; }
  .archive { margin-top: 27px; padding-top: 20px; }
  .archive-tools { display: grid; gap: 7px; margin-block: 10px 10px; }
  #result-count { padding: 0; }
  .card-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .article-card > a { display: grid; grid-template-columns: minmax(0, 36%) minmax(0,1fr); }
  .article-card img { height: 100%; min-height: 128px; aspect-ratio: auto; }
  .card-copy { padding: 10px 12px 8px; }
  .card-copy h3 { margin-top: .35rem; font-size: .9375rem; }
  .article-paper { padding: 17px; border-radius: 12px; }
  .article-heading h1 { font-size: 1.5rem; }
  .article-photo { margin-top: 15px; aspect-ratio: 1.8; }
  .article-body { margin-top: 18px; line-height: 1.95; }
  .article-body h2 { font-size: 1.2rem; }
  .section-page, .reading-page { padding-block: 16px 40px; }
  .simple-paper, .link-list li { padding: 17px; }
  .reading-aside .category-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 487px) {
  .article-body .table-hint { display: block; margin: 1.2rem 0 .35rem; color: var(--muted); font-size: .8125rem; }
  .table-hint + .table-scroll { margin-top: 0; }
}
