:root {
  color-scheme: light;
  --background: #f7f8f5;
  --surface: #ffffff;
  --text: #20221f;
  --muted: #687064;
  --border: #dfe4dc;
  --accent: #167067;
  --accent-soft: #e3f1ee;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  line-height: 1.8;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.site-header,
.site-footer,
main {
  width: min(100% - 32px, 960px);
  margin-inline: auto;
}

.site-header {
  padding: 40px 0 28px;
  border-bottom: 1px solid var(--border);
}

.site-title {
  color: var(--text);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
}

.site-header p,
.site-footer p {
  margin: 8px 0 0;
  color: var(--muted);
}

main {
  padding: 28px 0 56px;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}

.topic-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 24px;
}

.topic-card {
  display: grid;
  gap: 7px;
  min-height: 78px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}

.topic-grid--compact .topic-card {
  min-height: 0;
}

.topic-card:hover,
.topic-card--active {
  border-color: var(--accent);
  background: #fbfdfc;
}

.topic-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.topic-card__title {
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

.topic-card__count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.88rem;
}

.topic-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.topic-card__tags span {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #14564f;
  font-size: 0.78rem;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 28px;
}

.tag-cloud--compact {
  margin-bottom: 24px;
}

.tag-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 4px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.92rem;
  text-decoration: none;
}

.tag-button:hover,
.tag-button--active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #14564f;
}

.tag-count {
  min-width: 1.6em;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #14564f;
  font-size: 0.78rem;
  line-height: 1.6;
  text-align: center;
}

.tag-button--active .tag-count,
.tag-button:hover .tag-count {
  background: var(--surface);
}

.archive-header {
  margin-bottom: 20px;
}

.archive-header h1 {
  margin: 8px 0 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.3;
}

.archive-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.back-link {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 0.92rem;
}

.post-list {
  display: grid;
  gap: 16px;
}

.post-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.post-card time,
.post-header time {
  color: var(--muted);
  font-size: 0.92rem;
}

.post-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.post-card__header time {
  flex: 0 0 auto;
}

.post-card h2 {
  min-width: 0;
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.4;
}

.post-card h2 a {
  color: var(--text);
  text-decoration: none;
}

.post-card h2 a:hover {
  color: var(--accent);
}

@media (max-width: 640px) {
  .post-card__header {
    display: grid;
    gap: 4px;
  }
}

.post-card__excerpt {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.taxonomy {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 14px 0 0;
  list-style: none;
}

.taxonomy li {
  padding: 2px 10px;
  background: var(--accent-soft);
  border-radius: 999px;
  color: #14564f;
  font-size: 0.86rem;
}

.taxonomy--category a {
  color: inherit;
  text-decoration: none;
}

.taxonomy--category a:hover {
  color: var(--accent);
}

.taxonomy--tag li {
  padding: 0;
  background: transparent;
}

.taxonomy--tag a {
  display: inline-block;
  padding: 2px 10px;
  background: #eef0f4;
  border-radius: 999px;
  color: #3f4755;
  text-decoration: none;
}

.taxonomy--tag a:hover {
  background: var(--accent-soft);
  color: #14564f;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 28px 0 0;
}

.pagination__pages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.pagination__link,
.pagination__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 4px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.92rem;
  text-decoration: none;
}

.pagination__link:hover,
.pagination__page:hover,
.pagination__page--current {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #14564f;
}

.pagination__link--disabled {
  color: var(--muted);
  opacity: 0.55;
}

.post {
  max-width: 760px;
  margin-inline: auto;
}

.post-header {
  margin-bottom: 28px;
}

.post h1 {
  margin: 8px 0 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.35;
}

.post-body {
  overflow-wrap: anywhere;
}

.ad-slot {
  display: block;
  min-height: 120px;
  margin: 28px 0;
  overflow: hidden;
}

.ad-slot--article-top {
  margin-bottom: 32px;
}

.ad-slot--article-bottom {
  margin-top: 40px;
}

.post-body :where(h2, h3, h4) {
  margin-top: 2em;
  line-height: 1.45;
}

.post-body pre {
  overflow-x: auto;
  padding: 16px;
  background: #202620;
  border-radius: 8px;
  color: #f4f6f2;
}

.post-body code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.post-body blockquote {
  margin-inline: 0;
  padding-left: 18px;
  border-left: 4px solid var(--border);
  color: var(--muted);
}

.wp-block-image,
.wp-block-table {
  margin: 1.5em 0;
}

.wp-block-table {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

td,
th {
  padding: 8px 10px;
  border: 1px solid var(--border);
}

.site-footer {
  padding: 28px 0 40px;
  border-top: 1px solid var(--border);
}
