/*
Theme Name: PJ Perspective
Theme URI: https://pjperspective.com/
Author: PJ Perspective
Author URI: https://pjperspective.com/
Description: A soft, editorial WordPress theme built around a light, neutral gray palette. Ideal for portfolios, photography, and story-driven blogs. Includes full block-editor support, responsive layouts, and accessible, semantic markup.
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pjperspective
Tags: portfolio, photography, blog, editorial, custom-colors, custom-menu, featured-images, block-styles, wide-blocks, translation-ready, threaded-comments
*/

/* ==========================================================================
   Design tokens — earthy neutral palette
   ========================================================================== */

:root {
	/* Palette — soft neutral grays */
	--pj-color-mist:   #EBECF0; /* lightest — primary background */
	--pj-color-cloud:  #E2E3E5; /* light cool gray — header / surfaces */
	--pj-color-ash:    #D5D3D4; /* light gray */
	--pj-color-stone:  #C0BCB9; /* warm gray — borders / hero */
	--pj-color-greige: #BAB0A6; /* deepest tone — accent / buttons / footer */

	/* Supporting neutrals for legible text (outside the 5-color palette) */
	--pj-color-ink:       #33353A; /* near-black cool gray for text/headings */
	--pj-color-ink-hover: #17181B; /* darker ink for hover states */
	--pj-accent-hover:    #A79D91; /* greige, one step darker for button hover */

	/* Semantic roles */
	--pj-bg:            var(--pj-color-mist);
	--pj-bg-alt:        var(--pj-color-cloud);
	--pj-surface:       #F5F6F8;
	--pj-border:        var(--pj-color-stone);
	--pj-text:          var(--pj-color-ink);
	--pj-text-muted:    #6C6A6A;
	--pj-heading:       var(--pj-color-ink);
	--pj-link:          var(--pj-color-ink);
	--pj-link-hover:    #8A847C;
	--pj-accent:        var(--pj-color-greige);
	--pj-on-accent:     var(--pj-color-ink);

	/* Typography */
	--pj-font-body: Georgia, "Times New Roman", serif;
	--pj-font-head: "Helvetica Neue", Helvetica, Arial, sans-serif;
	--pj-font-size: 1.125rem;
	--pj-line: 1.7;

	/* Layout */
	--pj-content-width: 46rem;
	--pj-wide-width: 62rem;
	--pj-gutter: clamp(1rem, 4vw, 2.5rem);
	--pj-radius: 4px;
	--pj-shadow: 0 8px 30px rgba(51, 53, 58, 0.12);
	--pj-transition: 180ms ease;
}

/* ==========================================================================
   Base / reset
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	background-color: var(--pj-bg);
	color: var(--pj-text);
	font-family: var(--pj-font-body);
	font-size: var(--pj-font-size);
	line-height: var(--pj-line);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

a {
	color: var(--pj-link);
	text-decoration: underline;
	text-underline-offset: 0.15em;
	text-decoration-thickness: 1px;
	transition: color var(--pj-transition);
}

a:hover,
a:focus { color: var(--pj-link-hover); }

:focus-visible {
	outline: 2px solid var(--pj-color-ink);
	outline-offset: 2px;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
	font-family: var(--pj-font-head);
	color: var(--pj-heading);
	line-height: 1.2;
	margin: 0 0 0.5em;
	font-weight: 600;
	letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.25rem; }

p, ul, ol, blockquote, figure, table, pre { margin: 0 0 1.5em; }

blockquote {
	border-left: 4px solid var(--pj-accent);
	margin-left: 0;
	padding: 0.25em 0 0.25em 1.25em;
	color: var(--pj-text-muted);
	font-style: italic;
}

code, pre {
	font-family: "SF Mono", Menlo, Consolas, monospace;
	font-size: 0.9em;
}

pre {
	background: var(--pj-color-ink);
	color: var(--pj-color-mist);
	padding: 1.25em;
	border-radius: var(--pj-radius);
	overflow-x: auto;
}

code {
	background: var(--pj-bg-alt);
	padding: 0.15em 0.4em;
	border-radius: 3px;
}

hr {
	border: 0;
	height: 1px;
	background: var(--pj-border);
	margin: 3em 0;
}

/* ==========================================================================
   Layout helpers
   ========================================================================== */

.pj-container {
	width: 100%;
	max-width: var(--pj-wide-width);
	margin-inline: auto;
	padding-inline: var(--pj-gutter);
}

.pj-content-narrow { max-width: var(--pj-content-width); margin-inline: auto; }

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

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 1000;
	background: var(--pj-color-ink);
	color: var(--pj-color-mist);
	padding: 0.75em 1.25em;
	border-radius: 0 0 var(--pj-radius) 0;
	text-decoration: none;
}

.skip-link:focus { left: 0; color: var(--pj-color-mist); }

/* ==========================================================================
   Site header
   ========================================================================== */

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

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	padding-block: 1.25rem;
	flex-wrap: wrap;
}

.site-branding { display: flex; flex-direction: column; }

.site-title {
	font-family: var(--pj-font-head);
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0;
	line-height: 1.1;
	letter-spacing: 0.02em;
}

.site-title a { color: var(--pj-heading); text-decoration: none; }
.site-title a:hover { color: var(--pj-color-ink-hover); }

.site-description {
	margin: 0.25rem 0 0;
	color: var(--pj-text-muted);
	font-size: 0.95rem;
	font-family: var(--pj-font-head);
}

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

/* Navigation */
.main-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 1.75rem;
	flex-wrap: wrap;
	align-items: center;
}

.main-navigation a {
	font-family: var(--pj-font-head);
	text-decoration: none;
	color: var(--pj-text);
	font-size: 0.95rem;
	font-weight: 500;
	padding-block: 0.25rem;
	position: relative;
}

.main-navigation a::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -2px;
	width: 0;
	height: 2px;
	background: var(--pj-color-ink);
	transition: width var(--pj-transition);
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a { color: var(--pj-color-ink); }
.main-navigation a:hover::after,
.main-navigation .current-menu-item > a::after { width: 100%; }

/* Mobile menu toggle */
.menu-toggle {
	display: none;
	background: transparent;
	border: 1px solid var(--pj-border);
	border-radius: var(--pj-radius);
	color: var(--pj-heading);
	font-family: var(--pj-font-head);
	padding: 0.5rem 0.9rem;
	cursor: pointer;
	font-size: 0.9rem;
}

@media (max-width: 782px) {
	.menu-toggle { display: inline-block; }
	.main-navigation .menu { display: none; flex-direction: column; gap: 0.5rem; width: 100%; }
	.main-navigation.is-open .menu { display: flex; }
	.site-header__inner { align-items: flex-start; }
}

/* ==========================================================================
   Main / posts
   ========================================================================== */

.site-main { padding-block: clamp(2rem, 6vw, 4.5rem); }

.site-content {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: clamp(2rem, 5vw, 4rem);
}

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

@media (max-width: 900px) {
	.has-sidebar .site-content { grid-template-columns: minmax(0, 1fr); }
}

.entry {
	background: var(--pj-surface);
	border: 1px solid var(--pj-border);
	border-radius: var(--pj-radius);
	overflow: hidden;
	margin-bottom: 2.5rem;
	transition: transform var(--pj-transition), box-shadow var(--pj-transition);
}

.entry:hover { transform: translateY(-3px); box-shadow: var(--pj-shadow); }

.entry__thumbnail img { width: 100%; object-fit: cover; }

.entry__body { padding: clamp(1.25rem, 3vw, 2rem); }

.entry__title { margin-top: 0; }
.entry__title a { text-decoration: none; color: var(--pj-heading); }
.entry__title a:hover { color: var(--pj-color-ink-hover); }

.entry__meta {
	font-family: var(--pj-font-head);
	font-size: 0.85rem;
	color: var(--pj-text-muted);
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1rem;
	margin-bottom: 1rem;
}

.entry__meta a { color: var(--pj-text-muted); text-decoration: none; }
.entry__meta a:hover { color: var(--pj-color-ink); }

.entry__excerpt { color: var(--pj-text); }

/* Single post */
.single-entry .entry { background: transparent; border: 0; }
.single-entry .entry:hover { transform: none; box-shadow: none; }
.single-entry .entry__body { padding: 0; }

.entry-content { max-width: var(--pj-content-width); }
.entry-content .alignwide { max-width: var(--pj-wide-width); margin-inline: auto; }
.entry-content .alignfull { max-width: none; }
.entry-content--full { max-width: none; }

/* Buttons & tags */
.pj-button,
.wp-block-button__link {
	display: inline-block;
	background: var(--pj-accent);
	color: var(--pj-on-accent);
	font-family: var(--pj-font-head);
	font-weight: 600;
	text-decoration: none;
	padding: 0.7em 1.5em;
	border-radius: var(--pj-radius);
	border: 0;
	cursor: pointer;
	transition: background var(--pj-transition), transform var(--pj-transition);
}

.pj-button:hover,
.wp-block-button__link:hover {
	background: var(--pj-accent-hover);
	color: var(--pj-on-accent);
	transform: translateY(-1px);
}

.read-more { font-family: var(--pj-font-head); font-weight: 600; }

.entry-tags { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.entry-tags a {
	font-family: var(--pj-font-head);
	font-size: 0.8rem;
	background: var(--pj-bg-alt);
	color: var(--pj-text-muted);
	padding: 0.3em 0.8em;
	border-radius: 999px;
	text-decoration: none;
	border: 1px solid var(--pj-border);
}
.entry-tags a:hover { background: var(--pj-accent); color: var(--pj-on-accent); border-color: var(--pj-accent); }

/* ==========================================================================
   Page hero / archive header
   ========================================================================== */

.page-hero {
	background: var(--pj-color-stone);
	color: var(--pj-color-ink);
	padding-block: clamp(2.5rem, 7vw, 5rem);
	text-align: center;
}

.page-hero__title { color: var(--pj-color-ink); margin: 0; }
.page-hero__subtitle { margin: 0.75rem 0 0; color: var(--pj-color-ink); opacity: 0.85; font-family: var(--pj-font-head); }

/* ==========================================================================
   Front page
   ========================================================================== */

.front-intro { padding-block: clamp(2.5rem, 7vw, 4.5rem); text-align: center; }

.front-recent { padding-bottom: clamp(2rem, 6vw, 4rem); }

.front-recent__title {
	text-align: center;
	margin-bottom: 2.5rem;
	position: relative;
}

.front-recent__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
	gap: 2rem;
	align-items: start;
}

.front-recent__more { text-align: center; margin-top: 2.5rem; }

/* ==========================================================================
   Sidebar & widgets
   ========================================================================== */

.widget-area .widget { margin-bottom: 2.5rem; }

.widget-title {
	font-size: 1.05rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	border-bottom: 2px solid var(--pj-accent);
	padding-bottom: 0.5rem;
	margin-bottom: 1rem;
}

.widget ul { list-style: none; margin: 0; padding: 0; }
.widget ul li { padding: 0.4rem 0; border-bottom: 1px solid var(--pj-border); }
.widget ul li:last-child { border-bottom: 0; }
.widget a { text-decoration: none; color: var(--pj-text); }
.widget a:hover { color: var(--pj-color-ink-hover); }

/* ==========================================================================
   Comments
   ========================================================================== */

.comments-area { max-width: var(--pj-content-width); margin: 3rem auto 0; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-body {
	background: var(--pj-surface);
	border: 1px solid var(--pj-border);
	border-radius: var(--pj-radius);
	padding: 1.25rem;
	margin-bottom: 1.25rem;
}
.comment-list .children { list-style: none; margin-left: 1.5rem; }
.comment-author { font-family: var(--pj-font-head); font-weight: 600; }
.comment-metadata { font-size: 0.8rem; color: var(--pj-text-muted); }

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea,
.search-field {
	width: 100%;
	padding: 0.7em 0.9em;
	border: 1px solid var(--pj-border);
	border-radius: var(--pj-radius);
	background: var(--pj-surface);
	font-family: inherit;
	font-size: 1rem;
	color: var(--pj-text);
}

.comment-form input:focus,
.comment-form textarea:focus,
.search-field:focus { outline: none; border-color: var(--pj-color-ink); box-shadow: 0 0 0 3px rgba(51, 53, 58, 0.18); }

.comment-form p { margin-bottom: 1rem; }

/* ==========================================================================
   Search form
   ========================================================================== */

.search-form { display: flex; gap: 0.5rem; }
.search-form .search-submit { flex-shrink: 0; }

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination { margin-top: 2rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.pagination .page-numbers {
	font-family: var(--pj-font-head);
	display: inline-block;
	padding: 0.5em 0.9em;
	border: 1px solid var(--pj-border);
	border-radius: var(--pj-radius);
	text-decoration: none;
	color: var(--pj-text);
}
.pagination .page-numbers.current { background: var(--pj-accent); color: var(--pj-on-accent); border-color: var(--pj-accent); }
.pagination .page-numbers:hover { background: var(--pj-bg-alt); }
.pagination .page-numbers.current:hover { background: var(--pj-accent); }

.post-navigation { margin-top: 3rem; }
.post-navigation .nav-links { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.post-navigation a { text-decoration: none; font-family: var(--pj-font-head); }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
	background: var(--pj-color-greige);
	color: var(--pj-color-ink);
	padding-block: clamp(2.5rem, 6vw, 4rem) 1.5rem;
	margin-top: clamp(3rem, 8vw, 6rem);
}

.site-footer a { color: var(--pj-color-ink); }
.site-footer a:hover { color: var(--pj-color-ink-hover); }

.footer-widgets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: 2.5rem;
	margin-bottom: 2.5rem;
}

.site-footer .widget-title { color: var(--pj-color-ink); border-color: rgba(51, 53, 58, 0.35); }
.site-footer .widget ul li { border-bottom-color: rgba(51, 53, 58, 0.15); }

.site-info {
	border-top: 1px solid rgba(51, 53, 58, 0.2);
	padding-top: 1.5rem;
	font-size: 0.85rem;
	font-family: var(--pj-font-head);
	text-align: center;
	opacity: 0.85;
}

/* ==========================================================================
   Utility / accessibility
   ========================================================================== */

.no-results { text-align: center; padding-block: 3rem; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
