/*
Theme Name: Pasturly
Theme URI: https://pasturly.com
Author: Nature's Grove Farm LLC
Description: The website for Pasturly, which gives farms selling direct the tools online stores leave out: selling by the pound, boxes customers build, pickups, delivery routes, packing, cut sheets and CSAs. On its own, or inside a Shopify store. Every page is ordinary blocks, editable without code; colors and fonts are under Appearance → Editor → Styles.
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
Version: 2.9.3
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pasturly
Tags: block-patterns, full-site-editing, one-column, custom-colors, editor-style, wide-blocks
*/

/*
 * Almost everything lives in theme.json, so it can be changed from
 * Appearance → Editor → Styles without touching this file. What is here is
 * only what theme.json cannot say: the block styles named in functions.php,
 * the sticky header, the early-access form, and a few finishing touches.
 */

/* ---------- Cards ---------- */

.wp-block-group.is-style-card {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 16px;
	padding: var(--wp--preset--spacing--40);
	height: 100%;
}

.wp-block-group.is-style-card-highlight {
	background: var(--wp--preset--color--base);
	border: 2px solid var(--wp--preset--color--primary);
	border-radius: 16px;
	padding: var(--wp--preset--spacing--40);
	height: 100%;
	box-shadow: 0 18px 40px -24px rgba(29, 61, 40, 0.55);
}

/* A card whose first block is a photo: the photo runs to the card's edges. */
.is-style-card > .wp-block-image:first-child {
	margin: calc(-1 * var(--wp--preset--spacing--40)) calc(-1 * var(--wp--preset--spacing--40)) 0;
}
.is-style-card > .wp-block-image:first-child img {
	border-radius: 15px 15px 0 0;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	width: 100%;
}

/* In a card, a row of buttons at the end sits on the card's bottom edge, so plans line up. */
.is-style-card > .wp-block-buttons:last-child,
.is-style-card-highlight > .wp-block-buttons:last-child,
.is-style-card > p:last-child.pasturly-more {
	margin-top: auto;
	padding-top: var(--wp--preset--spacing--20);
}

/* ---------- Small text styles ---------- */

/* The small label that sits above a heading: "Built by a farm". */
.is-style-eyebrow {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-dark);
}
.has-primary-dark-background-color .is-style-eyebrow,
.has-primary-background-color .is-style-eyebrow,
.has-contrast-background-color .is-style-eyebrow {
	color: var(--wp--preset--color--accent);
}

/* Which plan a feature is in. */
p.is-style-pill {
	display: inline-block;
	align-self: flex-start;
	width: fit-content;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1;
	padding: 0.45em 0.8em;
	border-radius: 999px;
	background: var(--wp--preset--color--sage);
	color: var(--wp--preset--color--primary-dark);
}
.has-sage-background-color p.is-style-pill {
	background: var(--wp--preset--color--base);
}

/* ---------- Lists ---------- */

.wp-block-list.is-style-checks {
	list-style: none;
	padding-left: 0;
}
.wp-block-list.is-style-checks li {
	position: relative;
	padding-left: 1.75em;
	margin-bottom: 0.5em;
}
.wp-block-list.is-style-checks li::before {
	content: "";
	position: absolute;
	left: 0.1em;
	top: 0.45em;
	width: 0.75em;
	height: 0.4em;
	border-left: 2px solid var(--wp--preset--color--leaf);
	border-bottom: 2px solid var(--wp--preset--color--leaf);
	transform: rotate(-45deg);
}
.has-primary-dark-background-color .wp-block-list.is-style-checks li::before {
	border-color: var(--wp--preset--color--accent);
}

/* ---------- Pictures ---------- */

.wp-block-image.is-style-screen img,
.wp-block-media-text.is-style-screen .wp-block-media-text__media img {
	border-radius: 12px;
	border: 1px solid var(--wp--preset--color--line);
	box-shadow: 0 24px 48px -28px rgba(38, 42, 39, 0.45);
	background: var(--wp--preset--color--base);
}
.wp-block-image.is-style-photo img {
	border-radius: 18px;
	object-fit: cover;
}
.wp-block-media-text .wp-block-media-text__media img {
	height: auto;
}
.wp-block-media-text.is-style-screen {
	gap: 0;
}

/* ---------- Comparison table ---------- */

.wp-block-table.is-style-compare table {
	border-collapse: separate;
	border-spacing: 0;
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 14px;
	overflow: hidden;
}
.wp-block-table.is-style-compare th,
.wp-block-table.is-style-compare td {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding: 0.9em 1.1em;
	text-align: left;
	vertical-align: top;
}
.wp-block-table.is-style-compare tr:last-child td {
	border-bottom: 0;
}
.wp-block-table.is-style-compare thead th {
	font-family: var(--wp--preset--font-family--heading);
	background: var(--wp--preset--color--cream);
}
.wp-block-table.is-style-compare td:nth-child(2),
.wp-block-table.is-style-compare th:nth-child(2) {
	background: var(--wp--preset--color--sage);
	color: var(--wp--preset--color--primary-dark);
	font-weight: 600;
}
.wp-block-table.is-style-compare td:first-child {
	color: var(--wp--preset--color--muted);
}

/*
 * Two Pasturly columns, Pasturly and Pasturly for Shopify: both get the green,
 * with a thin line between so they still read as two. Four columns is a lot
 * for a phone, so there the table scrolls sideways inside its own box
 * rather than squeezing every cell to a word wide.
 */
.wp-block-table.pasturly-compare-two td:nth-child(3),
.wp-block-table.pasturly-compare-two th:nth-child(3) {
	background: var(--wp--preset--color--sage);
	color: var(--wp--preset--color--primary-dark);
	font-weight: 600;
	border-left: 1px solid var(--wp--preset--color--base);
}
.wp-block-table.pasturly-compare-two table {
	font-size: 0.95em;
}
@media (max-width: 640px) {
	.wp-block-table.pasturly-compare-two {
		overflow-x: auto;
	}
	.wp-block-table.pasturly-compare-two table {
		min-width: 36rem;
	}
}

/* ---------- Questions and answers ---------- */

.wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding: var(--wp--preset--spacing--30) 0;
}
.wp-block-details summary {
	cursor: pointer;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--large);
}
.wp-block-details[open] summary {
	margin-bottom: var(--wp--preset--spacing--20);
}

/* ---------- Big numbers in "how it works" ---------- */

.pasturly-step-number {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 800;
	font-size: 2.5rem;
	line-height: 1;
	color: var(--wp--preset--color--accent);
}

/* ---------- Header ---------- */

/*
 * The sticky part is the template part's own <header>, not the group inside
 * it: a sticky element only sticks within its parent, and the <header> is
 * exactly as tall as the group, so the group alone would scroll away.
 */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 20;
}
.admin-bar .wp-site-blocks > header.wp-block-template-part {
	top: 32px;
}
@media (max-width: 782px) {
	.admin-bar .wp-site-blocks > header.wp-block-template-part {
		top: 46px;
	}
}
/*
 * The frosted background sits on a layer behind the header, not on the
 * header itself: an element with backdrop-filter traps fixed-position
 * children inside it, which squeezed the phone menu into the header bar.
 */
.pasturly-header {
	position: relative;
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.pasturly-header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	backdrop-filter: saturate(180%) blur(8px);
	background: color-mix(in srgb, var(--wp--preset--color--base) 90%, transparent);
}
/*
 * The logos' sizes are set on their Image blocks (the width box in the
 * block's settings), not here, because the editor wraps images in a resize
 * box that ignores stylesheet sizes. Setting them on the block makes the
 * editor and the site match. Only the phone size is adjusted here.
 */
.pasturly-logo img,
.pasturly-footer-logo img {
	height: auto;
	max-width: 100%;
}
.pasturly-logo {
	flex-shrink: 0;
}
/*
 * Log in is a button beside Join early access while there is room for
 * the buttons, and an item in the menu once the menu folds away on a phone.
 */
.pasturly-header .pasturly-nav-login {
	display: none;
}
@media (max-width: 600px) {
	.pasturly-header .wp-block-navigation__responsive-container.is-menu-open .pasturly-nav-login {
		display: flex;
	}
	.pasturly-header .wp-block-buttons {
		display: none;
	}
	.pasturly-logo img {
		width: 112px !important;
	}
}

/* ---------- Early-access form ---------- */

.pasturly-form {
	display: grid;
	gap: 1rem;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	border-radius: 16px;
	padding: var(--wp--preset--spacing--40);
	text-align: left;
}
.pasturly-form__row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
	gap: 1rem;
}
.pasturly-form label {
	display: grid;
	gap: 0.35rem;
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small);
}
.pasturly-form input,
.pasturly-form select,
.pasturly-form textarea {
	font: inherit;
	font-weight: 400;
	font-size: 1rem;
	padding: 0.7em 0.85em;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 10px;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	width: 100%;
	box-sizing: border-box;
}
.pasturly-form input:focus,
.pasturly-form select:focus,
.pasturly-form textarea:focus {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 1px;
	border-color: var(--wp--preset--color--accent);
}
.pasturly-form button {
	justify-self: start;
	border: 0;
	cursor: pointer;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
	border-radius: 999px;
	padding: 0.85em 1.8em;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: 1rem;
}
.pasturly-form button:hover {
	background: var(--wp--preset--color--primary-dark);
}
.pasturly-form__note {
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
}
.pasturly-form__trap {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.pasturly-form--done p {
	margin: 0;
}

/* ---------- Newsletter form ([pasturly_newsletter]) ---------- */

/* Shown by its script; .pasturly-form's grid would otherwise override [hidden]. */
.pasturly-newsletter__form[hidden] {
	display: none;
}
.pasturly-newsletter__sells {
	border: 0;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
	gap: 0.35rem 1rem;
}
.pasturly-newsletter__sells legend {
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small);
	margin-bottom: 0.5rem;
	padding: 0;
}
.pasturly-newsletter__sells legend span {
	display: block;
	font-weight: 400;
	color: var(--wp--preset--color--muted);
}
.pasturly-form label.pasturly-newsletter__tick {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 400;
	font-size: 0.95rem;
}
.pasturly-form .pasturly-newsletter__tick input {
	width: 1.1rem;
	height: 1.1rem;
	padding: 0;
	margin: 0;
	flex: none;
	accent-color: var(--wp--preset--color--primary);
}
.pasturly-newsletter__consent {
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
}
.pasturly-newsletter__status {
	margin: 0;
	font-weight: 600;
}
.pasturly-newsletter__status:empty {
	display: none;
}
/* Once signed up, the thanks is all that is left. */
.pasturly-newsletter__form.is-done > :not(.pasturly-newsletter__status) {
	display: none;
}
.pasturly-newsletter--compact .pasturly-form {
	padding: var(--wp--preset--spacing--30);
	gap: 0.75rem;
}
.pasturly-footer-newsletter {
	margin-bottom: var(--wp--preset--spacing--50);
}

/* ---------- Finishing touches ---------- */

html {
	scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}
[id] {
	scroll-margin-top: 90px;
}

h1, h2, h3 {
	text-wrap: balance;
}

.wp-element-button {
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/*
 * Header, page sections and footer sit flush against each other; each
 * section brings its own padding. Without this WordPress puts its usual
 * gap between blocks, which shows as a white strip between two coloured
 * bands. The second half of the list is the same thing inside the editor,
 * which has no .wp-site-blocks and calls its outermost box .is-root-container.
 */
.wp-site-blocks > *,
.wp-block-post-content > .alignfull,
main > .alignfull,
.is-root-container > .wp-block-template-part,
.is-root-container > main,
.is-root-container > .alignfull {
	margin-block-start: 0;
	margin-block-end: 0;
}

/* Feature rows on the Features page: room between one and the next. */
.pasturly-feature + .pasturly-feature {
	margin-top: var(--wp--preset--spacing--70);
}

/* Every other row puts its picture on the left. On a phone the words always come first. */
@media (min-width: 782px) {
	.wp-block-columns.pasturly-flip {
		flex-direction: row-reverse;
	}
}

/* Storefront screenshots are tall and narrow, like a phone. Keep them a sensible height. */
.wp-block-image.pasturly-tall {
	text-align: center;
}
.wp-block-image.pasturly-tall img {
	max-height: 560px;
	width: auto;
	max-width: 100%;
	margin-inline: auto;
}
.pasturly-feature .wp-block-image + .wp-block-image {
	margin-top: var(--wp--preset--spacing--40);
}

/* YouTube guides keep their shape. */
.wp-block-embed.is-provider-youtube iframe {
	border-radius: 12px;
}

/*
 * The legal pages: long documents with tables. Ordinary tables (not the
 * Comparison style) get quiet rules and smaller type so a three-column
 * table of data and purposes reads on a phone, scrolling sideways inside
 * itself if it must rather than widening the page.
 */
.wp-block-table:not(.is-style-compare) {
	overflow-x: auto;
	font-size: var(--wp--preset--font-size--small);
}
.wp-block-table:not(.is-style-compare) th,
.wp-block-table:not(.is-style-compare) td {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding: 0.6em 0.8em;
	text-align: left;
	vertical-align: top;
}
.wp-block-table:not(.is-style-compare) thead th {
	border-bottom: 2px solid var(--wp--preset--color--contrast);
}
.wp-block-post-content code {
	font-size: 0.9em;
	background: var(--wp--preset--color--cream);
	padding: 0.1em 0.35em;
	border-radius: 4px;
}

/* On ordinary pages (the legal ones, and any page made later) headings are
   sized for reading a document, not for selling. */
.pasturly-page .wp-block-post-content h2 {
	font-size: var(--wp--preset--font-size--x-large);
	margin-top: var(--wp--preset--spacing--50);
}
.pasturly-page .wp-block-post-content h3 {
	font-size: var(--wp--preset--font-size--large);
}
