/* ==========================================================================
   WordPress core additions — nothing in site.css is re-styled here.
   Only classes WordPress emits automatically that site.css does not target.
   ========================================================================== */

/* Screen reader text (WP core class) */
.screen-reader-text {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* WP alignment classes (block editor) */
.alignleft  { float: left;  margin: 0 24px 24px 0; }
.alignright { float: right; margin: 0 0 24px 24px; }
.aligncenter{ display: block; margin: 24px auto; }
.alignwide  { margin-left: -60px; margin-right: -60px; max-width: calc(100% + 120px); }
.alignfull  { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; }
@media (max-width: 900px) {
	.alignwide, .alignfull { margin-left: 0; margin-right: 0; max-width: 100%; }
}

/* Captions */
.wp-caption { max-width: 100%; }
.wp-caption-text,
.wp-block-image figcaption,
.wp-block-gallery figcaption {
	margin-top: 8px;
	font-size: 0.83rem;
	color: var(--muted-fg);
	text-align: center;
	line-height: 1.55;
}

/* Gallery (classic) */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0; }
.gallery-item { margin: 0; }
.gallery-icon img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); }
.gallery-caption { margin-top: 6px; font-size: 0.8rem; color: var(--muted-fg); text-align: center; }
.gallery-columns-1 { grid-template-columns: 1fr; }
.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 640px) {
	.gallery, .gallery-columns-2, .gallery-columns-3, .gallery-columns-4 { grid-template-columns: 1fr 1fr; }
}

/* WP core block classes needed for editor parity */
.wp-block-quote {
	border-left: 3px solid var(--foreground);
	padding: 8px 0 8px 20px;
	margin: 24px 0;
	font-style: italic;
	color: var(--muted-fg);
}
.wp-block-quote cite { display: block; margin-top: 8px; font-size: 0.85rem; font-style: normal; color: var(--subtle-fg); }
.wp-block-code, .wp-block-preformatted {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 16px 18px;
	font-family: var(--font-mono);
	font-size: 0.85rem;
	overflow-x: auto;
	margin: 24px 0;
}
.wp-block-table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 0.9rem; }
.wp-block-table th, .wp-block-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; }
.wp-block-table th { font-weight: 600; color: var(--foreground); }
.wp-block-table td { color: var(--muted-fg); }
.wp-block-separator {
	border: 0;
	height: 1px;
	background: var(--border);
	margin: 40px auto;
}
.wp-block-separator.is-style-wide { max-width: 100%; }
.wp-block-separator.is-style-dots {
	background: none;
	text-align: center;
	height: auto;
}
.wp-block-separator.is-style-dots::before {
	content: "···";
	letter-spacing: 1.4em;
	padding-left: 1.4em;
	color: var(--border-strong);
	font-family: var(--font-mono);
}

/* WordPress comment list (used by comments.php) */
.comment-list .comment-body { padding: 18px 0; border-bottom: 1px solid var(--border); }
.comment-list .comment-body:last-child { border-bottom: 0; }
.comment-list .children { list-style: none; padding-left: 22px; margin-top: 8px; }
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.comment-author img { border-radius: 50%; }
.comment-metadata { font-size: 0.78rem; color: var(--subtle-fg); margin: 4px 0 8px; }
.comment-metadata a { color: var(--subtle-fg); }
.comment-content p { color: var(--muted-fg); line-height: 1.7; }
.reply a {
	display: inline-block;
	margin-top: 8px;
	font-size: 0.82rem;
	color: var(--foreground);
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Comment form fields (WP emits these) */
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	height: 42px;
	padding: 0 14px;
	background: var(--card);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	font-size: 0.9rem;
	color: var(--foreground);
	font-family: var(--font-sans);
	margin-bottom: 12px;
	transition: border-color var(--transition), box-shadow var(--transition);
}
.comment-form textarea { height: auto; min-height: 130px; padding: 12px 14px; resize: vertical; line-height: 1.6; }
.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--foreground); box-shadow: 0 0 0 3px color-mix(in srgb, var(--foreground) 8%, transparent); outline: none; }
.comment-form label { display: block; font-size: 0.83rem; font-weight: 500; margin-bottom: 7px; }
.comment-form .form-submit { margin-top: 8px; }

/* Pagination (WP core .page-numbers reused via the .template-filters wrapper) */
.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius-full);
	font-size: 0.84rem;
	color: var(--muted-fg);
	background: var(--card);
	text-decoration: none;
	transition: all var(--transition);
}
.pagination .page-numbers:hover { border-color: var(--border-strong); color: var(--foreground); }
.pagination .page-numbers.current {
	background: var(--foreground);
	color: var(--background);
	border-color: var(--foreground);
}
.pagination .page-numbers.dots { border-color: transparent; background: transparent; }

/* Sticky / bypostauthor (WP core requirements) */
.sticky .post-card { border-color: var(--foreground); }
.bypostauthor > .comment-body .comment-author { color: var(--accent); }

/* Search form — WP wraps its own field with .search-form (already in site.css);
   this only ensures the label wrapper doesn't break layout. */
.search-form label { display: block; margin: 0; flex: 1; min-width: 0; }

/* WP admin bar offset — push the fixed chrome down when logged in */
body.admin-bar .nav-header { top: 32px; }
body.admin-bar .nav-mobile { top: calc(var(--chrome-h) + 32px); }
@media (max-width: 782px) {
	body.admin-bar .nav-header { top: 46px; }
	body.admin-bar .nav-mobile { top: calc(var(--chrome-h) + 46px); }
}

/* If a legal page uses the Legal Page template, .legal-layout needs
   the sticky TOC — but WP has no TOC auto-generator. Users add anchors
   manually; the layout simply respects whatever structure is inside. */
body.page-template-templates/legal-php .legal-layout { padding-top: 40px; }