/*
Theme Name: Keanu Pro
Theme URI: https://romanfink.com/keanu/
Author: Roman Fink
Author URI: https://romanfink.com
Description: Keanu Pro is a card-based ("bento") block theme for personal websites and portfolios: a stack of rounded cards on a soft canvas, a menu that highlights the section you are reading, and ready-made pages for designers, developers, architects, yoga teachers, podcast hosts, illustrators and writers. Seven home layouts, case study pages, a resume, a link-in-bio page and a coming soon page, more than 60 patterns, nine color palettes and three font pairings. Full Site Editing, no code required.
Requires at least: 7.0
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: keanu-pro
Tags: one-column, grid-layout, editor-style, featured-images, full-site-editing, block-patterns, block-styles, style-variations, wide-blocks, translation-ready, blog, portfolio
*/

/* Font pairings ship only the weights they have: no faux bold (Instrument Serif has just 400). */
h1, h2, h3, h4, h5, h6, .wp-block-heading {
	font-synthesis-weight: none;
}

:root {
	--keanu-gap: 0.5rem;
}

html {
	scroll-behavior: smooth;
}

:target,
[id] {
	scroll-margin-top: 6rem;
}

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

a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

a:where(:not(.wp-element-button)):hover {
	text-decoration-color: var(--wp--preset--color--accent);
	text-decoration-thickness: 2px;
}

a:has(> img) {
	text-decoration: none;
}

h1, h2, h3, h4, h5, h6, blockquote, figcaption, p {
	text-wrap: pretty;
}

/* --- Page frame: a stack of cards on the canvas --- */

.wp-site-blocks {
	display: flex;
	flex-direction: column;
	gap: var(--keanu-gap);
	min-height: 100vh;
	min-height: 100dvh;
	padding-block: var(--keanu-gap);
}

.wp-site-blocks > * {
	margin-block: 0;
}

.wp-site-blocks > main,
.wp-site-blocks > .wp-block-group:not(header, footer) {
	flex-grow: 1;
}

/* Site Editor: the same rhythm between template parts. */
.is-root-container:has(> .wp-block-template-part) {
	padding-block: var(--keanu-gap);
}

.is-root-container:has(> .wp-block-template-part) > * + * {
	margin-block-start: var(--keanu-gap);
}

/* --- Sticky header card --- */

.wp-site-blocks:not(.is-root-container) > header {
	position: sticky;
	top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--keanu-gap));
	z-index: 30;
}

@media (max-width: 600px) {
	.admin-bar .wp-site-blocks:not(.is-root-container) > header {
		top: var(--keanu-gap);
	}
}

.keanu-header {
	box-shadow: 0 12px 28px -20px rgb(0 0 0 / 0.35);
}

/* --- Highlight navigation (block style): plain links, the current one sits in an accent pill --- */

.wp-block-navigation.is-style-highlight .wp-block-navigation-item__content {
	padding: 0.45em 0.95em;
	border-radius: var(--wp--preset--border-radius--pill);
	line-height: 1.25;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.wp-block-navigation.is-style-highlight .wp-block-navigation-item__content:hover {
	background-color: var(--wp--preset--color--inset);
}

.wp-block-navigation.is-style-highlight .current-menu-item > .wp-block-navigation-item__content,
.wp-block-navigation.is-style-highlight .is-in-view > .wp-block-navigation-item__content {
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--on-accent);
}

/* Menu and Close buttons of the mobile overlay. */
.keanu-header .wp-block-navigation__responsive-container-open,
.wp-block-navigation-overlay-close {
	padding: 0.5em 1.1em;
	border-radius: var(--wp--preset--border-radius--pill);
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--surface);
	line-height: 1.25;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.keanu-header .wp-block-navigation__responsive-container-open:hover,
.wp-block-navigation-overlay-close:hover {
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--on-accent);
}

/* Buttons on an accent card: hover to white instead of the accent. */
.has-accent-background-color .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--primary);
}

/* Buttons do not inherit the font by default. */
.wp-block-navigation-overlay-close {
	font: inherit;
	line-height: 1.25;
}

/* Custom navigation overlay fills the viewport. */
.wp-block-navigation__responsive-container.is-menu-open .keanu-overlay {
	min-height: 100dvh;
}

/* --- Fill height (image block style): the photo stretches to the height of its column --- */

.wp-block-image.is-style-fill {
	height: 100%;
	margin-block: 0;
}

.wp-block-image.is-style-fill img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* --- Accordion: details blocks with a round plus / minus --- */

.wp-block-details > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	list-style: none;
	font-weight: 500;
	cursor: pointer;
}

.wp-block-details > summary::-webkit-details-marker {
	display: none;
}

.wp-block-details > summary::after {
	content: "";
	flex-shrink: 0;
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 50%;
	background:
		linear-gradient(currentColor, currentColor) center / 0.75rem 1.5px no-repeat,
		linear-gradient(currentColor, currentColor) center / 1.5px 0.75rem no-repeat,
		var(--wp--preset--color--surface);
	transition: transform 0.3s ease, background-color 0.2s ease;
}

.wp-block-details[open] > summary::after {
	background:
		linear-gradient(var(--wp--preset--color--on-accent), var(--wp--preset--color--on-accent)) center / 0.75rem 1.5px no-repeat,
		var(--wp--preset--color--accent);
	transform: rotate(180deg);
}

.wp-block-details > summary + * {
	margin-block-start: 0.5rem;
}

/* --- Status dot --- */

/* Labels and the status line on coloured cards follow the card's own text colour. */
.has-background .is-style-label {
	color: inherit;
	opacity: 0.72;
}

.has-accent-background-color .is-style-status::before {
	background-color: currentColor;
	animation: none;
}

@keyframes keanu-pulse {
	0% {
		box-shadow: 0 0 0 0 color-mix(in srgb, var(--wp--preset--color--accent) 60%, transparent);
	}
	70%,
	100% {
		box-shadow: 0 0 0 0.45em color-mix(in srgb, var(--wp--preset--color--accent) 0%, transparent);
	}
}

/* --- Photo card (cover block style): the photo is a rounded card, content sits in a corner --- */

.wp-block-cover.is-style-photo-card {
	padding: var(--wp--preset--spacing--10);
	border-radius: var(--wp--preset--border-radius--large);
	overflow: hidden;
}

.wp-block-cover.is-style-photo-card .is-style-card {
	border-radius: var(--wp--preset--border-radius--medium);
}

/* --- More link (details block style): a quiet "More" that reveals the rest of the text --- */

.wp-block-details.is-style-more {
	padding: 0;
	border-radius: 0;
	background: none;
}

.wp-block-details.is-style-more > summary {
	display: inline-flex;
	justify-content: flex-start;
	gap: 0.4em;
	color: var(--wp--preset--color--secondary);
	font-weight: 400;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.wp-block-details.is-style-more > summary:hover {
	color: var(--wp--preset--color--primary);
	text-decoration-color: var(--wp--preset--color--accent);
}

.wp-block-details.is-style-more > summary::after {
	content: "↓";
	width: auto;
	height: auto;
	border-radius: 0;
	background: none;
	text-decoration: none;
	transform: none;
}

.wp-block-details.is-style-more[open] > summary::after {
	content: "↑";
	background: none;
	transform: none;
}

.wp-block-details.is-style-more > summary + * {
	margin-block-start: var(--wp--preset--spacing--40);
}

/* --- A header card inside a Landing page stays at the top while scrolling --- */

.wp-block-post-content > .keanu-header,
.wp-block-post-content > * > .keanu-header {
	position: sticky;
	top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--keanu-gap));
	z-index: 30;
}

@media (max-width: 600px) {
	.admin-bar .wp-block-post-content .keanu-header {
		top: var(--keanu-gap);
	}
}

/* --- Mobile menu of a page header card (the default overlay, styled as a card) --- */

.wp-block-navigation.keanu-page-nav:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--keanu-gap);
	background-color: var(--wp--preset--color--canvas);
	color: var(--wp--preset--color--primary);
	--navigation-layout-justification-setting: flex-start;
	--navigation-layout-justify: flex-start;
}

.wp-block-navigation.keanu-page-nav .is-menu-open .wp-block-navigation__responsive-close,
.wp-block-navigation.keanu-page-nav .is-menu-open .wp-block-navigation__responsive-dialog {
	min-height: 100%;
}

.wp-block-navigation.keanu-page-nav .is-menu-open .wp-block-navigation__responsive-dialog {
	position: relative;
	padding: var(--wp--preset--spacing--40);
	border-radius: var(--wp--preset--border-radius--large);
	background-color: var(--wp--preset--color--surface);
}

.wp-block-navigation.keanu-page-nav .is-menu-open .wp-block-navigation__responsive-container-close {
	top: var(--wp--preset--spacing--20);
	right: var(--wp--preset--spacing--20);
	padding: 0.5em 1.1em;
	border-radius: var(--wp--preset--border-radius--pill);
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--on-accent);
	font: inherit;
	line-height: 1.25;
}

.wp-block-navigation.keanu-page-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	padding-top: 4rem;
	align-items: flex-start;
}

.wp-block-navigation.keanu-page-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container {
	align-items: flex-start;
	gap: 0.375rem;
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 500;
	letter-spacing: -0.03em;
}

/* --- Featured post without an image: the text takes the whole row --- */

.wp-block-post-template .wp-block-column:not(:has(*)) {
	display: none;
}

.wp-block-post-template .wp-block-column:not(:has(*)) ~ .wp-block-column {
	flex-basis: 100% !important;
}

/* --- Buttons in a row never squeeze their labels --- */

.is-layout-flex > .wp-block-buttons {
	flex-shrink: 0;
}

/* --- Lists of inset rows (projects, posts) --- */

.keanu-rows .wp-block-post-template {
	display: flex;
	flex-direction: column;
	gap: var(--keanu-gap);
}

.keanu-rows .wp-block-post-template > li {
	margin-block: 0;
}

/* --- Single post: hide cards that would render empty --- */

.keanu-post-nav:not(:has(a)),
.wp-block-comments:not(:has(.wp-block-comment-template, .comment-respond)) {
	display: none;
}

/* --- Reduced motion --- */

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}
}
