/* ── Variables ── */
:root {
  --color-bg: #c5d4e7;
  --color-dark: #0e0e0e;
  --color-orange: #f75e1e;
  --color-blue: #6e94c4;
  --color-teal: #54beff;
  --color-white: #ffffff;
  --font-family: 'Nunito Sans', sans-serif;
}

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

/* ── Base ── */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-weight: 400;
  color: var(--color-dark);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

a {
  color: var(--color-blue);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-orange);
}

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

/* ── Container ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: flex;
  align-items: center;
}

.logo {
  height: 40px;
  width: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: var(--color-white);
  font-weight: 600;
  font-size: 0.95rem;
}

.nav-link:hover {
  color: var(--color-teal);
}

.nav-cta {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: var(--color-orange);
  color: var(--color-white);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 6px;
  transition: background 0.2s;
}

.nav-cta:hover {
  background: #e04d10;
  color: var(--color-white);
}

/* ── Blog Listing ── */
.blog-listing {
  padding: 3rem 0;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--color-dark);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: var(--color-white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.post-card-link {
  display: block;
  padding: 1.75rem;
  color: var(--color-dark);
}

.post-card-link:hover {
  color: var(--color-dark);
}

.post-card-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.post-card-date {
  display: block;
  font-size: 0.85rem;
  color: var(--color-blue);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.post-card-summary {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.5;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
  list-style: none;
}

.pagination .page-item a,
.pagination .page-item span {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

.pagination .page-item.active span {
  background: var(--color-blue);
  color: var(--color-white);
}

.pagination .page-item a:hover {
  background: var(--color-dark);
  color: var(--color-white);
}

/* ── Single Post ── */
.post-single {
  padding: 3rem 0;
}

.post-header {
  margin-bottom: 2rem;
}

.post-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.post-date {
  display: block;
  font-size: 0.9rem;
  color: var(--color-blue);
  font-weight: 600;
}

.post-content {
  max-width: 780px;
  font-size: 1.05rem;
  line-height: 1.75;
}

.post-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
}

.post-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 1.5rem 0 0.75rem;
}

.post-content p {
  margin-bottom: 1.25rem;
}

.post-content ul,
.post-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content blockquote {
  border-left: 4px solid var(--color-orange);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 0 8px 8px 0;
}

.post-content code {
  background: rgba(14, 14, 14, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.post-content pre {
  background: var(--color-dark);
  color: var(--color-white);
  padding: 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.post-content a {
  color: var(--color-orange);
  font-weight: 600;
}

.post-content a:hover {
  text-decoration: underline;
}

.post-nav {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 2px solid rgba(14, 14, 14, 0.1);
}

.back-link {
  font-weight: 700;
  color: var(--color-blue);
  font-size: 1rem;
}

.back-link:hover {
  color: var(--color-orange);
}

/* ── Footer ── */
.site-footer {
  background: var(--color-dark);
  padding: 2rem 0;
  margin-top: 2rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-logo {
  height: 32px;
  width: auto;
}

.copyright {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

.copyright a {
  color: var(--color-teal);
  font-weight: 600;
}

.copyright a:hover {
  color: var(--color-orange);
}

/* ── Responsive: Tablet (810px) ── */
@media (max-width: 810px) {
  .post-grid {
    grid-template-columns: 1fr;
  }

  .post-title {
    font-size: 2rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* ── Responsive: Mobile (480px) ── */
@media (max-width: 480px) {
  .header-inner {
    padding: 0.75rem 1rem;
  }

  .logo {
    height: 32px;
  }

  .main-nav {
    gap: 1rem;
  }

  .nav-link {
    font-size: 0.85rem;
  }

  .nav-cta {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
  }

  .container {
    padding: 0 1rem;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .post-title {
    font-size: 1.6rem;
  }

  .post-content {
    font-size: 1rem;
  }
}
