/*
 * SPJSBlog — styles specific to this site.
 * Loaded after tokens.css and shared.css (both copied verbatim from spjsworks.com),
 * so everything here uses the same tokens and only adds what a blog + forum needs.
 */

/* ---------- Core WordPress classes the shared CSS never needed ---------- */
.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; width: 1px; word-wrap: normal !important; }
.screen-reader-text:focus { clip: auto; clip-path: none; height: auto; width: auto; position: static; }
.alignleft { float: left; margin: 0.3rem 1.5rem 1rem 0; }
.alignright { float: right; margin: 0.3rem 0 1rem 1.5rem; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text, figcaption { font-size: 0.85rem; color: var(--mdffs-muted); margin-top: 0.4rem; }
.sticky, .bypostauthor, .gallery-caption { /* recognised, no special look */ }

/* ---------- Menu link colour ----------
   shared.css's `.mdffs-body a:not([class])` (0,2,1) outranks its own `.site-nav li a` (0,1,2), so menu
   links came out cobalt. Restored to the intended body colour here. spjsworks.com still shows cobalt
   (deliberately left as is there for now). The footer had the same problem; fixed in shared.css. */
.mdffs-body .site-nav li a:not([class]) { color: var(--mdffs-body); }
.mdffs-body .site-nav li a:not([class]):hover { color: var(--mdffs-primary); }

/* Footer at the bottom of the window on short pages (404, empty search). */
.spjs-body { min-height: 100vh; display: flex; flex-direction: column; }
.spjs-body .site-main { flex: 1 0 auto; }

/* ---------- Layout: content column, optional sidebar ---------- */
.spjs-page { padding-block: var(--mdffs-space-8) var(--mdffs-space-16); }
.spjs-layout__main { min-width: 0; }
.spjs-layout--sidebar { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--mdffs-space-12); align-items: start; }
/* minmax(0, 1fr) on one column too: without it, the implicit column on phones sizes to the widest
   child (a long <pre>, the subscribe input), and the whole page scrolls sideways off-screen. */
@media (min-width: 960px) { .spjs-layout--sidebar { grid-template-columns: minmax(0, 1fr) 300px; } }
/* Long floated images in old posts must not leak past the article. */
.spjs-entry__body::after { content: ""; display: table; clear: both; }

/* ---------- Headings and meta ---------- */
.spjs-entry__head h1, .spjs-listing-head h1, .spjs-404 > h1 {
	font-size: var(--mdffs-h2); line-height: 1.15; color: var(--mdffs-ink); margin: 0 0 0.5rem; }
.spjs-entry__head { margin-bottom: var(--mdffs-space-6); }
/* Older pages (e.g. /dffs/) use <h1> for their sections. Size them as section headings so the
   page title stays the largest; the markup itself is a content fix (one <h1> per page). */
.spjs-entry__body h1 { font-size: var(--mdffs-h3); line-height: 1.25; color: var(--mdffs-ink); margin: 2.2rem 0 0.6rem; }
.spjs-meta { color: var(--mdffs-muted); font-size: 0.88rem; margin: 0; }
.spjs-meta a { color: var(--mdffs-muted); }
.spjs-meta a:hover { color: var(--mdffs-primary); }
.spjs-entry__tags { margin-top: var(--mdffs-space-8); }

/* ---------- Article body: things old posts use that the spjsworks docs never did ---------- */
.mdffs-doc img { border-radius: var(--mdffs-radius-sm); }
.mdffs-doc table { border-collapse: collapse; margin: 1rem 0; font-size: 0.92rem; max-width: 100%; }
.mdffs-doc th, .mdffs-doc td { border: 1px solid var(--mdffs-line); padding: 0.45em 0.75em; text-align: left; vertical-align: top; }
.mdffs-doc th, .mdffs-doc thead td { background: var(--mdffs-surface-alt); color: var(--mdffs-ink); font-weight: 700; }
.mdffs-doc .wp-block-table { overflow-x: auto; margin: 1rem 0; }
.mdffs-doc .wp-block-table table { margin: 0; }
.mdffs-doc hr { border: 0; border-top: 1px solid var(--mdffs-line); margin: 2rem 0; }
/* SyntaxHighlighter draws its own boxes; keep the shared dark <pre> style off them. */
.mdffs-doc .syntaxhighlighter { font-size: 0.82rem !important; border-radius: var(--mdffs-radius-sm); }

/* Table of Contents Plus box on the manuals */
#toc_container { box-sizing: border-box; max-width: 100%; background: var(--mdffs-surface-alt) !important; border: 1px solid var(--mdffs-line) !important;
	border-radius: var(--mdffs-radius-sm); padding: var(--mdffs-space-4) var(--mdffs-space-6) !important; font-size: 0.9rem; }
#toc_container .toc_title { font-weight: 700; color: var(--mdffs-ink); text-align: left; }
#toc_container a { color: var(--mdffs-primary); }

/* Documentation pages (shared .mdffs-doc-layout): a grid item defaults to min-width:auto, so one long code
   line widened the text column past the viewport. Let the column shrink; <pre> scrolls on its own. */
.mdffs-doc-layout > * { min-width: 0; }

/* ---------- Listings (archives, search) ---------- */
.spjs-listing-head { margin-bottom: var(--mdffs-space-8); }
.spjs-list { display: flex; flex-direction: column; }
.spjs-list__item { padding: var(--mdffs-space-6) 0; border-top: 1px solid var(--mdffs-line); }
/* .spjs-page prefix: shared `.mdffs-section h2` and `.mdffs-body a:not([class])` outrank the bare classes. */
.spjs-page .spjs-list__title { font-size: var(--mdffs-h3); line-height: 1.3; margin: 0 0 0.3rem; }
.spjs-page .spjs-list__title a { color: var(--mdffs-ink); text-decoration: none; }
.spjs-page .spjs-list__title a:hover { color: var(--mdffs-primary); }
/* Jetpack's "Like this" block also prints inside excerpts; it belongs on the post only. */
.spjs-list .sharedaddy, .spjs-list .jetpack-likes-widget-wrapper { display: none; }
.spjs-list__excerpt p { margin: 0.5rem 0 0; color: var(--mdffs-body); }

/* Pagination (listings) and previous/next (single post) */
.pagination, .spjs-postnav { margin-top: var(--mdffs-space-8); }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.pagination .page-numbers { display: inline-block; min-width: 2.2rem; padding: 0.4rem 0.7rem; text-align: center;
	border: 1px solid var(--mdffs-line); border-radius: var(--mdffs-radius-sm); text-decoration: none; color: var(--mdffs-body); }
.pagination .page-numbers.current { background: var(--mdffs-primary); border-color: var(--mdffs-primary); color: #fff; }
.pagination a.page-numbers:hover { border-color: var(--mdffs-primary); color: var(--mdffs-primary); }
.spjs-postnav .nav-links { display: grid; gap: var(--mdffs-space-4); }
@media (min-width: 700px) { .spjs-postnav .nav-links { grid-template-columns: 1fr 1fr; } .spjs-postnav .nav-next { text-align: right; grid-column: 2; } }
.spjs-postnav a { display: block; padding: var(--mdffs-space-4); border: 1px solid var(--mdffs-line);
	border-radius: var(--mdffs-radius-sm); text-decoration: none; color: var(--mdffs-ink); font-weight: 600; }
.spjs-postnav a:hover { border-color: var(--mdffs-primary); }
.spjs-postnav__label { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
	color: var(--mdffs-muted); font-weight: 700; margin-bottom: 0.2rem; }

/* ---------- Forms: search, comment form, sidebar widgets ---------- */
.spjs-body input[type="text"], .spjs-body input[type="email"], .spjs-body input[type="url"],
.spjs-body input[type="search"], .spjs-body input[type="password"], .spjs-body textarea {
	font: inherit; padding: 0.55rem 0.75rem; border: 1px solid var(--mdffs-line); border-radius: var(--mdffs-radius-sm);
	background: #fff; color: var(--mdffs-ink); max-width: 100%; box-sizing: border-box; }
.spjs-body input:focus, .spjs-body textarea:focus { outline: 2px solid var(--mdffs-primary-050); border-color: var(--mdffs-primary); }
.search-form { display: flex; gap: 0.5rem; max-width: 520px; }
.search-form label { flex: 1; }
.search-form .search-field { width: 100%; }
.spjs-body .search-submit, .spjs-body .submit, .spjs-body .wp-block-search__button {
	font: inherit; font-weight: 600; background: var(--mdffs-primary); color: #fff; border: 0; cursor: pointer;
	border-radius: var(--mdffs-radius-sm); padding: 0.55rem 1.1rem; }
.spjs-body .search-submit:hover, .spjs-body .submit:hover, .spjs-body .wp-block-search__button:hover { background: var(--mdffs-primary-600); }
/* PayPal cart (Simple Shopping Cart) "Add to Cart" buttons on the Classic DFFS product page. */
.spjs-body .wp_cart_button_wrapper { margin: 0.4rem 0 1.2rem; }
.spjs-body .wp_cart_button_wrapper input.wspsc_add_cart_submit {
	font: inherit; font-weight: 600; background: var(--mdffs-primary); color: #fff; border: 0; cursor: pointer;
	border-radius: var(--mdffs-radius-sm); padding: 0.55rem 1.1rem; line-height: 1.2; box-shadow: none; }
.spjs-body .wp_cart_button_wrapper input.wspsc_add_cart_submit:hover { background: var(--mdffs-primary-600); }
/* Contact form ([spjs_contact_form], inc/contact-form.php). */
.spjs-contact { max-width: 680px; margin: var(--mdffs-space-4) 0 var(--mdffs-space-8); }
.spjs-contact__form p { margin: 0 0 1rem; }
.spjs-contact__row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 600px) { .spjs-contact__row { grid-template-columns: 1fr; } }
.spjs-contact label { display: block; font-weight: 600; color: var(--mdffs-ink); font-size: 0.9rem; margin-bottom: 0.25rem; }
.spjs-contact input[type="text"], .spjs-contact input[type="email"], .spjs-contact select, .spjs-contact textarea {
	font: inherit; width: 100%; padding: 0.55rem 0.75rem; border: 1px solid var(--mdffs-line); border-radius: var(--mdffs-radius-sm);
	background: #fff; color: var(--mdffs-ink); box-sizing: border-box; }
.spjs-contact select:focus { outline: 2px solid var(--mdffs-primary-050); border-color: var(--mdffs-primary); }
.spjs-contact textarea { min-height: 10rem; resize: vertical; }
.spjs-contact__hint { display: block; font-size: 0.82rem; color: var(--mdffs-muted); margin-top: 0.3rem; }
.spjs-contact__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.spjs-contact__submit { font: inherit; font-weight: 600; background: var(--mdffs-primary); color: #fff; border: 0; cursor: pointer;
	border-radius: var(--mdffs-radius-sm); padding: 0.6rem 1.3rem; }
.spjs-contact__submit:hover { background: var(--mdffs-primary-600); }
.spjs-contact__notice { border-radius: var(--mdffs-radius); padding: 0.8rem 1rem; margin: 0 0 1rem; border: 1px solid; }
.spjs-contact__notice ul { margin: 0; padding-left: 1.1rem; }
.spjs-contact__notice--ok { background: #ecfdf3; border-color: #a6f4c5; color: #05603a; }
.spjs-contact__notice--error { background: #fef3f2; border-color: #fecdca; color: #b42318; }
.spjs-contact-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 1rem; margin: var(--mdffs-space-4) 0 var(--mdffs-space-6); }
.spjs-contact-ways > div { border: 1px solid var(--mdffs-line); border-radius: var(--mdffs-radius); padding: 1rem 1.1rem; background: var(--mdffs-surface-alt); }
.spjs-contact-ways h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.spjs-contact-ways p { margin: 0; font-size: 0.92rem; }

/* ---------- Sidebar ---------- */
.spjs-sidebar { font-size: 0.92rem; }
.spjs-widget { margin-bottom: var(--mdffs-space-8); }
/* Scoped to .spjs-sidebar so it outweighs shared.css's `.mdffs-section h2` (0,1,1), which
   otherwise renders every widget title at page-heading size. */
.spjs-sidebar .spjs-widget__title, .spjs-sidebar h2, .spjs-sidebar h3, .spjs-sidebar .wp-block-search__label {
	font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mdffs-muted);
	font-weight: 700; margin: 0 0 0.7rem; }
.spjs-sidebar ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.spjs-sidebar li { line-height: 1.4; }
.spjs-sidebar a { color: var(--mdffs-body); text-decoration: none; }
.spjs-sidebar a:hover { color: var(--mdffs-primary); }
.spjs-sidebar .bbp-author-avatar img, .spjs-sidebar .avatar { display: none; }
.spjs-sidebar .wp-block-search__inside-wrapper { display: flex; gap: 0.4rem; }
.spjs-sidebar .wp-block-search__input { flex: 1; min-width: 0; }
.spjs-sidebar .wp-block-jetpack-subscriptions button, .spjs-sidebar .wp-block-button__link {
	font: inherit; font-weight: 600; background: var(--mdffs-primary) !important; color: #fff !important; border: 0;
	border-radius: var(--mdffs-radius-sm) !important; padding: 0.55rem 1.1rem !important; cursor: pointer; }
.spjs-sidebar .wp-block-jetpack-subscriptions input[type="email"] { width: 100%; }
.spjs-widget--cart { background: var(--mdffs-surface-alt); border: 1px solid var(--mdffs-line);
	border-radius: var(--mdffs-radius); padding: var(--mdffs-space-4) var(--mdffs-space-6); }

/* ---------- Comments ---------- */
.spjs-comments { margin-top: var(--mdffs-space-12); max-width: 820px; }
.spjs-page .spjs-comments__title { font-size: var(--mdffs-h3); color: var(--mdffs-ink); }
.mdffs-body .spjs-comments .comment-author a:not([class]) { color: var(--mdffs-ink); text-decoration: none; }
.spjs-comments__list, .spjs-comments .children { list-style: none; margin: 0; padding: 0; }
.spjs-comments .children { padding-left: var(--mdffs-space-6); border-left: 2px solid var(--mdffs-line); margin-left: 1.2rem; }
.spjs-comments .comment-body { padding: var(--mdffs-space-4) 0; border-top: 1px solid var(--mdffs-line); }
.spjs-comments .comment-author { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; color: var(--mdffs-ink); }
.spjs-comments .comment-author .avatar { border-radius: 50%; }
.spjs-comments .comment-author .says { display: none; }
.spjs-comments .comment-metadata { font-size: 0.8rem; margin: 0.15rem 0 0 calc(40px + 0.6rem); }
.spjs-comments .comment-metadata a { color: var(--mdffs-muted); text-decoration: none; }
.spjs-comments .comment-content { margin-left: calc(40px + 0.6rem); overflow-wrap: anywhere; }
.spjs-comments .comment-content pre { background: var(--mdffs-surface-alt); padding: 0.6rem 0.9rem; overflow-x: auto;
	border-radius: var(--mdffs-radius-sm); font-size: 0.82rem; }
.spjs-comments .bypostauthor > .comment-body .comment-author .fn::after {
	content: "Author"; margin-left: 0.5rem; font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
	letter-spacing: 0.05em; color: #fff; background: var(--mdffs-primary); padding: 0.15em 0.55em; border-radius: var(--mdffs-radius-pill); }
.spjs-comments .reply { margin-left: calc(40px + 0.6rem); font-size: 0.85rem; }
.spjs-comments__closed { color: var(--mdffs-muted); border-top: 1px solid var(--mdffs-line); padding-top: var(--mdffs-space-4); }
.comment-respond { margin-top: var(--mdffs-space-8); }
.comment-form p { margin: 0 0 0.9rem; }
.comment-form label { display: block; font-weight: 600; color: var(--mdffs-ink); font-size: 0.9rem; margin-bottom: 0.25rem; }
.comment-form textarea, .comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"] { width: 100%; }
.comment-form .comment-form-cookies-consent label { display: inline; font-weight: 400; }

/* ---------- bbPress (its own CSS and bbp-style-pack still load; this only fits it to the page) ---------- */
.spjs-forum #bbpress-forums { font-size: 0.95rem; font-family: inherit; margin-bottom: 0; }
.spjs-forum #bbpress-forums ul.bbp-forums, .spjs-forum #bbpress-forums ul.bbp-topics,
.spjs-forum #bbpress-forums ul.bbp-replies, .spjs-forum #bbpress-forums ul.bbp-search-results {
	border-color: var(--mdffs-line); border-radius: var(--mdffs-radius-sm); overflow: hidden; }
.spjs-forum #bbpress-forums li.bbp-header { background: var(--mdffs-surface-alt); color: var(--mdffs-ink); }
.spjs-forum #bbpress-forums div.bbp-reply-content pre,
.spjs-forum #bbpress-forums div.bbp-topic-content pre { overflow-x: auto; }
.spjs-forum #bbpress-forums img { max-width: 100%; height: auto; }
/* Topic / reply text box: bbPress leaves it one line high in this theme. */
/* line-height: bbpress.min.css sets line-height: 0 on div.wp-editor-container, and .spjs-body textarea
   inherits the font (line-height included), so without it every line is drawn on top of the last. */
#bbpress-forums textarea.bbp-the-content { width: 100%; min-height: 200px; resize: vertical; line-height: 1.5; }
/* Forum search widget: text box and button on one row, button like the site's other buttons. */
.spjs-widget.widget_display_search #bbp-search-form > div { display: flex; gap: 0.5rem; }
.spjs-widget.widget_display_search #bbp_search { flex: 1; min-width: 0; }
.spjs-widget.widget_display_search #bbp_search_submit {
	font: inherit; font-weight: 600; background: var(--mdffs-primary); color: #fff; border: 0; cursor: pointer;
	border-radius: var(--mdffs-radius-sm); padding: 0.55rem 1.1rem; box-shadow: none; text-shadow: none; }
.spjs-widget.widget_display_search #bbp_search_submit:hover { background: var(--mdffs-primary-600); }
/* Attachments on topics and replies: the file picker's button as an outline button. */
.bbp-attachments-form input[type="file"] { font: inherit; font-size: 0.9rem; max-width: 100%; color: var(--mdffs-muted); }
.bbp-attachments-form input[type="file"]::file-selector-button {
	font: inherit; font-weight: 600; margin-right: 0.75rem; padding: 0.45rem 1rem; cursor: pointer;
	background: transparent; color: var(--mdffs-primary); border: 1.5px solid var(--mdffs-primary);
	border-radius: var(--mdffs-radius-sm); transition: background .15s; }
.bbp-attachments-form input[type="file"]::file-selector-button:hover { background: var(--mdffs-primary-050); }

@media (max-width: 700px) {
	.alignleft, .alignright { float: none; margin: 1rem 0; }
	.spjs-comments .comment-content, .spjs-comments .comment-metadata, .spjs-comments .reply { margin-left: 0; }
	.spjs-comments .children { padding-left: var(--mdffs-space-3); margin-left: 0.4rem; }
}

/* [spjs_modern_release]: current Modern DFFS version (read from spjsworks.com's version.json),
   on its own line at the end of the home page's SharePoint Online callout. */
.spjs-modern-release { display: block; margin-top: 0.5rem; font-size: 0.94rem; }

/* Anchors that are not headings (old anchor ids kept as empty spans, ids on paragraphs or table rows) get the
   same offset as headings, so a link to them is not hidden under the sticky header. Empty spans become blocks:
   an empty inline box has no reliable position to scroll to. */
.mdffs-doc [id] { scroll-margin-top: 84px; }
.mdffs-doc span[id]:empty { display: block; }
