/*
Theme Name: Tim Printables
Theme URI: https://timprintables.com/
Author: Tim Printables
Author URI: https://timprintables.com/
Description: A compact printable catalog with colorful accents, accessible navigation, single-post widgets, optional sticky sidebar and Back to top button. Standalone classic theme; no parent theme or page builder required.
Version: 1.0.1
Requires at least: 6.2
Tested up to: 7.1
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: tim-printables
Tags: grid-layout, right-sidebar, custom-logo, custom-menu, featured-images, theme-options, blog
*/
:root {
	--blue: #1c64ce;
	--navy: #152b4c;
	--ink: #182b46;
	--muted: #546378;
	--line: #dce2e9;
	--sticky-offset: 20px;
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: #f1f3f5;
	color: var(--ink);
	font-family: Arial, Helvetica, sans-serif;
	font-size: 16px;
	line-height: 1.65;
}

a {
	color: #165ab8;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

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

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

button,
input[type="submit"],
/* stylelint-disable-next-line selector-class-pattern -- WordPress core block class. */
.wp-block-button__link {
	background: var(--blue);
	color: #fff;
	border: 0;
	border-radius: 5px;
	padding: 11px 20px;
	cursor: pointer;
}

input,
textarea,
select {
	max-width: 100%;
	border: 1px solid #b9c5d3;
	border-radius: 5px;
	padding: 10px;
	background: #fff;
	color: var(--ink);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
	outline: 3px solid #bd5700;
	outline-offset: 4px;
}

h1,
h2,
h3 {
	line-height: 1.25;
	letter-spacing: -0.025em;
}

h1 {
	font-size: clamp(26px, 3vw, 36px);
	margin: 0 0 12px;
}

h2 {
	font-size: 24px;
}

h3 {
	font-size: 20px;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	clip-path: none;
	width: auto;
	height: auto;
	top: 10px;
	left: 10px;
	background: #fff;
	padding: 12px;
	z-index: 99999;
}

.site-header {
	border-top: 4px solid transparent;
	border-image: linear-gradient(
			90deg,
			#1c64ce 0 25%,
			#e8483e 25% 50%,
			#f4c322 50% 75%,
			#36a363 75%
		)
		1;
	background: var(--blue);
	color: #fff;
	padding: 22px 24px;
}

.header-inner,
.footer-inner {
	max-width: 1180px;
	margin: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}

.brand-title {
	font-size: 25px;
	font-weight: 750;
	display: flex;
	align-items: center;
	gap: 12px;
	color: #fff;
}

.brand-mark {
	background: #fff;
	color: var(--blue);
	border-bottom: 4px solid #f4c322;
	border-radius: 4px;
	display: grid;
	place-items: center;
	width: 34px;
	height: 40px;
}

.brand p {
	font-size: 13px;
	margin: 3px 0 0 46px;
}

.custom-logo {
	max-height: 64px;
	width: auto;
}

.primary-nav .menu,
.site-footer .menu {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
}

.primary-nav a {
	display: block;
	background: #fff;
	color: #1555a6;
	padding: 9px 14px;
	border-radius: 5px;
	font-size: 14px;
}

.primary-nav li {
	position: relative;
}

.primary-nav .sub-menu {
	display: none;
	position: absolute;
	z-index: 20;
	min-width: 210px;
	padding: 8px;
	background: #fff;
	box-shadow: 0 5px 15px #152b4c22;
	list-style: none;
}

.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu {
	display: block;
}

.panel {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 6px;
}

.catalog {
	max-width: 1180px;
	margin: 24px auto 48px;
	padding: 30px;
}

.catalog-intro > p {
	color: var(--muted);
	margin: 0 0 22px;
}

.printable-search {
	display: flex;
	gap: 8px;
	margin: 20px 0 14px;
	max-width: 620px;
}

.printable-search input {
	min-width: 0;
	flex: 1;
}

.category-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding-bottom: 24px;
}

.category-nav a {
	border: 1px solid var(--line);
	border-radius: 4px;
	padding: 7px 11px;
	font-size: 13px;
	color: var(--ink);
}



.catalog-heading {
	border-top: 1px solid var(--line);
	padding-top: 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}

.catalog-heading h2 {
	margin: 0;
	font-size: 22px;
}

.catalog-heading span {
	font-size: 13px;
	color: var(--muted);
}

.catalog-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 22px;
}

.printable-card {
	border: 1px solid var(--line);
	border-top: 3px solid var(--blue);
	border-radius: 5px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.printable-card:nth-child(4n + 2) {
	border-top-color: #e8483e;
}

.printable-card:nth-child(4n + 3) {
	border-top-color: #36a363;
}

.printable-card:nth-child(4n + 4) {
	border-top-color: #e9b40d;
}

.preview-link {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 235px;
	background: #f7f8fa;
	padding: 18px;
	border-bottom: 1px solid var(--line);
}

.printable-preview {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	filter: drop-shadow(0 2px 3px #152b4c12);
}

.preview-placeholder {
	background: #fff;
	display: grid;
	place-items: center;
	width: 150px;
	height: 195px;
	border: 1px solid var(--line);
	color: var(--muted);
	font-size: 13px;
}

.card-body {
	padding: 18px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	flex: 1;
}

.category-badge {
	font-size: 11px;
	padding: 3px 7px;
	background: #eaf2ff;
	color: #1555a6;
	border-radius: 3px;
}

.card-body h3 {
	margin: 12px 0 10px;
	font-size: 19px;
	overflow-wrap: anywhere;
}



.card-body p {
	font-size: 14px;
	color: var(--muted);
	margin: 0 0 18px;
}

.view-link {
	margin-top: auto;
	font-size: 14px;
}

.pagination {
	margin: 30px 0 0;
}

.nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.page-numbers {
	padding: 6px 13px;
	border: 1px solid var(--line);
	border-radius: 4px;
}

.page-numbers.current {
	background: var(--blue);
	color: #fff;
}

.breadcrumb {
	max-width: 1180px;
	margin: 22px auto;
	font-size: 13px;
	color: var(--muted);
	padding: 0 4px;
	overflow-wrap: anywhere;
}

.post-layout {
	max-width: 1180px;
	margin: 0 auto 48px;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 280px;
	gap: 24px;
	align-items: start;
}

.post-layout.no-sidebar {
	display: block;
	max-width: 900px;
}

.post-article {
	padding: 30px;
	min-width: 0;
}

.entry-header > a {
	font-size: 13px;
}

.entry-header h1 {
	margin-top: 12px;
}

.entry-content {
	overflow-wrap: anywhere;
}

.entry-content > img,
.entry-content p > img,
.entry-content figure img {
	display: block;
	margin: 20px auto;
	height: auto;
}

.entry-content h2 {
	margin-top: 32px;
}

.entry-content a {
	text-decoration: underline;
}

.entry-content iframe,
.entry-content video {
	max-width: 100%;
}

.entry-content table {
	border-collapse: collapse;
	width: 100%;
	display: block;
	overflow: auto;
}

.entry-content td,
.entry-content th {
	padding: 9px;
	border: 1px solid var(--line);
}

.entry-content pre {
	overflow: auto;
	background: #f4f6f8;
	padding: 16px;
}

.entry-content blockquote {
	border-left: 4px solid var(--blue);
	margin-left: 0;
	padding-left: 20px;
}

.alignleft {
	float: left;
	margin: 0 20px 15px 0;
}

.alignright {
	float: right;
	margin: 0 0 15px 20px;
}

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

.wp-caption {
	max-width: 100%;
}

.wp-caption-text,
.gallery-caption {
	font-size: 13px;
	color: var(--muted);
}

.sticky .card-body {
	background: #fcfdff;
}

.bypostauthor {
	border-left: 2px solid var(--blue);
}

.entry-content::after {
	content: "";
	display: block;
	clear: both;
}

.page-content {
	max-width: 900px;
	margin: 24px auto 48px;
	padding: 32px;
	min-height: 45vh;
}

.post-sidebar {
	align-self: start;
	display: flex;
	flex-direction: column;
	gap: 18px;
	min-width: 0;
}

.post-sidebar.is-sticky {
	position: sticky;
	top: var(--sticky-offset);
}

.admin-bar .post-sidebar.is-sticky {
	top: calc(var(--sticky-offset) + 32px);
}

.post-sidebar.too-tall {
	position: static;
}

.widget {
	padding: 20px;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 6px;
	overflow-wrap: anywhere;
}

.widget-title,
.widget h2 {
	font-size: 18px;
	margin: 0 0 14px;
}

.widget ul {
	padding-left: 18px;
	margin: 0;
}

.widget li {
	padding: 5px 0;
	font-size: 14px;
}

.widget .printable-search {
	flex-direction: column;
	margin: 0;
}

.widget input {
	width: 100%;
}

.post-navigation {
	border-top: 1px solid var(--line);
	margin-top: 30px;
	padding-top: 20px;
}

.post-navigation .nav-links {
	justify-content: space-between;
}

.post-navigation .nav-links > div {
	max-width: 46%;
	font-size: 14px;
}

.comments-area {
	margin-top: 32px;
}

.comment-list {
	padding-left: 20px;
}

.comment-form textarea {
	display: block;
	width: 100%;
}

.comment-form label {
	display: block;
}

.comment-form-cookies-consent label {
	display: inline;
}

.comment-form-cookies-consent input {
	width: auto;
}

.avatar {
	border-radius: 50%;
}

.site-footer {
	background: var(--navy);
	color: #dfe8f5;
	padding: 32px 24px 90px;
}

.site-footer a {
	color: #fff;
}

.site-footer p {
	font-size: 13px;
	margin: 5px 0;
}

.site-footer .menu {
	font-size: 14px;
}

.back-top {
	position: fixed;
	right: 24px;
	bottom: 22px;
	z-index: 100;
	background: var(--navy);
	color: #fff;
	padding: 10px 17px;
	border: 1px solid #fff6;
	border-radius: 6px;
	box-shadow: 0 3px 12px #152b4c22;
	font-size: 14px;
}

.back-top:hover {
	background: var(--blue);
	text-decoration: none;
}

.breadcrumb a { text-decoration: underline; }

.card-body h3 a {
	color: var(--ink);
}

.category-nav a:hover,
.category-nav a[aria-current] {
	background: var(--blue);
	color: #fff;
	border-color: var(--blue);
}

@media (min-width: 783px) {

	body.admin-bar {
		--admin-height: 32px;
	}
}

@media (max-width: 1220px) {

	.catalog,
	.post-layout,
	.page-content {
		margin-left: 20px;
		margin-right: 20px;
	}

	.breadcrumb {
		margin-left: 20px;
		margin-right: 20px;
	}
}

@media (max-width: 900px) {

	.catalog-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.post-layout {
		grid-template-columns: minmax(0, 1fr) 245px;
		gap: 18px;
	}

	.post-article {
		padding: 24px;
	}
}

@media (max-width: 782px) {

	.header-inner {
		align-items: flex-start;
		flex-direction: column;
		gap: 16px;
	}

	.site-header {
		padding: 18px 20px;
	}

	.brand-title {
		font-size: 23px;
	}

	.post-layout {
		display: block;
	}

	.post-sidebar,
	.post-sidebar.is-sticky,
	.admin-bar .post-sidebar.is-sticky {
		position: static;
		margin-top: 24px;
	}

	.footer-inner {
		align-items: flex-start;
		flex-direction: column;
	}

	.primary-nav .sub-menu {
		position: static;
	}

	.post-article {
		padding: 22px;
	}
}

@media (max-width: 520px) {

	.catalog {
		padding: 18px;
		margin: 16px 12px 30px;
	}

	.catalog-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 18px;
	}

	.preview-link {
		height: 240px;
	}

	.card-body {
		padding: 16px;
	}

	.category-nav {
		gap: 6px;
	}

	.category-nav a {
		font-size: 12px;
		padding: 6px 9px;
	}

	.catalog-heading h2 {
		font-size: 20px;
	}

	.post-layout,
	.page-content {
		margin-left: 12px;
		margin-right: 12px;
	}

	.page-content,
	.post-article {
		padding: 20px;
	}

	.breadcrumb {
		margin-left: 16px;
		margin-right: 16px;
	}

	.back-top {
		right: 14px;
		bottom: 14px;
	}

	.printable-search button {
		padding: 10px 14px;
	}

	.alignleft,
	.alignright {
		float: none;
		margin: 15px auto;
	}

	.brand-title {
		overflow-wrap: anywhere;
	}
}

@media (prefers-reduced-motion: reduce) {

	html {
		scroll-behavior: auto;
	}
}

@media print {

	body {
		background: #fff;
		color: #000;
	}

	.site-header,
	.site-footer,
	.back-top,
	.post-sidebar,
	.breadcrumb,
	.post-navigation,
	.comments-area,
	.skip-link {
		display: none !important;
	}

	.post-layout,
	.page-content {
		display: block;
		margin: 0;
		max-width: none;
	}

	.panel {
		border: 0;
		padding: 0;
	}

	.entry-content img {
		max-width: 100%;
		break-inside: avoid;
	}

	a {
		color: #000;
	}

	.catalog-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* Keep nested navigation usable on touch devices without hover. */
@media (max-width: 782px) {

	.primary-nav .sub-menu {
		display: block;
		padding: 4px 0 0 12px;
		background: transparent;
		box-shadow: none;
	}

	.primary-nav .sub-menu a {
		margin-top: 4px;
	}
}


