/*
Theme Name: TBL
Author: TBL
Description: A fast, responsive dark editorial theme for visual entertainment catalogs and magazines.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tbl
Tags: blog, entertainment, news, custom-logo, custom-menu, featured-images, accessibility-ready
*/

:root {
	--tbl-bg: #000;
	--tbl-surface: #171717;
	--tbl-surface-raised: #242424;
	--tbl-border: rgb(255 255 255 / 9%);
	--tbl-border-hover: rgb(255 255 255 / 30%);
	--tbl-text: #fff;
	--tbl-muted: #b7b7b7;
	--tbl-subtle-text: #dedede;
	--tbl-chrome-bg: #0c0c0c;
	--tbl-chrome-border: #292929;
	--tbl-field-bg: #111;
	--tbl-nav-text: #dedede;
	--tbl-accent-contrast: #000;
	--tbl-accent-hover: #ddd;
	--tbl-poster-bg: linear-gradient(145deg, #343434, #1d1d1d 58%, #303030);
	--tbl-poster-text: rgb(255 255 255 / 80%);
	--tbl-accent: #fff;
	--tbl-radius: 12px;
	--tbl-content-width: 1000px;
	color-scheme: dark;
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--tbl-bg);
	color: var(--tbl-text);
	font-family: Ubuntu, "Segoe UI", Arial, sans-serif;
	font-weight: 400;
	font-size: 16px;
	line-height: 1.65;
	font-synthesis: weight;
	-webkit-font-smoothing: antialiased;
}

a {
	color: inherit;
	text-decoration: none;
}

a:hover {
	color: var(--tbl-accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
	outline: 2px solid var(--tbl-accent);
	outline-offset: 3px;
}

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

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

.skip-link {
	position: fixed;
	z-index: 20;
	top: 12px;
	left: 12px;
	padding: 10px 14px;
	transform: translateY(-160%);
	border-radius: 6px;
	background: var(--tbl-accent);
	color: var(--tbl-accent-contrast);
	font-weight: 700;
}

.skip-link:focus {
	transform: translateY(0);
}

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

.header-inner,
.site-main,
.footer-inner {
	width: min(calc(100% - 48px), var(--tbl-content-width));
	margin-inline: auto;
}

.header-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
	padding-block: 27px 18px;
}

.site-branding {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.custom-logo-link {
	display: block;
	margin-bottom: 5px;
}

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

.site-title {
	margin: 0;
	font-size: clamp(1.4rem, 2.2vw, 1.8rem);
	font-weight: 900;
	letter-spacing: .1em;
	line-height: 1;
}

.site-title a {
	color: var(--tbl-text);
}

.site-title a span {
	color: var(--tbl-accent);
}

.site-description {
	margin: 9px 0 0;
	color: var(--tbl-muted);
	font-size: .79rem;
	letter-spacing: .13em;
	text-transform: uppercase;
}

.header-tools {
	display: flex;
	width: min(100%, 620px);
	align-items: center;
	justify-content: center;
	gap: 18px;
}

.search-form {
	display: flex;
	width: min(100%, 470px);
	flex: 1 1 470px;
	min-width: 0;
	gap: 8px;
	align-items: stretch;
}

.search-form label {
	display: block;
	flex: 1;
	min-width: 0;
}

.search-field {
	width: 100%;
	height: 44px;
	padding: 8px 14px;
	border: 1px solid var(--tbl-border);
	border-radius: 7px;
	background: var(--tbl-surface);
	color: var(--tbl-text);
	font: inherit;
	font-size: .94rem;
	line-height: 1.4;
	transition: border-color .18s ease, box-shadow .18s ease;
}

.search-field:focus {
	border-color: var(--tbl-accent);
	outline: 2px solid var(--tbl-accent);
	outline-offset: 2px;
}

.search-field::placeholder {
	color: var(--tbl-muted);
}

.search-submit {
	min-height: 44px;
	padding: 8px 18px;
	border: 0;
	border-radius: 7px;
	background: var(--tbl-accent);
	color: var(--tbl-accent-contrast);
	font: inherit;
	font-size: .9rem;
	font-weight: 750;
	line-height: 1.4;
	cursor: pointer;
	transition: background-color .18s ease, transform .18s ease;
}

.search-submit:hover {
	background: var(--tbl-accent-hover);
}

.search-submit:active {
	transform: translateY(1px);
}

.primary-navigation {
	width: 100%;
	border-top: 1px solid var(--tbl-chrome-border);
}

.primary-navigation ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 26px;
	margin: 0;
	padding: 14px 0 0;
	list-style: none;
}

.primary-navigation a {
	color: var(--tbl-nav-text);
	font-size: .88rem;
	font-weight: 600;
}

.primary-navigation a:hover,
.primary-navigation .current-menu-item > a {
	color: var(--tbl-accent);
}

.site-main {
	min-height: 55vh;
	padding-block: 37px 70px;
}

.single-post .site-main {
	padding-top: 18px;
}

.page-heading {
	margin: 0 0 30px;
	text-align: center;
}

.eyebrow {
	display: block;
	margin-bottom: 3px;
	color: var(--tbl-accent);
	font-size: .72rem;
	font-weight: 800;
	letter-spacing: .17em;
	text-transform: uppercase;
}

.page-heading h1,
.page-heading h2 {
	margin: 0;
	font-size: clamp(1.7rem, 3vw, 2.2rem);
	font-weight: 800;
	letter-spacing: -.035em;
	line-height: 1.25;
}

.archive-description {
	max-width: 680px;
	margin: 10px auto 0;
	color: var(--tbl-muted);
}

.archive-description > :last-child {
	margin-bottom: 0;
}

.content-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 286px;
	align-items: start;
	gap: 34px;
}

.content-area {
	min-width: 0;
}

.post-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 25px 17px;
}

.post-card {
	min-width: 0;
}

.post-card-image {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 2 / 3;
	border: 1px solid var(--tbl-border);
	border-radius: 8px;
	box-shadow: 0 1px 4px rgb(0 0 0 / 18%);
	transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
	background:
		radial-gradient(ellipse at 70% 27%, rgb(255 255 255 / 12%), transparent 34%),
		var(--tbl-poster-bg);
}

.post-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .28s ease;
}

@media (hover: hover) and (pointer: fine) {
	.post-card-image:hover {
		z-index: 1;
		transform: translateY(-3px);
		border-color: var(--tbl-border-hover);
		box-shadow: 0 8px 20px rgb(0 0 0 / 34%);
	}

	.post-card-image:hover img {
		transform: scale(1.025);
	}
}

.post-card-image:focus-visible {
	z-index: 1;
	outline: 2px solid #fff;
	outline-offset: 3px;
	box-shadow: 0 0 0 5px #000;
}

.post-card-placeholder {
	position: absolute;
	inset: auto 12px 14px;
	color: var(--tbl-poster-text);
	font-size: .8rem;
	font-weight: 800;
	letter-spacing: .14em;
	text-align: center;
	text-transform: uppercase;
}

.post-card-category {
	display: block;
	margin: 11px 0 3px;
	overflow: hidden;
	color: var(--tbl-accent);
	font-size: .68rem;
	font-weight: 800;
	letter-spacing: .1em;
	text-overflow: ellipsis;
	text-transform: uppercase;
	white-space: nowrap;
}

.post-card h2 {
	margin: 0;
	font-size: .97rem;
	font-weight: 400;
	line-height: 1.4;
	text-align: center;
}

.post-card h2 a {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.post-card-date {
	display: block;
	margin-top: 6px;
	color: var(--tbl-muted);
	font-size: .76rem;
}

.site-sidebar {
	min-width: 0;
}

.sidebar-section {
	margin-bottom: 24px;
	padding: 20px;
	border: 1px solid var(--tbl-border);
	border-radius: var(--tbl-radius);
	background: linear-gradient(155deg, rgb(255 255 255 / 2%), transparent 48%), var(--tbl-surface);
	box-shadow: 0 2px 12px rgb(0 0 0 / 18%);
}

.sidebar-section h2 {
	margin: 0 0 17px;
	font-size: 1.02rem;
	font-weight: 800;
}

.sidebar-posts {
	display: grid;
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sidebar-post {
	display: grid;
	grid-template-columns: 58px minmax(0, 1fr);
	align-items: center;
	gap: 12px;
}

.sidebar-post-image {
	width: 58px;
	height: 72px;
	overflow: hidden;
	border-radius: 5px;
	border: 1px solid var(--tbl-border);
	background: var(--tbl-surface-raised);
}

.sidebar-post-placeholder {
	display: grid;
	width: 100%;
	height: 100%;
	place-items: center;
	background: linear-gradient(145deg, #242424, #111);
	color: var(--tbl-muted);
	font-size: .68rem;
	font-weight: 700;
	letter-spacing: .12em;
}

.sidebar-post-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sidebar-post-title {
	display: -webkit-box;
	overflow: hidden;
	font-size: .97rem;
	font-weight: 400;
	line-height: 1.4;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.ad-slot {
	margin: 0 0 25px;
	padding: 12px;
	border: 1px dashed var(--tbl-border);
	border-radius: 8px;
	color: var(--tbl-muted);
	text-align: center;
}

.ad-slot-label {
	display: block;
	margin-bottom: 6px;
	font-size: .65rem;
	font-weight: 700;
	letter-spacing: .13em;
	text-transform: uppercase;
}

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

.ad-slot-content > :last-child {
	margin-bottom: 0;
}

.pagination {
	margin-top: 36px;
}

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

.page-numbers {
	display: inline-flex;
	min-width: 40px;
	min-height: 40px;
	align-items: center;
	justify-content: center;
	padding: 6px 12px;
	border: 1px solid var(--tbl-border);
	border-radius: 6px;
	background: var(--tbl-surface);
}

.page-numbers.current {
	border-color: var(--tbl-accent);
	background: var(--tbl-accent);
	color: var(--tbl-accent-contrast);
	font-weight: 800;
}

.empty-state {
	padding: 35px;
	border: 1px solid var(--tbl-border);
	border-radius: var(--tbl-radius);
	background: var(--tbl-surface);
	text-align: center;
}

.tbl-breadcrumbs {
	width: min(100%, 720px);
	margin: 0 0 12px;
	margin-inline: auto;
	color: var(--tbl-muted);
	font-size: .82rem;
	line-height: 1.5;
}

.tbl-breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 7px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tbl-breadcrumbs li + li::before {
	margin-right: 7px;
	color: var(--tbl-muted);
	content: "/";
}

.tbl-breadcrumbs a {
	color: var(--tbl-subtle-text);
	text-decoration: underline;
	text-decoration-color: var(--tbl-border);
	text-underline-offset: 3px;
}

.tbl-breadcrumbs a:hover,
.tbl-breadcrumbs a:focus-visible {
	color: var(--tbl-accent);
}

.tbl-breadcrumbs [aria-current="page"] {
	color: var(--tbl-text);
}

.entry-header {
	max-width: 900px;
	margin: 0 auto 22px;
	text-align: center;
}

.entry-title {
	margin: 0;
	font-size: clamp(1.25rem, 1.8vw, 1.65rem);
	font-weight: 850;
	letter-spacing: -.04em;
	line-height: 1.16;
}

.single-post .entry-content {
	font-weight: 300;
}

.entry-meta {
	margin-top: 12px;
	color: var(--tbl-muted);
	font-size: .86rem;
}

.entry-meta a {
	color: var(--tbl-accent);
}

.entry-featured-image {
	display: grid;
	width: min(100%, 165px);
	aspect-ratio: 3 / 4;
	place-items: center;
	overflow: hidden;
	margin: 0 auto 28px;
	border-radius: var(--tbl-radius);
	background:
		radial-gradient(ellipse at 70% 27%, rgb(255 255 255 / 8%), transparent 34%),
		var(--tbl-surface);
}

.entry-featured-image img {
	width: 100%;
	height: 100%;
	border: 1px solid var(--tbl-border);
	border-radius: var(--tbl-radius);
	object-fit: cover;
}

.entry-featured-image .post-card-placeholder {
	position: static;
	display: grid;
	width: 100%;
	height: 100%;
	place-items: center;
}

.entry-content {
	width: min(100%, 720px);
	margin-inline: auto;
	font-size: 1rem;
	line-height: 1.75;
	overflow-wrap: anywhere;
}

.entry-content > * {
	max-width: 100%;
}

.entry-content h2 {
	margin-top: 1.7em;
	font-size: clamp(1.25rem, 2.2vw, 1.55rem);
	font-weight: 700;
	line-height: 1.3;
}

.entry-content h3 {
	margin-top: 1.6em;
	font-size: clamp(1.1rem, 1.8vw, 1.3rem);
	font-weight: 600;
	line-height: 1.35;
}

.entry-content h4 {
	margin-top: 1.5em;
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.4;
}

.entry-content a,
.comment-content a {
	color: var(--tbl-accent);
	text-decoration: underline;
	text-underline-offset: .15em;
}

.entry-content blockquote {
	margin-inline: 0;
	padding: 4px 20px;
	border-left: 3px solid var(--tbl-accent);
	color: var(--tbl-subtle-text);
}

.entry-content pre {
	overflow-x: auto;
	padding: 16px;
	border-radius: 8px;
	background: var(--tbl-surface);
}

.entry-content table {
	width: 100%;
	border-collapse: collapse;
}

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

.entry-footer {
	max-width: 820px;
	margin: 30px auto 0;
	color: var(--tbl-muted);
	font-size: .86rem;
}

.entry-footer a {
	color: var(--tbl-accent);
}

.page-content {
	max-width: 900px;
	margin-inline: auto;
}

.comments-area {
	max-width: 820px;
	margin: 48px auto 0;
	padding-top: 28px;
	border-top: 1px solid var(--tbl-border);
}

.comments-area h2 {
	font-size: 1.35rem;
}

.comment-list {
	display: grid;
	gap: 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.comment-body,
.comment-respond {
	padding: 18px;
	border: 1px solid var(--tbl-border);
	border-radius: 8px;
	background: var(--tbl-surface);
}

.comment-meta,
.comment-notes,
.logged-in-as {
	color: var(--tbl-muted);
	font-size: .84rem;
}

.comment-form label {
	display: block;
	margin-bottom: 5px;
	font-weight: 650;
}

.comment-form input:not([type="checkbox"]),
.comment-form textarea {
	width: 100%;
	padding: 10px;
	border: 1px solid var(--tbl-border);
	border-radius: 6px;
	background: var(--tbl-field-bg);
	color: var(--tbl-text);
	font: inherit;
}

.comment-form .submit {
	width: auto;
	padding: 10px 16px;
	border: 0;
	border-radius: 6px;
	background: var(--tbl-accent);
	color: var(--tbl-accent-contrast);
	font: inherit;
	font-weight: 750;
	cursor: pointer;
}

.site-footer {
	border-top: 1px solid var(--tbl-border);
	background: var(--tbl-chrome-bg);
}

.footer-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	flex-direction: column;
	justify-content: center;
	gap: 12px;
	padding-block: 25px;
	color: var(--tbl-muted);
	font-size: .82rem;
	text-align: center;
}

.footer-inner p {
	margin: 0;
}

.footer {
	width: 100%;
}

.footer p {
	margin: 0;
	text-align: center;
}

.footer a {
	color: var(--tbl-nav-text);
	text-decoration: underline;
	text-underline-offset: .15em;
}

.footer a:hover {
	color: var(--tbl-accent-hover);
}

.footer-navigation ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.footer-navigation a {
	color: var(--tbl-nav-text);
}

@media (max-width: 1100px) {
	.content-layout {
		grid-template-columns: minmax(0, 1fr) 250px;
		gap: 24px;
	}

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

@media (min-width: 1280px) {
	.page-heading h1,
	.page-heading h2 {
		font-size: clamp(1.6rem, 2.4vw, 2rem);
	}

}

@media (min-width: 1101px) {
	body {
		background-color: var(--tbl-bg);
		background-image: repeating-linear-gradient(135deg, rgb(255 255 255 / 2%) 0 2px, transparent 2px 7px);
	}

	.content-layout {
		grid-template-columns: minmax(0, 1fr) 275px;
		gap: 15px;
	}

	.post-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 20px 14px;
	}

	.post-card h2,
	.sidebar-post-title {
		font-size: .84rem;
	}
}

@media (max-width: 760px) {
	.header-inner,
	.site-main,
	.footer-inner {
		width: min(calc(100% - 32px), var(--tbl-content-width));
	}

	.header-inner {
		padding-top: 22px;
	}

	.search-form {
		width: min(100%, 520px);
	}

	.primary-navigation ul {
		gap: 8px 18px;
	}

	.content-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.single-post .site-main {
		padding-top: 16px;
		padding-bottom: 48px;
	}

	.post-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 21px 13px;
	}

	.site-sidebar {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px;
	}

	.sidebar-section {
		margin: 0;
	}
}

@media (max-width: 480px) {
	.header-inner,
	.site-main,
	.footer-inner {
		width: min(calc(100% - 24px), var(--tbl-content-width));
	}

	.site-main {
		padding-top: 27px;
	}

	.single-post .site-main {
		padding-top: 14px;
	}

	.search-form {
		gap: 6px;
	}

	.search-submit {
		padding-inline: 13px;
	}

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

	.post-card h2 {
		font-size: .8rem;
	}

	.post-card-date {
		font-size: .68rem;
	}

	.post-card-category {
		font-size: .62rem;
	}

	.site-sidebar {
		grid-template-columns: minmax(0, 1fr);
	}

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

@media (prefers-reduced-motion: reduce) {
	* {
		scroll-behavior: auto !important;
		transition-duration: .01ms !important;
	}

	.post-card-image:hover,
	.post-card-image:focus-visible {
		transform: none;
	}

	.post-card-image:hover img {
		transform: none;
	}
}
