/*
 * AMDI Farm: block layer on top of the Amdi Farm Brand Kit (amdi-brand.css).
 * The kit sets type, colour and spacing tokens under body.amdi; this file
 * fits them to WordPress block layouts.
 */

/* Block layouts own vertical rhythm (blockGap); drop the kit's bottom margins. */
body.amdi :is(h1, h2, h3, h4, h5, h6, p, ul, ol, figure) { margin-bottom: 0; }
body.amdi .wp-site-blocks { min-height: 100vh; display: flex; flex-direction: column; }
body.amdi .wp-site-blocks > main { flex: 1 0 auto; }
body.amdi a:where(:not(.wp-element-button)) { text-underline-offset: 3px; }

/* Eyebrow label above section headings. */
.amdi .is-style-eyebrow,
.amdi .amdi-eyebrow {
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.8rem;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--tomato-deep);
}

/* Header */
.amdi .site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	backdrop-filter: saturate(1.2) blur(8px);
	background: color-mix(in srgb, var(--wp--preset--color--cream) 92%, transparent);
	border-bottom: 1px solid var(--wp--preset--color--sand);
}
.admin-bar .amdi .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .amdi .site-header { top: 0; position: relative; } }
.amdi .site-header .wp-block-site-logo img { width: 64px; height: auto; }
.amdi .site-header .wp-block-site-title a { color: var(--wp--preset--color--bark); text-decoration: none; }
.amdi .wp-block-navigation a { text-decoration: none; }
.amdi .wp-block-navigation a:hover { color: var(--wp--preset--color--tomato-deep); }
.amdi .wp-block-navigation .current-menu-item > a { color: var(--wp--preset--color--tomato-deep); }

/* Hero (cover block) */
.amdi .amdi-hero { min-height: min(78vh, 720px); }
.amdi .amdi-hero h1 { color: var(--wp--preset--color--linen); text-wrap: balance; }
.amdi .amdi-hero p { color: var(--wp--preset--color--cream); max-width: 38rem; }

/* Card block style for groups */
.amdi .is-style-amdi-card {
	background: var(--wp--preset--color--linen);
	border: 1px solid var(--wp--preset--color--sand);
	border-radius: var(--wp--custom--radius--card);
	box-shadow: var(--wp--preset--shadow--soft);
	padding: var(--wp--preset--spacing--40);
	height: 100%;
}
.amdi .is-style-amdi-card .wp-block-image img { border-radius: 10px; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.amdi .wp-block-columns.amdi-cards > .wp-block-column { display: flex; }
.amdi .wp-block-columns.amdi-cards > .wp-block-column > .is-style-amdi-card { flex: 1; }

/* Business-line chips */
.amdi .amdi-lines { gap: 0.6rem !important; }
.amdi .amdi-lines p {
	background: var(--wp--preset--color--linen);
	border: 1px solid var(--wp--preset--color--kraft);
	border-radius: 999px;
	padding: 0.45rem 1.05rem;
	font-weight: 700;
	color: var(--wp--preset--color--forest);
}

/* Images with the brand radius and a soft shadow */
.amdi .amdi-photo img { border-radius: var(--wp--custom--radius--image); box-shadow: var(--wp--preset--shadow--lifted); width: 100%; object-fit: cover; }

/* Secondary (outline) button */

/* Footer */
.amdi .site-footer { color: var(--wp--preset--color--cream); }
.amdi .site-footer :is(h2, h3, h4) { color: var(--wp--preset--color--sun); }
.amdi .site-footer a { color: var(--wp--preset--color--cream); }
.amdi .site-footer a:hover { color: var(--wp--preset--color--sun); }
.amdi .site-footer .wp-block-site-logo img { width: 96px; height: auto; }
.amdi .site-footer .amdi-credits { border-top: 1px solid rgba(250, 241, 224, .18); color: #CBBF9F; font-size: 0.875rem; }
.amdi .site-footer .amdi-credits a { color: var(--wp--preset--color--cream); font-weight: 700; text-decoration: none; }
.amdi .site-footer .amdi-credits a:hover { color: var(--wp--preset--color--sun); text-decoration: underline; }
.amdi .site-footer .amdi-vimo img { height: 26px; width: auto; filter: brightness(0) invert(1); opacity: .85; }

/* Contact list */
.amdi .amdi-contact-list { list-style: none; padding-left: 0; }
.amdi .amdi-contact-list li + li { margin-top: 0.4rem; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Buttons: the kit's `.amdi a` link colour must not reach button labels. */
.amdi a.wp-element-button,
.amdi .wp-block-button__link { color: var(--wp--preset--color--linen); text-decoration: none; }
.amdi a.wp-element-button:hover,
.amdi .wp-block-button__link:hover { color: var(--wp--preset--color--linen); }

/* Dark sections: light text throughout. */
.amdi :is(.has-forest-background-color, .has-forest-deep-background-color, .has-forest-night-background-color, .has-bark-background-color, .has-bark-deep-background-color) {
	color: var(--wp--preset--color--cream);
}
.amdi :is(.has-forest-background-color, .has-forest-deep-background-color, .has-forest-night-background-color, .has-bark-background-color, .has-bark-deep-background-color) :is(h1, h2, h3, h4, p, cite, li) { color: inherit; }
.amdi :is(.has-forest-background-color, .has-forest-deep-background-color, .has-forest-night-background-color) .wp-block-quote { border-left-color: var(--wp--preset--color--pumpkin); }
.amdi :is(.has-forest-background-color, .has-forest-deep-background-color, .has-forest-night-background-color) .wp-block-quote p { color: var(--wp--preset--color--linen); font-size: var(--wp--preset--font-size--xx-large); line-height: 1.15; }
.amdi :is(.has-forest-background-color, .has-forest-deep-background-color, .has-forest-night-background-color) .wp-block-quote cite { color: var(--wp--preset--color--sun); font-style: normal; font-weight: 700; }
.amdi :is(.has-forest-background-color, .has-forest-deep-background-color, .has-forest-night-background-color) a:not(.wp-element-button) { color: var(--wp--preset--color--sun); }

/* Cards: compact headings, never split words. */
.amdi .is-style-amdi-card :is(h2, h3) { font-size: var(--wp--preset--font-size--large); overflow-wrap: normal; word-break: normal; hyphens: manual; }

/* Block spacing: the kit's `margin: 0 0 …` on headings/paragraphs would cancel
   WordPress's blockGap (margin-block-start), so restore it between siblings. */
body.amdi :is(.is-layout-constrained, .is-layout-flow) > :is(h1, h2, h3, h4, h5, h6, p, ul, ol, figure, .wp-block-buttons, .wp-block-columns, .wp-block-group, .wp-block-quote, .wp-block-separator) { margin-block-start: var(--wp--style--block-gap, 1.25rem); }
body.amdi :is(.is-layout-constrained, .is-layout-flow) > :first-child { margin-block-start: 0; }
body.amdi .is-style-eyebrow + :is(h1, h2, h3) { margin-block-start: 0.4rem; }

/* Hero: everything left-aligned in the wide container, light outline button. */
.amdi .amdi-hero .is-style-eyebrow { color: var(--wp--preset--color--sun); }

/* Outline buttons take the colour of their surroundings: forest on light
   sections, linen on photos and dark sections. */
.amdi .wp-block-button.is-style-outline > .wp-block-button__link { background: transparent; color: var(--wp--preset--color--forest); border: 2px solid currentColor; }
.amdi .wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--parchment); color: var(--wp--preset--color--forest); }
.amdi :is(.wp-block-cover, .has-forest-background-color, .has-forest-deep-background-color, .has-forest-night-background-color) .wp-block-button.is-style-outline > .wp-block-button__link { color: var(--wp--preset--color--linen); }
.amdi :is(.wp-block-cover, .has-forest-background-color, .has-forest-deep-background-color, .has-forest-night-background-color) .wp-block-button.is-style-outline > .wp-block-button__link:hover { background: rgba(255, 251, 242, .14); color: var(--wp--preset--color--linen); }

/* Hero content sits in the wide column, left-aligned. */
.amdi .amdi-hero .wp-block-cover__inner-container { width: 100%; max-width: var(--wp--style--global--wide-size, 1200px); margin-inline: auto; }
.amdi .amdi-hero .wp-block-cover__inner-container > * { margin-left: 0 !important; margin-right: 0 !important; }

/* Small screens: no horizontal overflow; the header CTA moves into the page. */
html, body.amdi { overflow-x: clip; }
@media (max-width: 781px) {
	.amdi .amdi-header-cta { display: none; }
	.amdi .site-header .wp-block-site-logo img { width: 52px; }
	.amdi .site-header .wp-block-site-title { font-size: 1.2rem !important; }
	.amdi .amdi-hero h1 { font-size: 2.2rem; }
}
