/* ============================================================
   SimpleGitBlog — style.css
   Clean, minimal, mobile-first typography.
   ============================================================ */

/* --- Reset / Base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  color: #222;
  background: #fafaf8;
  line-height: 1.7;
}

a {
  color: #0969da;
  text-decoration: underline;
}
a:hover { color: #0550ae; }

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

/* --- Layout ----------------------------------------------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- Header ----------------------------------------------- */
.site-header {
  background: #1a1a2e;
  color: #fff;
  padding: 0.85rem 0;
  border-bottom: 3px solid #0969da;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-title {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.site-title:hover { color: #93c5fd; }

.site-nav a {
  color: #cbd5e1;
  text-decoration: none;
  margin-left: 1.25rem;
  font-size: 0.9rem;
}
.site-nav a:hover { color: #fff; }

.setup-warning {
  background: #fef08a;
  color: #713f12 !important;
  border-radius: 4px;
  padding: 0.15em 0.5em;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none !important;
}
.setup-warning:hover { background: #fde047 !important; color: #713f12 !important; }

/* --- Footer ----------------------------------------------- */
.site-footer {
  margin-top: 4rem;
  padding: 1.5rem 0;
  border-top: 1px solid #e2e8f0;
  font-size: 0.82rem;
  color: #64748b;
  text-align: center;
}
.site-footer a { color: #64748b; }

/* --- Main content spacing --------------------------------- */
main.container { padding-top: 2.5rem; padding-bottom: 2.5rem; }

/* --- Page heading ----------------------------------------- */
.page-heading {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 1.75rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.6rem;
  color: #111;
}

/* --- Blog sections ---------------------------------------- */
.blog-section + .blog-section {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 2px solid #e2e8f0;
}

.section-heading {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
  color: #111;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.section-icon {
  font-size: 1.25rem;
  line-height: 1;
}

/* --- Source badges ---------------------------------------- */
.source-badge {
  display: inline-block;
  padding: 0.1em 0.5em;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.source-badge--github     { background: #dbeafe; color: #1d4ed8; }
.source-badge--youtube    { background: #fee2e2; color: #b91c1c; }
.source-badge--hackernews { background: #ffedd5; color: #c2410c; }

/* --- Video embed (16:9 responsive iframe) ----------------- */
.video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  margin: 1.5rem 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* --- Post card (index) ------------------------------------ */
.post-list { list-style: none; margin: 0; padding: 0; }

.post-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.25rem;
  transition: box-shadow 0.15s ease;
}
.post-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,0.08); }

/* Subtle left-border accent per content source */
.post-card--github     { border-left: 3px solid #0969da; }
.post-card--youtube    { border-left: 3px solid #dc2626; }
.post-card--hackernews { border-left: 3px solid #ea580c; }

.post-card__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.45rem;
  color: #111;
}
.post-card__title a {
  color: inherit;
  text-decoration: none;
}
.post-card__title a:hover { color: #0969da; }

.post-card__meta {
  font-size: 0.82rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.post-card__meta a { color: #475569; }

.post-card__excerpt {
  margin: 0 0 0.9rem;
  color: #374151;
  font-size: 0.95rem;
}

.post-card__read-more {
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  color: #0969da;
}
.post-card__read-more:hover { text-decoration: underline; }

/* --- Empty state ------------------------------------------ */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #64748b;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
}

/* --- Avatar ----------------------------------------------- */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  vertical-align: middle;
}
.avatar--small { width: 24px; height: 24px; }

/* --- Post page -------------------------------------------- */
.post__header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.post__title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 0.75rem;
  color: #111;
  letter-spacing: -0.03em;
}

.post__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: #64748b;
}
.post__meta a { color: #475569; }

.post__date-link { color: #94a3b8; text-decoration: none; }
.post__date-link:hover { color: #475569; text-decoration: underline; }

.post__labels {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.label {
  display: inline-block;
  padding: 0.15em 0.55em;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #dbeafe;
  color: #1d4ed8;
  text-decoration: none;
}
.label:hover { background: #bfdbfe; color: #1e3a8a; }
.label--active { background: #1d4ed8; color: #fff; }
.label--page { font-size: 1.1rem; padding: 0.2em 0.7em; }

/* --- Prose (rich content) --------------------------------- */
.prose {
  color: #1e293b;
  font-size: 1rem;
  line-height: 1.75;
}
.prose > * + * { margin-top: 1em; }
.prose h1, .prose h2, .prose h3,
.prose h4, .prose h5, .prose h6 {
  font-weight: 700;
  line-height: 1.3;
  color: #111;
  margin-top: 1.75em;
  margin-bottom: 0.5em;
}
.prose h1 { font-size: 1.6rem; }
.prose h2 { font-size: 1.35rem; border-bottom: 1px solid #e2e8f0; padding-bottom: 0.3em; }
.prose h3 { font-size: 1.15rem; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.5em; margin-bottom: 1em; }
.prose li + li { margin-top: 0.3em; }
.prose blockquote {
  border-left: 4px solid #94a3b8;
  margin: 1.5em 0;
  padding: 0.5em 1.25em;
  color: #475569;
  background: #f8fafc;
  border-radius: 0 4px 4px 0;
}
.prose code {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-size: 0.875em;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
.prose pre {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 6px;
  padding: 1.1em 1.25em;
  overflow-x: auto;
  font-size: 0.875em;
  line-height: 1.6;
  margin: 1.5em 0;
}
.prose pre code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9rem;
  overflow-x: auto;
  display: block;
}
.prose th, .prose td {
  border: 1px solid #e2e8f0;
  padding: 0.5em 0.85em;
  text-align: left;
}
.prose th {
  background: #f8fafc;
  font-weight: 600;
  color: #334155;
}
.prose img {
  border-radius: 6px;
  max-width: 100%;
  height: auto;
}
.prose hr {
  border: none;
  border-top: 2px solid #e2e8f0;
  margin: 2em 0;
}
.prose a {
  color: #0969da;
  word-break: break-word;
}

/* --- Post actions ----------------------------------------- */
.post__actions {
  margin: 2rem 0 1rem;
}

/* --- Buttons ---------------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.55em 1.15em;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn--primary {
  background: #0969da;
  color: #fff;
}
.btn--primary:hover { background: #0550ae; color: #fff; }

.btn--secondary { background: #1a1a2e; color: #fff; }
.btn--secondary:hover { background: #0f0f1e; color: #fff; }

.btn--spaced { margin-left: 0.75rem; }

/* --- Comments --------------------------------------------- */
.comments {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid #e2e8f0;
}

.comments__heading {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
  color: #111;
}

.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.comment {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
}

.comment__header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.comment__author-info {
  font-size: 0.87rem;
  color: #64748b;
  line-height: 1.4;
}

.comment__author {
  font-weight: 700;
  color: #1e293b;
  text-decoration: none;
}
.comment__author:hover { color: #0969da; text-decoration: underline; }

.comment__fork-link {
  font-size: 0.8rem;
  color: #7c3aed;
  font-weight: 600;
}

.comment__date { color: #94a3b8; font-size: 0.8rem; }

.comment__body { font-size: 0.95rem; }
.comment__body > *:last-child { margin-bottom: 0; }

.comments__empty {
  color: #64748b;
  font-style: italic;
  margin: 0 0 1.5rem;
}

.comments__cta {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-align: center;
}

.comments__cta-note {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: #64748b;
}

/* --- Post card labels ------------------------------------- */
.post-card__labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0 0.6rem;
}

/* --- Reactions -------------------------------------------- */
.reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 0;
}

.reactions--comment {
  margin: 0.6rem 0 0;
}

.reaction {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  padding: 0.2em 0.55em;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: default;
}

.reaction__count {
  font-weight: 600;
  color: #334155;
}

/* --- Two-column page layout ------------------------------- */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2.5rem;
  align-items: start;
}

.main-column { min-width: 0; }

/* --- Page sidebar ----------------------------------------- */
.page-sidebar {
  position: sticky;
  top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* --- Sidebar sections ------------------------------------- */
.sidebar-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem 1.1rem;
}

.sidebar-section__heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111;
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.5rem;
}

.sidebar-list {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-item { font-size: 0.85rem; }

.sidebar-item__title {
  display: block;
  font-weight: 600;
  color: #1e293b;
  text-decoration: none;
  line-height: 1.35;
}
.sidebar-item__title:hover { color: #0969da; text-decoration: underline; }

.sidebar-item__meta {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 0.2rem;
}
.sidebar-item__meta a { color: #94a3b8; }
.sidebar-item__meta a:hover { color: #0969da; }

.sidebar-item__excerpt {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: #64748b;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Video sidebar items ---------------------------------- */
.sidebar-list--videos { gap: 0.8rem; }

.sidebar-item--video {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.sidebar-item__thumb-link { flex-shrink: 0; }

.sidebar-item__thumb {
  width: 100px;
  height: 56px;
  object-fit: cover;
  border-radius: 5px;
  display: block;
}

.sidebar-item__video-info { flex: 1; min-width: 0; }
.sidebar-item--video .sidebar-item__title { font-size: 0.82rem; }

/* --- Sidebar "view all" link ------------------------------ */
.sidebar-section__view-all {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #0969da;
  text-decoration: none;
  margin-top: 0.5rem;
}
.sidebar-section__view-all:hover { text-decoration: underline; }

.sidebar-section__view-more-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* --- Labels sidebar --------------------------------------- */
.labels-sidebar {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid #e2e8f0;
}

.labels-sidebar__heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111;
  margin: 0 0 1rem;
}

.label-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.label-list li {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.label-count {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* --- Breadcrumb ------------------------------------------- */
.breadcrumb {
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
}
.breadcrumb a { color: #64748b; text-decoration: none; }
.breadcrumb a:hover { color: #0969da; text-decoration: underline; }
.post-nav {
  margin-top: 2.5rem;
  font-size: 0.9rem;
}
.post-nav a {
  color: #64748b;
  text-decoration: none;
}
.post-nav a:hover { color: #0969da; text-decoration: underline; }

.config-section__subheading {
  font-size: 1rem;
  font-weight: 700;
  color: #334155;
  margin: 1.25rem 0 0.4rem;
}

.config-profile {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.config-profile__avatar {
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

/* --- Config page ------------------------------------------ */
.config-alert {
  padding: 0.9rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}
.config-alert--warning {
  background: #fef9c3;
  border: 1px solid #fde047;
  color: #713f12;
}
.config-alert--warning a { color: #713f12; font-weight: 600; }

.config-section {
  margin-bottom: 2.5rem;
}
.config-section--actions {
  padding: 1.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.config-section__heading {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: #111;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #e2e8f0;
}

.config-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.config-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #334155;
  text-align: left;
  padding: 0.5em 0.85em;
  border: 1px solid #e2e8f0;
}
.config-table td {
  padding: 0.6em 0.85em;
  border: 1px solid #e2e8f0;
  vertical-align: top;
}

.config-detail {
  font-size: 0.8rem;
  color: #64748b;
  word-break: break-all;
}
a.config-detail { color: #64748b; }
a.config-detail:hover { color: #0969da; }

.config-status { font-size: 0.85rem; }
.config-status--ok   { color: #15803d; }
.config-status--off  { color: #64748b; }
.config-status--warn { color: #92400e; }

.config-dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 1.5rem;
  font-size: 0.92rem;
}
.config-dl dt {
  font-weight: 600;
  color: #334155;
  padding-top: 0.1em;
  white-space: nowrap;
}
.config-dl dd {
  margin: 0;
  color: #1e293b;
}

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

.config-hint {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0.4rem 0 0;
}

/* --- Video thumbnail in feed cards ------------------------ */
.post-card__video-thumb {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: 6px;
  margin: 0.5rem 0 0.75rem;
}

/* --- Pagination ------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1rem 0;
  border-top: 1px solid #e2e8f0;
  font-size: 0.9rem;
}

.pagination__link {
  font-weight: 600;
  color: #0969da;
  text-decoration: none;
  padding: 0.35em 0.85em;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  transition: background 0.12s ease;
}
.pagination__link:hover { background: #f1f5f9; text-decoration: none; }

.pagination__link--disabled {
  color: #cbd5e1;
  cursor: default;
  pointer-events: none;
}

.pagination__info {
  color: #64748b;
  font-size: 0.85rem;
}

/* --- Responsive ------------------------------------------- */
@media (max-width: 900px) {
  .page-layout {
    grid-template-columns: 1fr;
  }

  .page-sidebar {
    position: static;
    border-top: 2px solid #e2e8f0;
    padding-top: 2rem;
  }
}

@media (max-width: 600px) {
  html { font-size: 16px; }

  .post__title { font-size: 1.5rem; }
  .post-card { padding: 1rem 1.1rem; }

  .comment__header { flex-wrap: wrap; }

  .config-dl {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .config-table { font-size: 0.82rem; }
}
