/* ==========================================================================
   WordPress-specific additions on top of styles.css (design tokens reused).
   Owner: Foundation (A).
   ========================================================================== */

/* ---------- Admin bar offset for the sticky / fixed header ---------- */
.admin-bar .site-header { top: 32px; }
.admin-bar .site-header--dark { top: 32px; }
@media (max-width: 782px) {
  .admin-bar .site-header, .admin-bar .site-header--dark { top: 46px; }
}
@media (max-width: 600px) {
  /* The admin bar scrolls away on small screens */
  .admin-bar .site-header { top: 0; }
  .admin-bar .site-header--dark { top: 0; }
}
.admin-bar .mobile-menu { top: 32px; }
@media (max-width: 782px) { .admin-bar .mobile-menu { top: 46px; } }
@media (max-width: 600px) { .admin-bar .mobile-menu { top: 0; } }

/* ---------- Footer at the bottom on short pages (main takes the free height) ---------- */
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body > main { flex: 1 0 auto; }
body.admin-bar { min-height: calc(100vh - 32px); min-height: calc(100dvh - 32px); }
@media (max-width: 782px) { body.admin-bar { min-height: calc(100vh - 46px); min-height: calc(100dvh - 46px); } }

/* ---------- Forms ---------- */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
form .form-error { margin: 0; }

/* ---------- Blog search field (real <form>, matches design .search-input) ---------- */
form.search-input { margin: 0; }
.search-input input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* ---------- Long-form content (posts, legal pages, plain pages) ---------- */
.entry-content { overflow-wrap: anywhere; }
.entry-content > * + * { margin-top: 18px; }
.entry-content h2, .entry-content h3, .entry-content h4 { margin-top: 32px; }
.entry-content h2 { font-size: 26px; }
.entry-content h3 { font-size: 22px; }
.entry-content h4 { font-size: 18px; font-family: var(--font-body); font-weight: 600; }
.entry-content p, .entry-content li { font-size: 18px; line-height: 1.7; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; display: grid; gap: 8px; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content a:not(.btn) { color: var(--terra); text-decoration: underline; text-underline-offset: 3px; }
.entry-content a:not(.btn):hover { color: var(--terra-hover); }
.entry-content img, .entry-content video { border-radius: var(--radius-card); }
.entry-content figure { margin: 28px 0; }
.entry-content figcaption, .wp-caption-text { font-size: 14px; color: var(--muted); margin-top: 8px; }
.entry-content blockquote {
  margin: 8px 0; background: var(--bg-soft); border-radius: var(--radius-card); padding: 20px 24px;
  font-family: var(--font-title); font-size: 22px; line-height: 1.45; border-left: 3px solid var(--terra);
}
.entry-content blockquote p { font-family: inherit; font-size: inherit; line-height: inherit; }
.entry-content hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 16px; }
.entry-content th, .entry-content td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.entry-content iframe { max-width: 100%; }
.entry-content .wp-block-image img { height: auto; }
.entry-content .aligncenter, .entry-content .wp-block-image.aligncenter { margin-inline: auto; }
.entry-content .alignleft { float: left; margin: 4px 24px 12px 0; max-width: 50%; }
.entry-content .alignright { float: right; margin: 4px 0 12px 24px; max-width: 50%; }
.entry-content::after { content: ""; display: table; clear: both; }

/* Legal pages: sections are just headings + paragraphs */
.legal.entry-content { display: block; padding-bottom: 72px; }
.legal.entry-content h2 { margin-top: 40px; margin-bottom: 0; }
.legal.entry-content h2:first-child { margin-top: 0; }
.legal.entry-content p, .legal.entry-content li { color: var(--gray); font-size: 17px; }

/* Post prose keeps the design spacing (grid) */
.prose.entry-content { display: grid; }
.prose.entry-content > * + * { margin-top: 0; }
.prose.entry-content h2 { margin-top: 12px; font-size: var(--fs-h2); }
.prose.entry-content h3 { margin-top: 8px; }
@media (max-width: 719px) {
  .entry-content p, .entry-content li { font-size: 16px; }
  .entry-content blockquote { font-size: 19px; }
  .entry-content .alignleft, .entry-content .alignright { float: none; margin: 16px 0; max-width: 100%; }
}

/* ---------- Pagination (design uses .pagination > a) ---------- */
.pagination a { display: inline-flex; align-items: center; justify-content: center; }
.pagination .page-numbers.dots { min-width: 24px; padding: 0; background: none; }

/* ---------- Core block helpers (when posts contain core blocks) ---------- */
.wp-block-image, .wp-block-gallery { margin-inline: 0; }
.wp-block-embed iframe { width: 100%; }
.wp-block-button__link { display: inline-block; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.alignwide { width: min(var(--container), 100% - (var(--gutter) * 2)); margin-inline: auto; }
.alignfull { width: 100%; }
