/* ============================================
   adamzolyak.com - Jekyll Theme
   Matches Ghost site design
   ============================================ */

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

:root {
  --accent: #22C77C;
  --accent-dark: #1aab68;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --bg: #ffffff;
  --bg-secondary: #f9fafb;
  --border: #e5e7eb;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  --max-width: 1200px;
  --content-width: 720px;
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

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

/* --- Header --- */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.site-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: var(--bg-secondary);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* --- Main Content --- */
.site-main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px;
  width: 100%;
}

/* --- Home Hero --- */
.home-hero {
  padding: 48px 0 40px;
  text-align: center;
}

.home-tagline {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-muted);
  font-style: italic;
}

/* --- Post Grid --- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
}

/* --- Post Card --- */
.post-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

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

.post-card-image-link {
  display: block;
  overflow: hidden;
  aspect-ratio: 16/9;
}

.post-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.post-card:hover .post-card-image {
  transform: scale(1.03);
}

.post-card-content {
  padding: 20px 24px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.post-card-tag {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.post-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  margin-top: 4px;
}

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

.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

.post-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 8px;
}

/* --- Single Post --- */
.post {
  max-width: var(--content-width);
  margin: 0 auto;
}

.post-header {
  margin-bottom: 40px;
}

.post-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.post-tag {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: rgba(34, 199, 124, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
}

.post-title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
}

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

.post-feature-image {
  margin-top: 28px;
  border-radius: 12px;
  overflow: hidden;
}

.post-feature-image img {
  width: 100%;
}

/* --- Post Content --- */
.post-content {
  font-size: 1.05rem;
  line-height: 1.75;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  font-weight: 700;
  line-height: 1.3;
  margin: 2em 0 0.75em;
}

.post-content h1 { font-size: 1.8rem; }
.post-content h2 { font-size: 1.5rem; }
.post-content h3 { font-size: 1.25rem; }
.post-content h4 { font-size: 1.1rem; }

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

.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(34,199,124,0.4);
}

.post-content a:hover {
  text-decoration-color: var(--accent);
}

.post-content ul,
.post-content ol {
  margin: 1em 0 1.25em 1.5em;
}

.post-content li {
  margin-bottom: 0.4em;
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 20px;
  margin: 1.5em 0;
  color: var(--text-muted);
  font-style: italic;
}

.post-content code {
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
  font-size: 0.875em;
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.post-content pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5em 0;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: 0.9rem;
}

.post-content img {
  border-radius: 8px;
  margin: 1.5em auto;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

.post-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.back-link {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.15s;
}

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

/* --- Static Pages --- */
.page,
.tag-page {
  max-width: var(--content-width);
  margin: 0 auto;
}

.page-header {
  margin-bottom: 40px;
}

.page-title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
}

.page-description {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.page-content {
  font-size: 1.05rem;
  line-height: 1.75;
}

.page-content h2 { font-size: 1.5rem; font-weight: 700; margin: 2em 0 0.75em; }
.page-content h3 { font-size: 1.25rem; font-weight: 700; margin: 1.75em 0 0.5em; }
.page-content p { margin-bottom: 1.25em; }
.page-content a { color: var(--accent); text-decoration: underline; }
.page-content ul, .page-content ol { margin: 1em 0 1.25em 1.5em; }
.page-content li { margin-bottom: 0.4em; }

.tag-page .post-grid {
  margin-top: 0;
}

.no-posts {
  color: var(--text-muted);
  font-style: italic;
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.footer-nav {
  display: flex;
  gap: 16px;
}

.footer-nav a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.15s;
}

.footer-nav a:hover {
  color: var(--accent);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .header-inner {
    padding: 0 16px;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-left: 0;
  }

  .site-nav.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .site-main {
    padding: 24px 16px;
  }

  .post-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

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

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

  .home-tagline {
    font-size: 1.2rem;
  }

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