/* Product Dilemmas — public homepage (templates/page-home.php).
 *
 * Loaded after frontend.css, reusing its :root tokens (--pd-bg, --pd-border,
 * etc.), fonts (Bangers headings, Kalam body) and .pd-button. The page's
 * content is ordinary blocks from the block editor, so this styles the
 * section classes set on each Group block (pd-home-hero, pd-home-book, …)
 * plus core block markup inside them. Selectors are scoped under .pd-home
 * so they beat the theme's (Twenty Twenty-Five) global styles, which still
 * load in wp_head. */

body.pd-home {
	font-size: 20px;
	line-height: 1.6;
}

.pd-home a {
	color: var(--pd-accent);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

.pd-home a:hover {
	color: var(--pd-fg);
}

.pd-home :focus-visible {
	outline: 4px solid var(--pd-accent);
	outline-offset: 3px;
}

.pd-home-main {
	max-width: 960px;
	margin: 0 auto;
	padding: 32px 16px 48px;
}

.pd-home h1,
.pd-home h2,
.pd-home h3 {
	font-family: 'Bangers', cursive;
	font-weight: normal;
	letter-spacing: 0.03em;
	line-height: 1.1;
	color: var(--pd-fg);
}

.pd-home h2 {
	font-size: 2.2em;
	margin: 0 0 16px;
}

/* --- Hero --- */

/* Halftone dots behind the title — the classic comic-print texture. */
.pd-home .pd-home-hero {
	position: relative;
	text-align: center;
	padding: 56px 24px 64px;
	margin-bottom: 48px;
	background-color: #ffd23f;
	background-image: radial-gradient(rgba(26, 26, 26, 0.16) 2px, transparent 2.5px);
	background-size: 14px 14px;
	border: 4px solid var(--pd-border);
	border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
	box-shadow: 8px 8px 0 var(--pd-border);
}

.pd-home .pd-home-eyebrow {
	font-family: 'Bangers', cursive;
	font-size: 1.3em;
	letter-spacing: 0.05em;
	margin: 0 0 8px;
}

.pd-home .pd-home-hero h1 {
	font-size: clamp(3.2rem, 11vw, 7.5rem);
	margin: 0 0 24px;
	color: #fff8ec;
	-webkit-text-stroke: 3px var(--pd-border);
	paint-order: stroke fill;
	text-shadow: 6px 6px 0 var(--pd-border);
	transform: rotate(-2deg);
}

/* Speech bubble, with a little tail pointing up at the title. */
.pd-home .pd-home-bubble {
	position: relative;
	max-width: 620px;
	margin: 0 auto 28px;
	padding: 18px 24px;
	background: var(--pd-card-bg);
	border: 3px solid var(--pd-border);
	border-radius: 95% 4% 92% 5% / 4% 95% 6% 95%;
	box-shadow: 5px 5px 0 var(--pd-border);
	font-size: 1.1em;
}

.pd-home .pd-home-bubble::before {
	content: "";
	position: absolute;
	top: -22px;
	left: 50%;
	border: 11px solid transparent;
	border-bottom-color: var(--pd-border);
	transform: translateX(-50%);
}

/* The "Book a session" block button, made to look like .pd-button. */
.pd-home .wp-block-buttons {
	justify-content: center;
}

.pd-home .wp-block-button__link {
	display: inline-block;
	background: var(--pd-accent);
	color: var(--pd-accent-fg);
	border: 3px solid var(--pd-border);
	border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
	padding: 14px 32px;
	font-family: 'Bangers', cursive;
	font-size: 1.4em;
	letter-spacing: 0.04em;
	text-decoration: none;
	box-shadow: 4px 4px 0 var(--pd-border);
	transform: rotate(-1deg);
	transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.pd-home .wp-block-button__link:hover,
.pd-home .wp-block-button__link:focus {
	color: var(--pd-accent-fg);
	transform: rotate(-1deg) translate(-2px, -2px);
	box-shadow: 6px 6px 0 var(--pd-border);
}

/* --- Content panels --- */

.pd-home .pd-home-panel {
	background: var(--pd-card-bg);
	border: 3px solid var(--pd-border);
	border-radius: 3% 97% 4% 96% / 96% 4% 97% 3%;
	box-shadow: 6px 6px 0 var(--pd-border);
	padding: 28px 32px;
	margin: 0 0 40px;
}

/* A gentle tilt, alternating left/right, like panels stuck on a page. */
@media (min-width: 761px) {
	.pd-home .pd-home-panel:nth-of-type(odd) {
		transform: rotate(-0.6deg);
	}

	.pd-home .pd-home-panel:nth-of-type(even) {
		transform: rotate(0.5deg);
	}

	/* Breaks up the one-panel-per-row rhythm: the page is a 2-column grid
	 * where every section spans both columns, except "Who's it for?" and
	 * "Why play?", which sit side by side (same height, since grid rows
	 * stretch). They're adjacent in the page content, so they pair up —
	 * if they're ever moved apart in the editor, each just takes half a
	 * row on its own. Narrow screens skip all this and stay one column. */
	.pd-home-main {
		display: grid;
		grid-template-columns: 1fr 1fr;
		column-gap: 32px;
	}

	.pd-home-main > * {
		grid-column: 1 / -1;
		min-width: 0;
	}

	.pd-home-main > .pd-home-who,
	.pd-home-main > .pd-home-why {
		grid-column: auto;
	}

	/* Half-width now, so the list's own two columns would be cramped. */
	.pd-home .pd-home-who .pd-home-list {
		columns: 1;
	}

	/* Tilt the pair towards each other, whatever their position in the
	 * alternating sequence above. */
	.pd-home .pd-home-panel.pd-home-who {
		transform: rotate(-0.8deg);
	}

	.pd-home .pd-home-panel.pd-home-why {
		transform: rotate(0.8deg);
	}
}

.pd-home .pd-home-panel > :last-child {
	margin-bottom: 0;
}

/* "Who's it for?" — stars instead of bullets, in two columns when wide. */
.pd-home .pd-home-list {
	list-style: none;
	padding: 0;
	margin: 0 0 1em;
	columns: 2;
	column-gap: 32px;
}

.pd-home .pd-home-list li {
	position: relative;
	padding-left: 1.6em;
	margin-bottom: 6px;
	break-inside: avoid;
}

.pd-home .pd-home-list li::before {
	content: "★";
	position: absolute;
	left: 0;
	color: var(--pd-negative);
}

/* --- Characters ---
 * A row of the five pixel-art Role characters (animated GIFs, 128px
 * square) under the hero. Each one is an Image block inside the
 * pd-home-characters Group. Scaled up a little with "pixelated" rendering
 * so the pixel art stays crisp rather than going blurry. */

.pd-home .pd-home-characters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 24px;
	margin: 0 0 48px;
}

/* The theme adds its own spacing between blocks; the gap above replaces it. */
.pd-home .pd-home-characters > * {
	margin: 0;
}

.pd-home .pd-home-character {
	width: 150px;
	text-align: center;
}

.pd-home .pd-home-character img {
	display: block;
	width: 100%;
	height: auto;
	image-rendering: pixelated;
}

.pd-home .pd-home-character figcaption {
	margin-top: 4px;
	font-family: 'Bangers', cursive;
	font-size: 1.1em;
	letter-spacing: 0.03em;
	color: var(--pd-fg);
}

/* Phones: smaller characters, so they sit three-then-two rather than one
 * per line. */
@media (max-width: 600px) {
	.pd-home .pd-home-characters {
		gap: 4px 12px;
	}

	.pd-home .pd-home-character {
		width: 96px;
	}
}

/* --- Book a session --- */

.pd-home .pd-home-book {
	background: #eaffea;
	scroll-margin-top: 24px;
}

.pd-home-form {
	margin-top: 16px;
}

.pd-home-form-field {
	margin: 0 0 18px;
}

.pd-home-form label {
	display: block;
	font-weight: 700;
	margin-bottom: 6px;
}

.pd-home-form-required {
	font-weight: 400;
	color: var(--pd-muted);
	font-size: 0.85em;
}

.pd-home-form input[type="text"],
.pd-home-form input[type="email"],
.pd-home-form select,
.pd-home-form textarea {
	width: 100%;
	font: inherit;
	font-size: 1em;
	color: var(--pd-fg);
	background: #fff;
	border: 3px solid var(--pd-border);
	border-radius: 10px 4px 12px 5px / 5px 12px 4px 10px;
	padding: 10px 14px;
}

.pd-home-form textarea {
	resize: vertical;
}

.pd-home-form input:focus-visible,
.pd-home-form select:focus-visible,
.pd-home-form textarea:focus-visible {
	outline: 4px solid var(--pd-accent);
	outline-offset: 2px;
}

/* Honeypot: off-screen rather than display:none (some bots skip hidden
 * fields), and aria-hidden in the markup so screen readers skip it too. */
.pd-home-form-trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.pd-home-form .pd-button {
	margin-top: 4px;
}

.pd-home-form-privacy {
	margin-top: 16px;
}

.pd-home-form-message {
	border: 3px solid var(--pd-border);
	border-radius: 10px;
	padding: 12px 18px;
	margin: 16px 0;
	background: #fff;
}

.pd-home-form-message p {
	margin: 0;
}

.pd-home-form-success {
	border-color: var(--pd-positive);
	box-shadow: 4px 4px 0 var(--pd-positive);
}

.pd-home-form-error {
	border-color: var(--pd-negative);
	box-shadow: 4px 4px 0 var(--pd-negative);
}

/* --- About me --- */

.pd-home .pd-home-me .wp-block-columns {
	align-items: center;
	gap: 32px;
	margin: 0;
}

.pd-home .pd-home-portrait {
	margin: 0 auto;
	max-width: 220px;
}

.pd-home .pd-home-portrait img {
	display: block;
	width: 220px;
	height: 220px;
	object-fit: cover;
	border-radius: 50%;
	border: 4px solid var(--pd-border);
	box-shadow: 6px 6px 0 var(--pd-border);
}

/* --- Footer --- */

.pd-home-footer {
	text-align: center;
	padding: 0 16px 48px;
	color: var(--pd-muted);
	font-size: 0.85em;
}

.pd-home-footer a {
	color: var(--pd-muted);
}

/* --- Small screens --- */

@media (max-width: 760px) {
	.pd-home .pd-home-hero {
		padding: 40px 16px 48px;
	}

	.pd-home .pd-home-hero h1 {
		-webkit-text-stroke-width: 2px;
		text-shadow: 4px 4px 0 var(--pd-border);
	}

	.pd-home .pd-home-panel {
		padding: 22px 18px;
	}

	.pd-home .pd-home-list {
		columns: 1;
	}
}

/* Respect "reduce motion": no tilts or hover movement. */
@media (prefers-reduced-motion: reduce) {
	.pd-home .pd-home-hero h1,
	.pd-home .pd-home-panel,
	.pd-home .wp-block-button__link,
	.pd-home .pd-button {
		transform: none !important;
		transition: none !important;
	}
}
