/*
Theme Name: iamb.io
Theme URI: https://iamb.io
Author: iamb.io
Author URI: https://iamb.io
Description: The iamb.io site as a block theme. Every page, the header, the footer and the forms are editable in the WordPress editor. Activating the theme on a new site installs the pages, articles, images, forms, logo and homepage settings. Includes a form builder, a single Site Details screen for contact information, and built-in SEO.
Version: 1.0.1
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: iamb
Tags: full-site-editing, block-patterns, block-styles, custom-logo, custom-menu, editor-style, wide-blocks
*/

/* ---------------------------------------------------------------------------
   Tokens
--------------------------------------------------------------------------- */
:root {
	--iamb-ink: var(--wp--preset--color--ink);
	--iamb-pine: var(--wp--preset--color--pine);
	--iamb-moss: var(--wp--preset--color--moss);
	--iamb-sage: var(--wp--preset--color--sage);
	--iamb-mist: var(--wp--preset--color--mist);
	--iamb-paper: var(--wp--preset--color--paper);
	--iamb-rule: rgba(16, 26, 21, 0.16);
	--iamb-rule-light: rgba(255, 255, 255, 0.18);
	/* The logo's underline: thick on the left, tapering to a point. */
	--iamb-wedge: polygon(0 14%, 100% 0, 1.2% 100%);
	--iamb-utility-height: 2.25rem;
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

h1,
h2 {
	font-stretch: 108%;
	text-wrap: balance;
}

p {
	text-wrap: pretty;
}

::selection {
	background: var(--iamb-sage);
	color: var(--iamb-ink);
}

:where(a, button, summary, input, select, textarea):focus-visible {
	outline: 3px solid var(--iamb-moss);
	outline-offset: 2px;
}

:where(.has-pine-background-color, .has-ink-background-color) :focus-visible {
	outline-color: var(--iamb-sage);
}

/* ---------------------------------------------------------------------------
   Page structure
--------------------------------------------------------------------------- */
.wp-site-blocks > * {
	margin-block-start: 0;
}

.iamb-section {
	margin-block: 0 !important;
}

.wp-block-image img,
.wp-block-post-featured-image img {
	height: auto;
	border-radius: 4px;
}

.iamb-lede {
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.5;
	max-width: 38rem;
}

.iamb-measure {
	max-width: 40rem;
}

/* ---------------------------------------------------------------------------
   Dark sections
--------------------------------------------------------------------------- */
:where(.has-pine-background-color, .has-ink-background-color) a:where(:not(.wp-element-button)) {
	color: var(--iamb-sage);
}

:where(.has-pine-background-color, .has-ink-background-color) .wp-block-button:not(.is-style-outline):not(.is-style-text-link) > .wp-block-button__link:not(.has-background),
:where(.has-pine-background-color, .has-ink-background-color) .iamb-form .wp-element-button {
	background: var(--iamb-sage);
	color: var(--iamb-ink);
}

:where(.has-pine-background-color, .has-ink-background-color) .wp-block-button:not(.is-style-outline):not(.is-style-text-link) > .wp-block-button__link:not(.has-background):hover,
:where(.has-pine-background-color, .has-ink-background-color) .iamb-form .wp-element-button:hover {
	background: #fff;
	color: var(--iamb-ink);
}

/* ---------------------------------------------------------------------------
   Buttons
--------------------------------------------------------------------------- */
.wp-element-button,
.wp-block-button__link {
	transition: background-color 0.15s ease, color 0.15s ease;
}

.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 2px solid currentColor;
	padding: calc(0.9rem - 2px) calc(1.5rem - 2px);
}

.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color) {
	color: inherit;
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--iamb-ink);
	border-color: var(--iamb-ink);
	color: #fff;
}

:where(.has-pine-background-color, .has-ink-background-color) .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: #fff;
	border-color: #fff;
	color: var(--iamb-ink);
}

.wp-block-button.is-style-text-link > .wp-block-button__link {
	background: none;
	color: inherit;
	padding: 0 0 0.2rem;
	border-radius: 0;
	border-bottom: 3px solid var(--iamb-sage);
}

.wp-block-button.is-style-text-link > .wp-block-button__link:hover {
	background: none;
	color: inherit;
	border-bottom-color: currentColor;
}

/* ---------------------------------------------------------------------------
   Signature: the wedge and the iambic headline
--------------------------------------------------------------------------- */
.is-style-iambic {
	font-weight: 300;
	font-stretch: 100%;
	letter-spacing: -0.035em;
	line-height: 0.98;
}

.is-style-iambic strong {
	font-weight: 900;
	font-stretch: 112%;
}

.iamb-hero {
	position: relative;
	overflow: hidden;
}

.wp-block-separator.is-style-wedge {
	border: 0;
	height: 14px;
	width: 12rem;
	max-width: 60%;
	margin-inline: 0 auto;
	background: currentColor;
	clip-path: var(--iamb-wedge);
	opacity: 1;
}

.is-style-wedge-card {
	position: relative;
	padding-top: 1.75rem;
}

.is-style-wedge-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: min(100%, 11rem);
	height: 12px;
	background: var(--iamb-sage);
	clip-path: var(--iamb-wedge);
}

.has-sage-background-color .is-style-wedge-card::before,
.has-mist-background-color .is-style-wedge-card::before {
	background: var(--iamb-moss);
}

.is-style-wedge-card h3 a,
.is-style-wedge-card h2 a {
	color: inherit;
	text-decoration: none;
}

.is-style-wedge-card h3 a:hover,
.is-style-wedge-card h2 a:hover {
	text-decoration: underline;
	text-decoration-thickness: 3px;
	text-decoration-color: var(--iamb-sage);
	text-underline-offset: 0.18em;
}

.is-style-panel {
	background: #fff;
	border: 1px solid var(--iamb-rule);
	border-radius: 4px;
	padding: clamp(1.5rem, 3vw, 2.5rem);
}

.has-pine-background-color .is-style-panel,
.has-ink-background-color .is-style-panel {
	color: var(--iamb-ink);
}

.is-style-panel.is-style-panel .wp-block-button:not(.is-style-outline):not(.is-style-text-link) > .wp-block-button__link:not(.has-background),
.is-style-panel.is-style-panel .iamb-form .wp-element-button {
	background: var(--iamb-ink);
	color: #fff;
}

.is-style-panel.is-style-panel .wp-block-button:not(.is-style-outline):not(.is-style-text-link) > .wp-block-button__link:not(.has-background):hover,
.is-style-panel.is-style-panel .iamb-form .wp-element-button:hover {
	background: var(--iamb-moss);
	color: #fff;
}

.has-pine-background-color .is-style-panel a:where(:not(.wp-element-button)),
.has-ink-background-color .is-style-panel a:where(:not(.wp-element-button)) {
	color: var(--iamb-moss);
}

ul.is-style-wedge {
	list-style: none;
	padding-left: 0;
}

ul.is-style-wedge li {
	position: relative;
	padding-left: 2rem;
	margin-bottom: 0.65rem;
}

ul.is-style-wedge li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.55em;
	width: 1.25rem;
	height: 0.5rem;
	background: var(--iamb-moss);
	clip-path: var(--iamb-wedge);
}

:where(.has-pine-background-color, .has-ink-background-color) ul.is-style-wedge li::before {
	background: var(--iamb-sage);
}

/* ---------------------------------------------------------------------------
   Steps (a real sequence, numbered automatically)
--------------------------------------------------------------------------- */
.iamb-steps {
	counter-reset: iamb-step;
}

.iamb-step {
	counter-increment: iamb-step;
	border-top: 2px solid currentColor;
	padding-top: 1rem;
}

.iamb-step::before {
	content: counter(iamb-step);
	display: block;
	font-size: clamp(3rem, 6vw, 4.5rem);
	font-weight: 200;
	line-height: 1;
	letter-spacing: -0.04em;
	color: var(--iamb-moss);
	margin-bottom: 0.75rem;
}

:where(.has-pine-background-color, .has-ink-background-color) .iamb-step::before {
	color: var(--iamb-sage);
}

/* ---------------------------------------------------------------------------
   Link lists
--------------------------------------------------------------------------- */
ul.iamb-links {
	list-style: none;
	padding: 0;
	margin-block: 0;
	columns: 2 16rem;
	column-gap: 2.5rem;
}

ul.iamb-links li {
	break-inside: avoid;
	border-top: 1px solid var(--iamb-rule);
	padding: 0.85rem 0;
}

:where(.has-pine-background-color, .has-ink-background-color) ul.iamb-links li {
	border-top-color: var(--iamb-rule-light);
}

ul.iamb-links a {
	font-weight: 700;
	text-decoration: none;
	color: inherit;
}

ul.iamb-links a:hover {
	text-decoration: underline;
	text-decoration-thickness: 3px;
	text-decoration-color: var(--iamb-sage);
	text-underline-offset: 0.2em;
}

/* ---------------------------------------------------------------------------
   Header
--------------------------------------------------------------------------- */
header.wp-block-template-part {
	position: sticky;
	top: calc(var(--wp-admin--admin-bar--height, 0px) - var(--iamb-utility-height));
	z-index: 100;
}

.iamb-utility {
	min-height: var(--iamb-utility-height);
	font-size: 0.8125rem;
}

.iamb-utility a,
.iamb-utility a:where(:not(.wp-element-button)) {
	color: inherit;
	text-decoration: none;
}

.iamb-utility a:hover {
	color: var(--iamb-sage);
}

.iamb-utility p,
.iamb-utility .iamb-detail {
	margin: 0;
}

.iamb-header-main .wp-block-site-logo img {
	display: block;
}

.iamb-header-main .wp-block-navigation a:where(:not(.wp-element-button)) {
	color: inherit;
}

.iamb-header-main .wp-block-navigation .wp-block-navigation-item__content:hover,
.iamb-header-main .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
	color: var(--iamb-sage);
}

.iamb-header-main .wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container {
	background: var(--iamb-pine);
	color: #fff;
	border: 1px solid var(--iamb-rule-light);
	border-radius: 4px;
	min-width: 17rem;
	padding: 0.5rem;
}

.iamb-header-main .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 0.55rem 0.75rem;
}

.iamb-header-main .wp-block-button__link {
	padding: 0.65rem 1.1rem;
	font-size: 0.9375rem;
	white-space: nowrap;
}

.wp-block-navigation__responsive-container.is-menu-open {
	padding: 1.5rem clamp(1.25rem, 4vw, 3rem);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item__content {
	font-size: 1.375rem;
	font-weight: 800;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	font-size: 1.0625rem;
	font-weight: 500;
}

/* Switch to the menu button before the links run out of room. */
@media (min-width: 600px) and (max-width: 1039px) {
	.iamb-header-main .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}

	.iamb-header-main .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}
}

@media (max-width: 781px) {
	header.wp-block-template-part {
		top: 0;
	}

	.iamb-utility {
		display: none !important;
	}

	.iamb-header-cta {
		display: none !important;
	}
}

/* ---------------------------------------------------------------------------
   Footer
--------------------------------------------------------------------------- */
.iamb-footer a:where(:not(.wp-element-button)) {
	color: inherit;
	text-decoration: none;
}

.iamb-footer a:where(:not(.wp-element-button)):hover {
	color: var(--iamb-sage);
	text-decoration: underline;
}

.iamb-footer ul {
	list-style: none;
	padding: 0;
	margin-top: 0.75rem;
}

.iamb-footer li {
	margin-bottom: 0.55rem;
}

.iamb-footer .iamb-detail {
	margin-block: 0 0.55rem;
}

.iamb-footer-bottom {
	border-top: 1px solid var(--iamb-rule-light);
}

/* ---------------------------------------------------------------------------
   Site details
--------------------------------------------------------------------------- */
.iamb-detail address {
	font-style: normal;
}

.iamb-detail__prefix {
	opacity: 0.7;
}

.iamb-social {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
	margin: 0;
	padding: 0;
}

.iamb-contact-list .iamb-detail {
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 700;
	margin-block: 0 0.35rem;
}

.iamb-contact-list .iamb-detail a {
	color: inherit;
	text-decoration-color: var(--iamb-sage);
	text-decoration-thickness: 3px;
	text-underline-offset: 0.2em;
}

/* ---------------------------------------------------------------------------
   Questions and answers
--------------------------------------------------------------------------- */
.wp-block-details {
	border-top: 1px solid var(--iamb-rule);
	padding-block: 1.1rem;
	margin-block: 0 !important;
}

.wp-block-details:last-of-type {
	border-bottom: 1px solid var(--iamb-rule);
}

.wp-block-details summary {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1.5rem;
	list-style: none;
	cursor: pointer;
	font-weight: 700;
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.3;
}

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

.wp-block-details summary::after {
	content: "+";
	flex: none;
	font-weight: 300;
	font-size: 1.6em;
	line-height: 0.8;
	color: var(--iamb-moss);
}

.wp-block-details[open] summary::after {
	content: "\2212";
}

.wp-block-details > :not(summary) {
	max-width: 42rem;
	margin-block: 0.75rem 0;
}

/* ---------------------------------------------------------------------------
   Articles
--------------------------------------------------------------------------- */
.iamb-post-card .wp-block-post-title {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.12;
	letter-spacing: -0.02em;
	font-stretch: 100%;
}

.iamb-post-card .wp-block-post-title a:hover {
	text-decoration: underline;
	text-decoration-thickness: 3px;
	text-decoration-color: var(--iamb-sage);
	text-underline-offset: 0.16em;
}

.iamb-post-card .wp-block-post-excerpt__more-text {
	display: none;
}

.iamb-meta {
	font-size: 0.875rem;
	color: var(--iamb-moss);
}

.iamb-meta a {
	color: inherit;
	text-decoration: none;
	font-weight: 600;
}

:where(.has-pine-background-color, .has-ink-background-color) .iamb-meta {
	color: var(--iamb-sage);
}

.iamb-prose > h2 {
	font-size: var(--wp--preset--font-size--large);
	font-stretch: 100%;
	letter-spacing: -0.02em;
	line-height: 1.15;
	margin-block-start: 2.75rem;
}

.iamb-prose > h3 {
	font-size: var(--wp--preset--font-size--medium);
	margin-block-start: 2rem;
}

.wp-block-query-pagination {
	border-top: 1px solid var(--iamb-rule);
	padding-top: 1.5rem;
	font-weight: 700;
}

.wp-block-search__input {
	font: inherit;
	padding: 0.75rem 0.875rem;
	border: 1.5px solid rgba(16, 26, 21, 0.4);
	border-radius: 3px;
	background: #fff;
}

/* ---------------------------------------------------------------------------
   Forms
--------------------------------------------------------------------------- */
.iamb-form {
	position: relative;
}

.iamb-form__fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.1rem 1.25rem;
}

.iamb-field {
	grid-column: 1 / -1;
	margin: 0;
	min-width: 0;
	border: 0;
	padding: 0;
}

.iamb-field--half {
	grid-column: span 1;
}

@media (max-width: 600px) {
	.iamb-field--half {
		grid-column: 1 / -1;
	}
}

.iamb-field > label,
.iamb-field > legend {
	display: block;
	font-weight: 600;
	font-size: 0.9375rem;
	margin-bottom: 0.4rem;
	padding: 0;
}

.iamb-form__required {
	color: var(--iamb-moss);
}

.iamb-form input:where([type="text"], [type="email"], [type="tel"], [type="url"]),
.iamb-form select,
.iamb-form textarea {
	display: block;
	width: 100%;
	box-sizing: border-box;
	font: inherit;
	color: var(--iamb-ink);
	background: #fff;
	border: 1.5px solid rgba(16, 26, 21, 0.4);
	border-radius: 3px;
	padding: 0.75rem 0.875rem;
}

.iamb-form select {
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, var(--iamb-ink) 50%), linear-gradient(135deg, var(--iamb-ink) 50%, transparent 50%);
	background-position: calc(100% - 1.15rem) 50%, calc(100% - 0.8rem) 50%;
	background-size: 0.35rem 0.35rem;
	background-repeat: no-repeat;
	padding-right: 2.25rem;
}

.iamb-form textarea {
	resize: vertical;
	min-height: 8rem;
}

.iamb-form input:focus-visible,
.iamb-form select:focus-visible,
.iamb-form textarea:focus-visible {
	border-color: var(--iamb-ink);
	outline-offset: 0;
}

.iamb-form__choice {
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
	font-weight: 400;
	margin-bottom: 0.35rem;
}

.iamb-form__choice input {
	flex: none;
	accent-color: var(--iamb-moss);
}

.iamb-form__actions {
	margin: 1.5rem 0 0;
}

.iamb-form .wp-element-button {
	border: 0;
	cursor: pointer;
	font-family: inherit;
}

.iamb-form.is-sending .wp-element-button {
	opacity: 0.6;
	pointer-events: none;
}

.iamb-form__trap {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.iamb-form__notice {
	padding: 1rem 1.25rem;
	border-left: 6px solid var(--iamb-moss);
	background: var(--iamb-mist);
	color: var(--iamb-ink);
	font-weight: 600;
	border-radius: 0 4px 4px 0;
	margin-bottom: 1.25rem;
}

.iamb-form__notice--error {
	border-left-color: #a3341f;
	background: #fbeae6;
}

/* ---------------------------------------------------------------------------
   Small screens
--------------------------------------------------------------------------- */
@media (max-width: 781px) {
	.iamb-reverse-mobile {
		flex-direction: column-reverse;
	}
}

/* Linked section headings keep the heading colour. */
.wp-block-post-content :where(h2, h3).wp-block-heading a {
	color: inherit;
	text-decoration-color: var(--iamb-sage);
	text-decoration-thickness: 3px;
	text-underline-offset: 0.14em;
}

.wp-block-post-content :where(h2, h3).wp-block-heading a:hover {
	text-decoration-color: currentColor;
}
