/*
 * Theme-only rules for WordPress (theme.css is the untouched compiled site CSS).
 * Covers: page-transition arrival cover, dropdown/admin-bar behaviour, WordPress
 * content (blocks, images, captions, comments, pagination) and card images.
 */

/* Arriving through the tile transition: keep the page covered until theme.js reveals it. */
html.res-arriving body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-transition, 700);
  background: var(--color-ink);
}

/* The Product dropdown is server-rendered and toggled with [hidden]. */
.SiteChrome__dropdown[hidden] { display: none !important; }

/* Home dashboard preview (customer view): "My Jobs" is the open screen. Same ink colour and
   weight the old highlighted sub-item used, on a soft pill so it reads as a top-level item. */
.DashboardPreview__sidebar > a.res-dash-active { color: var(--color-ink); font-weight: var(--weight-strong); background: var(--color-dashboard-surface); border-radius: var(--radius-md); }
.DashboardPreview__sidebar > a.res-dash-active svg { color: var(--color-ink); }

/* Logged-in admin bar. */
.admin-bar .SiteChrome__header { top: 32px; }
@media screen and (max-width: 782px) { .admin-bar .SiteChrome__header { top: 46px; } }
@media screen and (max-width: 600px) { #wpadminbar { position: fixed; } }

/* Uploaded logo (Appearance → Customize → Site Identity). */
.brand-lockup--custom img.brand-lockup__mark { width: auto; height: 100%; max-height: 40px; object-fit: contain; }

/* Featured images on article cards fill the artwork window. */
.InsightsSection__artWindow .res-card-image { display: block; width: 100%; height: 100%; object-fit: cover; }

.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px;
  overflow: hidden; padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important;
}
.screen-reader-text:focus {
  clip: auto !important; clip-path: none; height: auto; width: auto; z-index: 100000;
  background: var(--color-paper); color: var(--color-ink); padding: 12px 16px; left: 8px; top: 8px;
}

/* ------------------------------------------------------------ Listings */
.res-listing { padding-top: var(--workflow-sticky-top); }
.res-listing__hero { margin-bottom: 0; }
.res-pagination { margin-top: var(--space-2xl); }
.res-pagination .nav-links { display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: center; justify-content: center; }
.res-pagination .page-numbers { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; padding: 0 var(--space-sm); border: var(--rule-hair) solid var(--color-rule); font-size: var(--text-sm); }
.res-pagination .page-numbers.current { background: var(--color-ink); color: var(--color-paper); border-color: var(--color-ink); }

/* ------------------------------------------- WordPress content (the_content) */
.res-prose { min-width: 0; }
.res-prose > * { margin-top: 0; }
.res-prose > * + * { margin-top: var(--space-lg); }
.res-prose p, .res-prose li { color: var(--color-graphite); line-height: 1.8; }
.res-prose > p:first-child { font-size: var(--text-lg); line-height: 1.6; color: var(--color-ink); }
.res-prose h2, .res-prose h3, .res-prose h4 { font-family: var(--font-display); font-weight: var(--weight-display); line-height: 1.15; letter-spacing: -.02em; color: var(--color-ink); scroll-margin-top: calc(var(--workflow-sticky-top) + var(--space-lg)); }
.res-prose h2 { font-size: var(--text-2xl); margin-top: var(--space-2xl); }
.res-prose h3 { font-size: var(--text-xl, 1.5rem); margin-top: var(--space-xl); }
.res-prose h4 { font-size: var(--text-lg); margin-top: var(--space-xl); }
.res-prose a { text-decoration: underline; text-underline-offset: 4px; }
.res-prose ul, .res-prose ol { padding-left: 1.25em; }
.res-prose ul { list-style: disc; }
.res-prose ol { list-style: decimal; }
.res-comments form p { margin: 0 0 var(--space-md); }
.res-comments label { display: block; margin-bottom: var(--space-2xs, 4px); font-size: var(--text-sm); }
.res-comments .comment-form-cookies-consent label { display: inline; }
.res-prose li + li { margin-top: var(--space-xs); }
.res-prose blockquote, .res-prose .wp-block-quote { margin-left: 0; margin-right: 0; padding: var(--space-lg) var(--space-xl); border-left: 2px solid var(--color-ink); background: var(--color-meadow); }
.res-prose blockquote p { color: var(--color-ink); }
.res-prose cite { font-style: normal; font-size: var(--text-sm); color: var(--color-muted); }
.res-prose img, .res-prose video, .res-prose iframe { max-width: 100%; height: auto; }
.res-prose figure { margin-left: 0; margin-right: 0; }
.res-prose figcaption, .res-prose .wp-caption-text, .res-prose .wp-element-caption { margin-top: var(--space-sm); font-size: var(--text-sm); color: var(--color-muted); }
.res-prose .wp-caption { max-width: 100%; }
.res-prose .alignleft { float: left; margin: 0 var(--space-lg) var(--space-md) 0; }
.res-prose .alignright { float: right; margin: 0 0 var(--space-md) var(--space-lg); }
.res-prose .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.res-prose .alignwide, .res-prose .alignfull { width: 100%; }
.res-prose::after { content: ""; display: table; clear: both; }
.res-prose table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.res-prose th, .res-prose td { padding: var(--space-sm) var(--space-md); border-bottom: var(--rule-hair) solid var(--color-rule); text-align: left; vertical-align: top; }
.res-prose th { color: var(--color-ink); font-weight: var(--weight-strong, 600); }
.res-prose pre, .res-prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.res-prose pre { overflow-x: auto; padding: var(--space-lg); background: var(--color-meadow); }
.res-prose hr { border: 0; border-top: var(--rule-hair) solid var(--color-rule); margin: var(--space-2xl) 0; }
.res-prose .wp-block-button__link, .res-prose .wp-element-button { display: inline-flex; min-height: 48px; align-items: center; padding: var(--space-sm) var(--space-lg); background: var(--color-ink); color: var(--color-paper); text-decoration: none; font-size: var(--text-sm); }
.res-prose .wp-block-image img { display: block; }
.res-prose .gallery, .res-prose .wp-block-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-md); }
.res-prose .page-links { font-size: var(--text-sm); }
@media (max-width: 600px) { .res-prose .alignleft, .res-prose .alignright { float: none; margin: 0 0 var(--space-md); } }

/* Block-editor paragraphs are direct children: undo the article-intro sizing of the compiled CSS. */
.res-prose.EditorialPages__prose > p { font-size: inherit; line-height: 1.8; margin-bottom: 0; color: var(--color-graphite); }
.res-prose.EditorialPages__prose > p.res-post-meta { font-size: var(--text-sm); line-height: 1.5; color: var(--color-muted); }
.res-prose.EditorialPages__prose > .res-post-meta + p { font-size: var(--text-lg); line-height: 1.6; color: var(--color-ink); }
.res-prose.ContentPage__reading a:not(.ContentPage__button):not(.wp-block-button__link) { display: inline; min-height: 0; }

/* Single posts and plain pages without a theme template. */
.res-single .EditorialPages__readingLayout.res-no-toc { grid-template-columns: minmax(0, var(--editorial-reading-width)); justify-content: center; }
.res-post-meta { margin-top: var(--space-md); color: var(--color-muted); font-size: var(--text-sm); }
.res-page-cover { width: min(calc(100% - var(--page-gutter) * 2), var(--layout-heading)); margin: 0 auto var(--space-xl); overflow: clip; }
.res-page-cover img { display: block; width: 100%; height: auto; }

/* Comments (only shown when a post has comments enabled). */
.res-comments { max-width: calc(var(--editorial-reading-width) + var(--page-gutter) * 2); margin: 0 auto var(--section-margin, 96px); padding: 0 var(--page-gutter); }
.res-comments h2, .res-comments .comment-reply-title { font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--text-2xl); }
.res-comments ol { list-style: none; padding: 0; }
.res-comments .children { padding-left: var(--space-xl); }
.res-comments .comment-body { padding: var(--space-lg) 0; border-top: var(--rule-hair) solid var(--color-rule); }
.res-comments .comment-meta { font-size: var(--text-sm); color: var(--color-muted); }
.res-comments input[type="text"], .res-comments input[type="email"], .res-comments input[type="url"], .res-comments textarea { width: 100%; padding: var(--space-sm) var(--space-md); border: var(--rule-hair) solid var(--color-rule); background: var(--color-paper); font: inherit; }
.res-comments .submit { min-height: 48px; padding: var(--space-sm) var(--space-lg); border: 0; background: var(--color-ink); color: var(--color-paper); font: inherit; cursor: pointer; }

/* 404 */
.res-404 .ContentPage__hero { min-height: calc(70vh - var(--workflow-sticky-top)); display: flex; flex-direction: column; justify-content: center; align-items: center; }
.res-404 .ContentPage__related { justify-content: center; margin-top: var(--space-lg); }
.res-404 .ContentPage__related a { display: inline-flex; min-height: 44px; align-items: center; text-decoration: underline; text-underline-offset: 4px; }
