:root {
  color-scheme: light;
  --background: #f8f6ef;
  --paper: #fffdf8;
  --ink: #20372d;
  --muted: #4e6157;
  --accent: #a4432c;
  --line: #dedfd3;
  --green-pale: #edf1e7;
  --page-width: 1168px;
  font-family: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--background); line-height: 1.75; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
a { color: inherit; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
:target { scroll-margin-top: 22px; }

.wrap { width: min(var(--page-width), calc(100% - 80px)); 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: 1; top: 8px; left: 12px;
  padding: 8px 16px; color: var(--paper); background: var(--ink); border-radius: 5px;
}
.arrow { display: inline-block; font-family: system-ui, sans-serif; line-height: 1; }

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; min-height: 76px; align-items: center;
  justify-content: space-between; gap: 24px;
}
.brand {
  display: inline-flex; width: fit-content; align-items: center; gap: 11px;
  color: var(--ink); font-size: 18px; font-weight: 800; text-decoration: none;
}
.brand img { flex: 0 0 auto; border-radius: 8px; }
.main-nav { display: flex; align-items: center; gap: 29px; }
.main-nav a {
  display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap;
  color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: none;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--accent); }

.hero {
  display: grid; grid-template-columns: .86fr 1.14fr; align-items: center;
  gap: clamp(36px, 5vw, 76px); padding-block: 50px 54px;
}
.hero h1 {
  font-size: clamp(34px, 3.48vw, 55px); font-weight: 900;
  line-height: 1.26; letter-spacing: -.06em;
}
.hero h1 span {
  display: block; font-size: clamp(58px, 6.6vw, 98px);
  line-height: 1; font-weight: 900; letter-spacing: -.084em; margin: 0 0 8px -.055em;
}
.hero p { max-width: 28em; margin-block: 20px 24px; color: var(--muted); }
.hero-image {
  width: 100%; height: auto; aspect-ratio: 1.82; object-fit: cover;
  object-position: 54% center; border-radius: 20px 20px 64px 20px;
  background: var(--green-pale);
}
.search-form {
  display: flex; gap: 5px; width: min(100%, 422px); padding: 5px;
  border: 1px solid #cbd2c6; border-radius: 12px; background: var(--paper);
}
.search-form:focus-within { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.search-form input {
  width: 0; flex: 1; min-width: 0; padding: 8px 10px;
  color: var(--ink); background: transparent; border: 0; outline: 0;
}
.search-form input:focus-visible { outline: 0; }
.search-form input::placeholder { color: #58675e; opacity: 1; }
.search-form button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 6px 15px; border: 0; border-radius: 8px;
  color: var(--paper); background: var(--ink); cursor: pointer;
  white-space: nowrap; font-size: 14px; font-weight: 700; text-decoration: none;
}
.search-form button:hover, .button:hover { color: var(--paper); background: #38594a; }

.archive { padding-block: 25px 40px; border-top: 1px solid var(--line); }
.section-heading {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 6px 18px; margin-bottom: 17px;
}
.section-heading h2 { font-size: 27px; line-height: 1.4; letter-spacing: -.04em; }
.section-heading [role="status"] { color: var(--muted); font-size: 14px; }
.article-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.article-card {
  min-width: 0; overflow: hidden; border: 1px solid var(--line);
  background: var(--paper); border-radius: 14px; transition: border-color .2s, box-shadow .2s;
}
.article-card:hover { border-color: #a5b1a2; box-shadow: 0 6px 14px #21372d12; }
.article-card a {
  display: flex; flex-direction: column; height: 100%; text-decoration: none;
}
.article-card a:focus-visible { outline-offset: -3px; }
.article-card img { width: 100%; height: auto; aspect-ratio: 1.8; object-fit: cover; background: var(--green-pale); }
.card-copy { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 9px; padding: 14px 16px 15px; }
.category-label {
  display: inline-block; border-radius: 4px; padding: 3px 8px; color: var(--ink);
  background: var(--green-pale); font-size: 12px; font-weight: 700; text-decoration: none;
}
.card-copy h3 { color: var(--ink); font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; }
.article-card a:hover h3 { color: var(--accent); }
.card-arrow { align-self: flex-end; margin-top: auto; color: var(--accent); font-size: 20px; line-height: 1.2; }
.empty-state { padding: 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.empty-state button {
  padding: 8px 0; color: var(--accent); background: none; border: 0; text-decoration: underline; cursor: pointer;
}

.home-categories { padding-block: 4px 64px; }
.category-list, .related {
  padding: 20px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--paper);
}
.home-categories .category-list { padding: 23px 26px; background: var(--green-pale); }
.category-list h2, .related h2 { font-size: 17px; font-weight: 800; }
.home-categories h2 { font-size: 21px; }
.category-list ul, .related ul, .external-links, .breadcrumbs ol { list-style: none; padding: 0; margin: 0; }
.category-list ul, .related ul { margin-top: 9px; }
.home-categories ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 0 23px; }
.category-list li, .related li { border-top: 1px solid var(--line); }
.category-list a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  min-height: 44px; padding-block: 11px; font-size: 14px; font-weight: 700; text-decoration: none;
}
.category-count { color: var(--muted); white-space: nowrap; font-size: 12px; font-weight: 500; }
.category-count .arrow, .related .arrow { color: var(--accent); margin-left: 3px; }
.related a { display: block; padding-block: 11px; font-size: 14px; font-weight: 600; text-decoration: none; }
.category-list li:last-child a, .related li:last-child a { padding-bottom: 3px; }

.inner-main { padding-block: 24px 60px; }
.breadcrumbs { margin-bottom: 20px; color: var(--muted); font-size: 13px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 9px; }
.breadcrumbs li + li::before { content: "›"; display: inline-block; margin-right: 9px; color: #65756a; }
.breadcrumbs a { text-underline-offset: 3px; }
.page-heading { margin-bottom: 21px; }
.page-heading h1 { font-size: clamp(27px, 4vw, 43px); line-height: 1.4; letter-spacing: -.04em; overflow-wrap: anywhere; }
.category-archive .search-form { margin-bottom: 22px; }
.article-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 305px);
  align-items: start; gap: clamp(22px, 3vw, 38px);
}
.article-sidebar { display: grid; gap: 16px; }
.article-paper, .simple-paper {
  min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
}
.article-paper { padding: 30px clamp(22px, 3.1vw, 46px) 36px; }
.article-header h1 {
  margin-block: 12px 10px; font-size: clamp(25px, 2.7vw, 39px);
  line-height: 1.43; letter-spacing: -.04em; overflow-wrap: anywhere;
}
.reading-time { color: var(--muted); font-size: 13px; }
.eyecatch {
  width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover;
  margin-block: 20px 25px; border-radius: 10px; background: var(--green-pale);
}
.article-body, .simple-paper { color: #29372f; font-size: 16px; line-height: 1.9; overflow-wrap: anywhere; }
.article-body p, .simple-paper p { margin-block: 0 1.05em; }
.article-body p:last-child, .simple-paper p:last-child { margin-bottom: 0; }
.article-body a, .simple-paper a:not(.button), .toc a { color: #3b6552; text-underline-offset: .18em; }
.article-body a:hover, .simple-paper a:not(.button):hover, .toc a:hover { color: var(--accent); }
.article-body h2, .simple-paper h2 {
  margin: 1.9em 0 .8em; padding: .36em .65em;
  border-left: 4px solid #69846c; background: var(--green-pale);
  color: var(--ink); font-size: 1.36em; line-height: 1.55;
}
.simple-paper h2:first-child { margin-top: 0; }
.article-body h3, .article-body h4 { margin: 1.35em 0 .6em; color: var(--ink); line-height: 1.6; }
.article-body h3 { font-size: 1.13em; }
.article-body ul, .article-body ol { padding-inline-start: 1.5em; margin-block: .6em 1.25em; }
.article-body li + li { margin-top: .28em; }
.article-body blockquote { margin-inline: 0; border-left: 4px solid var(--line); padding-left: 1em; }
.toc { margin-block: 1.65em; padding: .9em 1.2em; border: 1px solid var(--line); border-radius: 9px; background: #f3f5ed; }
.toc summary { width: fit-content; font-size: 16px; font-weight: 800; cursor: pointer; }
.toc ol { margin-bottom: .15em; font-size: 14px; }
.table-scroll {
  display: block; max-width: 100%; margin-block: 1.3em; overflow-x: auto;
  border: 1px solid var(--line); border-radius: 7px;
}
.article-body table { width: 100%; min-width: 540px; border-collapse: collapse; font-size: 15px; line-height: 1.65; }
.article-body th, .article-body td { padding: .65em .8em; text-align: start; vertical-align: top; border: 1px solid var(--line); }
.article-body th { background: var(--green-pale); }
.article-body tbody tr:nth-child(even) { background: #faf9f3; }
.article-navigation {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
  margin-top: 16px; font-size: 14px; font-weight: 700;
}
.article-navigation a { padding-block: 9px; text-align: center; text-underline-offset: 3px; }
.simple-layout { max-width: 800px; margin-inline: auto; }
.simple-paper { padding: 24px clamp(18px, 3.2vw, 36px); }
.simple-paper .button { margin-bottom: 18px; }

.external-links { display: grid; gap: 13px; }
.external-links a {
  display: grid; gap: 6px; padding: 19px 24px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--paper); text-decoration: none;
}
.external-links a:hover { border-color: #a5b1a2; }
.external-name { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 19px; font-weight: 800; }
.external-name span { color: var(--accent); }
.external-description { color: var(--muted); white-space: pre-line; }
.external-domain { color: var(--muted); font-size: 13px; }

.site-footer { padding-block: 28px 23px; background: var(--green-pale); border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: 13px; }
.footer-inner nav a { padding: 5px 0; text-decoration: none; }
.footer-inner nav a:hover { text-decoration: underline; }
.copyright { display: block; margin-top: 13px; color: var(--muted); font-size: 12px; }

@media (max-width: 1020px) {
  .wrap { width: calc(100% - 56px); }
  .article-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  .wrap { width: calc(100% - 40px); }
  .header-inner { min-height: 62px; flex-wrap: wrap; gap: 0 17px; }
  .main-nav { gap: 17px; }
  .main-nav a { font-size: 13px; }
  .hero { gap: 25px; padding-block: 34px 36px; }
  .hero p { margin-block: 14px 16px; }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-sidebar { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
  .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .wrap { width: calc(100% - 32px); }
  .header-inner { padding-top: 9px; align-items: flex-start; }
  .brand { font-size: 16px; gap: 8px; }
  .brand img { width: 32px; height: 32px; border-radius: 6px; }
  .main-nav { width: 100%; justify-content: space-between; gap: 0 7px; }
  .hero { grid-template-columns: minmax(0, 1fr); padding-block: 27px 26px; gap: 19px; }
  .hero h1 { font-size: clamp(28px, 8vw, 41px); }
  .hero h1 span { font-size: clamp(53px, 15vw, 72px); margin-bottom: 5px; }
  .hero p { font-size: 15px; }
  .hero-image { aspect-ratio: 1.95; border-radius: 13px 13px 36px 13px; }
  .archive { padding-block: 18px 25px; }
  .section-heading h2 { font-size: 22px; }
  .article-grid { gap: 11px; }
  .article-card { border-radius: 9px; }
  .card-copy { padding: 9px; gap: 6px; }
  .card-copy h3 { font-size: 14px; }
  .category-label { padding-inline: 5px; font-size: 11px; }
  .home-categories { padding-bottom: 35px; }
  .home-categories .category-list { padding: 16px; }
  .inner-main { padding-block: 15px 38px; }
  .breadcrumbs { margin-bottom: 12px; font-size: 12px; }
  .article-paper { padding: 17px 15px 22px; border-radius: 12px; }
  .article-header h1 { margin-block: 8px; }
  .eyecatch { margin-block: 15px 18px; }
  .article-body h2 { font-size: 1.23em; }
  .external-links a { padding: 14px 16px; }
  .site-footer { padding-block: 20px; }
}

@media (max-width: 340px) {
  .article-grid { grid-template-columns: minmax(0, 1fr); }
}

@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;
  }
}
