/* ============ BLOG LISTING ============ */
.posts-hero {
  padding-bottom: 48px;
}

.posts-hero h1 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.045em;
  margin-bottom: 16px;
}

.posts-hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 500px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding-bottom: 60px;
  max-width: 1136px;
  margin: 0 auto;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s;
  display: flex;
  flex-direction: column;
}

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

.post-card-img-wrap {
  position: relative;
  padding-top: 56.25%;
  background: rgba(0,0,0,0.2);
  overflow: hidden;
}

.post-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

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

.post-card-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.56rem;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-muted);
  color: var(--accent);
  border: 1px solid rgba(74,222,128,0.12);
}

.post-card h3 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.3;
}

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

.post-card-meta {
  margin-top: 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.64rem;
  color: var(--text-dim);
}

.pagination {
  text-align: center;
  padding-bottom: 80px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ============ SINGLE POST ============ */
.post-header {
  padding-top: 160px;
  padding-bottom: 32px;
  max-width: 800px;
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}

.post-breadcrumb {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.post-breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
}

.post-breadcrumb a:hover {
  color: var(--text);
}

.post-header h1 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  margin-bottom: 16px;
}

.post-excerpt {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.post-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.post-meta-date {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.64rem;
  color: var(--text-dim);
}

.post-featured-image {
  max-width: 800px;
  margin: 0 auto 48px;
  padding: 0 32px;
}

.post-featured-image img {
  width: 100%;
  border-radius: var(--radius-lg);
}

/* Post Content & Editor Blocks */
.post-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 32px 80px;
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.post-content p {
  margin: 12px 0;
}

.post-content h2 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 40px 0 16px;
}

.post-content h3 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 32px 0 12px;
}

.post-code-block {
  margin: 20px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.post-code-lang {
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.post-code-block pre {
  margin: 0;
  padding: 16px;
  background: rgba(0,0,0,0.25);
  overflow-x: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text);
}

.post-embed-wrap {
  position: relative;
  padding-top: 56.25%;
  margin: 20px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.post-embed-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.post-file-dl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  margin: 16px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.post-file-dl-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--text);
}

.post-file-dl-name {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.62rem;
  color: var(--text-dim);
  margin-left: 10px;
}

.post-figure {
  margin: 20px 0;
}

.post-figure img {
  max-width: 100%;
  border-radius: var(--radius-md);
}

.post-figcaption {
  text-align: center;
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* Breakpoints */
@media (max-width: 900px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .posts-grid { grid-template-columns: 1fr; }
}
/* ============ CODE BLOCK COPY ============ */
.post-code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
}
.post-code-copy:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

/* ============ OPTIN WIDGET ============ */
.optin-split {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 70px;
  align-items: center;
  padding: 40px 0;
  margin: 40px 0;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 40px;
}

.optin-form-col h1 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(32px, 4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 20px;
}

.optin-form-col p.subtitle {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 30px;
}

.custom-input {
  width: 100% !important;
  padding: 14px 16px !important;
  background: var(--bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  color: var(--text) !important;
  font-family: inherit !important;
  font-size: 15px !important;
  outline: none !important;
  transition: all 0.2s !important;
  box-shadow: none !important;
}
.custom-input::placeholder { color: var(--text-dim) !important; }
.custom-input:focus { 
  border-color: var(--accent) !important; 
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1) !important; 
}

.optin-video-col {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.optin-video-col iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 900px){
  .optin-split {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 30px 20px;
  }
  .optin-form-col { order: 2; }
  .optin-video-col { order: 1; }
}

/* ============ OPTIN WIDGET CSS (No Inline Styles) ============ */
.newsletter-iframe {
  display: none;
}
.optin-success-msg {
  display: none;
  padding: 32px 24px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}
.optin-success-msg.show {
  display: block;
}
.optin-success-icon {
  margin: 0 auto 16px;
  width: 48px;
  height: 48px;
  color: var(--accent);
}
.optin-success-msg h3 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.optin-success-msg p {
  color: var(--text-muted);
  font-size: 15.5px;
  line-height: 1.6;
}
.optin-input-group {
  margin-bottom: 16px;
}
.optin-input-group-last {
  margin-bottom: 24px;
}
.optin-submit-btn {
  width: 100%;
}
.optin-hidden {
  display: none;
}
.code-block-wrapper {
  position: relative;
}

/* ============ MARKDOWN BLOCK ============ */
.post-markdown {
  font-family: inherit;
  line-height: 1.7;
  color: var(--text-muted);
}
.post-markdown h1,
.post-markdown h2,
.post-markdown h3,
.post-markdown h4 {
  color: var(--text);
  font-family: "Bricolage Grotesque", sans-serif;
  margin-top: 2em;
  margin-bottom: 0.8em;
  letter-spacing: -0.02em;
}
.post-markdown h1 { font-size: 2.2rem; }
.post-markdown h2 { font-size: 1.8rem; }
.post-markdown h3 { font-size: 1.4rem; }
.post-markdown p {
  margin-bottom: 1.2em;
}
.post-markdown ul, 
.post-markdown ol {
  margin-bottom: 1.5em;
  padding-left: 1.5em;
}
.post-markdown li {
  margin-bottom: 0.5em;
}
.post-markdown blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.2em;
  margin: 1.5em 0;
  font-style: italic;
  color: var(--text-dim);
  background: var(--bg-card);
  padding: 1em 1.2em;
  border-radius: 0 8px 8px 0;
}
.post-markdown code {
  font-family: "JetBrains Mono", monospace;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--accent);
}
.post-markdown pre {
  background: var(--bg-card);
  padding: 1.2em;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.5em;
  border: 1px solid var(--border);
}
.post-markdown pre code {
  background: transparent;
  padding: 0;
  color: var(--text-muted);
}
.post-markdown a {
  color: var(--accent);
  text-decoration: none;
}
.post-markdown a:hover {
  text-decoration: underline;
}
.post-markdown img {
  max-width: 100%;
  border-radius: 8px;
  margin: 1.5em 0;
}
