/*
Theme Name: TricksWindow Lite
Theme URI: https://trickswindow.com/
Author: Tricks Window
Author URI: https://trickswindow.com/
Description: A lightweight, mobile-first magazine theme built for trickswindow.com. No jQuery, no external fonts, minimal CSS/JS, optimized for Core Web Vitals.
Version: 1.0.46
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: trickswindow-lite
Tags: blog, news, one-column, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ---------- Custom properties ---------- */
:root {
	--tw-accent: #da5500;       /* decorative fills, borders, lines (no text) */
	--tw-accent-text: #bf4a00;  /* accent used with text — 5.0:1 on white (WCAG AA) */
	--tw-accent-dark: #b34600;
	--tw-text: #222;
	--tw-text-light: #666;
	--tw-bg: #f4f4f4;
	--tw-card-bg: #fff;
	--tw-border: #e3e3e3;
	--tw-header-bg: #1f2229;
	--tw-radius: 6px;
	--tw-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
	--tw-max-width: 1100px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body {
	margin: 0;
	font-family: var(--tw-font);
	font-size: 1rem;
	line-height: 1.65;
	color: var(--tw-text);
	background: var(--tw-bg);
	-webkit-text-size-adjust: 100%;
	overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--tw-accent-text); text-decoration: none; }
a:hover, a:focus { color: var(--tw-accent-dark); text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { line-height: 1.25; margin: 1.2em 0 0.5em; overflow-wrap: break-word; }
p, ul, ol, table, blockquote { margin: 0 0 1.2em; }
blockquote {
	border-left: 4px solid var(--tw-accent);
	padding: 0.5em 1em;
	background: #faf6f2;
	font-style: italic;
}
pre, code, kbd {
	font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
	font-size: 0.9em;
	background: #f0f0f0;
	border-radius: 4px;
}
pre { padding: 1em; overflow-x: auto; }
code { padding: 0.15em 0.35em; }
pre code { padding: 0; background: none; }
table { border-collapse: collapse; width: 100%; }
th, td { border: 1px solid var(--tw-border); padding: 0.5em 0.75em; text-align: left; }
/* Wide tables scroll inside their own container instead of widening the page. */
.tw-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin: 0 0 1.35em;
	max-width: 100%;
}
.tw-table-wrap > table { margin: 0; }
/* Fallback for tables outside post content (widgets, comments, block themes). */
.comments-area table, .widget table { display: block; overflow-x: auto; }
@media (max-width: 699px) {
	.entry-content table { font-size: 0.9rem; }
	.entry-content th, .entry-content td { padding: 0.45em 0.6em; }
}
embed, iframe, object, video { max-width: 100%; }

/* ---------- Accessibility ---------- */
.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	overflow: hidden;
	position: absolute !important;
	word-wrap: normal !important;
}
.skip-link:focus {
	clip: auto;
	clip-path: none;
	left: 8px;
	top: 8px;
	width: auto;
	height: auto;
	padding: 12px 20px;
	background: var(--tw-accent);
	color: #fff;
	z-index: 100000;
	border-radius: var(--tw-radius);
}
:focus-visible { outline: 2px solid var(--tw-accent); outline-offset: 2px; }

/* ---------- Layout ---------- */
.container {
	max-width: var(--tw-max-width);
	margin: 0 auto;
	padding: 0 16px;
}
.site-content {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 28px;
	padding: 24px 0 40px;
}
/* Grid items must be allowed to shrink below their content's intrinsic width,
   or wide images/tables in posts force horizontal scrolling on phones. */
.site-content > * { min-width: 0; }

/* ---------- Top bar (desktop only) ---------- */
.top-bar {
	display: none;
	background: #f7f3ec;
	border-top: 3px solid var(--tw-accent);
	border-bottom: 1px solid var(--tw-border);
	font-size: 0.85rem;
}
@media (min-width: 900px) { .top-bar { display: block; } }
.top-bar-inner { display: flex; align-items: center; gap: 24px; }
.top-bar-date {
	color: var(--tw-text);
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 8px 0;
	white-space: nowrap;
}
.top-bar-menu { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.top-bar-menu a { display: block; color: var(--tw-text); padding: 8px 12px; text-decoration: none; }
.top-bar-menu a:hover { color: var(--tw-accent-text); text-decoration: none; }
.top-bar-search { margin-left: auto; }
.top-bar-search .search-form { gap: 0; }
.top-bar-search .search-field {
	padding: 5px 10px;
	font-size: 0.8rem;
	width: 170px;
	border-right: 0;
	border-radius: var(--tw-radius) 0 0 var(--tw-radius);
}
.top-bar-search .search-submit { padding: 5px 12px; border-radius: 0 var(--tw-radius) var(--tw-radius) 0; }

/* ---------- Header ---------- */
/* Header + nav stick together at the top on all screen sizes. */
.site-top {
	position: sticky;
	top: 0;
	z-index: 200;
}
.admin-bar .site-top { top: 46px; }
@media (min-width: 783px) { .admin-bar .site-top { top: 32px; } }
/* White branding bar so the site logo (black text on a white JPG) blends seamlessly. */
.site-header { background: #fff; border-bottom: 1px solid var(--tw-border); }
.site-branding {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 0;
}
.site-title {
	margin: 0;
	font-size: 1.65rem;
	font-weight: 800;
	letter-spacing: -0.5px;
}
.site-title a { color: var(--tw-text); text-decoration: none; }
.site-title a:hover { color: var(--tw-accent-text); text-decoration: none; }
.site-description { margin: 2px 0 0; font-size: 0.85rem; color: #777; }
.custom-logo { max-height: 56px; width: auto; }

/* ---------- Navigation ---------- */
/* Dark nav strip below the white branding bar. */
.main-navigation {
	position: relative;
	background: var(--tw-header-bg);
	border-bottom: 4px solid var(--tw-accent);
}
.menu-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: none;
	border: 1px solid #ccc;
	border-radius: var(--tw-radius);
	color: var(--tw-text);
	font: inherit;
	padding: 8px 14px;
	cursor: pointer;
}
.menu-toggle:hover { background: #f0f0f0; }
.menu-toggle .bars { display: inline-block; width: 18px; }
.menu-toggle .bars span {
	display: block;
	height: 2px;
	background: var(--tw-text);
	margin: 3px 0;
	transition: transform 0.2s ease, opacity 0.2s ease;
}
.menu-toggle[aria-expanded="true"] .bars span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bars span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .bars span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.primary-menu-wrap { display: none; padding: 8px 0 12px; }
/* Search box at the top of the open mobile menu (hidden on desktop nav). */
.menu-search { padding: 4px 0 12px; }
@media (min-width: 900px) { .menu-search { display: none; } }
/* Sticky header: keep a long open menu scrollable within the viewport. */
@media (max-width: 899px) {
	.primary-menu-wrap.is-open { max-height: calc(100vh - 150px); overflow-y: auto; }
}
.primary-menu-wrap.is-open { display: block; }
.main-navigation ul { list-style: none; margin: 0; padding: 0; }
.main-navigation li { position: relative; }
.main-navigation a {
	display: block;
	padding: 10px 14px;
	color: #e8eaee;
	font-weight: 600;
	font-size: 0.95rem;
	text-decoration: none;
	border-radius: var(--tw-radius);
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a { background: var(--tw-accent-text); color: #fff; }
.main-navigation ul ul { padding-left: 16px; }

@media (min-width: 900px) {
	.menu-toggle { display: none; }
	.primary-menu-wrap { display: block; padding: 0; }
	/* Second selector covers wp_page_menu fallback markup (.menu > ul). */
	.primary-menu-wrap > ul,
	.primary-menu-wrap > .menu > ul { display: flex; flex-wrap: wrap; }
	.main-navigation ul ul {
		position: absolute;
		top: 100%;
		left: 0;
		min-width: 200px;
		background: var(--tw-header-bg);
		padding: 6px;
		border-radius: 0 0 var(--tw-radius) var(--tw-radius);
		display: none;
		z-index: 50;
	}
	.main-navigation li:hover > ul,
	.main-navigation li:focus-within > ul { display: block; }
}

/* ---------- Breadcrumbs ---------- */
.tw-breadcrumbs {
	font-size: 0.85rem;
	padding: 14px 0 0;
	overflow-wrap: anywhere;
}
.tw-breadcrumbs a {
	color: var(--tw-text);
	font-weight: 600;
	text-decoration: none;
}
.tw-breadcrumbs a:hover { color: var(--tw-accent-text); }
.tw-breadcrumbs .home-icon { vertical-align: -1px; margin-right: 2px; }
.tw-breadcrumbs .sep { color: var(--tw-text-light); margin: 0 4px; }
.tw-breadcrumbs .current { color: var(--tw-text); }

/* ---------- Post cards ---------- */
.post-card {
	background: var(--tw-card-bg);
	border: 1px solid var(--tw-border);
	border-radius: var(--tw-radius);
	overflow: hidden;
	margin-bottom: 24px;
	display: grid;
	grid-template-columns: 1fr;
}
@media (min-width: 600px) {
	.post-card.has-thumb { grid-template-columns: 300px 1fr; }
}
.post-card .post-thumb { position: relative; }
.post-card .post-thumb img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 9; }
.post-card .card-body { padding: 18px 20px; }
.post-card .entry-title { margin: 0 0 8px; font-size: 1.25rem; }
.post-card .entry-title a { color: var(--tw-text); }
.post-card .entry-title a:hover { color: var(--tw-accent-text); text-decoration: none; }
.entry-meta {
	font-size: 0.82rem;
	color: var(--tw-text-light);
	margin-bottom: 10px;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
}
.entry-meta a { color: var(--tw-text-light); }
.entry-meta a:hover { color: var(--tw-accent-text); }
.cat-label {
	display: inline-block;
	background: var(--tw-accent-text);
	color: #fff !important;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 2px 9px;
	border-radius: 3px;
}
.cat-label:hover { background: var(--tw-accent-dark); text-decoration: none; }
.post-card .entry-summary { font-size: 0.95rem; color: #444; }
.read-more { font-weight: 700; font-size: 0.88rem; }

/* ---------- Single post / page ---------- */
.entry-single {
	background: var(--tw-card-bg);
	border: 1px solid var(--tw-border);
	border-radius: var(--tw-radius);
	padding: 24px 18px;
}
@media (min-width: 700px) { .entry-single { padding: 36px 40px; } }
/* On phones the article runs full-bleed: the card chrome and its side padding
   go away, the text column widens, and the type scales up to match. */
@media (max-width: 699px) {
	.entry-single {
		margin: 0 -16px;
		padding: 20px 16px;
		border-left: 0;
		border-right: 0;
		border-radius: 0;
	}
	.entry-single .entry-content { font-size: 1.125rem; line-height: 1.8; }
}
.entry-single .entry-title { margin-top: 0; font-size: 1.5rem; }
@media (min-width: 700px) { .entry-single .entry-title { font-size: 2.1rem; } }
/* Long-form reading: slightly larger text, roomier lines and paragraphs. */
.entry-content { font-size: 1.0625rem; line-height: 1.75; }
.entry-content p, .entry-content ul, .entry-content ol { margin-bottom: 1.35em; }
.entry-content li { margin-bottom: 0.5em; }
.entry-content h2 { font-size: 1.45rem; margin-top: 1.7em; }
.entry-content h3 { font-size: 1.2rem; margin-top: 1.5em; }
/* Center standalone images; leave aligned (floated) images to their own
   margins below so text keeps a gap beside them. */
.entry-content img { border-radius: var(--tw-radius); }
.entry-content img:not(.alignleft):not(.alignright):not(.aligncenter) { margin: 1.4em auto; }
.entry-content a { text-decoration: underline; }
/* Legacy [caption] markup carries a fixed inline width (e.g. style="width:700px");
   max-width caps it to the screen so captioned images can't overflow phones. */
.wp-caption { max-width: 100% !important; }
.wp-caption img { margin-left: auto; margin-right: auto; }
.wp-caption-text { margin: 0.4em 0 0; }
.wp-caption, .wp-caption-text, .wp-block-image figcaption { font-size: 0.85rem; color: var(--tw-text-light); }
.entry-footer { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--tw-border); font-size: 0.88rem; }
.tag-links a {
	display: inline-block;
	background: #f0f0f0;
	color: var(--tw-text-light);
	padding: 3px 10px;
	margin: 0 6px 6px 0;
	border-radius: 3px;
	font-size: 0.8rem;
}
.tag-links a:hover { background: var(--tw-accent-text); color: #fff; text-decoration: none; }

/* Author bio box */
.author-box {
	display: flex;
	gap: 18px;
	align-items: flex-start;
	margin-top: 24px;
	padding: 18px 20px;
	background: #f8f8f8;
	border: 1px solid var(--tw-border);
	border-left: 4px solid var(--tw-accent);
	border-radius: var(--tw-radius);
}
.author-avatar { flex-shrink: 0; }
.author-avatar img { border-radius: 50%; width: 72px; height: 72px; }
.author-info { min-width: 0; }
.author-label {
	display: block;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--tw-text-light);
}
.author-name { margin: 2px 0 6px; font-size: 1.1rem; }
.author-name a { color: var(--tw-text); text-decoration: none; }
.author-name a:hover { color: var(--tw-accent-text); }
.author-bio { font-size: 0.92rem; color: #444; margin-bottom: 8px; }
/* Bio text may contain inline links (Twitter, etc.); underline them so they
   are distinguishable by more than colour alone (WCAG 1.4.1). */
.author-bio a { text-decoration: underline; }
.author-posts-link { font-size: 0.85rem; font-weight: 700; }

/* Post navigation */
.post-navigation .nav-links {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin: 24px 0;
}
.post-navigation a {
	display: block;
	background: var(--tw-card-bg);
	border: 1px solid var(--tw-border);
	border-radius: var(--tw-radius);
	padding: 12px 16px;
	font-size: 0.9rem;
	color: var(--tw-text);
}
.post-navigation .nav-next { text-align: right; }
.post-navigation .nav-subtitle {
	display: block;
	font-size: 0.75rem;
	text-transform: uppercase;
	color: var(--tw-accent-text);
	font-weight: 700;
}

/* ---------- Archive header / pagination ---------- */
.page-header-bar {
	background: var(--tw-card-bg);
	border: 1px solid var(--tw-border);
	border-left: 4px solid var(--tw-accent);
	border-radius: var(--tw-radius);
	padding: 14px 20px;
	margin-bottom: 24px;
}
.page-header-bar .page-title { margin: 0; font-size: 1.3rem; }
.page-header-bar .archive-description { margin: 6px 0 0; font-size: 0.9rem; color: var(--tw-text-light); }

.pagination { text-align: center; margin: 8px 0 24px; }
.pagination .nav-links { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pagination .page-numbers {
	display: inline-block;
	min-width: 40px;
	padding: 8px 12px;
	background: var(--tw-card-bg);
	border: 1px solid var(--tw-border);
	border-radius: var(--tw-radius);
	color: var(--tw-text);
	font-weight: 600;
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover { background: var(--tw-accent-text); border-color: var(--tw-accent-text); color: #fff; text-decoration: none; }

/* ---------- Sidebar / widgets ---------- */
.widget-area .widget {
	background: var(--tw-card-bg);
	border: 1px solid var(--tw-border);
	border-radius: var(--tw-radius);
	padding: 18px 20px;
	margin-bottom: 24px;
}
.widget-title, .widget .wp-block-heading {
	margin: 0 0 14px;
	padding-bottom: 10px;
	font-size: 1.05rem;
	border-bottom: 2px solid var(--tw-accent);
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 7px 0; border-bottom: 1px solid #f0f0f0; font-size: 0.92rem; }
.widget li:last-child { border-bottom: 0; }

/* ---------- Search form ---------- */
.search-form { display: flex; gap: 8px; }
.search-form .search-field {
	flex: 1;
	min-width: 0;
	padding: 10px 12px;
	border: 1px solid var(--tw-border);
	border-radius: var(--tw-radius);
	font: inherit;
}
.search-form .search-submit,
button, input[type="submit"] {
	background: var(--tw-accent-text);
	color: #fff;
	border: 0;
	border-radius: var(--tw-radius);
	padding: 10px 18px;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}
.search-form .search-submit:hover, button:hover, input[type="submit"]:hover { background: var(--tw-accent-dark); }

/* ---------- Comments ---------- */
.comments-area {
	background: var(--tw-card-bg);
	border: 1px solid var(--tw-border);
	border-radius: var(--tw-radius);
	padding: 24px 20px;
	margin-top: 24px;
}
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .comment { border-bottom: 1px solid var(--tw-border); padding: 16px 0; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-author img { border-radius: 50%; display: inline-block; vertical-align: middle; margin-right: 8px; }
.comment-metadata { font-size: 0.8rem; color: var(--tw-text-light); }
.comment-form label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 0.9rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--tw-border);
	border-radius: var(--tw-radius);
	font: inherit;
	margin-bottom: 12px;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--tw-header-bg); color: #b8bdc7; border-top: 4px solid var(--tw-accent); margin-top: 8px; }
.footer-widgets {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
	padding: 32px 0;
}
@media (min-width: 700px) { .footer-widgets { grid-template-columns: repeat(3, 1fr); } }
.site-footer .widget { background: none; border: 0; padding: 0; }
.site-footer .widget-title { color: #fff; }
.site-footer a { color: #e8eaee; }
.site-footer a:hover { color: var(--tw-accent); }
.site-footer .widget li { border-bottom-color: #333842; }
.site-info {
	border-top: 1px solid #333842;
	padding: 16px 0;
	font-size: 0.85rem;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
	justify-content: space-between;
}
/* The site name sits inside the copyright sentence; underline it so it's
   distinguishable as a link by more than colour alone (WCAG 1.4.1). */
.site-info span a { text-decoration: underline; }

/* ---------- AI summary block (ai-summarization plugin) ----------
   The plugin ships no front-end CSS; its box look came from the old theme. */
.ai-summarization-summary {
	background: #f6f6f6;
	border-left: 5px solid var(--tw-header-bg);
	border-radius: 0 var(--tw-radius) var(--tw-radius) 0;
	padding: 18px 22px;
	margin: 0 0 1.6em;
}
.ai-summarization-summary p:last-child { margin-bottom: 0; }

/* ---------- Sahifa shortcode compatibility ---------- */
.tw-devider {
	border: 0;
	border-top: 1px solid var(--tw-border);
	height: 0;
	clear: both;
}
.tw-box {
	padding: 14px 18px;
	margin: 0 0 1.2em;
	border: 1px solid var(--tw-border);
	border-left-width: 4px;
	border-radius: var(--tw-radius);
	background: #fafafa;
}
.tw-box-info { border-left-color: #2478ba; background: #f0f7fc; }
.tw-box-success, .tw-box-download { border-left-color: #3f9c35; background: #f1f9f0; }
.tw-box-warning, .tw-box-error { border-left-color: #c0392b; background: #fdf3f2; }
.tw-box-note { border-left-color: #d8a800; background: #fdfaee; }
.tw-box-shadow { border-left-width: 1px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); background: #fff; }
.tw-box > :last-child { margin-bottom: 0; }
.tw-btn {
	display: inline-block;
	background: var(--tw-accent-text);
	color: #fff !important;
	font-weight: 700;
	border-radius: var(--tw-radius);
	text-decoration: none !important;
	margin: 0 6px 6px 0;
}
.tw-btn:hover { background: var(--tw-accent-dark); }
.tw-btn-small { padding: 5px 12px; font-size: 0.8rem; }
.tw-btn-medium { padding: 9px 18px; font-size: 0.92rem; }
.tw-btn-big { padding: 13px 26px; font-size: 1.05rem; }
.tw-list ul { list-style: none; padding-left: 4px; }
.tw-list li { padding-left: 1.5em; position: relative; margin-bottom: 0.4em; }
.tw-list li::before { position: absolute; left: 0; font-weight: 700; }
.tw-list-checklist li::before { content: "\2713"; color: #3f9c35; }
.tw-list-starlist li::before { content: "\2605"; color: var(--tw-accent-text); }
.tw-list-plus li::before { content: "+"; color: #3f9c35; }
.tw-list-minus li::before { content: "\2212"; color: #c0392b; }
.tw-list-thumbup li::before { content: "\1F44D"; }
.tw-list-thumbdown li::before { content: "\1F44E"; }

/* ---------- WP core alignment classes ---------- */
.alignleft { float: left; margin: 0.3em 2em 1em 0; }
.alignright { float: right; margin: 0.3em 0 1em 2em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
/* On phones a floated image squeezes the text into a cramped column beside it,
   so let aligned images sit on their own line with text flowing below. */
@media (max-width: 600px) {
	.entry-content .alignleft,
	.entry-content .alignright {
		float: none;
		display: block;
		margin: 0 auto 1.2em;
	}
}
.alignwide, .alignfull { width: 100%; }
.sticky { border-left: 4px solid var(--tw-accent); }
.bypostauthor { display: block; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Print ---------- */
@media print {
	.site-header, .site-footer, .widget-area, .comments-area, .post-navigation, .pagination { display: none; }
	.entry-single { border: 0; }
}
