@import url("https://cdn.jsdelivr.net/npm/@lumeland/lume-design-system/dist/full.css");
.navbar {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1rem;
  row-gap: 1rem;
  justify-content: space-between;
  padding: 2rem min(5vw, 5rem);
  align-items: center;
}
.navbar-links {
  padding: 0;
  margin: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  column-gap: 1.5rem;
  font: var(--font-ui-bold);
  align-items: center;

  & [aria-current="page"] {
    text-decoration: none;
  }
}
.navbar-search {
  padding: 0 1em;
  margin-left: auto;
  display: flex;
  align-items: center;
}
.navbar-home {
  text-decoration: none;
}
.page-header {
  margin-bottom: var(--row-gap-medium);

  & > p:first-child {
    margin-top: 0;
  }
}
.page-title {
  font: var(--font-display);
  letter-spacing: var(--font-display-spacing);
  margin: 0;
  text-wrap: balance;
  color: var(--color-base);
}
.page-navigation {
  margin-bottom: var(--row-gap-medium);

  & ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
  }

  & h2 {
    font: var(--font-body-bold);
    letter-spacing: var(--font-body-spacing);
    margin: 0.5em 0;
  }
}
.page-pagination {
  border-top: solid 1px var(--color-line);
  margin-top: var(--row-gap-medium);
}
.postList {
  list-style: none;
  padding: 0;

  & article.post + article.post {
    margin-top: var(--row-gap-medium);
  }
  & li.post + li.post {
    margin-top: var(--row-gap-small);
  }

  & .post-header {
    margin-bottom: var(--row-gap-xsmall);
  }

  & .post-details {
    font: var(--font-small);
  }

  & .post-title {
    font: var(--font-title);
    letter-spacing: var(--font-title-spacing);
    display: block;

    & a {
      text-decoration: none;
    }
  }
}
.post-header {
  margin-bottom: var(--row-gap-small);
}
.post-title {
  font: var(--font-display);
  letter-spacing: var(--font-display-spacing);
  margin: 0 0 0.2em;
  text-wrap: balance;
  color: var(--color-base);
}
.post-details {
  display: flex;
  flex-flow: row wrap;
  row-gap: 1em;
  column-gap: 0.5em;
  align-items: center;
  font: var(--font-small);
  color: var(--color-dim);

  & p {
    margin: 0;
  }

  & p::after {
    content: "•";
    padding-left: 0.5em;
    align-self: stretch;
  }

  & p:last-of-type {
    margin-right: 0.5em;

    &::after {
      display: none;
    }
  }

  & a {
    color: inherit;
  }
}
.post-tags {
  display: flex;
  flex-flow: row wrap;
  gap: 0.5em;
  align-items: center;
}
.post-link {
  display: inline-block;
}
.comments-section {
  margin-top: 5em;
}
.comments-header {
  & h2 {
    font: var(--font-title);
    letter-spacing: var(--font-title-spacing);
    margin: 0;
    color: var(--color-base);
  }
  & p {
    font: var(--font-ui);
    color: var(--color-dim);
    margin: 0.5em 0;
  }
}
.comments {
  display: block;
  padding: 2em;
  margin-top: 2em;
  background: var(--color-highlight);
  border-radius: var(--border-radius);
  border: solid 1px var(--color-line);
  color: var(--color-dim);
  font: var(--font-small);

  @media (max-width: 450px) {
    margin-left: calc(-15vw / 2);
    margin-right: calc(-15vw / 2);
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: calc(15vw / 2);
  }

  & a {
    color: currentColor;
  }

  & ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  & li {
    container-type: inline-size;

    ul {
      margin-top: 2em;
      padding-top: 2em;
      border-top: solid 1px var(--color-line);
      margin-left: min(var(--indent), 10cqw);
    }
  }

  & li + li {
    margin-top: 2em;
    padding-top: 2em;
    border-top: solid 1px var(--color-line);
  }
  & article {
    max-width: 600px;
  }
  > ul {
    --avatar-size: clamp(32px, 10cqw, 50px);
    --indent: calc(var(--avatar-size) + 15px);
  }

  .comment-avatar {
    width: var(--avatar-size);
    height: var(--avatar-size);
    border-radius: 6px;
    float: left;
    margin-right: 14px;
    box-shadow: 0 0 1px #0009;
  }
  .comment-user {
    text-decoration: none;
    display: block;
    position: relative;
  }
  .comment-author {
    position: absolute;
    left: calc(var(--avatar-size) - 15px);
    top: calc(var(--avatar-size) - 15px);
    background: var(--color-highlight);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    color: var(--color-primary);
  }
  .comment-user:hover .comment-username {
    text-decoration: underline;
  }
  .comment-username {
    margin-right: 0.5em;
    color: var(--color-text);
  }
  .comment-useraddress {
    font-style: normal;
  }
  .comment-time {
    font-size: small;
    display: flex;
    column-gap: 0.3em;
    align-items: center;

    svg {
      width: 1em;
      height: 1em;
      fill: currentColor;
    }
  }
  .comment-address {
    color: currentColor;
    text-decoration: none;
    display: block;
    padding-left: var(--indent);
    margin-top: 0.2em;
  }
  .comment-address:hover {
    text-decoration: underline;
  }
  .comment-body {
    margin-top: 1em;
    margin-left: var(--indent);
    line-height: 1.5;

    .invisible {
      display: none;
    }
    .ellipsis::after {
      content: "…";
    }
    .mention {
      text-decoration: none;
      color: var(--color-text);

      &:hover {
        text-decoration: underline;
      }
    }
  }
  .comment-body p {
    margin: 0.5em 0 0;
  }
  .comment-counts {
    display: flex;
    column-gap: 1em;
    font-size: small;

    & svg {
      color: var(--color-primary);
    }
  }
  .comment-counts > span {
    display: flex;
    align-items: center;
    column-gap: 0.3em;
  }
}
:root,
[data-theme="light"] {
  --color-base: #6ba3c7;
  --color-link: #4a88b0;
  --color-link-hover: #2d6d96;
  --color-line: #d4e4f0;
  --color-bg: #f8fbff;
  --color-text: #3a4550;
  --color-heading: #2a3540;
  --font-ui: "M PLUS Rounded 1c", sans-serif;
  --font-ui-bold: "M PLUS Rounded 1c", sans-serif;
  --font-display: "M PLUS Rounded 1c", sans-serif;
  --font-code: "Fira Code", "SF Mono", monospace;
}
/* ====== Base ====== */
body {
  font-family: "M PLUS Rounded 1c", sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.9;
}
main {
  max-width: min(100% - 10vw, 42em);
  margin: 0 auto;
  padding: 2em 5vw 4em;
}
/* ====== Spacing ====== */
.navbar {
  border-bottom: 1px solid var(--color-line);
  padding: 1em 2em;
  margin-bottom: 1.5em;
}
.page-header {
  margin-bottom: 1.5em;
}
.post-header {
  margin-bottom: 2em;
}
.postList {
  margin-top: 1.5em;
}
.postList li {
  margin-bottom: 1.5em;
}
article > * + * {
  margin-top: 1.4em;
}
article h2 {
  margin-top: 2.5em;
  margin-bottom: 0.8em;
}
article h3 {
  margin-top: 2em;
  margin-bottom: 0.6em;
}
/* ====== Links ====== */
a {
  color: var(--color-link);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
  text-decoration-color: rgba(74, 136, 176, 0.4);
  text-underline-offset: 0.15em;
}
/* ====== Navbar ====== */
.navbar a {
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-weight: 700;
  color: var(--color-heading);
  text-decoration: none;
}
.navbar a:hover {
  color: var(--color-link);
  text-decoration: none;
}
.navbar-home {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}
.navbar-home::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 24px;
  background-image: url("/favicon.png");
  background-size: contain;
  background-repeat: no-repeat;
}
.navbar-home strong {
  color: var(--color-base);
}
/* ====== Headings ====== */
h1, h2, h3, h4, h5, h6 {
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-weight: 800;
  color: var(--color-heading);
  line-height: 1.4;
}
h2 a, h3 a, h4 a {
  color: inherit;
  text-decoration: none;
}
h2 a:hover, h3 a:hover, h4 a:hover {
  color: var(--color-link);
  text-decoration: none;
}
.page-title,
.post-title {
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-weight: 800;
  color: var(--color-heading);
  font-size: 1.6em;
  line-height: 1.3;
  margin-bottom: 0.3em;
}
/* Homepage description: lighter weight, smaller font */
.page-header .page-title {
  font-weight: 400;
  font-size: 1em;
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: 0.8em;
}
/* ====== Post Details ====== */
.post-details {
  color: #7a8a98;
  font-size: 0.9em;
  margin-top: 0.5em;
  margin-bottom: 1em;
}
/* ====== Post Tags ====== */
.post-tags a {
  background-color: #e4eff8;
  color: var(--color-base);
  border-radius: 1em;
  padding: 0.2em 0.8em;
  text-decoration: none;
  font-size: 0.85em;
  font-weight: 700;
  transition: background-color 0.2s;
}
.post-tags a:hover {
  background-color: #cce0f0;
  color: var(--color-link-hover);
  text-decoration: none;
}
/* ====== Post List ====== */
.postList .post,
.postList li {
  background: white;
  border: 1px solid var(--color-line);
  border-radius: 12px;
  padding: 1.8em 2em;
  margin-bottom: 1.2em;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.postList .post:hover,
.postList li:hover {
  box-shadow: 0 2px 12px rgba(107, 163, 199, 0.12);
  border-color: rgba(107, 163, 199, 0.4);
}
.postList .post-title,
.postList .post h2 {
  font-size: 1.35em;
  margin-bottom: 0.3em;
  line-height: 1.4;
}
.postList a {
  text-decoration: none;
  color: var(--color-heading);
  font-weight: 700;
  transition: color 0.2s;
}
.postList a:hover {
  color: var(--color-link);
  text-decoration: none;
}
/* ====== Post Content ====== */
article {
  overflow-wrap: anywhere;
}
article a {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-color: rgba(74, 136, 176, 0.3);
  text-underline-offset: 0.15em;
}
article a:hover {
  text-decoration-color: var(--color-link-hover);
}
article img {
  max-width: 100%;
  height: auto;
  border-radius: 0.6em;
  margin: 0.5em 0;
}
article p {
  line-height: 1.9;
}
article li {
  line-height: 1.8;
  margin-bottom: 0.3em;
}
/* ====== Table ====== */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5em 0;
  font-size: 0.92em;
  display: block;
  overflow-x: auto;
}
th {
  background-color: #e4eff8;
  color: var(--color-heading);
  font-weight: 700;
  padding: 0.7em 1em;
  text-align: left;
  border-bottom: 2px solid var(--color-line);
}
td {
  padding: 0.7em 1em;
  border-bottom: 1px solid var(--color-line);
}
tr:hover td {
  background-color: rgba(107, 163, 199, 0.08);
}
/* ====== Code ====== */
pre {
  border-radius: 0.6em;
  border: 1px solid var(--color-line);
  padding: 1.2em;
  margin: 1.5em 0;
  overflow-x: auto;
  max-width: 100%;
}
code {
  font-family: var(--font-code);
  font-size: 0.88em;
}
:not(pre) > code {
  background-color: #e4eff8;
  color: var(--color-heading);
  padding: 0.15em 0.4em;
  border-radius: 0.3em;
}
/* ====== Misc ====== */
hr {
  border: none;
  border-top: 1px solid var(--color-line);
  margin: 2.5em 0;
}
blockquote {
  border-left: 3px solid var(--color-base);
  color: #6a7a88;
  padding-left: 1.2em;
  margin: 1.5em 0;
}
::selection {
  background-color: #d4e8f8;
  color: var(--color-heading);
}
/* ====== TOC ====== */
nav.toc {
  margin-bottom: 2em;
}
nav.toc a {
  color: var(--color-link);
  text-decoration: none;
}
nav.toc a:hover {
  text-decoration: underline;
  text-decoration-color: rgba(74, 136, 176, 0.4);
}
/* ====== Coding Agent notice (auto-inserted) ====== */
.post-body::before {
  content: "この記事はCoding Agentを使って執筆されています。";
  display: block;
  color: #7a8a98;
  font-size: 0.85em;
  margin-bottom: 1.2em;
}
/* ====== Search ====== */
.pagefind-ui__search-input {
  border-radius: 0.5em !important;
  border-color: var(--color-line) !important;
}
/* ====== Dark Mode ====== */
[data-theme="dark"] {
  --color-bg: #1a1e24;
  --color-text: #d8e0e8;
  --color-heading: #e8f0f8;
  --color-base: #7ab8d8;
  --color-link: #7ab8d8;
  --color-link-hover: #a0d4ec;
  --color-line: #2e3640;
}
[data-theme="dark"] .postList .post,
[data-theme="dark"] .postList li {
  background: #1e2530;
  border-color: var(--color-line);
}
[data-theme="dark"] .postList .post:hover,
[data-theme="dark"] .postList li:hover {
  box-shadow: 0 2px 12px rgba(122, 184, 216, 0.08);
  border-color: rgba(122, 184, 216, 0.3);
}
[data-theme="dark"] .post-tags a {
  background-color: #243040;
  color: #7ab8d8;
}
[data-theme="dark"] .post-tags a:hover {
  background-color: #2e3a4a;
}
[data-theme="dark"] th {
  background-color: #243040;
}
[data-theme="dark"] :not(pre) > code {
  background-color: #243040;
  color: #d8e0e8;
}
[data-theme="dark"] blockquote {
  color: #a0b0c0;
}
[data-theme="dark"] ::selection {
  background-color: #2e3a4a;
  color: #e8f0f8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #1a1e24;
    --color-text: #d8e0e8;
    --color-heading: #e8f0f8;
    --color-base: #7ab8d8;
    --color-link: #7ab8d8;
    --color-link-hover: #a0d4ec;
    --color-line: #2e3640;
  }

  :root:not([data-theme="light"]) .postList .post,
  :root:not([data-theme="light"]) .postList li {
    background: #1e2530;
    border-color: #2e3640;
  }

  :root:not([data-theme="light"]) .postList .post:hover,
  :root:not([data-theme="light"]) .postList li:hover {
    box-shadow: 0 2px 12px rgba(122, 184, 216, 0.08);
    border-color: rgba(122, 184, 216, 0.3);
  }
}
