*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'PT Serif', Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.75;
  color: #2c2c2c;
  background-color: #faf8f5;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Header ── */
.site-header {
  background-color: #2c2424;
  padding: 2.5rem 0 2rem;
  text-align: center;
}

.site-header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.site-title {
  font-size: 1.65rem;
  font-weight: 700;
  color: #f5f0ea;
  text-decoration: none;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.site-title:hover {
  color: #e8d9c4;
}

.site-subtitle {
  font-size: 0.9rem;
  color: #b09e8e;
  font-style: italic;
  letter-spacing: 0.04em;
}

.site-header-rule {
  width: 3rem;
  height: 1px;
  background: #6b5040;
  margin-top: 0.75rem;
}

/* ── Main content ── */
main {
  padding: 2.5rem 0 3rem;
}

/* ── Footer ── */
.site-footer {
  padding: 1.75rem 0;
  border-top: 1px solid #e0dcd7;
  font-size: 0.8rem;
  color: #aaa;
  text-align: center;
  letter-spacing: 0.03em;
}

/* ── Homepage: tag groups ── */
.home-intro {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e0dcd7;
  color: #666;
  font-size: 0.95rem;
}

.tag-group {
  margin-bottom: 3rem;
}

.tag-group-title {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b4c3b;
  margin-bottom: 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e8ddd4;
}

.article-list {
  list-style: none;
  padding: 0;
}

.article-list li {
  padding: 0.35em 0;
  border-bottom: 1px dotted #e0dcd7;
  display: flex;
  align-items: baseline;
  gap: 0.6em;
}

.article-list li::before {
  content: '›';
  color: #c4a882;
  font-size: 1rem;
  flex-shrink: 0;
}

.article-list a {
  color: #2c2c2c;
  text-decoration: none;
  transition: color 0.15s;
}

.article-list a:hover {
  color: #6b4c3b;
}

/* ── Article page ── */
.article-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid #e8ddd4;
}

.article-title {
  font-size: 1.9rem;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  color: #1e1a1a;
}

.article-meta {
  font-size: 0.85rem;
  color: #999;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.article-meta-label {
  color: #bbb;
}

.article-tag {
  display: inline-block;
  padding: 0.15em 0.65em;
  background: #f0ebe3;
  border: 1px solid #e0d8ce;
  border-radius: 2px;
  color: #7a5540;
  text-decoration: none;
  font-size: 0.8rem;
  transition: background 0.15s;
}

.article-tag:hover {
  background: #e8ddd4;
  color: #5a3a28;
}

/* ── Lang switcher ── */
.lang-switcher {
  font-size: 0.82rem;
  margin-bottom: 1.25rem;
  display: flex;
  gap: 0.2rem;
  align-items: center;
}

.lang-switcher-item {
  padding: 0.2em 0.6em;
  border-radius: 2px;
  text-decoration: none;
  border: 1px solid transparent;
}

.lang-switcher a.lang-switcher-item {
  color: #7a5540;
  border-color: #e0d8ce;
  background: #f7f3ee;
  transition: background 0.15s;
}

.lang-switcher a.lang-switcher-item:hover {
  background: #ede5da;
}

.lang-switcher .active {
  font-weight: 700;
  color: #2c2c2c;
  background: #e8ddd4;
  border-color: #c8bfb4;
}

.lang-switcher .unavailable {
  color: #ccc;
  border-color: #eee;
}

/* ── Article content ── */
.article-content {
  margin-top: 0.5rem;
}

.article-content p {
  margin-bottom: 1.1em;
  text-align: justify;
  hyphens: auto;
}

.article-content blockquote {
  margin: 1.75em 0;
  padding: 0.75em 1.5em 0.75em 1.75em;
  border-left: 4px solid #c8a87a;
  background: #f5ede3;
  color: #4a3a2e;
  font-style: italic;
  border-radius: 0 3px 3px 0;
}

.article-content blockquote p:last-child {
  margin-bottom: 0;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75em 0;
  font-size: 0.88rem;
}

.article-content th,
.article-content td {
  padding: 0.55em 0.85em;
  border: 1px solid #d8cfc4;
  text-align: left;
  vertical-align: top;
}

.article-content th {
  background-color: #ede5d8;
  font-weight: 700;
  color: #3a2a1e;
}

.article-content tr:nth-child(even) td {
  background-color: #f7f3ee;
}

.article-content h2 {
  font-size: 1.35rem;
  margin: 2.25em 0 0.6em;
  color: #1e1a1a;
  border-bottom: 1px solid #e8ddd4;
  padding-bottom: 0.25em;
}

.article-content h3 {
  font-size: 1.1rem;
  margin: 1.75em 0 0.5em;
  color: #2c2424;
}

.article-content ul,
.article-content ol {
  margin: 1em 0;
  padding-left: 1.75em;
}

.article-content li {
  margin-bottom: 0.4em;
}

.article-content strong {
  color: #1e1a1a;
}

.article-content .footnotes {
  font-size: 0.83rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e0dcd7;
  color: #666;
}

.article-content .footnotes ol {
  padding-left: 1.5em;
}

/* ── Prev/next navigation ── */
.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid #e8ddd4;
  font-size: 0.88rem;
}

.article-nav-prev,
.article-nav-next {
  max-width: 48%;
}

.article-nav-next {
  text-align: right;
  margin-left: auto;
}

.article-nav-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #bbb;
  margin-bottom: 0.2em;
}

.article-nav a {
  color: #6b4c3b;
  text-decoration: none;
  font-style: italic;
  transition: color 0.15s;
}

.article-nav a:hover {
  color: #3a1f10;
  text-decoration: underline;
}

/* ── Tag page ── */
.tag-page-title {
  font-size: 1.5rem;
  margin-bottom: 1.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e8ddd4;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin-bottom: 2rem;
}

.tag-list a {
  display: inline-block;
  font-size: 0.82rem;
  padding: 0.3em 0.75em;
  background: #f0ebe3;
  border: 1px solid #ddd5c8;
  color: #6b4c3b;
  text-decoration: none;
  border-radius: 2px;
  transition: background 0.15s;
}

.tag-list a:hover {
  background: #e4d9cc;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .container { padding: 0 1.25rem; }
  .site-title { font-size: 1.35rem; }
  .article-title { font-size: 1.5rem; }
  .article-nav { flex-direction: column; gap: 1rem; }
  .article-nav-prev, .article-nav-next { max-width: 100%; text-align: left; }
}
