/*
Theme Name: Sharp Thoughts
Theme URI: https://example.com/sharp-thoughts
Author: Telex
Description: An ink-on-paper essay blog built for long-form and short-form writing across philosophy, politics, and business. Restrained palette, generous whitespace, sharp typographic hierarchy. No decoration — only structure.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sharp-thoughts
Tags: blog, one-column, custom-colors, custom-menu, editor-style, block-patterns, full-site-editing, wide-blocks
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 7.4
*/

/* =============================================
   Reset & Base
   ============================================= */

:root,
body,
.wp-site-blocks {
	overflow: visible;
}

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

::selection {
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--background);
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-variation-settings: "opsz" 12;
}

/* =============================================
   Sticky Header
   ============================================= */

.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 100;
}

.wp-site-blocks > header.wp-block-template-part::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	transition: background 0.4s ease;
}

body.is-scrolled .wp-site-blocks > header.wp-block-template-part::before {
	background: var(--wp--preset--color--background);
	box-shadow: 0 1px 0 var(--wp--preset--color--rule);
}

/* Header inner group transitions */
.site-header {
	transition: padding 0.25s ease;
}

/* =============================================
   Hide on scroll down, show on scroll up
   ============================================= */

@media (prefers-reduced-motion: no-preference) {
	.wp-site-blocks > header.wp-block-template-part {
		transition: transform 0.3s ease;
	}
	body.header-hidden .wp-site-blocks > header.wp-block-template-part {
		transform: translateY(-100%);
	}
}

/* =============================================
   Mobile Hamburger Overlay
   ============================================= */

.wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	gap: var(--wp--preset--spacing--40);
	align-items: flex-start;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-size: var(--wp--preset--font-size--large);
}

/* =============================================
   Typography — Optical Sizing & Weights
   ============================================= */

/* Body prose: Fraunces at opsz 12 for text sizes */
.wp-site-blocks,
.entry-content,
.wp-block-post-content {
	font-variation-settings: "opsz" 12;
}

/* Display headings: crank optical size up */
h1,
.wp-block-post-title {
	font-variation-settings: "opsz" 144, "wght" 300;
}

h2 {
	font-variation-settings: "opsz" 72, "wght" 300;
}

h3 {
	font-variation-settings: "opsz" 48, "wght" 300;
}

h4 {
	font-variation-settings: "opsz" 36, "wght" 400;
}

/* =============================================
   Link Styles
   ============================================= */

a {
	transition: color 0.2s ease;
	text-underline-offset: 0.15em;
	text-decoration-thickness: 1px;
}

a:hover {
	text-decoration-thickness: 2px;
}

/* Post title links — no underline, accent on hover */
.wp-block-post-title a {
	text-decoration: none;
}

.wp-block-post-title a:hover {
	color: var(--wp--preset--color--accent);
}

/* =============================================
   Navigation Polish
   ============================================= */

.wp-block-navigation .wp-block-navigation-item__content {
	transition: color 0.2s ease;
}

.wp-block-navigation .wp-block-navigation-item.current-menu-item > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--accent);
}

/* =============================================
   Button Polish
   ============================================= */

.wp-block-button .wp-block-button__link {
	transition: background-color 0.2s ease, color 0.2s ease;
}

/* Outline style buttons */
.wp-block-button.is-style-outline .wp-block-button__link {
	border: 2px solid var(--wp--preset--color--text);
	background: transparent;
	color: var(--wp--preset--color--text);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--accent);
	background: transparent;
	color: var(--wp--preset--color--accent);
}

/* =============================================
   Blockquote & Pullquote
   ============================================= */

.wp-block-quote p {
	font-variation-settings: "opsz" 36;
}

.wp-block-quote cite,
.wp-block-pullquote cite {
	font-family: var(--wp--preset--font-family--secondary);
	font-size: var(--wp--preset--font-size--small);
	font-style: normal;
	font-weight: 400;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
	display: block;
	margin-top: var(--wp--preset--spacing--20);
}

.wp-block-pullquote p {
	font-variation-settings: "opsz" 48, "wght" 300;
}

/* =============================================
   Separator
   ============================================= */

.wp-block-separator {
	border: none;
	border-top: 1px solid var(--wp--preset--color--rule);
	opacity: 1;
}

.wp-block-separator.is-style-wide {
	width: 100%;
}

.wp-block-separator:not(.is-style-wide):not(.is-style-dots) {
	max-width: 120px;
	margin-left: 0;
}

/* Dots style */
.wp-block-separator.is-style-dots::before {
	color: var(--wp--preset--color--rule);
}

/* =============================================
   Post Format: Aside
   ============================================= */

.format-aside .wp-block-post-content,
.post-format-aside {
	font-style: italic;
	font-weight: 400;
	font-variation-settings: "opsz" 12, "wght" 400;
	padding-left: var(--wp--preset--spacing--40);
	border-left: 2px solid var(--wp--preset--color--rule);
}

/* =============================================
   Post Format: Quote
   ============================================= */

.format-quote .wp-block-post-content,
.post-format-quote {
	font-size: var(--wp--preset--font-size--x-large);
	font-style: italic;
	font-weight: 300;
	text-align: center;
	font-variation-settings: "opsz" 48, "wght" 300;
}

/* =============================================
   Post Meta & Taxonomy Styling
   ============================================= */

.wp-block-post-date {
	font-variant-numeric: tabular-nums;
}

.wp-block-post-terms a {
	text-decoration: none;
	transition: color 0.2s ease;
}

.wp-block-post-terms a:hover {
	color: var(--wp--preset--color--text);
}

/* Tag pills — when used in a tag-cloud or inline */
.wp-block-tag-cloud a {
	font-family: var(--wp--preset--font-family--secondary);
	font-size: var(--wp--preset--font-size--small) !important;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--wp--preset--color--muted);
	transition: color 0.2s ease;
}

.wp-block-tag-cloud a:hover {
	color: var(--wp--preset--color--accent);
}

/* =============================================
   Post Content — Reading Rhythm
   ============================================= */

.wp-block-post-content > * + * {
	margin-top: var(--wp--preset--spacing--30);
}

.wp-block-post-content > h2,
.wp-block-post-content > h3 {
	margin-top: var(--wp--preset--spacing--50);
}

.wp-block-post-content > h2 + *,
.wp-block-post-content > h3 + * {
	margin-top: var(--wp--preset--spacing--20);
}

/* Tight leading for long body prose */
.wp-block-post-content > p {
	line-height: 1.45;
	font-variation-settings: "opsz" 12, "wght" 400;
}

/* =============================================
   Lists inside Post Content
   ============================================= */

.wp-block-post-content ul,
.wp-block-post-content ol {
	padding-left: 1.25em;
}

.wp-block-post-content li + li {
	margin-top: 0.25em;
}

/* =============================================
   Code & Preformatted
   ============================================= */

.wp-block-code,
.wp-block-preformatted {
	font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;
	border: 1px solid var(--wp--preset--color--rule);
}

.wp-block-code code {
	font-size: inherit;
}

/* Inline code */
:where(.wp-block-post-content) code {
	font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;
	font-size: 0.875em;
	background: var(--wp--preset--color--surface);
	padding: 0.15em 0.35em;
	border-radius: 2px;
}

/* =============================================
   Categories Block
   ============================================= */

.wp-block-categories-list {
	list-style: none;
	padding-left: 0;
}

.wp-block-categories-list li {
	font-family: var(--wp--preset--font-family--secondary);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding-block: var(--wp--preset--spacing--20);
	border-bottom: 1px solid var(--wp--preset--color--rule);
}

.wp-block-categories-list li:last-child {
	border-bottom: none;
}

.wp-block-categories-list a {
	color: var(--wp--preset--color--text);
	text-decoration: none;
	transition: color 0.2s ease;
}

.wp-block-categories-list a:hover {
	color: var(--wp--preset--color--accent);
}

/* =============================================
   Images — No Frills
   ============================================= */

.wp-block-image img {
	display: block;
}

.wp-block-image figcaption {
	font-family: var(--wp--preset--font-family--secondary);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
	margin-top: var(--wp--preset--spacing--20);
	letter-spacing: 0.05em;
}

/* =============================================
   Hero Statement (homepage masthead)
   ============================================= */

.hero-statement {
	font-variation-settings: "opsz" 144, "wght" 300;
}

/* =============================================
   Post Filing — Format Labels & Meta
   ============================================= */

.post-filing {
	font-family: var(--wp--preset--font-family--secondary);
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.post-format-label {
	color: var(--wp--preset--color--accent);
	font-weight: 600;
}

.post-meta-inline {
	color: var(--wp--preset--color--muted);
	font-weight: 400;
}

/* =============================================
   Post Deck (lede / argument summary)
   ============================================= */

.post-deck {
	font-family: var(--wp--preset--font-family--primary);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.75;
	font-weight: 400;
	color: var(--wp--preset--color--text);
}

/* =============================================
   Post Navigation Links
   ============================================= */

.wp-block-post-navigation-link a {
	text-decoration: none;
	transition: color 0.2s ease;
}

.wp-block-post-navigation-link a:hover {
	color: var(--wp--preset--color--accent);
}

/* =============================================
   Hairline Rules — Utility
   ============================================= */

.hairline-top {
	border-top: 1px solid var(--wp--preset--color--rule);
}

.hairline-bottom {
	border-bottom: 1px solid var(--wp--preset--color--rule);
}

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

footer.wp-block-template-part {
	border-top: 1px solid var(--wp--preset--color--rule);
}

footer.wp-block-template-part a {
	color: var(--wp--preset--color--muted);
	text-decoration: none;
	transition: color 0.2s ease;
}

footer.wp-block-template-part a:hover {
	color: var(--wp--preset--color--text);
}

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

.wp-block-query-pagination {
	font-family: var(--wp--preset--font-family--secondary);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.wp-block-query-pagination a {
	color: var(--wp--preset--color--text);
	text-decoration: none;
	transition: color 0.2s ease;
}

.wp-block-query-pagination a:hover {
	color: var(--wp--preset--color--accent);
}

.wp-block-query-pagination .wp-block-query-pagination-numbers .page-numbers {
	padding: 0.25em 0.5em;
}

.wp-block-query-pagination .wp-block-query-pagination-numbers .page-numbers.current {
	color: var(--wp--preset--color--accent);
}

/* =============================================
   Search Block
   ============================================= */

.wp-block-search__input {
	font-family: var(--wp--preset--font-family--secondary);
	font-size: var(--wp--preset--font-size--small);
	border: 1px solid var(--wp--preset--color--rule);
	background: var(--wp--preset--color--background);
	color: var(--wp--preset--color--text);
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
}

.wp-block-search__input:focus {
	border-color: var(--wp--preset--color--text);
	outline: none;
}

.wp-block-search__button {
	font-family: var(--wp--preset--font-family--secondary);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	background: var(--wp--preset--color--text);
	color: var(--wp--preset--color--button-text);
	border: none;
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40);
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.wp-block-search__button:hover {
	background: var(--wp--preset--color--accent);
}

/* =============================================
   Table
   ============================================= */

.wp-block-table table {
	border-collapse: collapse;
	width: 100%;
}

.wp-block-table td,
.wp-block-table th {
	border-bottom: 1px solid var(--wp--preset--color--rule);
	padding: var(--wp--preset--spacing--20);
	text-align: left;
}

.wp-block-table th {
	font-family: var(--wp--preset--font-family--secondary);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}

/* =============================================
   Scroll Progress Bar (CSS scroll-driven)
   ============================================= */

@media (prefers-reduced-motion: no-preference) {
	@supports (animation-timeline: scroll()) {
		.scroll-progress {
			position: fixed;
			top: 0;
			left: 0;
			right: 0;
			height: 2px;
			background: var(--wp--preset--color--accent);
			transform-origin: left center;
			transform: scaleX(0);
			z-index: 1000;
			animation: scroll-progress-grow linear;
			animation-timeline: scroll(root);
		}
		@keyframes scroll-progress-grow {
			from { transform: scaleX(0); }
			to   { transform: scaleX(1); }
		}
	}
}

/* ---------- Loop layout utilities ---------- */
/* These classes are wired to the wp:query blocks emitted by content/pages and
   templates. Do not rename. Tune colours and spacing to theme.json tokens. */

/* Horizontal scrollable rail */
.wp-block-query.is-style-loop-rail .wp-block-post-template {
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
	padding-bottom: var(--wp--preset--spacing--20);
}
.wp-block-query.is-style-loop-rail .wp-block-post-template > * {
	flex: 0 0 320px;
	scroll-snap-align: start;
}

/* Compact list with hairline row dividers */
.wp-block-query.is-style-loop-list .wp-block-post-template > * {
	border-bottom: 1px solid var(--wp--preset--color--rule);
	padding-block: var(--wp--preset--spacing--30);
}
.wp-block-query.is-style-loop-list .wp-block-post-template > *:last-child {
	border-bottom: 0;
}

/* Zigzag — flip the columns inside every even entry */
.wp-block-query.is-style-loop-zigzag .wp-block-post-template > *:nth-child(even) .wp-block-columns {
	flex-direction: row-reverse;
}

/* Timeline — vertical line with node markers per entry */
.wp-block-query.is-style-loop-timeline .wp-block-post-template {
	position: relative;
	padding-inline-start: 2.5rem;
}
.wp-block-query.is-style-loop-timeline .wp-block-post-template::before {
	content: '';
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0.5rem;
	width: 2px;
	background: var(--wp--preset--color--rule);
	opacity: 1;
}
.wp-block-query.is-style-loop-timeline .wp-block-post-template > * {
	position: relative;
}
.wp-block-query.is-style-loop-timeline .wp-block-post-template > *::before {
	content: '';
	position: absolute;
	inset-inline-start: -2.25rem;
	inset-block-start: 0.6rem;
	width: 1rem;
	height: 1rem;
	border: 2px solid var(--wp--preset--color--muted);
	border-radius: 50%;
	background: var(--wp--preset--color--background);
}

/* Magazine — first child spans 2 columns of the grid */
.wp-block-query.is-style-loop-magazine .wp-block-post-template > *:first-child {
	grid-column: span 2;
}
@media (max-width: 600px) {
	.wp-block-query.is-style-loop-magazine .wp-block-post-template > *:first-child {
		grid-column: auto;
	}
}

/* =============================================
   Responsive Tweaks
   ============================================= */

@media (max-width: 781px) {
	h1,
	.hero-statement {
		letter-spacing: -0.01em;
	}

	.wp-block-post-content > h2,
	.wp-block-post-content > h3 {
		margin-top: var(--wp--preset--spacing--40);
	}
}

@media (max-width: 480px) {
	.wp-block-navigation__responsive-container.is-menu-open {
		padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--30);
	}
}