@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --ink: #222c26;
  --muted: #536158;
  --muted-dark: #c8d2c9;
  --evergreen: #142820;
  --green: #254c3b;
  --gold: #edcb90;
  --paper: #f6f4ed;
  --surface: #fffef9;
  --line: #dedfd2;
  --sans: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 1.5rem; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 400 16px/1.8 var(--sans);
  overflow-wrap: anywhere;
}
h1, h2, h3, p { margin-top: 0; }
img { display: block; max-width: 100%; }
a { color: var(--green); text-underline-offset: 0.22em; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #a77132; outline-offset: 4px; }
::selection { color: #1d2f24; background: #eed49e; }

.wrap { width: min(1168px, calc(100% - 72px)); margin-inline: auto; }
.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus {
  position: absolute;
  z-index: 4;
  top: 10px;
  left: 10px;
  padding: 8px 14px;
  background: var(--surface);
}

.site-header, .site-footer { background: var(--evergreen); color: var(--surface); }
.site-header { border-bottom: 1px solid rgb(255 255 255 / 15%); }
.header-inner { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #faf6eb;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-decoration: none;
}
.brand img { flex: none; }
.main-nav, .footer-links { display: flex; align-items: center; gap: clamp(16px, 3vw, 42px); }
.main-nav a, .footer-links a { color: var(--muted-dark); font-size: 14px; font-weight: 600; text-decoration: none; }
.main-nav a:hover, .main-nav a[aria-current], .footer-links a:hover { color: var(--gold); }
.menu-toggle { display: none; }
.site-footer { padding: 40px 0 24px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 23px; }
.copyright { width: 100%; margin: 0; padding-top: 17px; border-top: 1px solid rgb(255 255 255 / 16%); color: var(--muted-dark); font-size: 12px; }

.hero { background: var(--evergreen); color: #f9f7ee; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr);
  align-items: center;
  gap: clamp(25px, 4vw, 62px);
  padding-block: 43px 51px;
}
.hero h1 { margin-bottom: 19px; color: #fffbf1; font-size: clamp(30px, 3.65vw, 48px); font-weight: 800; line-height: 1.22; letter-spacing: 0.015em; }
.hero h1 span { display: block; }
.hero-copy p { max-width: 29rem; margin-bottom: 24px; color: #d5ded4; }
.hero-image {
  width: 100%;
  height: auto;
  aspect-ratio: 1.82;
  object-fit: cover;
  border: 1px solid rgb(237 203 144 / 40%);
  border-radius: 8px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 45px;
  padding: 9px 18px;
  color: #fffdf7;
  background: var(--green);
  border: 1px solid transparent;
  border-radius: 5px;
  font-weight: 700;
  text-decoration: none;
}
.button:hover { background: #19382c; }
.button-light { color: #21362b; background: var(--gold); }
.button-light:hover { color: #162a20; background: #f8d9a6; }

.section { padding-block: 48px; }
#articles.section { padding-bottom: 36px; }
.section-title {
  margin-bottom: 20px;
  color: var(--evergreen);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.025em;
}
.archive-tools { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.result-count { margin: 0; color: var(--muted); font-size: 14px; }
.search-form { display: flex; width: min(100%, 430px); }
.search-form input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 8px 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #bac6ba;
  border-radius: 5px 0 0 5px;
}
.search-form button {
  flex: none;
  min-width: 68px;
  padding: 6px 12px;
  color: var(--surface);
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 0 5px 5px 0;
  font-size: 14px;
  font-weight: 700;
}
.search-form button:hover { background: var(--evergreen); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.article-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.article-card:hover { border-color: #829985; box-shadow: 0 6px 16px rgb(24 46 33 / 9%); }
.article-card img { width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; background: #30483a; }
.card-content { position: relative; flex: 1; padding: 18px 20px 44px; }
.category-label {
  display: inline-block;
  padding: 2px 9px;
  color: #325341;
  background: #e5eee3;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.95;
  text-decoration: none;
}
a.category-label:hover { background: #d7e5d4; }
.article-card h3 { margin: 10px 0 8px; color: var(--evergreen); font-size: 18px; font-weight: 800; line-height: 1.57; }
.article-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.card-arrow { position: absolute; right: 20px; bottom: 11px; color: var(--green); font-size: 20px; font-weight: 700; }
.empty-state { padding: 25px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.categories-section { margin-top: 0; border-top: 1px solid var(--line); }
.category-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0; margin: 0; list-style: none; }
.category-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  font-weight: 700;
  text-decoration: none;
}
.category-links a:hover, .category-links a[aria-current] { background: #e8efe5; border-color: #c0cebf; }
.category-count { flex: none; color: var(--muted); font-size: 12px; font-weight: 500; }

.inner-page { min-height: 65vh; padding-block: 22px 56px; }
.inner-page > .section:first-of-type { padding-top: 15px; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 9px; margin-bottom: 23px; color: var(--muted); font-size: 13px; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 280px); align-items: start; gap: 27px; }
.article-paper, .article-sidebar, .simple-paper { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }
.article-paper { overflow: hidden; }
.article-heading { padding: 32px clamp(24px, 4vw, 51px) 26px; }
.article-heading h1 {
  margin: 13px 0 10px;
  color: var(--evergreen);
  font-size: clamp(27px, 3.1vw, 35px);
  font-weight: 800;
  line-height: 1.42;
  letter-spacing: 0.012em;
  text-wrap: balance;
  word-break: auto-phrase;
}
.read-time { margin: 0; color: var(--muted); font-size: 13px; }
.article-image { width: 100%; height: auto; aspect-ratio: 2.26; object-fit: cover; background: #30483a; }
.article-body { min-width: 0; padding: 30px clamp(24px, 4vw, 51px) 42px; font-size: 16px; line-height: 1.95; }
.article-body p, .article-body ul, .article-body ol { margin-block: 0 1.12em; }
.article-body li + li { margin-top: 0.4em; }
.article-body h2 {
  margin: 2em 0 0.82em;
  padding: 0.45em 0.68em;
  color: var(--evergreen);
  background: #edf1e9;
  border-left: 4px solid #47745c;
  font-size: clamp(21px, 2.3vw, 28px);
  font-weight: 800;
  line-height: 1.52;
}
.article-body h3 { margin: 1.55em 0 0.55em; color: var(--evergreen); font-size: 20px; font-weight: 700; line-height: 1.55; }
.article-body h4 { margin: 1.5em 0 0.5em; color: var(--evergreen); }
.article-body blockquote { margin: 1.5em 0; padding: 0.7em 1em; border-left: 3px solid #9aaf9a; background: #f0f2e9; }
.article-body blockquote > :last-child { margin-bottom: 0; }
.toc { margin: 1.5em 0 2em; padding: 14px 20px; background: #f5f4ea; border: 1px solid var(--line); border-radius: 6px; }
.toc summary { color: var(--evergreen); font-size: 17px; font-weight: 800; cursor: pointer; }
.toc ol { margin: 9px 0 0; padding-inline-start: 1.65em; }
.toc a { font-size: 15px; font-weight: 600; }
.table-scroll { max-width: 100%; margin-block: 1.5em; overflow-x: auto; }
.table-scroll table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 15px; line-height: 1.66; }
.table-scroll th, .table-scroll td { padding: 0.72em 0.85em; border: 1px solid #d8ded2; text-align: left; vertical-align: top; }
.table-scroll th { background: #e7eee3; color: var(--evergreen); }
.table-scroll tbody tr:nth-child(even) { background: #f7f8f2; }
.article-sidebar { min-width: 0; padding: 17px; }
.article-sidebar h2 { margin: 0 0 12px; color: var(--evergreen); font-size: 18px; font-weight: 800; }
.article-sidebar .category-links { grid-template-columns: 1fr; gap: 6px; }
.article-sidebar .category-links a { padding: 9px 10px; font-size: 13px; }
.related { margin-top: 32px; }
.related .section-title { font-size: 24px; }
.related .card-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 13px; }
.article-navigation { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 24px; text-align: center; }
.article-navigation a { padding: 10px 4px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); font-size: 14px; font-weight: 700; text-decoration: none; }
.article-navigation a:hover { background: #e8efe5; }
.simple-paper { width: min(100%, 800px); padding: clamp(21px, 5vw, 42px); }
.simple-paper h2 { margin: 1.45em 0 0.45em; color: var(--evergreen); font-size: 21px; }

@media (max-width: 1020px) {
  .wrap { width: calc(100% - 48px); }
  .article-layout { grid-template-columns: minmax(0, 1fr) minmax(190px, 235px); gap: 18px; }
  .card-grid { gap: 17px; }
}
@media (max-width: 780px) {
  .wrap { width: calc(100% - 36px); }
  .hero-grid { gap: 22px; padding-block: 30px; }
  .hero h1 { font-size: clamp(28px, 4vw, 36px); }
  .hero-copy p { font-size: 14px; }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-sidebar .category-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 690px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-image { aspect-ratio: 2 / 1; }
}
@media (max-width: 600px) {
  .header-inner { min-height: 63px; flex-wrap: wrap; gap: 0 12px; padding-block: 10px; }
  .brand { max-width: calc(100% - 80px); gap: 8px; font-size: 13px; }
  .brand img { width: 28px; height: 28px; }
  .menu-toggle { display: block; min-height: 40px; padding: 5px 8px; border: 1px solid #718378; border-radius: 5px; background: transparent; color: #fbf7ee; font-size: 12px; }
  .main-nav { display: none; width: 100%; padding-block: 14px 2px; flex-wrap: wrap; gap: 9px 16px; }
  .main-nav.is-open { display: flex; }
  .main-nav a { font-size: 13px; }
  .site-footer .brand { max-width: none; }
  .footer-links { flex-wrap: wrap; gap: 8px 16px; }
  .footer-links a { font-size: 13px; }
  .hero-grid { grid-template-columns: 1fr; gap: 20px; padding-block: 28px 25px; }
  .hero h1 { font-size: clamp(30px, 8vw, 43px); margin-bottom: 13px; }
  .hero-copy p { margin-bottom: 16px; font-size: 15px; }
  .hero-image { aspect-ratio: 2 / 1; }
  .section { padding-block: 32px; }
  .section-title { margin-bottom: 13px; }
  .archive-tools { align-items: start; flex-direction: column; gap: 9px; margin-bottom: 15px; }
  .search-form { width: 100%; }
  .card-grid { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .category-links, .article-sidebar .category-links { grid-template-columns: minmax(0, 1fr); }
  .inner-page { padding-top: 16px; }
  .breadcrumb { margin-bottom: 15px; }
  .article-heading { padding: 19px 16px 17px; }
  .article-heading h1 { font-size: clamp(24px, 6.4vw, 32px); }
  .article-image { aspect-ratio: 1.9; }
  .article-body { padding: 20px 15px 27px; line-height: 1.85; }
  .article-body h2 { margin-top: 1.6em; }
  .article-body h3 { font-size: 18px; }
  .toc { padding: 12px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .article-card { transition: none; }
}

/* 記事内の共通囲みボックス */
.article-box {
  box-sizing: border-box;
  margin: 1.8em 0;
  padding: 1.2em 1.4em;
  border: 2px solid;
  border-radius: 8px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

/* ポイント */
.article-box--point {
  background-color: #eff8f7;
  border-color: #178a95;
}

/* 注意 */
.article-box--caution {
  background-color: #fff7ee;
  border-color: #d48735;
}

/* 補足 */
.article-box--note {
  background-color: #f2f6fc;
  border-color: #7393bd;
}

/* 囲みボックスの見出し */
.article-box .article-box__title {
  margin: 0 0 0.6em;
  font-weight: 700;
  font-size: 1em;
}

.article-box--point .article-box__title {
  color: #176a72;
}

.article-box--caution .article-box__title {
  color: #a35c20;
}

.article-box--note .article-box__title {
  color: #45678d;
}

/* ボックス内の最後の段落 */
.article-box p:last-child {
  margin-bottom: 0;
}

/* 黄色マーカー */
.article-marker {
  background: linear-gradient(
    transparent 55%,
    #fff0a6 55%
  );
  padding: 0 0.1em;
}

/* スマートフォン対応 */
@media (max-width: 600px) {
  .article-box {
    padding: 1em 1.1em;
    margin: 1.5em 0;
  }
}
