/*
Theme Name: Treasure These Things
Description: The one-page site for Treasure These Things, Reflections for Advent and Christmas, by Brenda H. McCord: the book, the 30-Day Psalms Reading Plan download (a Kit form), and Discover God's Truth Ministries. Colours sampled from the final cover.
Version: 0.2.13
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Text Domain: treasurethesethings
*/

/*
 * Mechanics only. Colours, type, sizes and spacing are theme.json presets and block styles
 * (styles/block/*.json), so they change in Styles. This file holds what theme.json cannot
 * express: the split and its sticky left half, the blur behind the cover, the star rule,
 * and the DGTM tree on the button.
 */

/* The split: two columns, no gap, edge to edge. */
.wp-block-columns.is-split { margin-block: 0; gap: 0; min-height: 100vh; }
.is-split > .wp-block-column { min-width: 0; }

/* Left half: a Cover of the book, its background blurred into a warm wash, sticking to the
   top of the screen while the right half scrolls. */
.wp-block-cover.is-style-wash { overflow: hidden; }
.is-split .wp-block-cover.is-style-wash {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
	min-height: 0 !important; /* the block's own min-height is for the stacked phone view */
}
.wp-block-cover.is-style-wash .wp-block-cover__image-background {
	filter: blur(38px) saturate(1.1);
	transform: scale(1.2);
}
.wp-block-cover.is-style-wash::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: radial-gradient(ellipse at 50% 45%, transparent 30%, rgb(54 24 8 / .45) 100%);
}
.wp-block-cover.is-style-wash .wp-block-cover__inner-container { position: relative; z-index: 2; }
.book-cover img {
	max-width: 100%;
	height: auto;
	border-radius: 3px;
	box-shadow: 0 2px 4px rgb(20 10 2 / .25), 0 30px 70px -20px rgb(20 10 2 / .65);
}

/* The cover's own divider: a four-point star between two thin rules, in currentColor. */
hr.wp-block-separator.is-style-star:not(.is-style-wide) {
	border: 0;
	width: 100%;
	max-width: 27.5rem;
	height: 22px;
	opacity: 1;
	position: relative;
	background:
		linear-gradient(currentColor, currentColor) left center / calc(50% - 20px) 1px no-repeat,
		linear-gradient(currentColor, currentColor) right center / calc(50% - 20px) 1px no-repeat;
}
hr.wp-block-separator.is-style-star::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 0;
	width: 22px;
	height: 22px;
	margin-left: -11px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0 13.4 10.6 24 12 13.4 13.4 12 24 10.6 13.4 0 12 10.6 10.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0 13.4 10.6 24 12 13.4 13.4 12 24 10.6 13.4 0 12 10.6 10.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Binding: a thin full-width green rule over a fine gold line, like a book's headband. Used under the hero. */
hr.wp-block-separator.is-style-binding {
	border: 0;
	height: 8px;
	margin: 0;
	opacity: 1;
	max-width: none;
	background:
		linear-gradient(var(--wp--preset--color--olive), var(--wp--preset--color--olive)) top / 100% 3px no-repeat,
		linear-gradient(var(--wp--preset--color--star), var(--wp--preset--color--star)) bottom / 100% 1.5px no-repeat,
		var(--wp--preset--color--ivory);
}

/* The star on its own, no rules (the green welcome band). */
hr.wp-block-separator.is-style-star-alone { border: 0; width: 22px; height: 22px; margin-inline: auto; opacity: 1; position: relative; background: none; }
hr.wp-block-separator.is-style-star-alone::after {
	content: "";
	position: absolute;
	inset: 0;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0 13.4 10.6 24 12 13.4 13.4 12 24 10.6 13.4 0 12 10.6 10.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0 13.4 10.6 24 12 13.4 13.4 12 24 10.6 13.4 0 12 10.6 10.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ttt-band p { text-wrap: balance; }

/* The DGTM tree, in a white circle at the start of the button. */
.wp-block-button.is-style-ministry .wp-block-button__link { position: relative; }
.wp-block-button.is-style-ministry .wp-block-button__link::before {
	content: "";
	position: absolute;
	left: 0.5rem;
	top: 50%;
	width: 2.25rem;
	height: 2.25rem;
	margin-top: -1.125rem;
	border-radius: 50%;
	background: #fff url(assets/dgtm-tree.png) center / 88% no-repeat;
}

h1, h2, h3, p.is-style-label { text-wrap: balance; }

/* ---- 0.2.0: the one-page sections (back cover, the gift, the ministry) ---- */

/* Full-width sections sit edge to edge: no block gap between them, or above the footer. */
.wp-block-post-content > .alignfull,
.wp-site-blocks > .wp-block-template-part,
.wp-site-blocks > footer { margin-block-start: 0; }

/* The back cover's bullets: the cover's four-point star instead of a dot. */
.wp-block-list.is-style-stars { list-style: none; }
.wp-block-list.is-style-stars li { position: relative; padding-left: 1.6rem; }
.wp-block-list.is-style-stars li + li { margin-top: 0.6rem; }
.wp-block-list.is-style-stars li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.42em;
	width: 0.8rem;
	height: 0.8rem;
	background: var(--wp--preset--color--star);
	clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
}

/* The reading plan's first page, laid on the table like a sheet of paper. */
.wp-block-image.is-style-sheet { position: relative; isolation: isolate; }
.wp-block-image.is-style-sheet img {
	display: block;
	border-radius: 2px;
	background: #fff;
	transform: rotate(-2.2deg);
	box-shadow: 0 1px 2px rgb(54 24 8 / .18), 0 22px 50px -18px rgb(54 24 8 / .45);
}
.wp-block-image.is-style-sheet::before {
	content: "";
	position: absolute;
	inset: 6px -6px -6px 6px;
	z-index: -1;
	background: #fff;
	border-radius: 2px;
	transform: rotate(2deg);
	box-shadow: 0 10px 30px -14px rgb(54 24 8 / .35);
}

/* The DGTM tree in a white circle. */
.wp-block-image.is-style-roundel img { border-radius: 50%; background: #fff; padding: 6px; }

/* The Kit form for the reading plan (Kit's HTML embed, unstyled by Kit, styled here). */
.ttt-kit .formkit-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; max-width: 33rem; }
.ttt-kit .formkit-field { min-width: 0; }
.ttt-kit .formkit-input {
	width: 100%;
	box-sizing: border-box;
	font: inherit;
	font-size: var(--wp--preset--font-size--body);
	color: var(--wp--preset--color--body-text);
	background: #fff;
	border: 1px solid #cfc5b3;
	border-radius: 999px;
	padding: 0.85rem 1.1rem;
}
.ttt-kit .formkit-input:focus { outline: 2px solid var(--wp--preset--color--star); outline-offset: 1px; border-color: transparent; }
.ttt-kit .formkit-submit {
	grid-column: 1 / -1;
	position: relative;
	font: inherit;
	font-size: 1.1875rem;
	font-weight: 500;
	color: var(--wp--preset--color--cream);
	background: var(--wp--preset--color--olive);
	border: 0;
	border-radius: 999px;
	padding: 1rem;
	cursor: pointer;
}
.ttt-kit .formkit-submit:hover { background: var(--wp--preset--color--deep); }
.ttt-kit .formkit-spinner { display: none; }
.ttt-kit[data-state="loading"] .formkit-submit { opacity: .7; cursor: progress; }
.ttt-kit .formkit-alert { list-style: none; margin: 0 0 0.75rem; padding: 0; }
.ttt-kit .formkit-alert:empty { display: none; }
.ttt-kit .formkit-alert-error li { color: #8a1c1c; }
.formkit-alert-success { font-size: var(--wp--preset--font-size--medium); color: var(--wp--preset--color--olive); }
@media (max-width: 480px) { .ttt-kit .formkit-fields { grid-template-columns: 1fr; } }

/* The ministry callout: tree, words, button in one row; stacks under 782px like core columns. */
.ttt-ministry .wp-block-buttons { justify-content: flex-start; }
@media (min-width: 782px) { .ttt-ministry .wp-block-columns > .wp-block-column:last-child { flex: 0 0 15rem; } }
@media (max-width: 781px) { .ttt-ministry .wp-block-image.is-style-roundel img { width: 64px !important; } }

/* Phones and small tablets: core stacks the columns below 782px. The cover sits on top,
   smaller, and stops sticking. */
@media (max-width: 781px) {
	.wp-block-columns.is-split { min-height: 0; }
	.is-split .wp-block-cover.is-style-wash {
		position: relative;
		top: 0;
		height: auto;
		min-height: 0 !important;
		padding: 2.5rem 1rem;
	}
	.is-style-wash .book-cover img { max-width: min(250px, 64vw); }
}

/* ---- 0.2.4: the hero (option 3, picked 2026-10-12): the cover beside the title, the gift card in the first screen ---- */

/* The hero's height is the group's own Minimum height setting; this centres the columns inside it. */
.ttt-hero { display: grid; align-content: center; }
.ttt-hero > .wp-block-columns { width: 100%; }
@media (max-width: 781px) { .ttt-hero .book-cover img { max-width: min(240px, 62vw); } }

/* The card: a small sheet of the plan beside its name and button. */
.wp-block-group.is-style-card { max-width: 34rem; }
.wp-block-group.is-style-card > .wp-block-image { flex: none; margin: 0; }
.wp-block-group.is-style-card .wp-block-image.is-style-sheet img { transform: rotate(-3deg); }
/* Under 360px the card has no room for the sheet beside its words; the gift section below shows the page in full. */
@media (max-width: 359px) { .wp-block-group.is-style-card > .wp-block-image { display: none; } }

/* The card's button scrolls to the form. */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* The buy bar above the hero: one quiet line, underlined only on hover. */
.ttt-buybar a { text-decoration: none; }
.ttt-buybar a:hover, .ttt-buybar a:focus-visible { text-decoration: underline; text-underline-offset: 0.35em; }

/* reCAPTCHA (Kit's bot protection) stays on; only its floating badge is hidden. Google allows that when its notice
   sits in the form's flow, which is the .ttt-recaptcha paragraph under the form. Hide it with visibility, never display:none. */
.grecaptcha-badge { visibility: hidden; }
.ttt-recaptcha { margin-top: 0.75rem; }
.ttt-recaptcha a { color: inherit; }

/* Skip link, visible on focus only. */
.skip-link.screen-reader-text:focus {
	clip: auto; clip-path: none; height: auto; width: auto;
	position: fixed; top: 8px; left: 8px; z-index: 100000;
	padding: 10px 14px; background: var(--wp--preset--color--cream); color: var(--wp--preset--color--olive);
}
