:root {
  color-scheme: light;
  --background: #faf8f1;
  --paper: #fffefa;
  --ink: #262f26;
  --muted: #535950;
  --green: #304b39;
  --soft-green: #e8eddf;
  --line: #dddccf;
  --accent: #a74329;
  --radius: 18px;
  font-family: "Noto Sans JP", "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: 16px;
  scroll-padding-top: 1.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--background); line-height: 1.75; }
[hidden] { display: none !important; }
a { color: var(--green); text-underline-offset: .22em; }
button, input { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.5; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.wrap { width: min(calc(100% - 72px), 1160px); 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: fixed; z-index: 2; top: .75rem; left: .75rem; padding: .5rem .75rem; background: var(--paper); }

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; justify-content: space-between; align-items: center; min-height: 74px; gap: 18px 32px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-weight: 800; font-size: 1.03rem; text-decoration: none; line-height: 1.4; }
.brand img { flex: 0 0 auto; }
.main-nav, .footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1.75rem; }
.main-nav a, .footer-links a { color: var(--ink); font-size: .88rem; font-weight: 600; text-decoration: none; }
.main-nav a:hover, .footer-links a:hover, .main-nav a[aria-current] { color: var(--accent); text-decoration: underline; }
.menu-toggle { display: none; }

.home { padding-block: 32px 72px; }
.hero { display: grid; grid-template-columns: 1.08fr 1fr; background: var(--soft-green); border-radius: 24px; overflow: hidden; }
.hero-copy { align-self: center; padding: clamp(32px, 4.3vw, 64px); }
.hero h1 { color: var(--green); font-size: clamp(2.6rem, 4.65vw, 4.15rem); line-height: 1.18; letter-spacing: -.055em; font-weight: 800; }
.hero p { margin-top: 1.2rem; color: #394637; line-height: 1.85; }
.hero-photo { width: 100%; height: 100%; min-height: 400px; object-fit: cover; object-position: 50% 51%; }
.search-form {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(100%, 440px);
  margin-top: 1.5rem;
  padding: 5px;
  padding-left: 13px;
  border: 1px solid #c9cebd;
  border-radius: 11px;
  background: var(--paper);
  color: var(--green);
}
.search-form:focus-within { border-color: var(--green); }
.search-form svg { flex: none; }
.search-form input { flex: 1; min-width: 0; width: 100%; color: var(--ink); background: transparent; border: 0; padding: .25rem .1rem; }
.search-form input:focus { outline: none; }
.search-form input::placeholder { color: #636b5e; opacity: 1; }
.search-form button, .button { flex: none; padding: .55rem .95rem; border: 0; border-radius: 7px; background: var(--green); color: #fff; font-weight: 700; }
.search-form button:hover, .button:hover { background: #233c2a; }
.button { display: inline-flex; align-items: center; gap: .7rem; padding: .65rem 1.05rem; text-decoration: none; }

.home-section { margin-top: 44px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-heading h2 { font-size: clamp(1.35rem, 2.35vw, 1.8rem); font-weight: 800; }
.result-info { color: var(--muted); flex: none; font-size: .85rem; }
.article-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.article-card { display: flex; flex-direction: column; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; transition: border-color .18s, box-shadow .18s; }
.article-card:hover { border-color: #7e967d; box-shadow: 0 5px 16px #303d2810; }
.article-card > img { width: 100%; height: auto; aspect-ratio: 1.72; object-fit: cover; }
.card-copy { display: flex; flex-direction: column; align-items: flex-start; flex: 1; padding: 16px 16px 13px; }
.category-label { display: inline-block; background: var(--soft-green); color: var(--green); border-radius: 6px; padding: 3px 9px; font-size: .77rem; font-weight: 700; text-decoration: none; }
a.category-label:hover { text-decoration: underline; }
.card-copy h3 { margin: 8px 0 10px; font-size: 1rem; font-weight: 700; line-height: 1.65; overflow-wrap: anywhere; }
.card-arrow { align-self: flex-end; margin-top: auto; color: var(--green); line-height: 1.1; }
.category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.category-grid a, .side-categories a { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-weight: 700; text-decoration: none; }
.category-grid a { padding: .75rem .9rem; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.category-grid a:hover, .category-grid a[aria-current] { background: var(--soft-green); border-color: #a9b6a2; }
.empty-state { padding: 1.25rem; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.empty-state p { margin-bottom: .8rem; }

.inner-page { padding-block: 25px 70px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: .4rem .65rem; align-items: center; color: var(--muted); font-size: .82rem; margin-bottom: 20px; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 290px); align-items: start; gap: 25px; }
.article-paper, .side-panel, .simple-paper, .link-card { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.article-paper { padding: clamp(18px, 3.4vw, 44px); }
.article-header h1 { margin: .55rem 0 1.25rem; color: var(--ink); font-size: clamp(1.6rem, 3.05vw, 2.45rem); font-weight: 800; letter-spacing: -.032em; overflow-wrap: anywhere; }
.article-cover { width: 100%; height: auto; aspect-ratio: 2.35; object-fit: cover; border-radius: 12px; }
.article-body { min-width: 0; margin-top: 1.55rem; line-height: 1.95; overflow-wrap: anywhere; container-type: inline-size; }
.article-body p, .article-body ul, .article-body ol, .article-body blockquote { margin: 0 0 1.15em; }
.article-body ul, .article-body ol { padding-inline-start: 1.4em; }
.article-body h2 { margin: 2em 0 .8em; padding: .55em .75em; border-left: 4px solid var(--green); border-radius: 0 6px 6px 0; background: var(--soft-green); font-size: clamp(1.18rem, 2vw, 1.45rem); }
.article-body h3 { margin: 1.55em 0 .65em; font-size: 1.13rem; }
.article-body h4 { margin: 1.4em 0 .6em; font-size: 1.02rem; }
.article-body blockquote { padding-left: 1em; border-left: 2px solid var(--line); }
.toc { margin: 1.6em 0; padding: .65rem 1.1rem .75rem; border: 1px solid #d6dccc; border-radius: 10px; background: #f4f6ed; }
.toc summary { color: var(--green); font-weight: 800; cursor: pointer; }
.article-body .toc ol { margin: .35rem 0 .1rem; }
.toc li { padding: .13rem 0; }
.toc a:hover { color: var(--accent); }
.table-hint { display: none; margin-top: 1.4rem; color: var(--muted); font-size: .8rem; }
.table-scroll { max-width: 100%; margin: 1.5em 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.table-scroll table { width: 100%; min-width: 27rem; border-spacing: 0; font-size: .92rem; line-height: 1.65; }
.table-scroll th, .table-scroll td { padding: .7em .8em; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: top; text-align: left; }
.table-scroll th { background: var(--soft-green); }
.table-scroll tr > :last-child { border-right: 0; }
.table-scroll tbody tr:last-child td { border-bottom: 0; }
@container (max-width: 433px) {
  .table-hint { display: block; }
  .table-hint + .table-scroll { margin-top: .35rem; }
}
.article-navigation { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem 1.3rem; margin-top: 2rem; padding-top: 1.15rem; border-top: 1px solid var(--line); font-size: .92rem; }

.article-aside { display: grid; gap: 16px; }
.side-panel { padding: 17px 19px; }
.side-panel h2 { margin-bottom: .45rem; color: var(--ink); font-size: 1rem; font-weight: 800; }
.side-categories a, .side-related a { padding: .56rem 0; font-size: .85rem; }
.side-categories a + a, .side-related a + a { border-top: 1px solid var(--line); }
.side-categories a:hover, .side-related a:hover { text-decoration: underline; }
.side-related a { display: flex; align-items: center; gap: .65rem; font-weight: 600; text-decoration: none; line-height: 1.52; }
.side-related img { width: 54px; height: 48px; border-radius: 5px; object-fit: cover; flex: none; }

.page-title { margin-bottom: 20px; }
.page-title h1 { color: var(--green); font-size: clamp(1.75rem, 3.8vw, 2.8rem); font-weight: 800; letter-spacing: -.02em; }
.simple-layout { max-width: 790px; margin-inline: auto; }
.simple-paper, .link-card { padding: clamp(18px, 3vw, 33px); }
.simple-paper h2, .link-card h2 { font-size: 1.2rem; }
.simple-paper h2:not(:first-child) { margin: 1.4rem 0 .4rem; }
.simple-paper p + p, .simple-paper .button, .simple-paper .button + p { margin-top: .9rem; }
.link-list { display: grid; gap: 16px; }
.link-card h2 a { display: inline-flex; gap: .55rem; align-items: baseline; color: var(--green); }
.link-card p { margin-top: .55rem; }
.link-domain { display: inline-block; margin-top: .7rem; font-size: .83rem; color: var(--muted); }

.site-footer { background: #e9eade; border-top: 1px solid var(--line); padding: 29px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 22px; }
.footer-inner .brand img { width: 31px; height: 31px; }
.copyright { margin-top: .38rem; color: var(--muted); font-size: .72rem; }
.footer-links { gap: .5rem 1.25rem; }
.footer-links a { font-size: .8rem; }

@media (max-width: 1000px) {
  .wrap { width: calc(100% - 48px); }
  .desktop-break { display: none; }
  .article-grid, .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-card > img { aspect-ratio: 2; }
}

@media (max-width: 760px) {
  .wrap { width: calc(100% - 32px); }
  .header-inner { min-height: 63px; flex-wrap: wrap; gap: 0 10px; padding-block: 10px; }
  .brand { gap: 7px; font-size: .9rem; }
  .brand img { width: 32px; height: 32px; }
  .js .menu-toggle { display: inline-flex; gap: 4px; align-items: center; padding: 6px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--green); background: var(--paper); font-size: .74rem; }
  .main-nav { flex-basis: 100%; gap: .5rem 1rem; padding-top: 10px; }
  .main-nav a { font-size: .82rem; }
  .js .main-nav:not(.is-open) { display: none; }
  .home { padding-block: 18px 44px; }
  .hero { grid-template-columns: minmax(0, 1fr); border-radius: 17px; }
  .hero-copy { padding: 23px 22px 25px; }
  .hero h1 { font-size: clamp(2rem, 9vw, 3.35rem); }
  .hero p { margin-top: .8rem; font-size: .92rem; }
  .hero-photo { height: clamp(170px, 39vw, 270px); min-height: 0; object-position: 50% 56%; }
  .search-form { margin-top: 1rem; }
  .search-form button { padding-inline: .7rem; }
  .home-section { margin-top: 30px; }
  .section-heading { margin-bottom: 13px; }
  .inner-page { padding-block: 16px 45px; }
  .breadcrumb { margin-bottom: 13px; }
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .article-header h1 { margin-bottom: .9rem; }
  .article-cover { aspect-ratio: 1.9; }
  .article-body { margin-top: 1.1rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 13px; }
}

@media (max-width: 465px) {
  .hero-copy { padding-inline: 17px; }
  .search-form input { font-size: .94rem; }
  .article-grid, .category-grid { gap: 9px; }
  .article-card { border-radius: 11px; }
  .article-card > img { aspect-ratio: 1.55; }
  .card-copy { padding: 9px 10px 10px; }
  .card-copy h3 { font-size: .87rem; line-height: 1.55; }
  .card-copy .category-label { font-size: .69rem; padding-inline: 5px; }
  .category-grid a { padding: .55rem .58rem; font-size: .81rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}


/* 記事内の共通囲みボックス */
.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;
  }
}
