/*
  Minimal Newspaper Blog Styles
  - Classic serif typography
  - Thin rules, generous whitespace
  - Responsive and print-friendly
  - Based on portfolio design system
*/

:root {
  --page-max-width: 960px;
  --gutter: 20px;
  --rule: 1px solid #111;
  --ink: #111;
  --muted: #6b6b6b;
  --paper: #fffdfa;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Source Serif 4", "EB Garamond", Georgia, serif;
  line-height: 1.5;
}

a { color: inherit; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Masthead */
.masthead { padding-top: 24px; padding-bottom: 16px; }
.masthead-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--gutter);
  font-size: 14px;
  color: var(--muted);
}
.masthead-left { text-align: left; }
.masthead-center { text-align: center; }
.masthead-right { text-align: right; }

.masthead-title {
  font-family: "EB Garamond", Georgia, serif;
  font-weight: 700;
  font-size: clamp(36px, 6vw, 64px);
  letter-spacing: 0.5px;
  text-align: center;
  margin: 8px 0 4px 0;
}

.masthead-title a {
  color: var(--ink);
  text-decoration: none;
  transition: opacity 0.2s ease;
  display: inline-block;
}

.masthead-title a:hover {
  opacity: 0.7;
}

.masthead-subtitle {
  text-align: center;
  color: var(--muted);
  margin: 0 0 12px 0;
  white-space: nowrap;
  font-size: clamp(12px, 1.5vw, 18px);
}

/* Hamburger menu button */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--ink);
  padding: 8px;
  cursor: pointer;
  position: absolute;
  top: 24px;
  right: var(--gutter);
  z-index: 100;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  transition: all 0.3s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.nav {
  display: flex;
  gap: 16px;
  justify-content: center;
  border-top: var(--rule);
  border-bottom: var(--rule);
  padding: 8px 0;
}
.nav a { text-decoration: none; }
.nav a.active { font-weight: 700; text-decoration: underline; }

/* Sections */
.section { padding: 20px 0; }
.section-kicker {
  font: 600 14px/1 "Source Serif 4", Georgia, serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: var(--rule);
  border-bottom: var(--rule);
  display: inline-block;
  padding: 6px 10px 4px 10px;
  margin: 16px 0 12px 0;
}

/* Footer */
.footer { border-top: var(--rule); padding: 16px 0 40px 0; color: var(--muted); font-size: 14px; }

/* Blog-specific styles */
.blog-filters {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: var(--rule);
}

.filter-group {
  flex: 1;
  min-width: 200px;
}

.filter-label {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 12px 0;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-tag {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
  border-radius: 4px;
}

.filter-tag:hover {
  background: var(--ink);
  color: var(--paper);
}

.filter-tag.active {
  background: var(--ink);
  color: var(--paper);
}

/* Blog posts list */
.blog-posts-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.blog-post-preview {
  border-top: var(--rule);
  padding-top: 24px;
}

.blog-post-preview:first-child {
  border-top: none;
  padding-top: 0;
}

.blog-post-header {
  margin-bottom: 12px;
}

.blog-post-title {
  font-family: "EB Garamond", Georgia, serif;
  font-weight: 700;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
  margin: 0 0 8px 0;
}

.blog-post-title a {
  color: var(--ink);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.blog-post-title a:hover {
  opacity: 0.7;
  text-decoration: underline;
}

.blog-post-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
}

.blog-date {
  font-style: italic;
}

.blog-category {
  display: inline-flex;
}

.blog-meta-link {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.blog-meta-link:hover {
  border-bottom-color: var(--muted);
}

.blog-excerpt {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 16px 0;
}

.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.blog-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--paper);
  border: 1px solid var(--muted);
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.blog-tag:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.blog-tag.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.blog-post-footer {
  margin-top: 16px;
}

.blog-read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.blog-read-more:hover {
  border-bottom-color: var(--ink);
}

.blog-read-more i {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.blog-read-more:hover i {
  transform: translateX(4px);
}

/* Blog post detail page */
.blog-post {
  max-width: 720px;
  margin: 0 auto;
}

.blog-post-title-main {
  font-family: "EB Garamond", Georgia, serif;
  font-weight: 700;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.2;
  margin: 0 0 16px 0;
  color: var(--ink);
}

.blog-post-body {
  font-size: 18px;
  line-height: 1.8;
  color: var(--ink);
  margin-top: 32px;
}

.blog-post-body h1,
.blog-post-body h2,
.blog-post-body h3,
.blog-post-body h4,
.blog-post-body h5,
.blog-post-body h6 {
  font-family: "EB Garamond", Georgia, serif;
  font-weight: 700;
  margin-top: 32px;
  margin-bottom: 16px;
  color: var(--ink);
}

.blog-post-body h2 {
  font-size: 32px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 8px;
}

.blog-post-body h3 {
  font-size: 24px;
}

.blog-post-body p {
  margin: 0 0 16px 0;
}

.blog-post-body ul,
.blog-post-body ol {
  margin: 16px 0;
  padding-left: 24px;
}

.blog-post-body li {
  margin: 8px 0;
}

.blog-post-body code {
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.blog-post-body pre {
  background: #f5f5f5;
  padding: 16px;
  border-radius: 4px;
  overflow-x: auto;
  border: 1px solid #e0e0e0;
  margin: 16px 0;
}

.blog-post-body pre code {
  background: none;
  padding: 0;
}

.blog-post-body blockquote {
  border-left: 4px solid var(--muted);
  padding-left: 16px;
  margin: 16px 0;
  color: var(--muted);
  font-style: italic;
}

.blog-post-body a {
  color: var(--ink);
  text-decoration: underline;
}

.blog-post-body a:hover {
  opacity: 0.7;
}

.blog-post-body img {
  max-width: 100%;
  height: auto;
  margin: 24px 0;
  border-radius: 4px;
  border: var(--rule);
}

.blog-post-comments {
  margin-top: 48px;
  padding-top: 24px;
  border-top: var(--rule);
}

.blog-post-navigation {
  margin-top: 48px;
  padding-top: 24px;
  border-top: var(--rule);
}

.blog-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.blog-nav-link:hover {
  border-bottom-color: var(--ink);
}

.blog-loading,
.blog-error {
  text-align: center;
  padding: 48px 24px;
}

.blog-error h2 {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 32px;
  margin-bottom: 16px;
}

.no-posts {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

/* Responsiveness */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .masthead-title { font-size: 42px; }
  .nav-toggle {
    display: flex;
  }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-top: var(--rule);
    border-bottom: var(--rule);
    flex-direction: column;
    gap: 0;
    padding: 0;
    z-index: 99;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  }
  .nav.open {
    display: flex;
  }
  .nav a {
    padding: 12px var(--gutter);
    font-size: 14px;
    border-bottom: 1px solid #e8e8e8;
    width: 100%;
    text-align: left;
  }
  .nav a:last-child {
    border-bottom: none;
  }
  .masthead {
    position: relative;
  }
  .blog-filters {
    flex-direction: column;
    gap: 24px;
  }
  .filter-group {
    min-width: 100%;
  }
  .blog-post-preview {
    padding-top: 20px;
  }
  .blog-post-title {
    font-size: 22px;
  }
  .blog-post-title-main {
    font-size: 28px;
  }
  .blog-post-body {
    font-size: 16px;
  }
  .blog-post-body h2 {
    font-size: 24px;
  }
  .blog-post-body h3 {
    font-size: 20px;
  }
  .blog-post-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 600px) {
  :root { --gutter: 14px; }
  .masthead-top { grid-template-columns: 1fr; text-align: center; gap: 4px; }
  .masthead-left, .masthead-right { text-align: center; }
  .masthead-title { font-size: 32px; }
  .masthead-subtitle { 
    font-size: clamp(11px, 3.5vw, 14px);
  }
  .section { 
    padding: 16px 0; 
  }
  .section-kicker { 
    font-size: 12px; 
    padding: 4px 8px; 
    margin: 12px 0 8px 0;
  }
}

/* Print styles */
@media print {
  :root { --ink: #000; --paper: #fff; }
  body { background: #fff; color: #000; }
  .nav { display: none !important; }
  .container { max-width: 720px; }
}

