/*
Theme Name: DomoCraft
Theme URI: https://example.com/domocraft
Author: Telex
Description: A modern, clean, and casual WordPress block theme for DIY home automation projects. Features a fresh lime accent, bold uppercase headings, and a relaxed maker-workshop aesthetic.
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: domocraft
Tags: block-patterns, full-site-editing, wide-blocks, custom-colors, custom-fonts, editor-style
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.0
*/

/* ---------- Base & root fixes ---------- */

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

/* Dot-grid background matching the design reference */
body {
	background-image: radial-gradient(
		circle at center,
		var(--wp--preset--color--surface) 1.5px,
		transparent 1.5px
	);
	background-size: 32px 32px;
}

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

.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 100;
	background-color: var(--wp--preset--color--background);
	/* Let the dot grid show faintly through when scrolled */
	background-image: radial-gradient(
		circle at center,
		var(--wp--preset--color--surface) 1.5px,
		transparent 1.5px
	);
	background-size: 32px 32px;
}

/* ---------- Typography polish ---------- */

/* Casual letter-spacing for body to loosen the feel */
body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Slightly relax heading uppercase tracking so it breathes */
h1, h2, h3, h4, h5, h6,
.wp-block-heading {
	letter-spacing: -0.03em;
}

/* Sub-headings at h4–h6 can drop the uppercase for a friendlier look */
h4, h5, h6 {
	text-transform: none;
	letter-spacing: -0.01em;
}

/* Paragraphs inside constrained groups get comfortable measure */
.wp-block-group.is-layout-constrained > p {
	max-width: 65ch;
}

/* ---------- Link styles ---------- */

a {
	text-decoration: none;
	text-underline-offset: 0.2em;
	transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
	text-decoration-color: var(--wp--preset--color--accent-lime);
}

/* Site title link — no underline ever */
.wp-block-site-title a,
.wp-block-site-title a:hover {
	text-decoration: none;
}

/* ---------- Button treatments ---------- */

.wp-block-button .wp-block-button__link {
	transition: background-color 0.25s ease, color 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
	font-weight: 500;
	letter-spacing: 0.01em;
}

.wp-block-button .wp-block-button__link:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(26, 28, 24, 0.12);
}

.wp-block-button .wp-block-button__link:active {
	transform: translateY(0);
	box-shadow: none;
}

/* Outline style button */
.wp-block-button.is-style-outline .wp-block-button__link {
	border-width: 2px;
	border-style: solid;
	background: transparent;
}

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

/* Nav-style bordered button (for header CTAs) */
.btn-nav,
.is-style-outline .wp-block-button__link {
	border-color: var(--wp--preset--color--text-main);
}

/* ---------- Image treatments ---------- */

.wp-block-image img,
.wp-block-cover img {
	filter: contrast(1.05) saturate(1.1);
	transition: transform 0.4s ease, filter 0.4s ease;
}

.wp-block-image:hover img {
	transform: scale(1.02);
}

/* Cards / post-featured images — rounded and shadowed */
.wp-block-post-featured-image img {
	border-radius: 24px;
	filter: contrast(1.05) saturate(1.1);
	transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.wp-block-post-featured-image:hover img {
	transform: translateY(-4px);
	box-shadow:
		0 20px 40px rgba(26, 28, 24, 0.1),
		0 8px 16px rgba(26, 28, 24, 0.06);
}

/* Cover block images keep their object-fit */
.wp-block-cover img.wp-block-cover__image-background {
	border-radius: 0;
}

/* ---------- Marker / highlight accent ---------- */

.marker,
mark,
.has-accent-lime-background-color {
	position: relative;
}

mark {
	background: transparent;
	color: inherit;
	position: relative;
	display: inline;
}

mark::after {
	content: '';
	position: absolute;
	bottom: 8%;
	left: -2%;
	right: -4%;
	height: 35%;
	background-color: var(--wp--preset--color--accent-lime);
	z-index: -1;
	transform: rotate(-1deg);
	border-radius: 2px;
	mix-blend-mode: multiply;
}

/* ---------- Navigation ---------- */

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

.wp-block-navigation a:hover {
	color: var(--wp--preset--color--icon-ink);
	text-decoration: none;
}

/* ---------- Separator ---------- */

.wp-block-separator {
	border-color: var(--wp--preset--color--surface);
	opacity: 1;
}

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

/* ---------- Quote ---------- */

.wp-block-quote {
	border-left-color: var(--wp--preset--color--accent-lime);
}

.wp-block-quote cite {
	font-style: normal;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--text-body);
	opacity: 0.7;
}

/* ---------- Code block ---------- */

.wp-block-code {
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.7;
	overflow-x: auto;
}

.wp-block-code code {
	font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* ---------- Post template cards ---------- */

.wp-block-post-template .wp-block-post {
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wp-block-post-template .wp-block-post:hover {
	transform: translateY(-4px);
}

/* Post titles as links — match the casual feel */
.wp-block-post-title a {
	text-decoration: none;
	color: var(--wp--preset--color--text-main);
	transition: color 0.2s ease;
}

.wp-block-post-title a:hover {
	color: var(--wp--preset--color--icon-ink);
	text-decoration: none;
}

/* Post date / meta */
.wp-block-post-date,
.wp-block-post-terms {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--text-body);
	opacity: 0.7;
}

/* ---------- Tag / term chips ---------- */

.wp-block-post-terms a {
	display: inline-block;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--text-main);
	padding: 0.2em 0.7em;
	border-radius: 6px;
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
	transition: background-color 0.2s ease;
}

.wp-block-post-terms a:hover {
	background: var(--wp--preset--color--accent-lime);
	text-decoration: none;
}

/* ---------- Footer credit ---------- */

footer .wp-block-template-part a,
footer a {
	text-underline-offset: 0.15em;
}

/* ---------- Columns responsive ---------- */

@media (max-width: 781px) {
	.wp-block-columns {
		gap: var(--wp--preset--spacing--30) !important;
	}
}

/* ---------- Cover block overlay softness ---------- */

.wp-block-cover::after {
	border-radius: inherit;
}

/* ---------- Accent dot decoration (utility class for hero sections) ---------- */

.accent-dot {
	position: absolute;
	width: 12px;
	height: 12px;
	background-color: var(--wp--preset--color--accent-lime);
	border-radius: 50%;
	box-shadow: 0 0 20px var(--wp--preset--color--accent-lime);
	pointer-events: none;
}

/* ---------- Hero visual shadow style ---------- */

.hero-visual,
.wp-block-image.is-style-shadowed img {
	box-shadow:
		0 30px 60px rgba(26, 28, 24, 0.12),
		0 10px 20px rgba(26, 28, 24, 0.05);
}

/* ---------- Sketch items (icon + label flex) ---------- */

.sketch-items {
	display: flex;
	gap: var(--wp--preset--spacing--40);
	flex-wrap: wrap;
}

.sketch-item {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	color: var(--wp--preset--color--text-main);
	opacity: 0.8;
}

.sketch-item svg {
	width: 32px;
	height: 32px;
	stroke: var(--wp--preset--color--icon-ink);
	stroke-width: 1.2;
	fill: none;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ---------- Selection color ---------- */

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

/* ---------- Focus outlines (accessibility) ---------- */

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

/* ---------- Scrollbar styling ---------- */

::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}

::-webkit-scrollbar-track {
	background: var(--wp--preset--color--background);
}

::-webkit-scrollbar-thumb {
	background: var(--wp--preset--color--surface);
	border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
	background: var(--wp--preset--color--text-body);
}

/* ---------- 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--surface);
	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--surface);
}
.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--accent-lime);
	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;
	}
}