/*
Theme Name: Tileview
Theme URI: https://example.com/tileview
Author: Tileview
Description: A modern Windows blog theme with a Windows 8–inspired live-tile header, light and dark mode, and a clean reading layout. Tiles fill automatically from your latest posts and most-used categories.
Version: 1.3.1
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: tileview
Tags: blog, news, two-columns, right-sidebar, custom-menu, custom-logo, featured-images, theme-options, threaded-comments, translation-ready, wide-blocks
*/

/* ---------- Tokens ---------- */
:root {
	--accent: #1B5FB8;
	--on-accent: #FFFFFF;
	--bg: #F4F5F7;
	--surface: #FFFFFF;
	--surface2: #E9ECF0;
	--text: #16181C;
	--muted: #535965;
	--line: #DCE0E6;
	--link: #1B5FB8;
	--font: "Segoe UI Variable Text", "Segoe UI", "Open Sans", system-ui, -apple-system, sans-serif;
	--font-display: "Segoe UI Variable Display", "Segoe UI", "Open Sans", system-ui, -apple-system, sans-serif;
	--mono: "Cascadia Code", Consolas, "SFMono-Regular", Menlo, monospace;
	--container: 1320px;
	--gutter: 24px;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #0F1115;
		--surface: #181B21;
		--surface2: #232831;
		--text: #F2F3F5;
		--muted: #A6ACB7;
		--line: #2D323C;
		--link: #80B6FF;
		color-scheme: dark;
	}
}

:root[data-theme="dark"] {
	--bg: #0F1115;
	--surface: #181B21;
	--surface2: #232831;
	--text: #F2F3F5;
	--muted: #A6ACB7;
	--line: #2D323C;
	--link: #80B6FF;
	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(--text);
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.6;
	transition: background-color .25s ease, color .25s ease;
}

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

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
	outline: 2px solid var(--link);
	outline-offset: 2px;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); line-height: 1.25; margin: 0 0 .6em; }

button, input, select, textarea { font: inherit; color: inherit; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

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

.plain-link { color: var(--text); }
.plain-link:hover { color: var(--link); text-decoration: none; }

.icon { display: inline-block; flex: none; vertical-align: middle; }

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 0 20px; border: 0; cursor: pointer;
	background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 14px;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); color: var(--on-accent); }
.btn-outline { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.btn-outline:hover { color: var(--text); border-color: var(--muted); filter: none; }

/* ---------- Header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
/* Header color: fixed dark or light regardless of the page mode (Customizer → Tileview → Colors & mode) */
.site-header.header-dark, .site-footer.header-dark {
	--bg: #0F1115; --surface: #181B21; --surface2: #232831; --text: #F2F3F5;
	--muted: #A6ACB7; --line: #2D323C; --link: #80B6FF;
	color-scheme: dark; color: var(--text);
}
.site-header.header-light, .site-footer.header-light {
	--bg: #F4F5F7; --surface: #FFFFFF; --surface2: #E9ECF0; --text: #16181C;
	--muted: #535965; --line: #DCE0E6; --link: #1B5FB8;
	color-scheme: light; color: var(--text);
}
.header-inner { min-height: 68px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }

.site-branding { display: flex; align-items: center; gap: 10px; }
.site-title { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.2px; line-height: 1; }
.site-title a { color: var(--text); display: flex; align-items: center; gap: 10px; }
.site-title a:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; background: var(--accent); display: inline-block; }
.custom-logo { max-height: 40px; width: auto; display: block; }

.main-navigation { flex: 1 1 auto; }
.main-navigation ul { list-style: none; margin: 0; padding: 0; }
.main-navigation > div > ul, .main-navigation > ul { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.main-navigation li { position: relative; }
.main-navigation a { color: var(--text); font-size: 15px; display: block; padding: 10px 0; }
.main-navigation a:hover, .main-navigation .current-menu-item > a, .main-navigation .current-cat > a { color: var(--link); text-decoration: none; }
.main-navigation .sub-menu, .main-navigation .children {
	display: none; position: absolute; left: -16px; top: 100%; min-width: 220px;
	background: var(--surface); border: 1px solid var(--line); padding: 8px 16px; z-index: 30;
}
.main-navigation li:hover > .sub-menu, .main-navigation li:focus-within > .sub-menu,
.main-navigation li:hover > .children, .main-navigation li:focus-within > .children { display: block; }

.header-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn {
	width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
	background: transparent; border: 0; color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--surface2); }
.menu-toggle { display: none; }

.theme-toggle {
	min-height: 44px; display: inline-flex; align-items: center; gap: 10px; padding: 0 10px;
	background: transparent; border: 0; color: var(--text); cursor: pointer; font-size: 14px;
}
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: inline-block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.switch { position: relative; width: 48px; height: 26px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--line); display: inline-block; }
.switch-knob {
	position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 999px;
	background: var(--accent); transition: transform .22s ease;
}
:root[data-theme="dark"] .switch-knob { transform: translateX(22px); }

.header-search { display: none; border-top: 1px solid var(--line); background: var(--surface); }
.header-search.is-open { display: block; }
.header-search .container { padding-top: 16px; padding-bottom: 16px; }

/* ---------- Search form ---------- */
.search-form { display: flex; gap: 8px; flex-wrap: wrap; }
.search-form label { flex: 1 1 220px; display: block; }
.search-field {
	width: 100%; min-height: 44px; padding: 0 14px; border: 1px solid var(--line);
	background: var(--bg); color: var(--text); font-size: 16px;
}
.search-submit { min-height: 44px; padding: 0 20px; border: 0; background: var(--accent); color: var(--on-accent); font-weight: 600; cursor: pointer; }

/* ---------- Start screen ---------- */
.start-screen { padding: 44px 0 48px; }
.start-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.start-title { margin: 0; font-weight: 300; font-size: clamp(44px, 6vw, 64px); line-height: 1; letter-spacing: -1px; }
.start-intro { margin: 10px 0 0; color: var(--muted); font-size: 16px; }
.start-user { display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--text); }
.start-user:hover { text-decoration: none; color: var(--text); }
.start-user-text { text-align: right; line-height: 1.2; }
.start-user-name { display: block; font-size: 18px; font-weight: 300; }
.start-user-sub { display: block; font-size: 13px; color: var(--muted); }
.start-user-avatar { width: 44px; height: 44px; background: var(--surface2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.start-user-avatar img { width: 44px; height: 44px; display: block; }

/* ---------- Tiles ---------- */
.tiles {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	grid-auto-rows: 152px;
	gap: 8px;
	grid-auto-flow: dense;
}
.tile-wide { grid-column: span 2; }
.tile-large { grid-column: span 2; grid-row: span 2; }

.tile {
	position: relative; overflow: hidden; display: block; color: #FFFFFF;
	outline: 2px solid transparent; outline-offset: -2px;
	transition: transform .14s ease, outline-color .14s ease, filter .14s ease;
}
.tile:hover { color: #FFFFFF; text-decoration: none; outline-color: rgba(255, 255, 255, .55); filter: brightness(1.06); }
.tile:active { transform: perspective(700px) rotateX(4deg) scale(.97); }
.tile:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }

/* Term tiles (categories) */
.tile-face { height: 100%; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.tile-name { font-size: 15px; font-weight: 600; }

/* Post tiles: headline always on the front, preview slides up on hover and automatically */
.tile-bg { position: absolute; inset: 0; width: 100%; height: 100% !important; object-fit: cover; z-index: 0; }

.tile-front {
	position: absolute; inset: 0; z-index: 1;
	display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
	padding: 18px;
}
.has-image .tile-front { justify-content: flex-end; padding: 0; }
.tile-caption { display: flex; flex-direction: column; gap: 4px; margin-top: auto; }
.has-image .tile-caption { padding: 12px 16px 14px; background: rgba(0, 0, 0, .68); }

.tile-back {
	position: absolute; inset: 0; z-index: 2;
	display: flex; flex-direction: column; gap: 8px;
	padding: 18px;
	transform: translateY(101%);
	transition: transform .45s cubic-bezier(.2, .8, .2, 1);
}
.tile-post:hover .tile-back,
.tile-post:focus-visible .tile-back,
.tile-post.is-flipped .tile-back { transform: translateY(0); }
.tile-more { margin-top: auto; font-size: 14px; font-weight: 600; }

.tile-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; opacity: .92; }
.tile-large .tile-label { font-size: 13px; }
.tile-title { font-family: var(--font-display); font-weight: 300; font-size: 20px; line-height: 1.2; }
.has-image .tile-title { font-weight: 400; font-size: 18px; }
.tile-large .tile-title { font-size: 28px; line-height: 1.15; }
.has-image.tile-large .tile-title { font-size: 26px; }
.tile-small .tile-title { font-size: 15px; font-weight: 600; font-family: var(--font); line-height: 1.3; }
.tile-back-title { font-family: var(--font-display); font-size: 20px; font-weight: 600; line-height: 1.25; }
.tile-excerpt { font-size: 14px; line-height: 1.45; }
.tile-large .tile-excerpt { font-size: 15px; line-height: 1.5; }

.tile-title, .tile-excerpt, .tile-back-title { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.tile-title { -webkit-line-clamp: 3; }
.tile-wide .tile-title, .has-image .tile-title { -webkit-line-clamp: 2; }
.tile-large .tile-title { -webkit-line-clamp: 3; }
.tile-small .tile-title { -webkit-line-clamp: 4; }
.tile-back-title { -webkit-line-clamp: 2; }
.tile-excerpt { -webkit-line-clamp: 3; }
.tile-small .tile-excerpt { -webkit-line-clamp: 4; }
.tile-large .tile-excerpt { -webkit-line-clamp: 8; }

/* ---------- Page header (archives, search) ---------- */
.page-hero { padding: 40px 0 8px; }
.page-hero .page-title { margin: 0; font-weight: 300; font-size: clamp(32px, 4vw, 48px); letter-spacing: -.5px; }
.page-hero .archive-description { color: var(--muted); max-width: 720px; margin-top: 8px; }
.page-hero .archive-description p { margin: 0; }

/* ---------- Layout ---------- */
.layout { display: flex; flex-wrap: wrap; gap: 48px; padding-top: 8px; padding-bottom: 64px; }
.content-area { flex: 999 1 560px; min-width: 0; }
.widget-area { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 32px; }

.section-head {
	display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
	border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 8px;
}
.section-title { margin: 0; font-size: 30px; font-weight: 300; }

/* ---------- Post list ---------- */
.post-card { display: flex; gap: 22px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.post-card:last-of-type { border-bottom: 0; }
.post-card-thumb {
	flex: 0 0 168px; height: 112px; display: flex; align-items: center; justify-content: center;
	color: #FFFFFF; overflow: hidden;
}
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card-body { min-width: 0; }
.post-card .cat-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.post-card-title { margin: 6px 0 8px; font-size: 21px; font-weight: 600; line-height: 1.3; }
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--link); text-decoration: none; }
.post-card-excerpt { margin: 0 0 10px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.post-card-excerpt p { margin: 0; }
.post-meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.post-meta a { color: var(--muted); }
.sticky .post-card-title::before { content: "★ "; color: var(--link); }

@media (max-width: 560px) {
	.post-card { flex-direction: column; gap: 14px; }
	.post-card-thumb { flex-basis: auto; width: 100%; height: 180px; }
}

/* ---------- Pagination ---------- */
.pagination, .posts-navigation, .post-navigation { margin-top: 24px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers {
	min-width: 44px; min-height: 44px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center;
	background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 14px;
}
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pagination a.page-numbers:hover { border-color: var(--muted); text-decoration: none; }

.post-navigation .nav-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.post-navigation a { display: block; padding: 18px; background: var(--surface); border: 1px solid var(--line); color: var(--text); height: 100%; }
.post-navigation a:hover { border-color: var(--muted); text-decoration: none; }
.post-navigation .nav-next { text-align: right; grid-column: 2; }
.post-navigation .nav-subtitle { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 4px; }
.post-navigation .nav-title { font-weight: 600; }
@media (max-width: 560px) {
	.post-navigation .nav-links { grid-template-columns: 1fr; }
	.post-navigation .nav-next { grid-column: auto; }
}

/* ---------- Sidebar & widgets ---------- */
.widget { background: var(--surface); border: 1px solid var(--line); padding: 24px; }
.widget-title { margin: 0 0 16px; font-size: 20px; font-weight: 600; }
.widget ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.widget a { color: var(--text); }
.widget a:hover { color: var(--link); text-decoration: none; }
.widget select { width: 100%; min-height: 44px; background: var(--bg); border: 1px solid var(--line); padding: 0 10px; }

.popular-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.popular-list li { display: flex; gap: 14px; }
.popular-num { font-size: 28px; font-weight: 300; line-height: 1; color: var(--link); min-width: 22px; }
.popular-list a { font-size: 15px; line-height: 1.45; color: var(--text); }
.popular-list a:hover { color: var(--link); text-decoration: none; }

/* Forum topics (Discourse) */
.forum-topics { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.forum-topic { display: flex; gap: 12px; align-items: flex-start; }
.forum-topic-mark { flex: none; width: 10px; height: 10px; margin-top: 7px; background: var(--accent); }
.forum-topic-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.widget .forum-topic-title, .forum-topic-title { color: var(--text); font-size: 15px; line-height: 1.4; font-weight: 600; overflow-wrap: anywhere; }
.widget .forum-topic-title:hover, .forum-topic-title:hover { color: var(--link); text-decoration: none; }
.forum-topic-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 13px; color: var(--muted); }
.widget .forum-more, .forum-more { display: inline-block; margin-top: 16px; font-size: 14px; font-weight: 600; color: var(--link); }
.forum-empty { color: var(--muted); font-size: 14px; margin: 0; }
.forum-shortcode { margin: 1.5em 0; }

.widget-plain { background: transparent; border: 0; padding: 0; }
.topic-list { display: flex; flex-wrap: wrap; gap: 8px; }
.topic-list a, .wp-block-tag-cloud a, .tagcloud a, .tags-links a {
	display: inline-block; padding: 10px 14px; background: var(--surface2); color: var(--text);
	font-size: 14px !important; line-height: 1.2;
}
.topic-list a:hover, .wp-block-tag-cloud a:hover, .tagcloud a:hover, .tags-links a:hover { color: var(--link); text-decoration: none; }

.newsletter-box { background: var(--accent); color: var(--on-accent); padding: 26px; }
.newsletter-box h2 { margin: 0 0 8px; font-size: 24px; font-weight: 300; }
.newsletter-box p { margin: 0 0 18px; font-size: 15px; line-height: 1.5; opacity: .95; }
.newsletter-box a { color: var(--on-accent); text-decoration: underline; }
.newsletter-box label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.newsletter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.newsletter-row input[type="email"] {
	flex: 1 1 160px; min-width: 0; min-height: 44px; padding: 0 12px; border: 0;
	font-size: 15px; color: #16181C; background: #FFFFFF;
}
.newsletter-row button {
	min-height: 44px; padding: 0 18px; border: 2px solid var(--on-accent); background: transparent;
	color: var(--on-accent); font-weight: 600; font-size: 14px; cursor: pointer;
}
.newsletter-row button:hover { background: rgba(255, 255, 255, .14); }

/* ---------- Single post ---------- */
.entry-hero { color: #FFFFFF; padding: 56px 0 48px; }
.entry-hero a { color: #FFFFFF; }
.entry-hero .cat-label { font-size: 13px; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 600; }
.entry-hero .entry-title { margin: 12px 0 16px; font-weight: 300; font-size: clamp(32px, 4.6vw, 54px); line-height: 1.12; letter-spacing: -.5px; max-width: 980px; }
.entry-hero .post-meta, .entry-hero .post-meta a { color: rgba(255, 255, 255, .92); font-size: 14px; }

.page-header-plain { padding: 48px 0 8px; }
.page-header-plain .entry-title { margin: 0; font-weight: 300; font-size: clamp(32px, 4.6vw, 54px); line-height: 1.12; letter-spacing: -.5px; }

.entry-wrap { max-width: 800px; margin: 0 auto; padding: 40px var(--gutter) 64px; }
.entry-thumb { margin: 0 0 32px; }
.entry-thumb img { display: block; width: 100%; }

.entry-footer { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; }
.tags-links { display: flex; flex-wrap: wrap; gap: 8px; }

.author-box { display: flex; gap: 16px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); padding: 20px; }
.author-box img { width: 64px; height: 64px; flex: none; }
.author-box h2 { font-size: 17px; margin: 0 0 4px; font-weight: 600; }
.author-box p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- Entry content ---------- */
.entry-content { font-size: 18px; line-height: 1.75; }
.entry-content > * { margin-top: 0; margin-bottom: 1.25em; }
.entry-content h2 { font-size: 30px; font-weight: 600; margin-top: 1.8em; }
.entry-content h3 { font-size: 23px; font-weight: 600; margin-top: 1.6em; }
.entry-content h4 { font-size: 19px; font-weight: 600; margin-top: 1.4em; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li + li { margin-top: .35em; }
.entry-content blockquote, .wp-block-quote {
	margin-left: 0; margin-right: 0; padding: 4px 0 4px 22px;
	border-left: 4px solid var(--accent); font-size: 20px; font-weight: 300;
}
.wp-block-pullquote { border-top: 4px solid var(--accent); border-bottom: 4px solid var(--accent); padding: 24px 0; }
.entry-content code, .entry-content kbd {
	font-family: var(--mono); font-size: .88em; background: var(--surface2); padding: .12em .4em;
}
.entry-content kbd { border: 1px solid var(--line); border-bottom-width: 2px; }
.entry-content pre {
	font-family: var(--mono); font-size: 15px; line-height: 1.6; background: #16181C; color: #E8EAED;
	padding: 20px; overflow-x: auto;
}
.entry-content pre code { background: none; padding: 0; color: inherit; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 16px; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.entry-content th { background: var(--surface2); }
.entry-content hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.entry-content img { display: block; }

/* Video embeds: always full 16:9 height, whatever height the embed code or a plugin sets */
.entry-content iframe[src*="youtube.com"],
.entry-content iframe[src*="youtube-nocookie.com"],
.entry-content iframe[src*="youtu.be"],
.entry-content iframe[src*="vimeo.com"],
.entry-content iframe[src*="dailymotion.com"] {
	display: block; width: 100% !important; height: auto !important; aspect-ratio: 16 / 9; border: 0;
}
.entry-content .wp-embed-aspect-9-16 iframe { aspect-ratio: 9 / 16 !important; max-width: 420px; margin: 0 auto; }
.entry-content .wp-block-embed__wrapper { position: relative; }
.wp-embed-responsive .entry-content .wp-has-aspect-ratio .wp-block-embed__wrapper::before { display: none; }
.wp-embed-responsive .entry-content .wp-has-aspect-ratio iframe { position: static; }
.entry-content .wp-block-embed { margin-left: 0; margin-right: 0; }
.entry-content figcaption, .wp-caption-text, .wp-element-caption { font-size: 14px; color: var(--muted); margin-top: 8px; text-align: center; }

.alignwide { margin-left: -80px; margin-right: -80px; max-width: none; }
.alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; width: 100vw; }
@media (max-width: 960px) { .alignwide { margin-left: 0; margin-right: 0; } }
.alignleft { float: left; margin: .4em 1.5em 1em 0; }
.alignright { float: right; margin: .4em 0 1em 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }
.gallery-caption { font-size: 14px; }
.wp-block-button__link { background: var(--accent); color: var(--on-accent); border-radius: 0; text-decoration: none !important; }
.entry-content::after { content: ""; display: table; clear: both; }

/* ---------- Article with sidebar ---------- */
.single-layout.has-sidebar {
	max-width: var(--container); margin: 0 auto; padding: 40px var(--gutter) 64px;
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 48px;
}
.single-layout.has-sidebar .entry-wrap { flex: 999 1 560px; min-width: 0; max-width: 800px; margin: 0; padding: 0; }
.single-layout.has-sidebar .widget-area { flex: 1 1 300px; min-width: 0; }
@media (min-width: 1100px) { .single-layout.has-sidebar .widget-area { max-width: 340px; } }
.has-sidebar .entry-content .alignwide,
.has-sidebar .entry-content .alignfull { margin-left: 0; margin-right: 0; width: auto; max-width: 100%; }

/* ---------- Ad slots ---------- */
.ad-slot {
	margin: 2em 0; padding: 10px 12px 12px;
	background: var(--surface); border: 1px solid var(--line);
	display: flex; flex-direction: column; gap: 8px;
	font-size: 15px; line-height: 1.4;
}
.ad-label { font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); line-height: 1; }
.ad-inner { min-height: var(--ad-reserve, 0px); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ad-unit { width: 100%; text-align: center; }
.ad-unit > *, .ad-inner iframe, .ad-inner img { max-width: 100%; margin-left: auto; margin-right: auto; }
.ad-inner ins.adsbygoogle { display: block; width: 100%; }
.entry-content .ad-slot { margin: 2em 0; }
.widget-area .ad-slot { margin: 0; }
.ad-slot--list { margin: 8px 0; }

/* Lower slots collapse when nothing is delivered (no CLS: they are below the fold). */
.ad-slot.is-collapsible:has(ins.adsbygoogle[data-ad-status="unfilled"]),
.ad-slot.is-collapsible:has(.ad-unit:empty) { display: none; }

/* Sticky sidebar ad on wide screens. */
@media (min-width: 960px) {
	.ad-slot.is-sticky { position: sticky; top: calc(16px + var(--wp-admin--admin-bar--height, 0px)); }
}

/* ---------- Comments ---------- */
.comments-area { margin-top: 48px; }
.comments-title, .comment-reply-title { font-size: 26px; font-weight: 300; }
.comment-list { list-style: none; margin: 0 0 32px; padding: 0; }
.comment-list .children { list-style: none; padding-left: 28px; }
.comment-body { background: var(--surface); border: 1px solid var(--line); padding: 20px; margin-bottom: 12px; }
.comment-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: 14px; margin-bottom: 10px; }
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.comment-author img { width: 36px; height: 36px; }
.comment-author .says { display: none; }
.comment-metadata a { color: var(--muted); }
.comment-content p { margin: 0 0 .8em; }
.reply a { font-size: 14px; font-weight: 600; }
.bypostauthor > .comment-body { border-left: 4px solid var(--accent); }
.comment-form label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 10px 12px; min-height: 44px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
.comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; }
.comment-form-cookies-consent label { font-weight: 400; }
.comment-form .submit { min-height: 44px; padding: 0 22px; border: 0; background: var(--accent); color: var(--on-accent); font-weight: 600; cursor: pointer; }

/* ---------- 404 ---------- */
.error-404 { padding: 80px 0; }
.error-face { font-size: clamp(96px, 14vw, 160px); font-weight: 300; line-height: 1; margin: 0 0 24px; color: var(--accent); }
.error-404 h1 { font-weight: 300; font-size: clamp(28px, 3.6vw, 40px); max-width: 760px; }
.error-404 p { color: var(--muted); max-width: 640px; }
.error-404 .search-form { max-width: 560px; margin: 28px 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); }
.footer-inner { padding: 32px var(--gutter); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; font-size: 14px; color: var(--muted); }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand .brand-mark { width: 16px; height: 16px; }
.footer-brand a { display: flex; align-items: center; }
.footer-logo { display: block; height: 32px; width: auto; max-width: 160px; }
.footer-navigation ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
	.tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
	.menu-toggle { display: inline-flex; }
	.header-inner { justify-content: space-between; }
	.main-navigation { order: 10; flex-basis: 100%; display: none; padding-bottom: 12px; }
	.main-navigation.is-open { display: block; }
	.main-navigation > div > ul, .main-navigation > ul { flex-direction: column; gap: 0; }
	.main-navigation .sub-menu, .main-navigation .children { display: block; position: static; border: 0; padding: 0 0 0 16px; min-width: 0; }
	.theme-toggle-text { display: none; }
}

@media (max-width: 560px) {
	:root { --gutter: 16px; }
	.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 136px; }
	.tile-large .tile-title { font-size: 22px; }
	.alignleft, .alignright { float: none; margin: 0 0 1em; }
	.header-subscribe { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.tile, .tile-back, .switch-knob, body { transition: none; }
}

@media print {
	.site-header, .site-footer, .widget-area, .comments-area, .post-navigation, .start-screen { display: none; }
	.entry-hero { color: #000; background: none !important; padding: 0; }
}
