/* =============================================
   CONTENT — Post content rich-text formatting
   ============================================= */

/* ---- POST CARD (index/archive listing) ---- */
.post-card {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 3rem;
}
.post-card:last-child { border-bottom: none; margin-bottom: 0; }
/* When no thumbnail, body spans full width */
.post-card > .post-card__body:only-child { grid-column: 1 / -1; }
@media (max-width: 600px) {
  .post-card { grid-template-columns: 1fr; }
  .post-card > .post-card__body:only-child { grid-column: 1; }
}
.post-card__thumb {
  overflow: hidden;
  border-radius: var(--radius);
  height: 200px;
}
.post-card__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .7s ease;
}
.post-card:hover .post-card__thumb img { transform: scale(1.08); }
.post-card__meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .5rem;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.post-card__cat { color: var(--primary); }
.post-card__sep { color: var(--gray-300); }
.post-card__date { color: var(--gray-400); }
.post-card__title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: .75rem;
  line-height: 1.35;
  transition: color .2s;
}
.post-card:hover .post-card__title { color: var(--primary); }
.post-card__excerpt {
  font-size: .9rem;
  color: var(--gray-600);
  line-height: 1.7;
  margin-bottom: 1rem;
}
.post-card__author {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--gray-800);
}
.post-card__author img {
  width: 24px; height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

/* Blog index heading */
.blog-heading { margin-bottom: 3rem; }
.blog-heading h1 { font-size: 2.25rem; margin-bottom: .5rem; }
.blog-heading p { color: var(--gray-500); }

/* ---- SINGLE POST ---- */
.post-header { margin-bottom: 2.5rem; }
.post-header__title {
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--accent);
}
.post-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
}
.post-header__author {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.post-header__author img {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.post-header__author-name { font-size: .9rem; font-weight: 700; color: var(--accent); }
.post-header__author-role { font-size: .75rem; color: var(--gray-500); }
.post-header__dates { font-size: .875rem; }
.post-header__dates .label {
  display: block;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gray-400);
  margin-bottom: .15rem;
}
.post-header__updated .value { color: var(--primary); font-weight: 500; }
.post-header__dates .sep {
  padding-left: 1.5rem;
  border-left: 1px solid var(--gray-100);
}

/* Featured image */
.post-featured-image {
  width: 100%;
  height: clamp(260px, 40vw, 450px);
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 3rem;
}

/* ---- RICH CONTENT (the_content) ---- */
.entry-content {
  font-size: 1.05rem;
  color: var(--secondary);
  line-height: 1.85;
}

/* Headings inside content */
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
  font-family: var(--font-heading);
  color: var(--accent);
  margin-top: 2.25rem;
  margin-bottom: .85rem;
  line-height: 1.3;
  scroll-margin-top: 100px;
}
.entry-content h2 { font-size: 1.75rem; border-bottom: 2px solid var(--gray-100); padding-bottom: .5rem; }
.entry-content h3 { font-size: 1.35rem; }
.entry-content h4 { font-size: 1.15rem; }
.entry-content h5 { font-size: 1rem; }
.entry-content h6 { font-size: .9rem; color: var(--gray-600); }

/* Paragraphs */
.entry-content p { margin-bottom: 1.4rem; }
.entry-content p:last-child { margin-bottom: 0; }

/* Lead paragraph */
.entry-content > p:first-of-type {
  font-size: 1.2rem;
  line-height: 1.75;
  color: var(--gray-700);
}

/* Links */
.entry-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  font-weight: 500;
}
.entry-content a:hover { color: var(--primary-hover); }

/* Lists */
.entry-content ul,
.entry-content ol {
  padding-left: 1.75rem;
  margin-bottom: 1.4rem;
}
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li { margin-bottom: .5rem; line-height: 1.75; }
.entry-content ul ul,
.entry-content ol ol,
.entry-content ul ol,
.entry-content ol ul { margin-top: .4rem; margin-bottom: .4rem; }

/* Blockquote */
.entry-content blockquote {
  border-left: 4px solid var(--primary);
  background: var(--gray-50);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--gray-700);
  border-radius: 0 var(--radius) var(--radius) 0;
  line-height: 1.8;
}
.entry-content blockquote cite {
  display: block;
  margin-top: .75rem;
  font-size: .85rem;
  font-style: normal;
  font-weight: 600;
  color: var(--gray-500);
}
.entry-content blockquote cite::before { content: '— '; }

/* Tables */
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: .9rem;
  overflow-x: auto;
  display: block;
}
.entry-content thead tr { background: var(--primary); color: #fff; }
.entry-content th {
  padding: .75rem 1rem;
  text-align: left;
  font-weight: 700;
  font-family: var(--font-heading);
  font-size: .875rem;
}
.entry-content td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-700);
}
.entry-content tbody tr:nth-child(even) { background: var(--gray-50); }
.entry-content tbody tr:hover { background: #fff7ed; }

/* Images inside content */
.entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 1.5rem auto;
  display: block;
}
.entry-content figure { margin: 2rem 0; }
.entry-content figcaption {
  text-align: center;
  font-size: .8rem;
  color: var(--gray-500);
  margin-top: .5rem;
  font-style: italic;
}

/* Horizontal rule */
.entry-content hr {
  border: none;
  border-top: 2px solid var(--gray-100);
  margin: 2.5rem 0;
}

/* ---- CODE BLOCKS ---- */
.entry-content pre {
  position: relative;
  background: var(--gray-900);
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 2rem 0;
  font-family: var(--font-mono);
  font-size: .875rem;
  line-height: 1.7;
}
.entry-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  border-radius: 0;
  border: none;
}
.entry-content code {
  font-family: var(--font-mono);
  font-size: .875em;
  background: var(--gray-100);
  color: #c7254e;
  padding: .15em .4em;
  border-radius: 3px;
  border: 1px solid var(--gray-200);
}

/* Copy button injected by JS */
.code-copy-btn {
  position: absolute;
  top: .75rem;
  right: .75rem;
  background: var(--gray-700);
  color: var(--gray-300);
  border: none;
  border-radius: var(--radius);
  padding: .3rem .7rem;
  font-size: .75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .3rem;
  transition: background .2s, color .2s;
  font-family: var(--font-body);
  z-index: 1;
}
.code-copy-btn:hover { background: var(--primary); color: #fff; }
.code-copy-btn.copied { background: #22c55e; color: #fff; }

/* Callout / info boxes */
.entry-content .wp-block-info,
.entry-content .callout {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 2rem 0;
  font-size: .95rem;
}

/* ---- ARCHIVE / CATEGORY header ---- */
.archive-header {
  background: var(--white);
  padding: 3rem 1rem 2rem;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 0;
}
.archive-header__inner {
  max-width: var(--max-w);
  margin-inline: auto;
}
.archive-header__label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--primary);
  margin-bottom: .5rem;
}
.archive-header__title {
  font-size: 2rem;
  margin-bottom: .5rem;
}
.archive-header__desc { color: var(--gray-500); max-width: 540px; }

/* ---- 404 ---- */
.error-404 {
  text-align: center;
  padding: 6rem 1rem;
}
.error-404 h1 { font-size: 5rem; color: var(--primary); margin-bottom: .5rem; }
.error-404 h2 { font-size: 1.5rem; margin-bottom: 1rem; }
.error-404 p { color: var(--gray-500); margin-bottom: 2rem; }

/* ---- SEARCH RESULTS ---- */
.search-header {
  padding: 2rem 0 1rem;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 2rem;
}
.search-header h1 { font-size: 1.6rem; }
.search-header h1 span { color: var(--primary); }
.search-no-results {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--gray-500);
}

/* ---- COMMENTS ---- */
.comments-area { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--gray-200); }
.comments-title { font-size: 1.4rem; margin-bottom: 2rem; }
.comment-list { list-style: none; padding: 0; margin: 0 0 2rem; }
.comment { padding: 1.5rem 0; border-bottom: 1px solid var(--gray-100); }
.comment .children { padding-left: 2rem; list-style: none; }
.comment-author-avatar { float: left; margin-right: 1rem; }
.comment-author-avatar img { border-radius: 50%; }
.comment-meta { margin-bottom: .5rem; }
.comment-author a { font-weight: 700; color: var(--accent); }
.comment-metadata a { font-size: .8rem; color: var(--gray-400); }
.comment-content { clear: both; font-size: .95rem; }
.comment-reply-link {
  font-size: .8rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: .5rem;
  display: inline-block;
}
.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: .65rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: .95rem;
  margin-bottom: 1rem;
  outline: none;
  transition: border-color .2s;
}
.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--primary); }
.comment-form textarea { height: 140px; resize: vertical; }
.comment-form .submit {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  border: none;
  padding: .75rem 2rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity .2s;
}
.comment-form .submit:hover { opacity: .9; }
