/* ==========================================================================
   WordPress-only styles
   ---------------------------------------------------------------------------
   The static build wraps every page in its own hand-written sections. In
   WordPress the body is whatever the editor produced, inside the wrappers the
   theme templates add — so this file styles those wrappers and the Gutenberg
   block classes, using the same tokens as the rest of the site.

   Nothing here should be needed by the static site; it ships only in the
   generated theme.
   ========================================================================== */

/* --- page frame --------------------------------------------------------- */
/* Without this the content butts straight up against the sticky header. */
.page-body {
  padding-block: clamp(32px, 5vw, 68px);
}

.page-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 clamp(20px, 3vw, 34px);
  color: var(--text);
}

/* The editor content column: readable measure, not full bleed. */
.page-body .prose {
  max-width: 74ch;
}

.page-body .prose > * + * {
  margin-top: 1.1em;
}

.page-body .prose h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(21px, 2.4vw, 27px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-top: 2em;
}

.page-body .prose h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(17px, 1.9vw, 20px);
  margin-top: 1.6em;
}

.page-body .prose p,
.page-body .prose li {
  color: var(--text-2);
  line-height: 1.75;
}

.page-body .prose a {
  color: var(--brand-600);
  text-decoration: underline;
  text-underline-offset: 2px;
}

[data-theme="dark"] .page-body .prose a { color: var(--brand-300); }

/* --- gutenberg blocks --------------------------------------------------- */
.wp-block-image {
  margin-block: 1.8em;
}

.wp-block-image img {
  width: 100%;
  height: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
}

.wp-block-image figcaption,
.wp-element-caption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.6;
}

.wp-block-quote {
  margin-block: 1.8em;
  padding: 18px 22px;
  border-left: 3px solid var(--brand-500);
  background: var(--bg-soft);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}

.wp-block-quote p {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.5;
  color: var(--text);
}

.wp-block-table {
  margin-block: 1.8em;
  overflow-x: auto;
}

.wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.wp-block-table th,
.wp-block-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.wp-block-table thead th {
  background: var(--bg-inset);
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.wp-block-table tbody tr:last-child td { border-bottom: 0; }

.wp-block-list { padding-left: 1.3em; }
.wp-block-list li + li { margin-top: .5em; }

/* --- blog listing ------------------------------------------------------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: clamp(18px, 2.4vw, 28px);
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.post-card__link { display: block; color: inherit; }

.post-card__art {
  aspect-ratio: 16 / 10;
  background: var(--bg-inset);
  overflow: hidden;
}

.post-card__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 16px 18px 0;
  color: var(--text);
}

.post-card:hover .post-card__title { color: var(--brand-600); }
[data-theme="dark"] .post-card:hover .post-card__title { color: var(--brand-300); }

.post-card__excerpt {
  margin: 8px 18px 18px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-3);
}

/* --- single post -------------------------------------------------------- */
.article__figure.wrap img {
  width: 100%;
  height: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
}

/* --- pagination --------------------------------------------------------- */
.wp-block-query-pagination,
.navigation.pagination {
  margin-top: clamp(28px, 4vw, 44px);
  display: flex;
  justify-content: center;
}

.navigation.pagination .nav-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.navigation.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-weight: 600;
  font-size: 14px;
}

.navigation.pagination .page-numbers.current {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #fff;
}

/* --- admin bar ---------------------------------------------------------- */
/* Logged in, WordPress pushes the page down 32px; keep the sticky header put. */
body.admin-bar .header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .header { top: 46px; } }
