/* ── Variables ── */
:root {
  --bg:           #f5f0e8;
  --bg-card:      #faf7f2;
  --bg-hover:     #f0ead8;
  --border:       #e0d8c8;
  --text:         #3a3228;
  --text-muted:   #8a7f72;
  --accent:       #7a6a52;
  --accent-hover: #5c4f3a;
  --label-bg:     #ede6d6;
  --label-text:   #6b5e48;
  --link:         #7a6a52;

  --font-body:  'Georgia', 'Times New Roman', serif;
  --font-ui:    'Segoe UI', 'Helvetica Neue', Arial, sans-serif;

  --radius:     6px;
  --max-width:  680px;
  --space:      1.5rem;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 18px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.75;
  min-height: 100vh;
  padding: 0 var(--space);
}

/* ── Layout ── */
.site-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ── ─────────────────────────── ── */
/* ── HEADER & HAMBURGER MENU     ── */
/* ── ─────────────────────────── ── */

.site-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.site-header a.site-title-link {
  text-decoration: none;
  color: inherit;
}

.site-name {
  font-family: var(--font-body);
  font-size: 1.55rem;
  font-weight: normal;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.site-tagline {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  letter-spacing: 0.04em;
}

/* Hamburger button */
.menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 22px;
  height: 16px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-top: 0.35rem;
  flex-shrink: 0;
}

.menu-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: center;
}

/* Animate to X when open */
.menu-btn[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-btn[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.menu-btn[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Drawer */
.nav-drawer {
  position: absolute;
  top: calc(100% + 1px); /* just below the header border */
  right: 0;
  width: min(260px, 80vw);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(58, 50, 40, 0.10);
  z-index: 100;
  overflow: hidden;

  /* Hidden state */
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-drawer.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-drawer nav {
  padding: 0.5rem 0;
}

.nav-item {
  display: block;
  padding: 0.65rem 1.2rem;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: var(--text);
  text-decoration: none;
  transition: background 0.12s ease;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

.nav-section-label {
  padding: 0.7rem 1.2rem 0.25rem;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-section-label:not(:first-child) {
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
}

.nav-item.nav-sub {
  padding-left: 2rem;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.nav-item.nav-sub:hover { color: var(--accent); }

/* ── Footer ── */
.site-footer {
  margin-top: 4rem;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* ── Labels ── */
.label {
  display: inline-block;
  background: var(--label-bg);
  color: var(--label-text);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.18em 0.6em;
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.label:hover {
  background: var(--accent);
  color: var(--bg);
}

.labels { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ── ─────────────────────────── ── */
/* ── HOME PAGE                   ── */
/* ── ─────────────────────────── ── */

.article-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.article-card {
  position: relative;
  padding: 1.5rem 1rem;
  margin: 0 -1rem;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background 0.15s ease;
}

.article-card:first-child { padding-top: 0; }

.article-card:hover { background: var(--bg-hover); }

/* Stretched link — expands the title anchor to cover the whole card */
.card-title a.card-link {
  text-decoration: none;
  color: inherit;
}

.card-title a.card-link::after {
  content: '';
  position: absolute;
  inset: 0;
}

/* Labels sit above the stretched link so their clicks aren't swallowed */
.card-meta .labels { position: relative; z-index: 1; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

.card-date {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.card-title {
  font-size: 1.15rem;
  font-weight: normal;
  line-height: 1.4;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.card-excerpt {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 0.7rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pagination-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 2rem;
  font-family: var(--font-ui);
}

.pagination-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.78rem;
  line-height: 1;
}

.pagination-tab:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

.pagination-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

/* ── ─────────────────────────── ── */
/* ── ARTICLE PAGE                ── */
/* ── ─────────────────────────── ── */

.article-header {
  margin-bottom: 2.5rem;
}

.article-title {
  font-size: 1.65rem;
  font-weight: normal;
  line-height: 1.35;
  margin-bottom: 0.9rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.article-date {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.article-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ── Article body typography ── */
.article-body { font-size: 1rem; }

.article-body p { margin-bottom: 1.4em; }

.article-body h2 {
  font-size: 1.2rem;
  font-weight: normal;
  margin: 2.2em 0 0.7em;
  color: var(--accent);
}

.article-body h3 {
  font-size: 1.05rem;
  font-weight: bold;
  margin: 1.8em 0 0.5em;
}

.article-body ul,
.article-body ol {
  padding-left: 1.5em;
  margin-bottom: 1.4em;
}

.article-body li { margin-bottom: 0.35em; }

.article-body blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1.1em;
  color: var(--text-muted);
  font-style: italic;
  margin: 1.5em 0;
}

.article-body a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body a:hover { color: var(--accent-hover); }

.article-body code {
  font-size: 0.85em;
  background: var(--label-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
}

.article-body pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  margin-bottom: 1.4em;
}

.article-body pre code {
  background: none;
  padding: 0;
  font-size: 0.82em;
}

/* ── ─────────────────────────── ── */
/* ── LABEL PAGE                  ── */
/* ── ─────────────────────────── ── */

.label-page-heading {
  margin-bottom: 2rem;
}

.label-page-heading h2 {
  font-size: 1.3rem;
  font-weight: normal;
  color: var(--text-muted);
}

.label-page-heading h2 em {
  font-style: normal;
  color: var(--text);
}

/* ── ─────────────────────────── ── */
/* ── RESPONSIVE                  ── */
/* ── ─────────────────────────── ── */

@media (max-width: 480px) {
  html { font-size: 17px; }

  body { padding: 0 1rem; }

  .site-header { padding: 1.8rem 0 1.2rem; margin-bottom: 1.8rem; }

  .site-name { font-size: 1.35rem; }

  .article-title { font-size: 1.4rem; }

  .article-card { padding: 0.75rem; margin: 0 -0.75rem; }
}
