/*
Theme Name: PurePress
Theme URI: https://example.com/purepress/
Author: PurePress
Author URI: https://example.com/
Description: PurePress is a lightning-fast, SEO-friendly WordPress theme built for content sites and AdSense publishers. It includes dedicated ad slots (header, in-content, after-content, in-feed), automatic table of contents, related posts, author box, breadcrumbs, Article schema markup, and full layout controls in the Customizer — no page builder or bloat required.
Version: 1.0.3
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: purepress
Tags: blog, news, magazine, one-column, two-columns, right-sidebar, left-sidebar, custom-colors, custom-logo, featured-images, footer-widgets, threaded-comments, translation-ready, adsense-ready, seo-friendly
*/

/* ============================================================
   1. VARIABLES & RESET
============================================================ */
:root {
	--pp-primary: #1d4ed8;
	--pp-primary-dark: #1e40af;
	--pp-text: #1f2937;
	--pp-muted: #6b7280;
	--pp-border: #e5e7eb;
	--pp-bg: #ffffff;
	--pp-bg-soft: #f9fafb;
	--pp-radius: 8px;
	--pp-max-width: 1200px;
	--pp-content-width: 760px;
	--pp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--pp-font);
	font-size: 17px;
	line-height: 1.7;
	color: var(--pp-text);
	background: var(--pp-bg);
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
	line-height: 1.3;
	margin: 1.5em 0 0.6em;
	font-weight: 700;
	color: #111827;
}
h1 { font-size: 2.1rem; margin-top: 0; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1.2em; }

a { color: var(--pp-primary); text-decoration: none; }
a:hover { color: var(--pp-primary-dark); text-decoration: underline; }

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

ul, ol { margin: 0 0 1.2em; padding-left: 1.4em; }

blockquote {
	border-left: 4px solid var(--pp-primary);
	margin: 1.5em 0;
	padding: 0.8em 1.2em;
	background: var(--pp-bg-soft);
	border-radius: 0 var(--pp-radius) var(--pp-radius) 0;
}
blockquote p:last-child { margin-bottom: 0; }

table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 0.95rem; }
th, td { padding: 0.7em 0.9em; border: 1px solid var(--pp-border); text-align: left; }
th { background: var(--pp-bg-soft); font-weight: 700; }
tr:nth-child(even) td { background: #fafbfc; }

code { background: var(--pp-bg-soft); padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.9em; }
pre { background: #111827; color: #f3f4f6; padding: 1.2em; border-radius: var(--pp-radius); overflow-x: auto; }
pre code { background: none; padding: 0; color: inherit; }

input, textarea, select, button { font-family: inherit; font-size: 1rem; }
button, .button, input[type="submit"] {
	background: var(--pp-primary);
	color: #fff;
	border: none;
	border-radius: var(--pp-radius);
	padding: 0.7em 1.4em;
	cursor: pointer;
	font-weight: 600;
}
button:hover, .button:hover, input[type="submit"]:hover { background: var(--pp-primary-dark); color: #fff; text-decoration: none; }

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

/* ============================================================
   2. LAYOUT
============================================================ */
.pp-container {
	max-width: var(--pp-max-width);
	margin: 0 auto;
	padding: 0 20px;
}
.pp-site-main { padding: 2.5rem 0; }

.pp-layout { display: flex; gap: 2.5rem; align-items: flex-start; }
.pp-content { flex: 1; min-width: 0; }
.pp-sidebar { width: 320px; flex-shrink: 0; }

.pp-layout.layout-left-sidebar { flex-direction: row-reverse; }
.pp-layout.layout-no-sidebar .pp-sidebar { display: none; }
.pp-layout.layout-no-sidebar .pp-content { max-width: var(--pp-content-width); margin: 0 auto; }

/* ============================================================
   3. HEADER
============================================================ */
.pp-topbar {
	background: #111827;
	color: #d1d5db;
	font-size: 0.82rem;
	padding: 0.45em 0;
}
.pp-topbar .pp-container { display: flex; justify-content: space-between; align-items: center; }
.pp-topbar a { color: #d1d5db; }
.pp-topbar a:hover { color: #fff; }

.pp-site-header {
	background: #fff;
	border-bottom: 1px solid var(--pp-border);
	position: sticky;
	top: 0;
	z-index: 100;
}
.pp-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	padding: 0.9rem 0;
}
.pp-site-branding { display: flex; align-items: center; gap: 0.8rem; }
.pp-site-title { font-size: 1.5rem; font-weight: 800; margin: 0; letter-spacing: -0.02em; }
.pp-site-title a { color: #111827; }
.pp-site-title a:hover { text-decoration: none; color: var(--pp-primary); }
.pp-site-description { margin: 0; font-size: 0.85rem; color: var(--pp-muted); }
.pp-custom-logo { max-height: 48px; width: auto; }

/* Primary nav */
.pp-primary-nav ul {
	list-style: none; margin: 0; padding: 0;
	display: flex; gap: 0.2rem; flex-wrap: wrap;
}
.pp-primary-nav a {
	display: block;
	padding: 0.6em 0.9em;
	color: var(--pp-text);
	font-weight: 600;
	font-size: 0.95rem;
	border-radius: 6px;
}
.pp-primary-nav a:hover { background: var(--pp-bg-soft); color: var(--pp-primary); text-decoration: none; }
.pp-primary-nav .current-menu-item > a,
.pp-primary-nav .current_page_item > a { color: var(--pp-primary); }

.pp-menu-toggle {
	display: none;
	background: none; border: 1px solid var(--pp-border);
	padding: 0.5em 0.8em; color: var(--pp-text); font-size: 1.1rem;
}

/* ============================================================
   4. AD SLOTS
============================================================ */
.pp-ad-slot { margin: 1.8rem auto; text-align: center; clear: both; }
.pp-ad-slot .pp-ad-label {
	display: block;
	font-size: 0.68rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #9ca3af;
	margin-bottom: 0.4em;
}
.pp-ad-below-header { margin: 1.2rem auto; }
.pp-ad-infeed { margin: 2rem auto; padding: 1rem 0; border-top: 1px solid var(--pp-border); border-bottom: 1px solid var(--pp-border); }

/* ============================================================
   5. POST CARDS (archives)
============================================================ */
.pp-archive-header { margin-bottom: 2rem; }
.pp-archive-title { font-size: 1.8rem; margin: 0 0 0.3em; }
.pp-archive-description { color: var(--pp-muted); }

.pp-post-card {
	display: flex;
	gap: 1.4rem;
	padding: 1.4rem 0;
	border-bottom: 1px solid var(--pp-border);
}
.pp-post-card:first-of-type { padding-top: 0; }
.pp-card-thumb { width: 240px; flex-shrink: 0; }
.pp-card-thumb img { border-radius: var(--pp-radius); aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.pp-card-body { min-width: 0; }
.pp-card-title { font-size: 1.25rem; margin: 0 0 0.4em; }
.pp-card-title a { color: #111827; }
.pp-card-title a:hover { color: var(--pp-primary); }
.pp-card-excerpt { color: var(--pp-muted); font-size: 0.95rem; margin-bottom: 0.6em; }
.pp-entry-meta { font-size: 0.82rem; color: var(--pp-muted); display: flex; gap: 1em; flex-wrap: wrap; align-items: center; }
.pp-entry-meta a { color: var(--pp-muted); }
.pp-entry-meta a:hover { color: var(--pp-primary); }
.pp-read-more { font-weight: 600; font-size: 0.9rem; }

/* Grid variant for homepage featured */
.pp-posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.8rem; }
.pp-posts-grid .pp-post-card { flex-direction: column; border: none; padding: 0; gap: 0.8rem; }
.pp-posts-grid .pp-card-thumb { width: 100%; }

/* Pagination */
.pp-pagination { margin: 2.5rem 0 0; text-align: center; }
.pp-pagination .page-numbers {
	display: inline-block; padding: 0.5em 0.95em; margin: 0 0.15em;
	border: 1px solid var(--pp-border); border-radius: 6px; color: var(--pp-text); font-weight: 600;
}
.pp-pagination .page-numbers.current { background: var(--pp-primary); border-color: var(--pp-primary); color: #fff; }
.pp-pagination a:hover { border-color: var(--pp-primary); color: var(--pp-primary); text-decoration: none; }

/* ============================================================
   6. SINGLE POST
============================================================ */
.pp-breadcrumbs { font-size: 0.82rem; color: var(--pp-muted); margin-bottom: 1.2rem; }
.pp-breadcrumbs a { color: var(--pp-muted); }
.pp-breadcrumbs .sep { margin: 0 0.5em; color: #d1d5db; }

.pp-single-title { font-size: 2.2rem; letter-spacing: -0.02em; margin-bottom: 0.4em; }
.pp-single .pp-entry-meta { margin-bottom: 1.4rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--pp-border); }
.pp-featured-image { margin: 0 0 1.8rem; }
.pp-featured-image img { border-radius: var(--pp-radius); width: 100%; }

.pp-entry-content { font-size: 1.05rem; }
.pp-entry-content > p:first-of-type { font-size: 1.12rem; }

/* Table of contents */
.pp-toc {
	background: var(--pp-bg-soft);
	border: 1px solid var(--pp-border);
	border-radius: var(--pp-radius);
	padding: 1.2em 1.4em;
	margin: 1.8em 0;
}
.pp-toc-title { font-weight: 700; margin: 0 0 0.6em; font-size: 1.05rem; }
.pp-toc ol { margin: 0; padding-left: 1.3em; }
.pp-toc li { margin: 0.3em 0; font-size: 0.95rem; }
.pp-toc a { color: var(--pp-text); }
.pp-toc a:hover { color: var(--pp-primary); }

/* Tags & share */
.pp-entry-footer { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--pp-border); }
.pp-tags { margin-bottom: 1.2rem; }
.pp-tags a {
	display: inline-block; background: var(--pp-bg-soft); border: 1px solid var(--pp-border);
	padding: 0.3em 0.8em; border-radius: 20px; font-size: 0.82rem; margin: 0 0.4em 0.4em 0; color: var(--pp-muted);
}
.pp-tags a:hover { border-color: var(--pp-primary); color: var(--pp-primary); text-decoration: none; }

.pp-share { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.pp-share span { font-weight: 700; font-size: 0.9rem; margin-right: 0.3em; }
.pp-share a {
	display: inline-flex; align-items: center; justify-content: center;
	width: 38px; height: 38px; border-radius: 50%;
	background: var(--pp-bg-soft); border: 1px solid var(--pp-border);
	color: var(--pp-text); font-size: 0.85rem; font-weight: 700;
}
.pp-share a:hover { background: var(--pp-primary); border-color: var(--pp-primary); color: #fff; text-decoration: none; }

/* Author box */
.pp-author-box {
	display: flex; gap: 1.2rem;
	background: var(--pp-bg-soft); border: 1px solid var(--pp-border);
	border-radius: var(--pp-radius); padding: 1.4em; margin: 2rem 0;
}
.pp-author-avatar img { border-radius: 50%; }
.pp-author-name { margin: 0 0 0.3em; font-size: 1.05rem; }
.pp-author-bio { margin: 0; font-size: 0.92rem; color: var(--pp-muted); }

/* Related posts */
.pp-related { margin: 2.5rem 0; }
.pp-related h2 { font-size: 1.35rem; margin-bottom: 1em; }
.pp-related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.pp-related-card { border: 1px solid var(--pp-border); border-radius: var(--pp-radius); overflow: hidden; }
.pp-related-card img { aspect-ratio: 16/9; object-fit: cover; width: 100%; display: block; }
.pp-related-card h3 { font-size: 0.98rem; margin: 0; padding: 0.9em 1em; }
.pp-related-card h3 a { color: #111827; }

/* ============================================================
   7. SIDEBAR & WIDGETS
============================================================ */
.pp-widget {
	background: #fff;
	border: 1px solid var(--pp-border);
	border-radius: var(--pp-radius);
	padding: 1.3em;
	margin-bottom: 1.6rem;
}
.pp-widget-title { font-size: 1rem; margin: 0 0 0.9em; padding-bottom: 0.6em; border-bottom: 2px solid var(--pp-primary); }
.pp-widget ul { list-style: none; margin: 0; padding: 0; }
.pp-widget li { padding: 0.45em 0; border-bottom: 1px solid #f3f4f6; font-size: 0.93rem; }
.pp-widget li:last-child { border-bottom: none; }
.pp-widget .post-date { display: block; font-size: 0.78rem; color: var(--pp-muted); }

/* Search */
.pp-search-form { display: flex; }
.pp-search-form input[type="search"] {
	flex: 1; border: 1px solid var(--pp-border); border-radius: var(--pp-radius) 0 0 var(--pp-radius);
	padding: 0.65em 0.9em; min-width: 0;
}
.pp-search-form button { border-radius: 0 var(--pp-radius) var(--pp-radius) 0; }

/* ============================================================
   8. COMMENTS
============================================================ */
.pp-comments { margin-top: 2.5rem; }
.pp-comments-title { font-size: 1.3rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .comment { border: 1px solid var(--pp-border); border-radius: var(--pp-radius); padding: 1.2em; margin-bottom: 1.2rem; }
.comment-list .children { list-style: none; margin: 1.2rem 0 0; padding-left: 1.5rem; }
.comment-meta { font-size: 0.85rem; color: var(--pp-muted); margin-bottom: 0.6em; }
.comment-author .avatar { border-radius: 50%; vertical-align: middle; margin-right: 0.5em; }
.comment-reply-link { font-size: 0.85rem; font-weight: 600; }
#respond { margin-top: 2rem; }
#comment { width: 100%; border: 1px solid var(--pp-border); border-radius: var(--pp-radius); padding: 0.8em; }
.pp-comment-inputs { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.pp-comment-inputs input { width: 100%; border: 1px solid var(--pp-border); border-radius: var(--pp-radius); padding: 0.65em 0.9em; }

/* ============================================================
   9. FOOTER
============================================================ */
.pp-site-footer { background: #111827; color: #cbd5e1; margin-top: 3rem; border-top: 4px solid var(--pp-primary); }
.pp-footer-main { padding: 3.5rem 0 2.5rem; }
.pp-footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2.5rem; }
.pp-footer-logo { margin: 0 0 0.6rem; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.01em; }
.pp-footer-logo a { color: #fff; text-decoration: none; }
.pp-footer-tagline { font-size: 0.9rem; color: #94a3b8; margin: 0 0 1.2rem; line-height: 1.6; }
.pp-footer-social { display: flex; gap: 0.6rem; }
.pp-footer-social a { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid #334155; border-radius: 50%; color: #cbd5e1; transition: background 0.2s, border-color 0.2s, color 0.2s; }
.pp-footer-social a:hover { background: var(--pp-primary); border-color: var(--pp-primary); color: #fff; }
.pp-footer-social svg { width: 17px; height: 17px; fill: currentColor; }
.pp-site-footer .pp-widget { background: transparent; border: none; padding: 0; margin: 0; box-shadow: none; }
.pp-site-footer .pp-widget-title { color: #fff; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; border: none; padding: 0 0 0.7rem; margin: 0 0 1rem; position: relative; }
.pp-site-footer .pp-widget-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 34px; height: 2px; background: var(--pp-primary); }
.pp-site-footer .pp-widget ul { list-style: none; margin: 0; padding: 0; }
.pp-site-footer .pp-widget li { border: none; padding: 0.32rem 0; font-size: 0.9rem; }
.pp-site-footer a { color: #cbd5e1; text-decoration: none; }
.pp-site-footer .pp-widget a:hover { color: #fff; padding-left: 4px; }
.pp-site-footer .pp-widget a { transition: color 0.2s, padding-left 0.2s; }
.pp-footer-bottom { background: #0b1220; border-top: 1px solid #1f2937; padding: 1.1rem 0; font-size: 0.82rem; color: #94a3b8; }
.pp-footer-bottom .pp-container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.8rem; }
.pp-footer-menu ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.2rem; flex-wrap: wrap; }
.pp-footer-menu a:hover { color: #fff; }

/* ============================================================
   10. MISC PAGES
============================================================ */
.pp-page-title { font-size: 2rem; margin-bottom: 0.6em; }
.pp-404 { text-align: center; padding: 4rem 0; }
.pp-404 h1 { font-size: 4rem; margin-bottom: 0.2em; }
.pp-nothing-found { text-align: center; padding: 3rem 0; color: var(--pp-muted); }

/* Back to top */
.pp-back-to-top {
	position: fixed; bottom: 24px; right: 24px; z-index: 90;
	width: 44px; height: 44px; border-radius: 50%;
	background: var(--pp-primary); color: #fff;
	display: none; align-items: center; justify-content: center;
	font-size: 1.2rem; box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.pp-back-to-top:hover { background: var(--pp-primary-dark); color: #fff; }
.pp-back-to-top.visible { display: inline-flex; }

/* Reading progress */
.pp-reading-progress {
	position: fixed; top: 0; left: 0; height: 3px; width: 0;
	background: var(--pp-primary); z-index: 200;
}

/* ============================================================
   11. RESPONSIVE
============================================================ */
@media (max-width: 960px) {
	.pp-layout { flex-direction: column; }
	.pp-sidebar { width: 100%; }
	.pp-posts-grid { grid-template-columns: repeat(2, 1fr); }
	.pp-related-grid { grid-template-columns: repeat(2, 1fr); }
	.pp-footer-grid { grid-template-columns: repeat(2, 1fr); }
	.pp-comment-inputs { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
	body { font-size: 16px; }
	h1, .pp-single-title { font-size: 1.7rem; }
	.pp-menu-toggle { display: inline-block; }
	.pp-primary-nav {
		display: none; width: 100%; order: 3;
	}
	.pp-primary-nav.toggled { display: block; }
	.pp-primary-nav ul { flex-direction: column; padding: 0.8rem 0; }
	.pp-header-inner { flex-wrap: wrap; }
	.pp-post-card { flex-direction: column; }
	.pp-card-thumb { width: 100%; }
	.pp-posts-grid, .pp-related-grid, .pp-footer-grid { grid-template-columns: 1fr; }
	.pp-author-box { flex-direction: column; }
	.pp-footer-bottom .pp-container { flex-direction: column; text-align: center; }
}

/* WordPress alignment */
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignleft { float: left; margin: 0 1.2em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.2em; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.85rem; color: var(--pp-muted); text-align: center; margin-top: 0.4em; }
.gallery { display: grid; gap: 1rem; }
.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }
