/* ── Westie Vibes — base styles ─────────────────────────────────────── */

:root {
  --bg: #ffffff;
  --bg-2: #f6f7f9;
  --text: #1f2328;
  --muted: #5f6b76;
  --line: #e5e7eb;
  --accent: #1e73be;
  --accent-2: #185a96;
  --radius: 6px;
  --max-w: 1100px;
  --font-body: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  --font-ui: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--accent-2); }

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

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

/* ── Site header ─────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-ui);
}
.site-header .container {
  display: flex; align-items: center; gap: 24px; padding-top: 14px; padding-bottom: 14px;
  flex-wrap: wrap;
}
.site-brand { color: var(--text); text-decoration: none; font-weight: 700; font-size: 20px; }
.site-nav { display: flex; gap: 18px; flex: 1; flex-wrap: wrap; }
.site-nav a { color: var(--text); text-decoration: none; font-size: 15px; }
.site-nav a:hover, .site-nav a.is-current { color: var(--accent); }
.site-search input {
  font: inherit; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2);
  min-width: 200px;
}

/* ── Main ────────────────────────────────────────────────────────────── */
.site-main { padding: 32px 0 64px; min-height: 50vh; }

/* ── Hero (homepage) ─────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
.hero h1 { font-size: 36px; margin: 0 0 8px; font-family: var(--font-ui); }
.hero p  { color: var(--muted); margin: 0; max-width: 640px; margin: 0 auto; }

/* ── Post grid (homepage, category, tag, archive, related) ───────────── */
.post-grid {
  display: grid; gap: 28px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.post-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow 120ms ease, transform 120ms ease;
}
.post-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.07); transform: translateY(-1px); }
.card-image { display: block; aspect-ratio: 3 / 2; overflow: hidden; }
.card-img-area { width: 100%; height: 100%; display: block; }
.card-img-area img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-img-default {
  background: #FAECE7;            /* c-coral 50 — soft peach */
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-img-default img {
  width: 60%;
  height: auto;
  max-width: 200px;
  object-fit: contain;            /* preserve illustration aspect, no crop */
}
.card-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-cat {
  font-family: var(--font-ui); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--accent); text-decoration: none;
}
.card-title { margin: 0; font-size: 20px; line-height: 1.3; font-family: var(--font-ui); }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.card-excerpt { color: var(--muted); margin: 0; font-size: 16px; }
.card-date { color: var(--muted); font-size: 13px; margin-top: auto; font-family: var(--font-ui); }

/* ── Pagination ──────────────────────────────────────────────────────── */
.pagination {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin: 40px 0 8px;
  font-family: var(--font-ui); font-size: 15px;
}
.pagination .page-info { color: var(--muted); }
.pagination a, .pagination span {
  padding: 8px 14px; border-radius: var(--radius);
}
.pagination a { background: var(--bg-2); color: var(--text); text-decoration: none; }
.pagination a:hover { background: var(--line); }
.pagination .disabled { color: var(--line); }

/* ── Archive header ──────────────────────────────────────────────────── */
.archive-header { margin-bottom: 28px; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.archive-header .archive-kind {
  font-family: var(--font-ui); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); margin: 0;
}
.archive-header h1 { font-size: 30px; margin: 4px 0 0; font-family: var(--font-ui); }
.archive-header .search-form { margin-top: 12px; display: flex; gap: 8px; }
.archive-header .search-form input {
  flex: 1; padding: 8px 12px; font: inherit;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.archive-header .search-form button {
  padding: 8px 16px; font-family: var(--font-ui); font-size: 14px;
  background: var(--accent); color: white; border: 0; border-radius: var(--radius);
  cursor: pointer;
}
.search-meta { color: var(--muted); margin: 8px 0 24px; font-family: var(--font-ui); font-size: 14px; }

/* ── Single post ─────────────────────────────────────────────────────── */
.single-post { max-width: 760px; margin: 0 auto; }
.post-header { margin-bottom: 24px; }
.post-cat {
  font-family: var(--font-ui); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--accent); text-decoration: none;
}
.post-title { font-size: 38px; line-height: 1.15; margin: 8px 0 12px; font-family: var(--font-ui); }
.post-meta { color: var(--muted); font-family: var(--font-ui); font-size: 14px; }
.meta-sep { margin: 0 6px; }
.post-featured { margin: 24px 0; }
.post-featured img { width: 100%; border-radius: var(--radius); }

.post-content { font-size: 19px; line-height: 1.7; }
.post-content h2, .post-content h3 { font-family: var(--font-ui); line-height: 1.25; margin-top: 1.5em; }
.post-content h2 { font-size: 26px; }
.post-content h3 { font-size: 21px; }
.post-content p, .post-content ul, .post-content ol, .post-content blockquote { margin: 1.1em 0; }
.post-content img { border-radius: var(--radius); margin: 1em 0; }
.post-content figure { margin: 1.5em 0; }
.post-content figcaption { color: var(--muted); font-size: 15px; font-family: var(--font-ui); text-align: center; margin-top: 8px; }
.post-content blockquote {
  border-left: 3px solid var(--accent); padding: 0 0 0 16px; margin-left: 0;
  color: var(--muted); font-style: italic;
}
.post-content code { background: var(--bg-2); padding: 2px 6px; border-radius: 4px; font-size: 0.92em; }
.post-content pre { background: var(--bg-2); padding: 14px; border-radius: var(--radius); overflow-x: auto; }
.post-content .aligncenter { margin-left: auto; margin-right: auto; }
.post-content .alignleft   { float: left; margin-right: 24px; margin-bottom: 8px; }
.post-content .alignright  { float: right; margin-left: 24px; margin-bottom: 8px; }

/* Iframe embeds (YouTube etc.) responsive. */
.post-content iframe {
  max-width: 100%; aspect-ratio: 16/9; width: 100%; height: auto; border: 0;
}

.post-terms { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line);
  font-family: var(--font-ui); font-size: 14px; color: var(--muted); }
.post-terms a { display: inline-block; margin-right: 8px; padding: 3px 8px;
  background: var(--bg-2); border-radius: 4px; text-decoration: none; color: var(--text); }
.post-terms a:hover { background: var(--line); }
.post-terms .terms-label { margin-right: 6px; }

.related { margin-top: 64px; }
.related h2 { font-family: var(--font-ui); margin-bottom: 20px; }

/* ── TOC ─────────────────────────────────────────────────────────────── */
nav.toc {
  background: var(--bg-2); border: 1px solid var(--line);
  padding: 16px 20px; border-radius: var(--radius); margin: 2em 0;
  font-family: var(--font-ui); font-size: 15px;
}
nav.toc .toc-label { display: block; font-weight: 700; margin-bottom: 8px; color: var(--muted);
  text-transform: uppercase; font-size: 12px; letter-spacing: 0.06em; }
nav.toc ul { list-style: none; margin: 0; padding: 0; }
nav.toc li { margin: 4px 0; }
nav.toc li.toc-h3 { padding-left: 16px; font-size: 14px; }
nav.toc a { text-decoration: none; }
nav.toc a:hover { text-decoration: underline; }

/* ── Categories index ────────────────────────────────────────────────── */
.categories-index {
  list-style: none; padding: 0; margin: 24px 0;
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.categories-index a {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--text); text-decoration: none;
  font-family: var(--font-ui);
}
.categories-index a:hover { background: var(--bg-2); border-color: var(--accent); }
.categories-index .cat-name  { font-weight: 600; }
.categories-index .cat-count { color: var(--muted); font-size: 14px; }

/* ── Wallpapers ──────────────────────────────────────────────────────── */
.wallpapers-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin: 24px 0 40px;
}
.wallpaper-card {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--bg); display: flex; flex-direction: column;
}
.wallpaper-preview {
  aspect-ratio: 16/9; background: var(--bg-2); cursor: zoom-in; display: block;
  position: relative; overflow: hidden;
}
.wallpaper-preview img { width: 100%; height: 100%; object-fit: cover; }
.wallpaper-body { padding: 12px 14px 14px; font-family: var(--font-ui); font-size: 14px; }
.wallpaper-month { margin: 0 0 8px; font-weight: 700; }
.wallpaper-links a {
  display: inline-block; margin: 0 6px 4px 0; padding: 4px 10px;
  background: var(--bg-2); color: var(--text); text-decoration: none; font-size: 13px;
  border-radius: 4px;
}
.wallpaper-links a:hover { background: var(--line); }
.wallpaper-section { margin-top: 16px; }
.wallpaper-section h2 { font-family: var(--font-ui); border-bottom: 1px solid var(--line);
  padding-bottom: 8px; margin-bottom: 16px; }

#lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.92);
  display: none; align-items: center; justify-content: center; z-index: 100;
  padding: 20px;
}
#lightbox.is-open { display: flex; }
#lightbox img { max-width: 100%; max-height: 100%; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
#lightbox button.close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,0.15); color: white; border: 0;
  width: 40px; height: 40px; border-radius: 50%; font-size: 20px; cursor: pointer;
}

/* ── Footer ──────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  padding: 40px 0 24px;
  font-family: var(--font-ui);
}
.footer-newsletter { text-align: center; margin-bottom: 24px; }
.footer-newsletter h3 { margin: 0 0 4px; font-size: 22px; }
.footer-newsletter p  { color: var(--muted); margin: 0 0 16px; }
.footer-newsletter iframe { display: inline-block; max-width: 100%; }
.footer-links {
  display: flex; gap: 18px; flex-wrap: wrap; justify-content: center;
  font-size: 14px; color: var(--muted); padding-top: 16px; border-top: 1px solid var(--line);
}
.footer-links a { color: var(--text); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

/* ── Cookie banner ───────────────────────────────────────────────────── */
#cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--text); color: white;
  padding: 12px 20px;
  display: none; align-items: center; justify-content: center; gap: 16px;
  font-family: var(--font-ui); font-size: 14px;
  z-index: 50;
}
#cookie-banner.is-visible { display: flex; }
#cookie-banner p { margin: 0; }
#cookie-banner a { color: white; text-decoration: underline; }
#cookie-banner button {
  background: var(--accent); color: white; border: 0;
  padding: 6px 14px; border-radius: var(--radius); font: inherit; cursor: pointer;
}
#cookie-banner button:hover { background: var(--accent-2); }

/* ── 404 ─────────────────────────────────────────────────────────────── */
.error-page h1 { font-family: var(--font-ui); font-size: 36px; }
.error-page ul { font-family: var(--font-ui); }

/* ── Mobile tweaks ───────────────────────────────────────────────────── */
@media (max-width: 720px) {
  body { font-size: 17px; }
  .site-header .container { gap: 12px; }
  .site-nav { order: 3; flex-basis: 100%; }
  .site-search { order: 2; }
  .site-search input { min-width: 0; width: 100%; }
  .post-title { font-size: 28px; }
  .post-content { font-size: 17px; }
  .hero h1 { font-size: 28px; }
  .pagination { flex-direction: column; gap: 8px; align-items: stretch; text-align: center; }
}
