/* Tottli Blog — extends styles.css tokens.
   Two layouts in this file: blog index (cards), and article reading view. */

/* ===== Blog index hero ===== */
.blog-hero {
  padding: clamp(48px, 8vw, 96px) 0 clamp(24px, 3vw, 40px);
  background: linear-gradient(180deg, var(--surface-warm) 0%, var(--bg) 100%);
  text-align: center;
}
.blog-hero-eyebrow {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: var(--text-sm);
  margin-bottom: var(--space-sm);
}
.blog-hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-3xl);
  letter-spacing: -0.02em;
  color: var(--text);
  max-width: 820px;
  margin: 0 auto var(--space-md);
}
.blog-hero-sub {
  max-width: 640px;
  margin: 0 auto;
  font-size: var(--text-lg);
  color: var(--text-secondary);
}

/* ===== Filter chips ===== */
.blog-filter {
  padding: clamp(16px, 2vw, 24px) 0 clamp(8px, 1vw, 16px);
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(253, 248, 244, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.blog-filter-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.blog-filter-chip {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 150ms var(--ease-out), color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}
.blog-filter-chip:hover {
  color: var(--text);
  border-color: var(--accent);
}
.blog-filter-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ===== Card grid ===== */
.blog-grid-section {
  padding: clamp(32px, 5vw, 64px) 0 clamp(48px, 6vw, 96px);
}
.blog-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(20px, 3vw, 36px);
}
.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}
.blog-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}
.blog-card-image {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--surface-warm);
}
.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms var(--ease-out-expo);
}
.blog-card:hover .blog-card-image img {
  transform: scale(1.04);
}
.blog-card-body {
  padding: clamp(16px, 2vw, 24px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.blog-card-meta {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.blog-card-cat {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.75rem;
}
.blog-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0;
}
.blog-card-excerpt {
  color: var(--text-secondary);
  font-size: var(--text-base);
  flex: 1;
}
.blog-card-read {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  margin-top: 4px;
}

/* ===== Bottom CTA on index ===== */
.blog-cta {
  background: var(--surface-warm);
  padding: clamp(48px, 6vw, 80px) 0;
  text-align: center;
}
.blog-cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}
.blog-cta h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-2xl);
  letter-spacing: -0.015em;
  max-width: 600px;
}
.blog-cta p {
  color: var(--text-secondary);
  max-width: 540px;
}

/* ===== Article reading view ===== */
.post-main {
  padding: clamp(24px, 3vw, 40px) 0 clamp(48px, 6vw, 80px);
}
.post-article {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}
.post-header {
  text-align: center;
  margin-bottom: clamp(24px, 3vw, 40px);
}
.post-eyebrow {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: var(--space-sm);
}
.post-eyebrow a {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.75rem;
}
.post-eyebrow a:hover { text-decoration: underline; }
.post-header h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-3xl);
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-md);
}
.post-excerpt {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-md);
}
.post-byline {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.post-hero {
  margin: 0 0 clamp(32px, 4vw, 48px);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-warm);
  aspect-ratio: 1200 / 630;
}
.post-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== Article body prose ===== */
.post-body {
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--text);
}
.post-body > * + * { margin-top: 1.25em; }
.post-body h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-2xl);
  letter-spacing: -0.015em;
  margin-top: 2em;
  margin-bottom: 0.4em;
}
.post-body h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
  margin-top: 1.6em;
  margin-bottom: 0.4em;
}
.post-body p { color: var(--text); }
.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.post-body a:hover { text-decoration-thickness: 2px; }
.post-body ul, .post-body ol {
  padding-left: 1.4em;
}
.post-body li + li { margin-top: 0.4em; }
.post-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 0.4em 1em;
  margin-left: 0;
  color: var(--text-secondary);
  background: var(--surface-warm);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.post-body strong { color: var(--text); }
.post-body code {
  background: var(--surface-warm);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.95em;
}
.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

/* ===== Tables in article body ===== */
.post-body table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-base);
  line-height: 1.5;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 640px) {
  .post-body table { display: table; }
}
.post-body thead {
  background: var(--surface-warm);
}
.post-body th {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.post-body td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text);
}
.post-body tbody tr:last-child td { border-bottom: none; }
.post-body tbody tr:nth-child(even) { background: rgba(253, 243, 231, 0.4); }
.post-body td:first-child,
.post-body th:first-child { padding-left: 20px; }
.post-body td:last-child,
.post-body th:last-child { padding-right: 20px; }
.post-body thead tr:first-child th:first-child { border-top-left-radius: var(--radius); }
.post-body thead tr:first-child th:last-child { border-top-right-radius: var(--radius); }
.post-body tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius); }
.post-body tbody tr:last-child td:last-child { border-bottom-right-radius: var(--radius); }
.post-body td strong { color: var(--text); font-weight: 700; }

/* ===== Inline CTA box (mid-article and at end) ===== */
.post-cta {
  margin: clamp(28px, 4vw, 48px) 0;
}
.post-cta-inner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(16px, 2vw, 24px);
  flex-wrap: wrap;
}
.post-cta-inner h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  margin: 0 0 4px;
}
.post-cta-inner p {
  color: var(--text-secondary);
  font-size: var(--text-base);
  margin: 0;
}
.post-cta-inner > div { flex: 1; min-width: 200px; }
.post-cta-inner .btn {
  background: var(--accent);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 700;
  white-space: nowrap;
  transition: box-shadow 150ms var(--ease-out), transform 150ms var(--ease-out);
}
.post-cta-inner .btn:hover {
  box-shadow: var(--shadow-btn-hover);
  transform: translateY(-1px);
}

/* ===== Disclaimer at end ===== */
.post-disclaimer {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
  color: var(--text-tertiary);
  text-align: center;
}

/* ===== Related posts strip ===== */
.post-related {
  max-width: 1120px;
  margin: clamp(40px, 6vw, 80px) auto 0;
  padding: 0 20px;
}
.post-related h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  letter-spacing: -0.015em;
  text-align: center;
  margin-bottom: var(--space-md);
}
.post-related ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
}
.post-related a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}
.post-related a:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-soft);
}
.post-related-cat {
  display: block;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.75rem;
  margin-bottom: 6px;
}
.post-related-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--text);
}
