/* =============================================================================
   wp.css — styling for WordPress-managed content (pages, posts, search, 404).
   The bespoke front page is fully styled by app.css; this file dresses the
   generic editor output (the_content) in the same Tradie Dark + Teal system.
   ============================================================================= */

/* Clear the fixed header on standalone content pages. */
.page-section { padding-top: calc(var(--section-y) + 1.5rem); }

.entry-title { font-size: var(--fs-h2); line-height: var(--lh-snug); color: var(--tx-1); }
.page-section .section-head { margin-bottom: var(--sp-6); }
.page-section .section-head .eyebrow { margin-bottom: var(--sp-4); }

.entry-thumb {
  margin-bottom: var(--sp-6);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line-1);
}
.entry-thumb img { width: 100%; height: auto; display: block; }

/* ---- Long-form content typography ---------------------------------------- */
.entry-content { color: var(--tx-2); font-size: var(--fs-lead); line-height: var(--lh-body); }
.entry-content > * + * { margin-top: var(--sp-4); }
.entry-content h2 { font-size: var(--fs-h3); color: var(--tx-1); margin-top: var(--sp-7); }
.entry-content h3 { color: var(--tx-1); margin-top: var(--sp-6); }
.entry-content h4 { color: var(--tx-1); margin-top: var(--sp-5); }
.entry-content a { color: var(--teal-300); border-bottom: 1px solid var(--teal-tint-22); transition: color var(--dur-fast), border-color var(--dur-fast); }
.entry-content a:hover { color: var(--teal-400); border-bottom-color: var(--teal-400); }
.entry-content strong { color: var(--tx-1); }
.entry-content ul, .entry-content ol { padding-left: 1.4rem; }
.entry-content li + li { margin-top: 0.4rem; }
.entry-content blockquote {
  border-left: 3px solid var(--teal-500);
  padding-left: var(--sp-4);
  color: var(--tx-1);
  font-family: var(--font-display);
  font-style: italic;
}
.entry-content img, .wp-block-image img { max-width: 100%; height: auto; border-radius: var(--r-md); }
.entry-content figure { margin: var(--sp-5) 0; }
.entry-content figcaption, .wp-caption-text { color: var(--tx-3); font-size: var(--fs-sm); margin-top: var(--sp-2); }
.entry-content hr { border: 0; height: 1px; background: var(--line-2); margin-block: var(--sp-6); }
.entry-content code {
  font-family: var(--font-mono);
  background: var(--bg-deep);
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  color: var(--tx-1);
}
.entry-content pre {
  background: var(--bg-deep);
  border: 1px solid var(--line-1);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  overflow: auto;
}
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { border: 1px solid var(--line-1); padding: 0.6rem 0.8rem; text-align: left; }
.entry-content th { color: var(--tx-1); background: var(--bg-card); }

/* ---- Alignments ---------------------------------------------------------- */
.alignleft { float: left; margin: 0 var(--sp-5) var(--sp-4) 0; }
.alignright { float: right; margin: 0 0 var(--sp-4) var(--sp-5); }
.aligncenter { display: block; margin-inline: auto; }
.alignwide, .alignfull { clear: both; }

/* ---- Blog index cards ---------------------------------------------------- */
.post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-5); }
.post-card { display: flex; flex-direction: column; gap: var(--sp-3); }
.post-thumb { display: block; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line-1); }
.post-thumb img { width: 100%; height: auto; display: block; }
.post-title { font-size: var(--fs-h3); }
.post-title a { color: var(--tx-1); }
.post-title a:hover { color: var(--teal-300); }
.post-excerpt { color: var(--tx-2); font-size: var(--fs-sm); }
.post-card .link { margin-top: auto; }
.post-card .link svg { width: 15px; height: 15px; vertical-align: -2px; }

/* ---- Pagination ---------------------------------------------------------- */
.pagination, .nav-links { margin-top: var(--sp-7); display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.pagination .page-numbers {
  display: inline-grid; place-items: center;
  min-width: 42px; height: 42px; padding: 0 0.6rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--bg-card);
  color: var(--tx-2);
  font-family: var(--font-mono); font-size: var(--fs-sm);
}
.pagination .page-numbers.current { color: #06231F; background: var(--teal-400); border-color: transparent; }
.pagination a.page-numbers:hover { color: var(--tx-1); border-color: var(--line-3); }
.page-links { margin-top: var(--sp-5); display: flex; gap: 0.4rem; }

/* ---- 404 ----------------------------------------------------------------- */
.error-404 { text-align: center; }
.error-404 .eyebrow { margin-bottom: var(--sp-4); }
.error-404 .lead { margin-inline: auto; max-width: 46ch; }
.error-404-actions { display: flex; justify-content: center; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-5); }
.error-404 .search-form { margin-top: var(--sp-6); }

/* ---- Search form --------------------------------------------------------- */
.search-form { display: flex; gap: 0.5rem; max-width: 460px; margin-inline: auto; }
.search-form .search-field {
  flex: 1;
  background: var(--bg-card); border: 1px solid var(--line-2);
  border-radius: var(--r-pill); color: var(--tx-1);
  padding: 0.75rem 1.1rem; font-family: var(--font-body); font-size: var(--fs-sm);
}
.search-form .search-field:focus-visible { outline: 2px solid var(--teal-400); outline-offset: 2px; }
.search-form .search-submit {
  border: 0; border-radius: var(--r-pill); cursor: pointer;
  padding: 0.75rem 1.3rem; font-weight: 600; color: #06231F;
  background: linear-gradient(180deg, var(--teal-400), var(--teal-500));
}

/* ---- Comments ------------------------------------------------------------ */
.comments-area { margin-top: var(--sp-7); }
.comment-list { list-style: none; padding: 0; display: grid; gap: var(--sp-4); }
.comment-body { border: 1px solid var(--line-1); border-radius: var(--r-md); padding: var(--sp-4); background: var(--bg-card); }
.comment-respond { margin-top: var(--sp-5); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  background: var(--bg-card); border: 1px solid var(--line-2);
  border-radius: var(--r-sm); color: var(--tx-1);
  padding: 0.7rem 0.9rem; font-family: var(--font-body); margin-top: 0.3rem;
}

/* ---- Alignfull safety on narrow container -------------------------------- */
@media (max-width: 520px) {
  .post-list { grid-template-columns: 1fr; }
  .error-404-actions { flex-direction: column; }
}
