/*
Theme Name: pu43x
Theme URI: https://www.pu43x.co.uk
Author: Gareth Davies
Description: Clean, modern personal site and notebook theme for pu43x.co.uk.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
Version: 0.3.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pu43x
*/

/* Most styling lives in theme.json. This file holds what it can't express. */

:root {
	--pu43x-radius: 12px;
}

body {
	-webkit-font-smoothing: antialiased;
	font-feature-settings: "cv11", "ss01";
}

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

:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
	border-radius: 4px;
}

/* Header */
.pu43x-header {
	position: sticky;
	top: 0;
	z-index: 10;
	background: rgba(255, 255, 255, 0.9);
	backdrop-filter: saturate(180%) blur(8px);
}

.admin-bar .pu43x-header {
	top: var(--wp-admin--admin-bar--height, 32px);
}

.pu43x-header .wp-block-navigation a,
.pu43x-footer .wp-block-navigation a {
	color: var(--wp--preset--color--muted);
}

.wp-block-navigation a:hover,
.wp-block-navigation a[aria-current="page"] {
	color: var(--wp--preset--color--contrast) !important;
	text-decoration: none;
}

/* Card (registered as the "panel" style). */
.is-style-panel {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--pu43x-radius);
	padding: var(--wp--preset--spacing--40);
	box-shadow: var(--wp--preset--shadow--soft);
}

.is-style-panel > :first-child {
	margin-top: 0;
}

/* Eyebrow (registered as the "label" style): small heading above a title. */
.is-style-label {
	font-size: 0.8125rem !important;
	font-weight: 600 !important;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
	margin-bottom: 0.5rem;
}

/* Badge: soft status pill. */
.is-style-badge {
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1;
	padding: 0.4rem 0.65rem;
	border-radius: 999px;
	background: var(--wp--preset--color--accent-soft);
	color: var(--wp--preset--color--accent);
}

/* Outline button: neutral, for the secondary action. */
.wp-block-button.is-style-outline .wp-block-button__link {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	border: 1px solid var(--wp--preset--color--border);
	box-shadow: var(--wp--preset--shadow--soft);
}

.wp-block-button__link {
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wp-block-button__link:hover {
	text-decoration: none;
	transform: translateY(-1px);
}

/* Home hero */
.pu43x-hero {
	align-items: center;
	padding-top: var(--wp--preset--spacing--40);
}

.pu43x-hero-title {
	margin-top: 0;
	margin-bottom: 0.5rem;
}

.pu43x-hero-role {
	font-size: var(--wp--preset--font-size--large);
	color: var(--wp--preset--color--contrast);
	font-weight: 500;
	margin-top: 0;
}

/* Key / value table (status card). */
.wp-block-table.is-style-kv table {
	border: 0;
	font-size: 0.9375rem;
	width: 100%;
	border-collapse: collapse;
}

.wp-block-table.is-style-kv th,
.wp-block-table.is-style-kv td {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding: 0.7rem 0;
	vertical-align: top;
	text-align: left;
}

.wp-block-table.is-style-kv tr:last-child th,
.wp-block-table.is-style-kv tr:last-child td {
	border-bottom: 0;
}

.wp-block-table.is-style-kv th {
	width: 6.5rem;
	font-weight: 500;
	color: var(--wp--preset--color--muted);
}

.wp-block-table.is-style-kv td {
	color: var(--wp--preset--color--contrast);
}

/* Cards that link somewhere lift on hover. */
.pu43x-doors .wp-block-column,
.pu43x-cards > .is-style-panel {
	transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.pu43x-doors .wp-block-column:hover,
.pu43x-cards > .is-style-panel:hover {
	box-shadow: var(--wp--preset--shadow--lift);
	transform: translateY(-2px);
	border-color: #d0d5dd;
}

.pu43x-doors h3,
.pu43x-cards h3 {
	margin-top: 0.25rem;
	margin-bottom: 0.5rem;
}

.pu43x-doors h3 a,
.pu43x-cards h3 a {
	color: var(--wp--preset--color--contrast);
}

.pu43x-doors h3 a::after {
	content: " →";
	color: var(--wp--preset--color--accent);
}

.pu43x-doors p,
.pu43x-cards p:not(.is-style-badge):not(.is-style-label) {
	color: var(--wp--preset--color--muted);
}

/* Stack line at the bottom of a project card. */
.pu43x-cards .is-style-label:last-child {
	color: var(--wp--preset--color--muted);
	text-transform: none;
	letter-spacing: 0;
	font-weight: 500 !important;
	margin-top: 1rem;
}

/* Experience timeline */
.pu43x-timeline {
	border-left: 2px solid var(--wp--preset--color--border);
	padding-left: var(--wp--preset--spacing--40);
	margin-left: 0.4rem;
}

.pu43x-role {
	position: relative;
	padding-bottom: var(--wp--preset--spacing--40);
}

.pu43x-role::before {
	content: "";
	position: absolute;
	left: calc(-1 * var(--wp--preset--spacing--40) - 0.4rem - 1px);
	top: 0.3rem;
	width: 0.75rem;
	height: 0.75rem;
	border-radius: 50%;
	background: var(--wp--preset--color--base);
	border: 2px solid #98a2b3;
}

.pu43x-role.is-current::before {
	border-color: var(--wp--preset--color--accent);
	background: var(--wp--preset--color--accent);
	box-shadow: 0 0 0 4px var(--wp--preset--color--accent-soft);
}

.pu43x-role .is-style-label {
	color: var(--wp--preset--color--muted);
	text-transform: none;
	letter-spacing: 0;
	font-weight: 500 !important;
	margin-bottom: 0.15rem;
}

.pu43x-role.is-current .is-style-label {
	color: var(--wp--preset--color--accent);
}

.pu43x-role h3 {
	margin-top: 0;
	margin-bottom: 0;
}

.pu43x-role-org {
	color: var(--wp--preset--color--muted);
	margin-top: 0.15rem;
	font-weight: 500;
}

/* Dash list */
ul.is-style-dash {
	list-style: none;
	padding-left: 0;
}

ul.is-style-dash li {
	padding-left: 1.25rem;
	position: relative;
}

ul.is-style-dash li::before {
	content: "";
	position: absolute;
	left: 0.2rem;
	top: 0.75em;
	width: 0.4rem;
	height: 2px;
	background: var(--wp--preset--color--accent);
}

/* Notes list: date | title | category on wide screens. */
.pu43x-notes-list .wp-block-post-template {
	border-top: 1px solid var(--wp--preset--color--border);
}

.pu43x-notes-list .wp-block-post {
	display: grid;
	grid-template-columns: 7rem 1fr auto;
	gap: var(--wp--preset--spacing--30);
	align-items: baseline;
	padding: 1rem 0;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.pu43x-notes-list .wp-block-post > * {
	margin: 0;
}

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

.pu43x-notes-list .wp-block-post-title {
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 600;
	letter-spacing: -0.01em;
}

.pu43x-notes-list .wp-block-post-title a {
	color: var(--wp--preset--color--contrast);
}

.pu43x-notes-list .wp-block-post-title a:hover {
	color: var(--wp--preset--color--accent);
	text-decoration: none;
}

.pu43x-notes-list .wp-block-post-terms a {
	color: var(--wp--preset--color--muted);
}

@media (max-width: 640px) {
	.pu43x-notes-list .wp-block-post {
		grid-template-columns: 1fr;
		gap: 0.2rem;
	}
}

/* Category filter on the notes page. */
.pu43x-category-filter.wp-block-categories {
	list-style: none;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
}

.pu43x-category-filter li a {
	display: inline-block;
	padding: 0.4rem 0.85rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 999px;
	color: var(--wp--preset--color--body);
	background: var(--wp--preset--color--base);
}

.pu43x-category-filter li a:hover,
.pu43x-category-filter li.current-cat a {
	border-color: var(--wp--preset--color--accent);
	background: var(--wp--preset--color--accent-soft);
	color: var(--wp--preset--color--accent);
	text-decoration: none;
}

/* Archive notice on old posts. */
.pu43x-archive-notice {
	box-sizing: border-box;
	font-size: var(--wp--preset--font-size--small);
	color: #7a2e0e;
	background: var(--wp--preset--color--warn-soft);
	border: 1px solid #fedf89;
	border-radius: 10px;
	padding: 0.75rem 1rem;
}

.pu43x-archive-notice span {
	font-weight: 600;
	margin-right: 0.35rem;
}

/* Post meta row */
.pu43x-post-meta {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
}

/* Inline code inside prose. */
:where(p, li, td) code {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.875em;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 5px;
	padding: 0.1em 0.35em;
	color: var(--wp--preset--color--contrast);
}

/* Code shows exactly what was typed: no ligatures. */
code,
pre {
	font-variant-ligatures: none;
	font-feature-settings: "liga" 0, "calt" 0;
}

/* Default tables in articles. */
.wp-block-table thead {
	border-bottom: 0;
}

.wp-block-table:not(.is-style-kv) table {
	border-collapse: collapse;
	font-size: var(--wp--preset--font-size--small);
}

.wp-block-table:not(.is-style-kv) th,
.wp-block-table:not(.is-style-kv) td {
	border: 1px solid var(--wp--preset--color--border);
	padding: 0.6rem 0.85rem;
	text-align: left;
}

.wp-block-table:not(.is-style-kv) th {
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	font-weight: 600;
}

/* Images in posts */
.wp-block-post-content .wp-block-image img {
	border-radius: 10px;
}

/* Older / newer links and pagination */
.wp-block-post-navigation-link,
.wp-block-query-pagination {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
	font-weight: 500;
}

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

@media (max-width: 640px) {
	.pu43x-footer .wp-block-navigation {
		justify-content: flex-start;
		row-gap: 0.25rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
	}
}
