/*
 * Block and page content styles.
 *
 * This is a classic theme, so WordPress does not generate layout CSS for
 * alignwide / alignfull on its own. These rules provide the constrained-layout
 * behaviour that block patterns rely on, using the widths declared in
 * theme.json so there is a single source of truth.
 */

:root {
	--ns-content: var(--wp--style--global--content-size, 780px);
	--ns-wide: var(--wp--style--global--wide-size, 1240px);
	--ns-gutter: 20px;
}

/* -------------------------------------------------------------------------
 * Constrained content flow
 * ---------------------------------------------------------------------- */

.entry-content > * {
	max-width: var(--ns-content);
	margin-inline: auto;
}

.entry-content > .alignwide {
	max-width: var(--ns-wide);
}

.entry-content > .alignfull {
	max-width: none;
	width: 100%;
	margin-inline: 0;
}

/*
 * Full-width sections span the viewport but keep their inner content aligned
 * to the same column as everything else.
 */
.entry-content > .alignfull > .wp-block-group__inner-container,
.entry-content > .alignfull.wp-block-group.is-layout-constrained > :where(:not(.alignwide):not(.alignfull)) {
	max-width: var(--ns-content);
	margin-inline: auto;
}

.entry-content > .alignfull.wp-block-group.is-layout-constrained > .alignwide {
	max-width: var(--ns-wide);
	margin-inline: auto;
}

/* Side padding so content never touches the viewport edge. */
.entry-content > .alignfull {
	padding-left: var(--ns-gutter);
	padding-right: var(--ns-gutter);
}

.entry-content > .alignfull.wp-block-cover,
.entry-content > .alignfull.wp-block-image {
	padding-left: 0;
	padding-right: 0;
}

.entry-content > *:not(.alignfull) {
	padding-left: var(--ns-gutter);
	padding-right: var(--ns-gutter);
}

.alignleft {
	float: left;
	margin: 0 var(--wp--preset--spacing--40, 24px) var(--wp--preset--spacing--30, 16px) 0;
}

.alignright {
	float: right;
	margin: 0 0 var(--wp--preset--spacing--30, 16px) var(--wp--preset--spacing--40, 24px);
}

.aligncenter {
	margin-inline: auto;
}

/* -------------------------------------------------------------------------
 * Page header (template-generated, for pages without a pattern header)
 * ---------------------------------------------------------------------- */

.entry-header {
	padding-block: var(--wp--preset--spacing--60, 64px);
	background: var(--wp--preset--color--cream, #f7f5ef);
}

.entry-header__inner {
	width: min(var(--ns-wide), calc(100% - (var(--ns-gutter) * 2)));
	margin-inline: auto;
}

.entry-title {
	margin: 0;
	font-size: var(--wp--preset--font-size--xx-large, 44px);
	line-height: 1.08;
	letter-spacing: -.04em;
}

.entry-header__lead {
	max-width: 60ch;
	margin: 14px 0 0;
	color: var(--wp--preset--color--muted, #65736b);
	font-size: var(--wp--preset--font-size--large, 18px);
}

.entry-thumbnail {
	width: min(var(--ns-wide), calc(100% - (var(--ns-gutter) * 2)));
	margin: var(--wp--preset--spacing--60, 64px) auto 0;
}

.entry-thumbnail img {
	display: block;
	width: 100%;
	border-radius: var(--wp--custom--radius--medium, 12px);
}

/* Space between the header band and the content. */
.entry-content {
	padding-block: var(--wp--preset--spacing--60, 64px);
}

.entry--full .entry-content {
	padding-block: 0;
}

/* -------------------------------------------------------------------------
 * Block refinements
 * ---------------------------------------------------------------------- */

/* Details / accordion — used by the FAQ patterns. */
.wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--line, #dfe5df);
}

.wp-block-details summary {
	position: relative;
	padding: 20px 44px 20px 0;
	font-size: var(--wp--preset--font-size--large, 18px);
	font-weight: 650;
	line-height: 1.4;
	cursor: pointer;
	list-style: none;
}

.wp-block-details summary::-webkit-details-marker {
	display: none;
}

.wp-block-details summary::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 8px;
	width: 11px;
	height: 11px;
	border-right: 2px solid var(--wp--preset--color--forest, #174a36);
	border-bottom: 2px solid var(--wp--preset--color--forest, #174a36);
	transform: translateY(-70%) rotate(45deg);
	transition: transform .2s ease;
}

.wp-block-details[open] summary::after {
	transform: translateY(-30%) rotate(-135deg);
}

.wp-block-details summary:focus-visible {
	outline: 2px solid var(--wp--preset--color--forest, #174a36);
	outline-offset: 3px;
}

.wp-block-details > *:not(summary) {
	margin-block: 0 0;
	padding-bottom: 20px;
	max-width: 68ch;
}

/* Buttons inside patterns */
.wp-block-button__link {
	transition: transform .2s ease, background-color .2s ease;
}

.wp-block-button__link:hover {
	transform: translateY(-2px);
}

.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 1px solid currentColor;
}

/* Columns collapse cleanly on small screens */
@media (max-width: 781px) {
	.wp-block-columns:not(.is-not-stacked-on-mobile) {
		gap: var(--wp--preset--spacing--50, 40px);
	}
}

/* Image placeholders inside patterns should not collapse to zero height. */
.wp-block-image img[src=""],
.wp-block-image img:not([src]) {
	display: block;
	width: 100%;
	min-height: 260px;
	background: linear-gradient(135deg, #e2eadd, #f7f5ef);
	border-radius: var(--wp--custom--radius--medium, 12px);
}

/* -------------------------------------------------------------------------
 * WooCommerce shortcodes inside block content
 * ---------------------------------------------------------------------- */

/*
 * [product_categories] renders li.product-category inside ul.products.
 * ul.products itself is already gridded in main.css; this styles the cards.
 */
.woocommerce ul.products li.product-category {
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--line, #dfe5df);
	border-radius: var(--wp--custom--radius--medium, 12px);
	background: #fff;
	transition: transform .25s ease, box-shadow .25s ease;
}

.woocommerce ul.products li.product-category:hover {
	transform: translateY(-4px);
	box-shadow: 0 2px 10px rgba(20, 33, 27, .06);
}

.woocommerce ul.products li.product-category > a {
	display: block;
	text-decoration: none;
}

.woocommerce ul.products li.product-category img {
	width: 100%;
	margin: 0 0 14px;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 0;
	background: linear-gradient(135deg, #e2eadd, var(--wp--preset--color--cream, #f7f5ef));
}

.woocommerce ul.products li.product-category h2.woocommerce-loop-category__title {
	padding: 0 18px 18px;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: -.01em;
}

.woocommerce ul.products li.product-category h2 .count {
	display: inline;
	padding: 0 0 0 6px;
	background: none;
	color: var(--wp--preset--color--muted, #65736b);
	font-weight: 400;
}

/* Shortcode blocks should not inherit the narrow prose column. */
.entry-content > .wp-block-shortcode.alignwide,
.entry-content .wp-block-group .wp-block-shortcode.alignwide {
	max-width: var(--ns-wide);
	margin-inline: auto;
}

/* -------------------------------------------------------------------------
 * Icon boxes
 *
 * Add "ns-ico ns-ico-<name>" as an Additional CSS class on any Group block to
 * give it an icon. Available: shield, flask, truck, headset, leaf, check.
 * ---------------------------------------------------------------------- */

.ns-ico::before {
	content: "";
	display: block;
	width: 44px;
	height: 44px;
	margin-bottom: 16px;
	border-radius: 999px;
	background-color: var(--wp--preset--color--mist, #f2f7f3);
	background-repeat: no-repeat;
	background-position: center;
	background-size: 22px 22px;
}

.ns-ico-shield::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23174a36' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2 4 5.5v6c0 5 3.4 9.3 8 10.5 4.6-1.2 8-5.5 8-10.5v-6L12 2Z'/%3E%3C/svg%3E");
}

.ns-ico-flask::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23174a36' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 3v5.6L4.6 17a2.4 2.4 0 0 0 2.1 3.6h10.6a2.4 2.4 0 0 0 2.1-3.6l-4.9-8.4V3'/%3E%3Cpath d='M8 3h8'/%3E%3Cpath d='M7.2 14h9.6'/%3E%3C/svg%3E");
}

.ns-ico-truck::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23174a36' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 6.5h11v10H2zM13 10h4.2l2.8 3.2v3.3h-7'/%3E%3Ccircle cx='6.2' cy='18' r='1.9'/%3E%3Ccircle cx='16.4' cy='18' r='1.9'/%3E%3C/svg%3E");
}

.ns-ico-headset::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23174a36' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 14v-2a8 8 0 0 1 16 0v2'/%3E%3Crect x='2.6' y='13.4' width='4.4' height='6.4' rx='2.2'/%3E%3Crect x='17' y='13.4' width='4.4' height='6.4' rx='2.2'/%3E%3C/svg%3E");
}

.ns-ico-leaf::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23174a36' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20c0-8 5-13 16-13 0 8-4.6 13-11 13H4Z'/%3E%3Cpath d='M4 20c3-4.6 6.6-7.6 11-9.4'/%3E%3C/svg%3E");
}

.ns-ico-check::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23174a36' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8.5 12.2 2.4 2.4 4.6-4.9'/%3E%3C/svg%3E");
}

/* -------------------------------------------------------------------------
 * Query Loop post cards
 * ---------------------------------------------------------------------- */

.wp-block-post-template {
	gap: 30px;
}

.wp-block-post-template > li {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	padding: 0 0 22px;
	border: 1px solid var(--wp--preset--color--line, #dfe5df);
	border-radius: var(--wp--custom--radius--medium, 12px);
	background: #fff;
	transition: transform .25s ease, box-shadow .25s ease;
}

.wp-block-post-template > li:hover {
	transform: translateY(-4px);
	box-shadow: 0 2px 10px rgba(20, 33, 27, .06);
}

.wp-block-post-template > li > .wp-block-post-featured-image {
	margin: 0 0 18px;
}

.wp-block-post-template > li > .wp-block-post-featured-image img {
	border-radius: 0;
}

.wp-block-post-template > li > :not(.wp-block-post-featured-image) {
	margin-inline: 22px;
}

.wp-block-post-template > li > .wp-block-post-date {
	margin-bottom: 8px;
}

.wp-block-post-template > li > .wp-block-post-title {
	margin: 0 22px 10px;
	line-height: 1.3;
}

.wp-block-post-template > li > .wp-block-post-title a {
	text-decoration: none;
}

/* -------------------------------------------------------------------------
 * Form fields from third-party plugins (contact forms)
 * ---------------------------------------------------------------------- */

.entry-content input[type="text"],
.entry-content input[type="email"],
.entry-content input[type="tel"],
.entry-content input[type="url"],
.entry-content input[type="number"],
.entry-content textarea,
.entry-content select {
	width: 100%;
	min-height: 48px;
	padding: 10px 12px;
	border: 1px solid #bdc8c0;
	border-radius: var(--wp--custom--radius--small, 6px);
	background: #fff;
	font: inherit;
	color: inherit;
}

.entry-content textarea {
	min-height: 130px;
	resize: vertical;
}

.entry-content input:focus,
.entry-content textarea:focus,
.entry-content select:focus {
	border-color: var(--wp--preset--color--forest, #174a36);
	outline: 2px solid var(--wp--preset--color--forest, #174a36);
	outline-offset: 1px;
}

.entry-content input[type="submit"],
.entry-content button[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	min-height: 50px;
	padding: 13px 26px;
	border: 0;
	border-radius: var(--wp--custom--radius--pill, 999px);
	background: var(--wp--preset--color--forest, #174a36);
	color: #fff;
	font-weight: 700;
	cursor: pointer;
}

.entry-content input[type="submit"]:hover,
.entry-content button[type="submit"]:hover {
	background: var(--wp--preset--color--ink, #14211b);
}
