/*
Theme Name: Tenant
Theme URI: https://example.com/
Author: Your Name
Description: A quiet, reading-first theme for technical blogs aimed at Microsoft 365 and IT administrators. Single reading column, light and dark modes, readable code blocks with copy buttons, an automatic table of contents, and a notice on older posts.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tenant
Tags: blog, one-column, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, accessibility-ready, dark-mode
*/

/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
	--bg: #ffffff;
	--bg-soft: #f6f8fa;
	--fg: #1c2127;
	--muted: #5d6975;
	--border: #e2e6ea;
	--accent: var(--accent-base, #0b5fd6);
	--accent-fg: #ffffff;
	--code-bg: #f3f5f8;
	--code-fg: #1c2127;
	--warn-bg: #fff8e6;
	--warn-border: #e8c766;
	--info-bg: #eef5ff;
	--info-border: #9cc2f5;

	--measure: 42rem;
	--wide: 60rem;
	--radius: 6px;

	--font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;

	color-scheme: light;
}

:root[data-theme="dark"] {
	--bg: #0f1317;
	--bg-soft: #161b21;
	--fg: #e4e8ec;
	--muted: #93a0ad;
	--border: #252d36;
	--accent: color-mix(in srgb, var(--accent-base, #0b5fd6) 55%, white);
	--accent-fg: #0f1317;
	--code-bg: #171d24;
	--code-fg: #dfe5ea;
	--warn-bg: #2a2412;
	--warn-border: #6b5a21;
	--info-bg: #121f33;
	--info-border: #2f568c;
	color-scheme: dark;
}

/*@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #0f1317;
		--bg-soft: #161b21;
		--fg: #e4e8ec;
		--muted: #93a0ad;
		--border: #252d36;
		--accent: color-mix(in srgb, var(--accent-base, #0b5fd6) 55%, white);
		--accent-fg: #0f1317;
		--code-bg: #171d24;
		--code-fg: #dfe5ea;
		--warn-bg: #2a2412;
		--warn-border: #6b5a21;
		--info-bg: #121f33;
		--info-border: #2f568c;
		color-scheme: dark;
	}
}*/

/* ==========================================================================
   Base
   ========================================================================== */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font: 400 1.0625rem/1.7 var(--font-sans);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img,
video,
iframe {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--accent);
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}

a:hover {
	text-decoration-thickness: 2px;
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	border-radius: 2px;
}

.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;
}

.skip-link:focus {
	clip: auto;
	clip-path: none;
	background: var(--accent);
	color: var(--accent-fg);
	height: auto;
	width: auto;
	left: 1rem;
	top: 1rem;
	padding: 0.5rem 0.75rem;
	z-index: 100;
	text-decoration: none;
	border-radius: var(--radius);
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
	border-bottom: 1px solid var(--border);
}

.site-header__inner {
	max-width: var(--wide);
	margin: 0 auto;
	padding: 1rem 1.25rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.5rem;
	flex-wrap: wrap;
}

.site-title {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.3;
}

.site-title a {
	color: var(--fg);
	text-decoration: none;
}

.custom-logo {
	max-height: 36px;
	width: auto;
	display: block;
}

.site-header__right {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	flex-wrap: wrap;
}

.primary-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 0.25rem 1.25rem;
	flex-wrap: wrap;
}

.primary-nav a {
	color: var(--muted);
	text-decoration: none;
	font-size: 0.9375rem;
}

.primary-nav a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a {
	color: var(--fg);
}

.header-tools {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: var(--radius);
	color: var(--muted);
	cursor: pointer;
}

.icon-btn:hover {
	color: var(--fg);
	background: var(--bg-soft);
}

/* ==========================================================================
   Layout
   ========================================================================== */

.site-main {
	max-width: var(--wide);
	margin: 0 auto;
	padding: 3rem 1.25rem 4rem;
}

.page-header {
	margin-bottom: 2rem;
}

.page-title {
	margin: 0;
	font-size: 1.75rem;
	line-height: 1.25;
	letter-spacing: -0.02em;
}

.page-description {
	margin: 0.5rem 0 0;
	color: var(--muted);
}

.page-description p {
	margin: 0;
}

/* ==========================================================================
   Post list
   ========================================================================== */

.post-item {
	padding: 1.75rem 0;
	border-bottom: 1px solid var(--border);
}

.post-item:first-of-type {
	padding-top: 0;
}

.post-item:last-of-type {
	border-bottom: 0;
}

.post-item__meta,
.entry-meta {
	margin: 0;
	font-size: 0.875rem;
	color: var(--muted);
}

.post-item__meta a,
.entry-meta a {
	color: inherit;
	text-decoration: none;
}

.post-item__meta a:hover,
.entry-meta a:hover {
	color: var(--accent);
	text-decoration: underline;
}

.post-item__title {
	margin: 0.3rem 0 0.5rem;
	font-size: 1.45rem;
	line-height: 1.3;
	letter-spacing: -0.015em;
}

.post-item__title a {
	color: var(--fg);
	text-decoration: none;
}

.post-item__title a:hover {
	color: var(--accent);
}

.post-item__excerpt {
	color: var(--muted);
}

.post-item__excerpt p {
	margin: 0;
}

.post-item__subtitle {
	margin: 0.3rem 0 0.5rem;
	font-size: 1rem;
	line-height: 1.3;
	letter-spacing: -0.015em;
}

/* Pagination */

.pagination {
	margin-top: 2.5rem;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	font-size: 0.9375rem;
}

.pagination .page-numbers {
	padding: 0.35rem 0.75rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	color: var(--fg);
	text-decoration: none;
}

.pagination a.page-numbers:hover {
	border-color: var(--accent);
	color: var(--accent);
}

.pagination .page-numbers.current {
	background: var(--fg);
	border-color: var(--fg);
	color: var(--bg);
}

.pagination .page-numbers.dots {
	border: 0;
}

/* ==========================================================================
   Single post / page
   ========================================================================== */

.entry-header {
	margin-bottom: 2rem;
}

.entry-cats {
	margin: 0 0 0.75rem;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.entry-cats a {
	color: var(--accent);
	text-decoration: none;
}

.entry-cats a + a::before {
	content: " / ";
	color: var(--muted);
	font-weight: 400;
}

.entry-title {
	margin: 0 0 0.75rem;
	font-size: clamp(1.75rem, 4.5vw, 2.35rem);
	line-height: 1.2;
	letter-spacing: -0.025em;
}

.entry-thumb {
	margin: 0 0 2rem;
}

.entry-thumb img {
	display: block;
	width: 100%;
	border-radius: var(--radius);
}

.entry-subtitle {
	margin: 0 0 0.75rem;
	font-size: clamp(1rem, 4.5vw, 1rem);
	line-height: 1.2;
	letter-spacing: -0.025em;
}

/* Table of contents */

.toc {
	margin: 0 0 2rem;
	padding: 0.75rem 1rem;
	background: var(--bg-soft);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	font-size: 0.9375rem;
}

.toc summary {
	cursor: pointer;
	font-weight: 600;
}

.toc ol {
	margin: 0.75rem 0 0.25rem;
	padding-left: 1.25rem;
}

.toc ol ol {
	margin: 0.25rem 0;
	list-style-type: circle;
}

.toc li {
	margin: 0.2rem 0;
}

.toc a {
	text-decoration: none;
}

.toc a:hover {
	text-decoration: underline;
}

/* Content */

.entry-content {
	overflow-wrap: break-word;
}

.entry-content > * + * {
	margin-top: 1.25em;
	margin-bottom: 0;
}

.entry-content > :first-child {
	margin-top: 0;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
	line-height: 1.3;
	letter-spacing: -0.015em;
	scroll-margin-top: 1.5rem;
}

.entry-content > h2 {
	margin-top: 2.4em;
	font-size: 1.55rem;
	padding-bottom: 0.3em;
	border-bottom: 1px solid var(--border);
}

.entry-content > h3 {
	margin-top: 2em;
	font-size: 1.25rem;
}

.entry-content > h4 {
	margin-top: 1.75em;
	font-size: 1.0625rem;
}

.entry-content h2 + *,
.entry-content h3 + *,
.entry-content h4 + * {
	margin-top: 0.75em;
}

.entry-content .anchor {
	margin-left: 0.4em;
	color: var(--muted);
	text-decoration: none;
	font-weight: 400;
	opacity: 0;
	transition: opacity 0.15s;
}

.entry-content h2:hover .anchor,
.entry-content h3:hover .anchor,
.entry-content .anchor:focus {
	opacity: 1;
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.5rem;
}

.entry-content li + li {
	margin-top: 0.3em;
}

.entry-content li > ul,
.entry-content li > ol {
	margin-top: 0.3em;
}

.entry-content hr {
	border: 0;
	border-top: 1px solid var(--border);
	margin: 2.5em 0;
}

.entry-content figure {
	margin-left: 0;
	margin-right: 0;
}

.entry-content figcaption,
.wp-caption-text {
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: var(--muted);
	text-align: center;
}

.entry-content img {
	border-radius: var(--radius);
}

.alignleft {
	float: left;
	margin: 0.25rem 1.5rem 1rem 0;
}

.alignright {
	float: right;
	margin: 0.25rem 0 1rem 1.5rem;
}

.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

/* Code */

code,
kbd,
samp,
pre {
	font-family: var(--font-mono);
	font-size: 0.875em;
}

:not(pre) > code,
kbd {
	padding: 0.15em 0.4em;
	background: var(--code-bg);
	border: 1px solid var(--border);
	border-radius: 4px;
	color: var(--code-fg);
	word-break: break-word;
}

kbd {
	border-bottom-width: 2px;
}

pre {
	position: relative;
	margin: 0;
	padding: 1rem 1.1rem;
	background: var(--code-bg);
	color: var(--code-fg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow-x: auto;
	line-height: 1.55;
	tab-size: 4;
	-moz-tab-size: 4;
}

pre code {
	font-size: 1em;
	background: none;
	border: 0;
	padding: 0;
	color: inherit;
}

.wp-block-code {
	border: 1px solid var(--border);
	padding: 0;
	background: none;
}

.wp-block-code code {
	display: block;
	padding: 1rem 1.1rem;
	background: var(--code-bg);
	border-radius: var(--radius);
	overflow-x: auto;
}

.copy-btn {
	position: absolute;
	top: 0.4rem;
	right: 0.4rem;
	padding: 0.2rem 0.55rem;
	font: 500 0.75rem/1.4 var(--font-sans);
	background: var(--bg);
	color: var(--muted);
	border: 1px solid var(--border);
	border-radius: 4px;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.15s;
}

pre:hover .copy-btn,
.copy-btn:focus-visible,
.copy-btn.is-copied {
	opacity: 1;
}

.copy-btn:hover {
	color: var(--fg);
}

@media (hover: none) {
	.copy-btn {
		opacity: 1;
	}
}

/* Tables */

.entry-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375rem;
	display: block;
	overflow-x: auto;
}

.entry-content th,
.entry-content td {
	padding: 0.55rem 0.8rem;
	border: 1px solid var(--border);
	text-align: left;
	vertical-align: top;
}

.entry-content thead th,
.entry-content th {
	background: var(--bg-soft);
	font-weight: 600;
}

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

.wp-block-table table {
	display: table;
	min-width: 100%;
}

/* Quotes and callouts */

blockquote,
.wp-block-quote {
	margin-left: 0;
	margin-right: 0;
	padding: 0.1rem 0 0.1rem 1.1rem;
	border-left: 3px solid var(--border);
	color: var(--muted);
}

blockquote p {
	margin: 0.5em 0;
}

.callout {
	padding: 0.85rem 1.1rem;
	background: var(--info-bg);
	border: 1px solid var(--info-border);
	border-left-width: 4px;
	border-radius: var(--radius);
	font-size: 0.9688rem;
}

.callout > * + * {
	margin-top: 0.6em;
}

.callout > :first-child {
	margin-top: 0;
}

.callout--warning,
.callout.warning {
	background: var(--warn-bg);
	border-color: var(--warn-border);
}

.age-notice {
	margin: 0 0 2rem;
}

/* Entry footer */

.entry-footer {
	margin-top: 3rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--border);
	font-size: 0.875rem;
	color: var(--muted);
}

.tag-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tag-list a {
	display: inline-block;
	padding: 0.1rem 0.6rem;
	border: 1px solid var(--border);
	border-radius: 999px;
	color: var(--muted);
	text-decoration: none;
}

.tag-list a:hover {
	color: var(--accent);
	border-color: var(--accent);
}

.post-navigation {
	margin-top: 2.5rem;
}

.post-navigation .nav-links {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

.post-navigation a {
	display: block;
	padding: 0.85rem 1rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	color: var(--fg);
	text-decoration: none;
	font-size: 0.9375rem;
	line-height: 1.4;
}

.post-navigation a:hover {
	border-color: var(--accent);
}

.post-navigation .nav-subtitle {
	display: block;
	margin-bottom: 0.2rem;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--muted);
}

.post-navigation .nav-next {
	text-align: right;
	grid-column: 2;
}

/* ==========================================================================
   Forms and search
   ========================================================================== */

.search-form {
	display: flex;
	gap: 0.5rem;
}

.search-form label {
	flex: 1;
}

input[type="text"],
input[type="search"],
input[type="email"],
input[type="url"],
textarea {
	width: 100%;
	padding: 0.6rem 0.75rem;
	font: inherit;
	color: var(--fg);
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

input:focus,
textarea:focus {
	border-color: var(--accent);
	outline: none;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

button,
input[type="submit"] {
	font: inherit;
}

.btn,
.search-form button,
.comment-form input[type="submit"] {
	padding: 0.6rem 1.1rem;
	background: var(--accent);
	color: var(--accent-fg);
	border: 0;
	border-radius: var(--radius);
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
}

.btn:hover,
.search-form button:hover,
.comment-form input[type="submit"]:hover {
	filter: brightness(1.1);
}

.not-found .search-form {
	margin: 1.5rem 0 2.5rem;
}

/* ==========================================================================
   Comments
   ========================================================================== */

.comments {
	margin-top: 3.5rem;
	padding-top: 2rem;
	border-top: 1px solid var(--border);
}

.comments__title,
.comment-reply-title {
	margin: 0 0 1.25rem;
	font-size: 1.25rem;
}

.comment-list,
.comment-list .children {
	list-style: none;
	margin: 0;
	padding: 0;
}

.comment-list .children {
	margin-left: 1.5rem;
	padding-left: 1rem;
	border-left: 1px solid var(--border);
}

.comment-body {
	padding: 1rem 0;
	font-size: 0.9688rem;
}

.comment-meta {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-size: 0.875rem;
	color: var(--muted);
}

.comment-meta .avatar {
	border-radius: 50%;
}

.comment-meta a {
	color: inherit;
}

.comment-author .fn {
	font-weight: 600;
	color: var(--fg);
	font-style: normal;
}

.comment-content > * + * {
	margin-top: 0.75em;
}

.reply a {
	font-size: 0.875rem;
}

.comment-form p {
	margin: 0 0 1rem;
}

.comment-form label {
	display: block;
	margin-bottom: 0.25rem;
	font-size: 0.9rem;
	font-weight: 600;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
	border-top: 1px solid var(--border);
	color: var(--muted);
	font-size: 0.875rem;
}

.site-footer__inner {
	max-width: var(--wide);
	margin: 0 auto;
	padding: 1.75rem 1.25rem;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.75rem 2rem;
}

.site-footer p {
	margin: 0;
}

.site-footer a {
	color: inherit;
}

.footer-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
}

.footer-note {
	flex-basis: 100%;
	font-size: 0.8125rem;
}

/* ==========================================================================
   Small screens and print
   ========================================================================== */

@media (max-width: 600px) {
	body {
		font-size: 1rem;
	}

	.site-main {
		padding-top: 2rem;
	}

	.post-navigation .nav-links {
		grid-template-columns: 1fr;
	}

	.post-navigation .nav-next {
		grid-column: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	* {
		transition: none !important;
	}
}

@media print {
	.site-header,
	.site-footer,
	.toc,
	.copy-btn,
	.post-navigation,
	.comments,
	.pagination {
		display: none;
	}

	body {
		font-size: 11pt;
		color: #000;
		background: #fff;
	}

	pre {
		white-space: pre-wrap;
		word-break: break-all;
	}
}
