/*
Theme Name: Dreamkeeper
Theme URI: https://www.dreamkeeperintuitiveanimalcommunication.com/
Author: Dreamkeeper Intuitive Animal Communication
Description: Custom block theme for Dreamkeeper Intuitive Animal Communication. Also provides the Site Settings screen, contact shortcodes and block, SMTP and booking form integration (see ADR 0003, 0007, 0008).
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Version: 0.7.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dreamkeeper
*/

/*
 * Design tokens (colors, fonts, sizes, spacing) live in theme.json.
 * This file holds only what theme.json cannot express: the fixed
 * decorative background, the fixed header, and a few layout helpers.
 */

/* ---------- Decorative background ---------- */
/* One fixed, non-interactive layer behind everything: two repeating spiral
   tiles, concentric circles and spirals in the corners, and the angel in the
   centre. Purely decorative, so it is CSS only and invisible to assistive tech. */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background-image:
		url("assets/decor/angel.svg"),
		url("assets/decor/circles.svg"),
		url("assets/decor/spiral-corner.svg"),
		url("assets/decor/circles.svg"),
		url("assets/decor/circles.svg"),
		url("assets/decor/spiral-corner.svg"),
		url("assets/decor/circles.svg"),
		url("assets/decor/spiral-tile-2.svg"),
		url("assets/decor/spiral-tile-1.svg");
	background-repeat:
		no-repeat, no-repeat, no-repeat, no-repeat, no-repeat,
		no-repeat, no-repeat, repeat, repeat;
	background-size:
		220px auto, 182px 182px, 182px 182px, 182px 182px, 182px 182px,
		182px 182px, 182px 182px, 680px 680px, 680px 680px;
	background-position:
		center center,
		left -42px top -42px,
		left -42px top -42px,
		right -42px top -42px,
		left -42px bottom -42px,
		right -42px bottom -42px,
		right -42px bottom -42px,
		340px 340px,
		0 0;
}

/* ---------- Header ---------- */
/* Fixed, with the same dark fade as the static site (kept unchanged at the
   client's request, ADR 0004; the "High contrast" style variation swaps in a
   turquoise fade). */
.dk-site-header {
	position: fixed;
	top: var(--wp-admin--admin-bar--height, 0px);
	left: 0;
	right: 0;
	z-index: 100;
	background: linear-gradient(to bottom, rgba(28, 51, 44, 0.95), rgba(28, 51, 44, 0));
	backdrop-filter: blur(2px);
}

/* Wordmark: "Dreamkeeper·Intuitive Animal Communication". The middle dot is
   decorative, so it keeps the cyan accent. */
.dk-site-header .wp-block-site-tagline::before {
	content: "·";
	color: var(--wp--preset--color--accent);
	font-style: normal;
}

/* The wordmark takes the free space and wraps; the menu button never gets
   pushed off-screen (a bug in the static site at phone widths). */
.dk-site-header.wp-block-group {
	flex-wrap: nowrap;
	gap: 1rem;
}

/* Title and tagline run together as one line of text that wraps like a
   sentence, as the static wordmark does, instead of stacking as flex items. */
.dk-site-header .dk-wordmark {
	display: block;
	flex: 1 1 auto;
	min-width: 0;
	font-size: 0; /* no gap from the whitespace between the two parts */
}

/* Fixed size: the static wordmark stays 1.35rem on phones too, so it does not
   take part in fluid font scaling. The static site asks for weight 700 but
   only loads italic 500, so browsers draw 500 with synthetic bold; weight 500
   plus a hairline stroke reproduces that look and letter width. */
.dk-site-header .dk-wordmark > .wp-block-site-title,
.dk-site-header .dk-wordmark > .wp-block-site-tagline {
	display: inline;
	margin: 0;
	font-size: 1.35rem;
	-webkit-text-stroke: 0.4px currentColor;
}

.dk-site-header .wp-block-navigation {
	flex: 0 0 auto;
}

/* The "Menu" button, as on the static site: text in a thin outlined box. */
.dk-site-header .wp-block-navigation__responsive-container-open,
.dk-site-header .wp-block-navigation__responsive-container-close {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 3px;
	padding: 8px 12px;
	font-family: var(--wp--preset--font-family--karla);
	font-size: 0.8rem;
	letter-spacing: normal;
	text-transform: none;
	color: var(--wp--preset--color--contrast);
}

/* Collapse the menu behind its button at 860px and below, matching the static
   site's breakpoint (core Navigation alone collapses only below 600px). */
@media (max-width: 860px) {
	.dk-site-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

	.dk-site-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}

	/* The open menu is a panel under the header with every link centred,
	   like the static site, instead of a full-screen overlay. */
	.dk-site-header .wp-block-navigation__responsive-container.is-menu-open {
		top: calc(var(--wp-admin--admin-bar--height, 0px) + 64px);
		right: 6vw;
		bottom: auto;
		left: 6vw;
		width: auto;
		height: auto;
		padding: 52px 20px 20px; /* room for "Close" above the links */
		border: 1px solid var(--wp--preset--color--line);
		border-radius: 4px;
		overflow: visible;
	}

	.dk-site-header .is-menu-open .wp-block-navigation__responsive-close,
	.dk-site-header .is-menu-open .wp-block-navigation__responsive-dialog {
		position: static; /* so "Close" is placed against the panel itself */
		max-width: none;
		margin: 0;
	}

	.dk-site-header .is-menu-open .wp-block-navigation__responsive-container-content {
		padding-top: 0 !important; /* core reserves room for its close button */
		align-items: stretch;
	}

	.dk-site-header .is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container {
		flex-direction: column;
		align-items: stretch;
		gap: 6px;
		width: 100%;
	}

	.dk-site-header .is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item {
		justify-content: center;
		width: 100%;
	}

	.dk-site-header .is-menu-open .wp-block-navigation-item__content {
		position: relative;
		display: block;
		width: 100%;
		padding: 10px 0 !important; /* core zeroes item padding in the overlay */
		line-height: normal;
		text-align: center;
		opacity: 0.9;
	}

	/* Current page: a full-width accent line under the link. */
	.dk-site-header .is-menu-open .wp-block-navigation-item.current-menu-item > a,
	.dk-site-header .is-menu-open .wp-block-navigation-item a[aria-current="page"] {
		text-decoration: none;
		opacity: 1;
	}

	.dk-site-header .is-menu-open .wp-block-navigation-item.current-menu-item > a::after,
	.dk-site-header .is-menu-open .wp-block-navigation-item a[aria-current="page"]::after {
		content: "";
		position: absolute;
		right: 0;
		bottom: -2px;
		left: 0;
		height: 1px;
		background: var(--wp--preset--color--accent);
	}

	/* "Close" sits in the panel's top-right corner, above the first link. */
	.dk-site-header .is-menu-open .wp-block-navigation__responsive-container-close {
		position: absolute;
		top: 12px;
		right: 12px;
		z-index: 1;
		padding: 4px 8px;
		background: var(--wp--preset--color--surface);
	}
}

/* Keep the page body clear of the fixed header. */
.dk-main {
	padding-top: var(--wp--custom--header-height);
}

/* Current page in the menu: thin underline in the accent colour. */
.dk-site-header .wp-block-navigation-item.current-menu-item > a,
.dk-site-header .wp-block-navigation-item a[aria-current="page"] {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--accent);
	text-underline-offset: 6px;
	text-decoration-thickness: 1px;
}

/* ---------- Footer ---------- */
.dk-site-footer {
	border-top: 1px solid var(--wp--preset--color--line);
	opacity: 0.6;
}

.dk-site-footer .dk-footer-contact {
	opacity: 0.85;
}

/* ---------- Helpers used by patterns ---------- */
.dk-eyebrow {
	display: block;
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

.dk-accent-text {
	color: var(--wp--preset--color--accent-text);
}

/* A hairline divider that fades in from both sides, as on the static site. */
.dk-divider {
	display: flex;
	align-items: center;
	max-width: 960px;
	margin-left: auto;
	margin-right: auto;
}

.dk-divider::before,
.dk-divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--wp--preset--color--line);
}

/* The "Wide line" separator draws the static site's section divider: a 1px
   hairline, 960px wide at most, with a 16px gap in the middle. */
.wp-block-separator.is-style-wide {
	max-width: 960px;
	height: 1px;
	margin-right: auto;
	margin-left: auto;
	border: 0;
	background-color: transparent;
	background-image: linear-gradient(
		to right,
		var(--wp--preset--color--line) calc(50% - 8px),
		transparent calc(50% - 8px),
		transparent calc(50% + 8px),
		var(--wp--preset--color--line) calc(50% + 8px)
	);
	opacity: 1;
}

/* Outline buttons ("Meet Kathy") take the accent colour on hover instead of
   filling in, as on the static site. */
.wp-block-button__link {
	transition: all 0.25s ease;
}

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

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