/* Static Tech Tips theme
   Layout and class names are shared by the static site generator. */

:root {
  --green: #288b68;
  --green-dark: #1f6f53;
  --green-light: #eaf6f0;
  --ink: #222;
  --muted: #777;
  --line: #dce7e2;
  --surface: #fff;
  --page: #fff;
  --shadow: 0 2px 10px rgba(29, 67, 52, .08);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: Meiryo, -apple-system, BlinkMacSystemFont, ".SFNSDisplay-Regular", "Hiragino Kaku Gothic Pro", "Yu Gothic", "MS PGothic", "Segoe UI", Verdana, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.8;
  word-break: break-word;
}

img { max-width: 100%; height: auto; }
a { color: #5268a5; }
a:hover { color: var(--green); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid #f1b928;
  outline-offset: 2px;
}

.wrap {
  width: min(100% - 32px, 1280px);
  margin-inline: auto;
}

.topbar {
  height: 34px;
  background: #fff;
  border-bottom: 1px solid #eef2ef;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.topbar .wrap { display: flex; justify-content: flex-end; align-items: center; }
.topbar a { color: var(--muted); font-size: .78rem; text-decoration: none; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 10px 0;
  min-height: 115px;
}

.site-header .wrap { position: relative; }
.site-title { margin: 0; color: #222; font-size: 32px; line-height: 1.25; font-weight: 400; }
.site-title a { color: #222; text-decoration: none; }
.site-description { margin: 12px 0 18px; color: #222; font-size: 14px; }

.site-nav { background: var(--green); text-align: center; min-height: 46px; }
.site-nav .wrap { display: flex; align-items: center; justify-content: center; min-height: 46px; }
.site-nav a { color: #fff; display: inline-block; padding: 8px 16px; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--green-dark); }

.breadcrumb { color: var(--muted); font-size: .86rem; padding: 22px 0 12px; }
.breadcrumb a { text-decoration: none; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 18px;
  align-items: start;
}

main, .sidebar { min-width: 0; }
.sidebar { padding: 50px 36px 36px; background: #fff; border: 1px solid var(--line); }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid #b9dcca;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  padding: 16px;
}
.card .cover { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--green-light); }
.card > :not(.cover) { margin-inline: 0; }
.card .meta { margin-top: 28px; color: #222; font-size: 14px; }
.meta a { color: inherit; }
.card-title { margin-top: 10px; margin-bottom: 20px; font-size: 16px; line-height: 1.5; font-weight: 400; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--green-dark); }
.excerpt { margin-top: 0; margin-bottom: 20px; color: #777; font-size: 14px; line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.read-more { margin-top: auto; margin-bottom: 0; align-self: flex-end; font-size: .87rem; font-weight: 400; }

.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; margin: 32px 0 42px; }
.pagination a, .pagination span { padding: 5px 12px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; }
.pagination [aria-current=page] { color: #fff; background: var(--green); border-color: var(--green); }

.widget, .profile {
  margin-bottom: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.widget h2, .widget h3 { margin: 0 0 24px; color: #222; font-size: 18px; }
.profile { display: block; position: relative; padding: 42px 12px 12px; background: #fff; border: 4px double #aaa; box-shadow: 0 0 8px #ddd; margin-bottom: 76px; }
.profile > strong { position: absolute; left: 0; top: 0; color: #fff; background: #333; padding: 2px 12px; font-size: 12px; }
.profile-body { display: grid; grid-template-columns: 80px 1fr; gap: 16px; font-size: 14px; line-height: 1.5; }
.avatar { display: block; width: 80px; margin: 0; text-align: center; font-size: 12px; }
.avatar img { width: 80px; height: 70px; object-fit: contain; }
.profile-body > :first-child { margin-top: 0; }
.profile-body > :last-child { margin-bottom: 0; }
.recent-item { display: grid; grid-template-columns: 100px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px dotted var(--line); font-size: 14px; line-height: 1.5; }
.recent-item p { margin: 6px 0; }
.recent-cover { width: 100px; height: 100px; object-fit: cover; background: var(--green-light); }
.recent-item a { font-size: .88rem; line-height: 1.45; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px 10px; line-height: 1.45; }
.tag-cloud a { text-decoration: none; }

.search-form { display: flex; gap: 6px; }
.search-form input[type="search"] { min-width: 0; flex: 1; padding: 8px 10px; border: 1px solid var(--line); }
.search-form button { padding: 8px 13px; color: #fff; background: var(--green); border: 1px solid var(--green); cursor: pointer; }
.copy-code { padding: 4px 9px; color: #fff; background: var(--green); border: 0; border-radius: 2px; font-size: .75rem; cursor: pointer; }
.copy-code:hover { background: var(--green-dark); }
.notice { padding: 13px 16px; background: var(--green-light); border-left: 4px solid var(--green); }
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 24px 0; }

.article { padding: 42px clamp(20px, 4vw, 68px); background: var(--surface); border: 1px solid var(--line); }
.article-title { margin: 0 0 28px; font-size: 28px; line-height: 1.5; font-weight: 500; }
.article .meta { color: var(--muted); font-size: .88rem; }
.article-body { margin-top: 28px; font-size: 16px; line-height: 1.9; }
.article-body > :first-child { margin-top: 0; }
.article-body h2, .article-body h3, .article-body h4 { margin-top: 2.2em; color: #222; line-height: 1.45; }
.article-body h2 { padding: 8px 20px; border-left: 8px solid #999; font-size: 24px; font-weight: 400; }
.article-body h3 { padding-left: 10px; border-left: 4px solid var(--green); }
.article-body p, .article-body ul, .article-body ol, .article-body blockquote { margin: 1.1em 0; }
.article-body blockquote { margin-inline: 0; padding: 8px 18px; color: #56645d; background: #f6f9f7; border-left: 4px solid var(--line); }
.article-body figure { margin: 1.7em 0; text-align: center; }
.article-body figure img { display: inline-block; }
.article-body figcaption { margin-top: 5px; color: var(--muted); font-size: .87rem; }
.article-body table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .94rem; }
.article-body th, .article-body td { padding: 7px 10px; border: 1px solid var(--line); text-align: left; }
.article-body th { color: #fff; background: var(--green); }
.article-body tr:nth-child(even) { background: #f7fbf9; }
.article-body pre { overflow-x: auto; padding: 16px; color: #374946; background: #fff8e5; border-radius: 3px; line-height: 1.55; font-size: .88rem; }
.article-body code { padding: .1em .35em; background: #eef4f1; border-radius: 2px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; }
.article-body pre code { padding: 0; background: transparent; color: inherit; }
.toc { padding: 16px 20px; background: #fafafa; border: 1px solid #ddd; width: fit-content; max-width: 100%; font-size: 14px; }
.toc a { color: #333; text-decoration: none; }
.toc .level-3 { margin-left: 1em; }
.toc summary { cursor: pointer; }
.share a, .share button { color: white; background: #333; padding: 6px 14px; font-size: 13px; border: 0; text-decoration: none; cursor: pointer; }
.share a:nth-child(2) { background: #405b96; }
.share button { background: #775018; }
.copy-code { display: block; margin-top: 10px; }
.toc :first-child { margin-top: 0; }
.toc :last-child { margin-bottom: 0; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); }
.post-nav a:last-child { text-align: right; }
.related { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); }

.site-footer { margin-top: 50px; padding: 30px 0; color: #333; background: #fff; border-top: 1px solid #eee; text-align: center; font-size: .85rem; }
.site-footer a { color: #fff; }

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; gap: 24px; }
  .sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 24px; }
  .sidebar > * { margin-bottom: 0; }
}

@media (max-width: 560px) {
  .wrap { width: min(100% - 22px, 1280px); }
  .site-header { padding-top: 18px; }
  .site-nav .wrap { overflow-x: auto; white-space: nowrap; }
  .site-nav a { padding-inline: 12px; }
  .cards, .sidebar { grid-template-columns: 1fr; }
  .sidebar { padding: 20px; }
  .article { padding: 23px 16px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav a:last-child { text-align: left; }
  .article-body table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
