/* ==========================================================================
   Shared Stylesheet — Simple Static Blog (Plain HTML & CSS)
   ========================================================================== */

:root {
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --badge-bg: #eff6ff;
  --badge-text: #1d4ed8;
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f19;
    --surface: #111827;
    --surface-hover: #1e293b;
    --border: #1f2937;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --badge-bg: #1e3a8a;
    --badge-text: #bfdbfe;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.7;
  padding: 0 1.25rem;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

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

/* --------------------------------------------------------------------------
   Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.75rem;
  margin-bottom: 2.75rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.brand:hover {
  text-decoration: none;
}

.brand-dot {
  width: 10px;
  height: 10px;
  background-color: var(--accent);
  border-radius: 50%;
  display: inline-block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.925rem;
}

.site-nav a {
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.15s ease;
}

.site-nav a:hover {
  color: var(--text-main);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Badges & Metadata
   -------------------------------------------------------------------------- */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  background-color: var(--badge-bg);
  color: var(--badge-text);
  margin-bottom: 0.85rem;
}

.post-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Featured Announcement Section (index.html)
   -------------------------------------------------------------------------- */
.featured-announcement {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 3rem;
}

.featured-announcement h1 {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
}

.featured-announcement h1 a {
  color: var(--text-main);
}

.featured-announcement h1 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.featured-announcement .post-meta {
  margin-bottom: 1rem;
}

.featured-announcement p {
  color: var(--text-main);
  font-size: 1.025rem;
  margin-bottom: 1.25rem;
}

.read-more {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Recent Posts Section (index.html)
   -------------------------------------------------------------------------- */
.section-heading {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.recent-posts {
  margin-bottom: 3.25rem;
}

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.post-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.post-card:hover {
  background-color: var(--surface);
  border-color: var(--text-muted);
}

.post-card-link {
  display: block;
  padding: 1.15rem 1.25rem;
  color: inherit;
}

.post-card-link:hover {
  text-decoration: none;
}

.post-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.post-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.post-card:hover .post-card-title {
  color: var(--accent);
}

.post-card-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.post-card-excerpt {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Single Post Page (posts/*.html)
   -------------------------------------------------------------------------- */
.back-link {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.back-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.post-header h1 {
  font-size: 2.15rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 0.65rem;
}

.article-body {
  font-size: 1.05rem;
}

.article-body p {
  margin-bottom: 1.35rem;
}

.article-body h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2.25rem 0 0.75rem;
  letter-spacing: -0.02em;
}

.article-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 1.75rem 0 0.5rem;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.5rem 1.35rem;
}

.article-body li {
  margin-bottom: 0.5rem;
}

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

.article-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  background-color: var(--surface);
  border: 1px solid var(--border);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Email Signup Section
   -------------------------------------------------------------------------- */
.signup-section {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-top: 3rem;
}

.signup-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.signup-section p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.signup-form {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.signup-input {
  flex: 1;
  min-width: 220px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--bg);
  color: var(--text-main);
}

.signup-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.signup-btn {
  background-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.35rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.signup-btn:hover {
  background-color: var(--accent-hover);
}

.form-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.65rem;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Mobile-Friendly Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  .container {
    padding: 1.75rem 0 3rem;
  }

  .featured-announcement,
  .signup-section {
    padding: 1.35rem;
  }

  .featured-announcement h1 {
    font-size: 1.5rem;
  }

  .post-header h1 {
    font-size: 1.75rem;
  }

  .post-card-header {
    flex-direction: column;
    gap: 0.2rem;
  }

  .signup-form {
    flex-direction: column;
  }

  .signup-input,
  .signup-btn {
    width: 100%;
  }
}

