/* ============================================================
   theme/static/css/style.css
   Minimal blog theme. No external deps. Dark-mode aware.
   ============================================================ */

:root {
  --fg: #1a1a1a;
  --fg-muted: #666;
  --bg: #fdfdfd;
  --bg-card: #f4f4f4;
  --accent: #0066cc;
  --accent-hover: #004999;
  --border: #e3e3e3;
  --code-bg: #f1f1f1;
  --max-w: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e6e6e6;
    --fg-muted: #999;
    --bg: #121212;
    --bg-card: #1e1e1e;
    --accent: #66b3ff;
    --accent-hover: #99ccff;
    --border: #2a2a2a;
    --code-bg: #1a1a1a;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { color: var(--accent-hover); text-decoration: underline; }

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

/* ----- header / nav ----- */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-bottom: 2rem;
}
.nav-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.site-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--fg);
}
.site-subtitle {
  color: var(--fg-muted);
  font-size: 0.95rem;
  margin-left: 0.5rem;
}
.site-nav {
  margin-left: auto;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

/* ----- site search ----- */
.site-search {
  position: relative;
  flex-basis: 100%;
  margin-top: 0.5rem;
}

/* ----- main ----- */
main { min-height: 60vh; }

/* ----- post list ----- */
.posts {
  list-style: none;
  padding: 0;
  margin: 0;
}
.post-item {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
}
.post-item:last-child { border-bottom: none; }
.post-title {
  font-size: 1.4rem;
  margin: 0 0 0.4rem;
}
.post-title a { color: var(--fg); }
.post-title a:hover { color: var(--accent); }
.meta {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}
.summary {
  margin: 0.5rem 0;
}
.read-more {
  font-size: 0.9rem;
}

/* ----- single post ----- */
.post-header { margin-bottom: 1.5rem; }
.post-header .post-title { font-size: 2rem; line-height: 1.2; }
.post-content { margin: 1.5rem 0; }
.post-content h2 { margin-top: 2rem; }
.post-content h3 { margin-top: 1.5rem; }
.post-content img { max-width: 100%; height: auto; }
.post-content code {
  background: var(--code-bg);
  padding: 0.15em 0.35em;
  border-radius: 3px;
  font-size: 0.92em;
}
.post-content pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 5px;
  overflow-x: auto;
}
.post-content pre code { background: transparent; padding: 0; }
.post-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 1rem 0;
  padding: 0.2rem 1rem;
  color: var(--fg-muted);
}

.tags {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.85rem;
  margin: 0.5rem 0;
}
.tags li a {
  background: var(--bg-card);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 2rem 0;
  font-size: 0.95rem;
}

/* ----- pagination ----- */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2rem 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.pagination .pages { color: var(--fg-muted); font-size: 0.9rem; }

/* ----- archives ----- */
.archives h2.year {
  margin-top: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
}
.archive-list {
  list-style: none;
  padding: 0;
}
.archive-list li {
  display: flex;
  gap: 1rem;
  padding: 0.3rem 0;
}
.archive-list time {
  color: var(--fg-muted);
  width: 4rem;
  flex-shrink: 0;
}

/* ----- tag / category / author lists ----- */
.tag-list, .cat-list, .author-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tag-list li a, .cat-list li a, .author-list li a {
  background: var(--bg-card);
  padding: 0.3rem 0.7rem;
  border-radius: 5px;
  display: inline-block;
}
.tag-list span, .cat-list span, .author-list span {
  color: var(--fg-muted);
  font-size: 0.85em;
}

/* ----- footer ----- */
.site-footer {
  margin-top: 3rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.9rem;
}
.site-footer p { margin: 0 0 0.5rem; }
.social {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

/* ----- misc ----- */
.empty { color: var(--fg-muted); }
code, pre { font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace; }
.error-404 { text-align: center; padding: 3rem 0; }
.error-404 h1 { font-size: 5rem; margin: 0; color: var(--accent); }

/* ----- plugin outputs ----- */
a.external::after { content: " ↗"; font-size: 0.8em; }
a.internal { font-weight: 500; }
.series-notice {
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0.8rem;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}
.similar-posts ul { padding-left: 1.2rem; }
.share-post { margin: 1.5rem 0; padding-top: 1rem; border-top: 1px solid var(--border); }
.share-label { font-size: 0.9rem; color: var(--fg-muted); margin: 0 0 0.4rem; }
.share-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; font-size: 0.9rem; }
.share-list li a { background: var(--bg-card); padding: 0.2rem 0.6rem; border-radius: 4px; }
.author-avatar { border-radius: 50%; margin: 1rem 0; }
.post-stats {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin: 0.3rem 0;
}

/* ----- new plugin outputs ----- */
.toc {
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  padding: 0.6rem 1rem;
  margin: 1rem 0;
  font-size: 0.95rem;
}
.toc ul { padding-left: 1.2rem; margin: 0.3rem 0; }
.toc a { color: var(--fg); }
.toc a:hover { color: var(--accent); }
.related-posts, .similar-posts, .citations { margin: 1.5rem 0; }
.related-posts h3, .similar-posts h3, .citations h3 { margin-bottom: 0.5rem; }
.related-posts ul, .similar-posts ul, .citations ol { padding-left: 1.2rem; }

/* ----- photos / galleries ----- */
.cover-image img {
  max-width: 100%;
  height: auto;
  border-radius: 5px;
}
.photo-gallery { margin: 2rem 0; }

/* Swiper overrides — keep theme colors */
.swiper-button-next, .swiper-button-prev {
  color: var(--accent);
  background: var(--bg);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.swiper-button-next::after, .swiper-button-prev::after { font-size: 18px; font-weight: 700; }
/* Force visibility even at end/beginning */
.swiper-button-lock { display: flex !important; opacity: 0.4 !important; pointer-events: auto !important; cursor: pointer; }
.swiper-pagination-bullet-active { background: var(--accent); }

/* Photo carousel slides */
.photo-swiper .swiper-slide {
  height: 180px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--bg-card);
  position: relative;
  max-width: 240px;
}
.photo-swiper .swiper-slide a {
  display: block;
  width: 100%;
  height: 100%;
}
.photo-swiper .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}
.photo-swiper .swiper-slide:hover img { transform: scale(1.05); }
.photo-swiper .slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.4rem 0.6rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  font-size: 0.8rem;
}

/* Hero slider */
.hero-slider {
  width: 100%;
  height: 360px;
  margin: 0 0 2rem;
  border-radius: 5px;
  overflow: hidden;
  background: var(--bg-card);
}
.hero-slider .swiper-slide {
  background-size: cover;
  background-position: center;
  position: relative;
}
.slide-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem 1.5rem;
  background: linear-gradient(transparent 40%, rgba(0,0,0,0.75));
  color: #fff;
}
.slide-title { font-size: 1.6rem; margin: 0 0 0.3rem; }
.slide-title a { color: #fff; }
.slide-meta { font-size: 0.85rem; opacity: 0.85; margin: 0 0 0.4rem; }
.slide-summary { font-size: 0.95rem; margin: 0; max-width: 600px; }
