/*
 * Small additions that theme.json cannot express.
 * Colours, type and spacing all come from theme.json presets.
 */

/* ---------- Links on dark backgrounds ---------- */
.has-forest-background-color a:where(:not(.wp-element-button)),
.has-garden-background-color a:where(:not(.wp-element-button)),
.wp-block-cover a:where(:not(.wp-element-button)) {
	color: inherit;
}
.has-forest-background-color :focus-visible,
.has-garden-background-color :focus-visible,
.wp-block-cover :focus-visible {
	outline-color: currentColor;
}

/* ---------- Header ---------- */
.site-utility p { margin: 0; }
.site-utility a { text-decoration: none; }
.site-utility a:hover { text-decoration: underline; }
.site-utility__sep { margin-inline: 0.6em; opacity: 0.6; }
.site-masthead { position: sticky; top: 0; z-index: 20; }
.site-header { box-shadow: 0 1px 0 var(--wp--preset--color--mist); }
.site-logo { margin: 0; }
.site-logo img { display: block; width: clamp(210px, 20vw, 280px) !important; height: auto; }

/*
 * Header layout
 *  ≥ 1180px   logo · menu · tour button on one row
 *  782–1179   logo + tour button, menu on its own row underneath
 *  < 782      logo + menu button (the mobile Call/Tour bar replaces the header button)
 */
.site-header__row { row-gap: 0.75rem; column-gap: var(--wp--preset--spacing--40); }
.site-nav { flex: 1 1 auto; font-size: 1.0625rem; }
.site-nav .wp-block-navigation__container { gap: clamp(1rem, 2vw, 1.75rem); }
.site-nav .wp-block-navigation-item__content { white-space: nowrap; }
.site-header__cta .wp-block-button__link { white-space: nowrap; }
@media (max-width: 1179px) {
	.site-header__row > .site-nav {
		order: 3;
		flex-basis: 100%;
		justify-content: flex-start;
		padding-top: 0.6rem;
		border-top: 1px solid var(--wp--preset--color--mist);
	}
	.site-nav .wp-block-navigation__container { justify-content: flex-start; }
}
@media (max-width: 781px) {
	.site-masthead { position: static; }
	.site-header__row > .site-header__cta.wp-block-buttons { display: none; }
	.site-utility__sep { display: none; }
	.site-utility p a:last-child { display: block; }
}
@media (max-width: 599px) {
	/* Core shows the hamburger here: keep it beside the logo, not on its own row. */
	.site-header__row > .site-nav { order: 0; flex: 0 0 auto; flex-basis: auto; padding-top: 0; border-top: 0; }
}
/* Sticky header must not sit on top of the admin bar. */
.admin-bar .site-masthead { top: var(--wp-admin--admin-bar--height, 32px); }

/* Tap targets at least 24×24px (WCAG 2.2, 2.5.8). */
.site-nav .wp-block-navigation-submenu__toggle { min-width: 24px; min-height: 24px; display: inline-flex; align-items: center; justify-content: center; }
.site-utility .wp-block-social-link a { min-width: 24px; min-height: 24px; display: inline-flex; align-items: center; justify-content: center; }

/* Navigation: current page + dropdowns */
.wp-block-navigation .current-menu-item > a,
.wp-block-navigation .current-menu-ancestor > a { text-decoration: underline; text-underline-offset: 0.3em; text-decoration-thickness: 2px; }
.site-nav .wp-block-navigation__submenu-container {
	min-width: 15rem !important;
	padding-block: 0.5rem;
	border: 1px solid var(--wp--preset--color--mist) !important;
	border-radius: 10px;
	box-shadow: var(--wp--preset--shadow--soft);
	font-size: 1rem;
	font-weight: 500;
}
.site-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 0.55rem 1.1rem !important;
	white-space: nowrap;
}
.site-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
	background: var(--wp--preset--color--linen);
	text-decoration: none;
}
/* Mobile overlay menu: a plain, left-aligned list with indented sub-items. */
.site-nav .wp-block-navigation__responsive-container.is-menu-open {
	--navigation-layout-justification-setting: flex-start;
	--navigation-layout-justify: flex-start;
	--navigation-layout-align: flex-start;
	padding: 1.25rem 1.5rem;
}
.site-nav .is-menu-open .wp-block-navigation__responsive-container-content {
	padding-top: 2.5rem;
	font-size: 1.25rem;
	align-items: flex-start !important;
}
.site-nav .is-menu-open .wp-block-navigation__container,
.site-nav .is-menu-open .wp-block-navigation-item { align-items: flex-start !important; gap: 0.9rem; }
.site-nav .is-menu-open .wp-block-navigation__submenu-container {
	min-width: 0 !important;
	padding: 0.2rem 0 0.4rem 1rem !important;
	border: 0 !important;
	border-left: 2px solid var(--wp--preset--color--mist) !important;
	border-radius: 0;
	box-shadow: none;
	font-size: 1.0625rem;
	gap: 0.2rem;
}
.site-nav .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding: 0.35rem 0 !important; }
.site-nav .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover { background: none; text-decoration: underline; }

/* ---------- Page structure ---------- */
/* Header, main, CTA band and footer butt up against each other. */
.wp-site-blocks > * { margin-block: 0; }
.entry-content > .alignfull { margin-block: 0; }
.page-titlebar .wp-block-post-title { margin-block-start: 0.25rem; }
.wp-block-breadcrumbs a { color: var(--wp--preset--color--stone); }

/* ---------- Lists ---------- */
.wp-block-list.is-style-plain { list-style: none; padding-left: 0; }
.wp-block-list.is-style-plain li + li { margin-top: 0.4em; }
.wp-block-list.is-style-checks { list-style: none; padding-left: 0; }
.wp-block-list.is-style-checks li { position: relative; padding-left: 1.9em; }
.wp-block-list.is-style-checks li + li { margin-top: 0.5em; }
.wp-block-list.is-style-checks li::before {
	content: "";
	position: absolute; left: 0; top: 0.35em;
	width: 1.15em; height: 1.15em; border-radius: 50%;
	background: var(--wp--preset--color--garden) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round' d='M5 10.5l3.2 3.2L15 7'/%3E%3C/svg%3E") center / 80% no-repeat;
}

/* ---------- Cards ---------- */
.wp-block-group.is-style-card {
	background: var(--wp--preset--color--white);
	border-radius: 14px;
	box-shadow: var(--wp--preset--shadow--soft);
	overflow: hidden;
	height: 100%;
}
.wp-block-group.is-style-card > .wp-block-image:first-child:not(.is-style-rounded) { margin: 0; }
.wp-block-group.is-style-card > .wp-block-image:first-child:not(.is-style-rounded) img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.wp-block-image img { border-radius: 10px; }
.wp-block-group.is-style-card > .wp-block-image:first-child:not(.is-style-rounded) img { border-radius: 0; }
.site-logo img, .site-footer .wp-block-image img { border-radius: 0; }

/* ---------- Hero / cover video ---------- */
.wp-block-cover.is-hero { padding-inline: var(--wp--style--root--padding-left, clamp(1rem, 4vw, 2rem)); }
/* Beats core's .has-custom-content-position rules so hero text lines up with the logo. */
.wp-block-cover.is-hero.is-hero.has-custom-content-position > .wp-block-cover__inner-container { width: 100%; max-width: 1240px; margin-inline: auto; }
/* Core constrained layout centres children with !important; the hero text sits left. */
.wp-block-cover.is-hero > .wp-block-cover__inner-container > .wp-block-group { max-width: 720px; margin-left: 0 !important; }
.wp-block-cover.is-hero h1 { text-wrap: balance; text-shadow: 0 2px 16px rgb(0 0 0 / 0.35); }
.cover-video-toggle {
	position: absolute; right: 1rem; bottom: 1rem; z-index: 2;
	width: 44px; height: 44px; border-radius: 50%;
	border: 2px solid #fff; background: rgb(0 0 0 / 0.35); color: #fff;
	cursor: pointer; display: grid; place-items: center;
}
.cover-video-toggle::before {
	content: ""; width: 14px; height: 14px;
	background: currentColor;
	clip-path: polygon(0 0, 35% 0, 35% 100%, 0 100%, 0 0, 65% 0, 100% 0, 100% 100%, 65% 100%, 65% 0);
}
.cover-video-toggle[data-state="paused"]::before { clip-path: polygon(10% 0, 100% 50%, 10% 100%); }
.cover-video-toggle:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* ---------- Details (FAQ) ---------- */
.wp-block-details summary {
	cursor: pointer;
	font-weight: 600;
	font-size: var(--wp--preset--font-size--large);
	color: var(--wp--preset--color--grove);
	list-style-position: outside;
}
.wp-block-details[open] summary { margin-bottom: 0.5rem; }

/* ---------- Placeholders (content the client must supply) ---------- */
.is-placeholder-content { outline: 2px dashed var(--wp--preset--color--bark); outline-offset: 6px; }

/* ---------- Footer ---------- */
.site-footer__heading {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
	color: var(--wp--preset--color--white);
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer__rule { border: 0; border-top: 1px solid rgb(255 255 255 / 0.2); opacity: 1; }

/* ---------- Mobile call / tour bar ---------- */
/* Extra class keeps these above core's "body .is-layout-flex { display: flex }" (same weight, loads later). */
body .mobile-cta-bar.is-layout-flex { display: none; }
@media (max-width: 781px) {
	body .mobile-cta-bar.is-layout-flex {
		display: flex;
		position: fixed; inset: auto 0 0 0; z-index: 30;
		padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom));
		box-shadow: 0 -2px 12px rgb(0 0 0 / 0.12);
	}
	.mobile-cta-bar .wp-block-buttons { width: 100%; gap: 0.6rem; }
	.mobile-cta-bar .wp-block-button { flex: 1; }
	.mobile-cta-bar .wp-block-button__link { width: 100%; padding: 0.65rem 0.5rem; font-size: 1rem; white-space: nowrap; }
	body { padding-bottom: 76px; }
}

/* ---------- Contact Form 7 ---------- */
.wpcf7 form p { margin-block: 0 1rem; }
.wpcf7 label { display: block; font-weight: 600; }
.wpcf7 input:where([type="text"], [type="email"], [type="tel"], [type="date"]),
.wpcf7 select,
.wpcf7 textarea {
	box-sizing: border-box;
	width: 100%; max-width: 100%; margin-top: 0.3rem;
	padding: 0.7rem 0.85rem;
	font: inherit;
	border: 1px solid #8d8d8d; border-radius: 8px;
	background: var(--wp--preset--color--white);
}
.wpcf7 textarea { min-height: 8rem; }
.wpcf7 input:focus, .wpcf7 select:focus, .wpcf7 textarea:focus {
	outline: 2px solid var(--wp--preset--color--garden); outline-offset: 1px; border-color: var(--wp--preset--color--garden);
}
.wpcf7 .wpcf7-submit {
	background: var(--wp--preset--color--garden); color: #fff;
	border: 0; border-radius: 999px; padding: 0.8rem 1.8rem;
	font: inherit; font-weight: 600; cursor: pointer;
}
.wpcf7 .wpcf7-submit:hover { background: var(--wp--preset--color--forest); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* ---------- Section helpers ---------- */
.eyebrow {
	margin-bottom: 0.25rem;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
	color: var(--wp--preset--color--bark);
}
.has-forest-background-color .eyebrow, .has-garden-background-color .eyebrow { color: var(--wp--preset--color--cream); }
.stat-row { border-top: 1px solid var(--wp--preset--color--mist); padding-top: var(--wp--preset--spacing--40); }
.stat { margin: 0; line-height: 1.4; color: var(--wp--preset--color--stone); }
.stat strong {
	display: block;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 500; line-height: 1.1;
	color: var(--wp--preset--color--grove);
}
.steps { padding-left: 1.4em; }
.steps li { padding-left: 0.4em; }
.steps li + li { margin-top: 0.8em; }
.steps li::marker { font-family: var(--wp--preset--font-family--heading); font-weight: 700; color: var(--wp--preset--color--garden); }
.wp-block-image.is-style-rounded img { border-radius: 50%; }
.card-body h3 a { color: inherit; text-decoration: none; }
.card-body h3 a:hover { text-decoration: underline; }
.map-embed { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--wp--preset--color--linen); }
.map-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.faq { margin-top: var(--wp--preset--spacing--40); }

/* ---------- Mid-width tuning (tablets, zoomed browsers) ---------- */
@media (max-width: 1099px) {
	/* Key-facts row: two per line instead of four squeezed. */
	.stat-row.wp-block-columns { flex-wrap: wrap !important; row-gap: var(--wp--preset--spacing--40); }
	.stat-row.wp-block-columns > .wp-block-column { flex-basis: calc(50% - var(--wp--preset--spacing--40)) !important; flex-grow: 0; }
}

/* ---------- Leadership cards ---------- */
.staff-grid .wp-block-post-template { align-items: stretch; }
.staff-grid .wp-block-post-template > li { display: flex; }
.staff-card { display: flex; flex-direction: column; width: 100%; }
.staff-card .wp-block-post-featured-image { margin: 0; }
.staff-card .wp-block-post-featured-image img { aspect-ratio: 1; object-fit: cover; object-position: 50% 20%; border-radius: 0; }
.staff-card > .card-body { display: flex; flex-direction: column; flex: 1; }
.staff-card .wp-block-post-title { margin: 0; font-size: var(--wp--preset--font-size--large); line-height: 1.25; }
.staff-card__role { margin: 0.35rem 0 1.25rem !important; color: var(--wp--preset--color--stone); font-size: var(--wp--preset--font-size--small); line-height: 1.45; }
/* "Read biography": small pill pinned to the bottom so every card lines up. */
.staff-card .staff-card__bio { margin-top: auto !important; padding: 0; border: 0; }
.staff-card .staff-card__bio > summary {
	display: inline-flex; align-items: center; gap: 0.4rem;
	padding: 0.45rem 1rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	color: var(--wp--preset--color--garden);
	border: 2px solid currentColor;
	border-radius: 999px;
	list-style: none;
}
.staff-card .staff-card__bio > summary::-webkit-details-marker { display: none; }
.staff-card .staff-card__bio > summary:hover { background: var(--wp--preset--color--linen); }
.staff-card .staff-card__bio[open] > summary { margin-bottom: 0.75rem; }
.staff-card .staff-card__bio .wp-block-post-content { font-size: var(--wp--preset--font-size--small); }

/* Biography dialog (enhanced by assets/js/staff-bio.js). */
.staff-dialog {
	width: min(40rem, calc(100% - 2rem));
	max-height: calc(100dvh - 2rem);
	padding: 0;
	border: 0;
	border-radius: 16px;
	box-shadow: 0 20px 60px rgb(0 0 0 / 0.3);
	color: var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--white);
}
.staff-dialog::backdrop { background: rgb(29 48 17 / 0.6); }
.staff-dialog__inner { padding: clamp(1.25rem, 4vw, 2rem); }
.staff-dialog__head { display: flex; gap: 1.25rem; align-items: center; margin-bottom: 1.25rem; }
.staff-dialog__head img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; flex: none; }
.staff-dialog__name { margin: 0; font-size: var(--wp--preset--font-size--x-large); }
.staff-dialog__role { margin: 0.25rem 0 0; color: var(--wp--preset--color--stone); }
.staff-dialog__body p { margin: 0 0 1em; }
.staff-dialog__close {
	position: absolute; top: 0.75rem; right: 0.75rem;
	width: 44px; height: 44px; border-radius: 50%;
	border: 0; background: var(--wp--preset--color--linen); color: var(--wp--preset--color--forest);
	font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.staff-dialog__close:focus-visible { outline: 3px solid var(--wp--preset--color--garden); outline-offset: 2px; }
/* Phones: compact rows (small photo left, details right) instead of full-width portraits. */
@media (max-width: 599px) {
	.staff-grid .wp-block-post-template { gap: 0.75rem; }
	.staff-card { flex-direction: row; align-items: center; }
	.staff-card .wp-block-post-featured-image { flex: 0 0 88px; width: 88px; margin: 0.75rem 0 0.75rem 0.75rem; }
	.staff-card .wp-block-post-featured-image img { width: 88px; height: 88px; border-radius: 10px; }
	.staff-card > .card-body { padding: 0.75rem 0.9rem !important; justify-content: center; }
	.staff-card .wp-block-post-title { font-size: 1.125rem; }
	.staff-card__role { margin: 0.2rem 0 0.6rem !important; font-size: 0.9375rem; }
	.staff-card .staff-card__bio { margin-top: 0 !important; }
	.staff-card .staff-card__bio > summary { padding: 0.3rem 0.8rem; font-size: 0.875rem; }
}

/*
 * Phones: the sticky bar always offers Call and Schedule a Tour, so hide in-page
 * buttons that only repeat those two actions (tel: links and links to /contact/).
 * A button row left with nothing in it is hidden too. Text links are untouched.
 */
@media (max-width: 781px) {
	/* Classes are added in functions.php (works in every browser). */
	:is(main, .cta-band) .wp-block-button.is-contact-action,
	:is(main, .cta-band) .wp-block-buttons.has-only-contact-actions { display: none !important; }
	/* The call-to-action band keeps its message; the sticky bar is the action. */
	.cta-band { padding-block: var(--wp--preset--spacing--50) !important; }
}

/* ---------- Values (Mission page): core Tabs block styled as centered pills ---------- */
/* Compact intro: eyebrow, heading and sentence sit close together. */
.entry-content .has-linen-background-color:has(.values-tabs) > * + * { margin-block-start: 0.5rem; }
.entry-content .has-linen-background-color:has(.values-tabs) h2 { margin-block: 0.1rem 0.25rem; }
.values-tabs { margin-top: var(--wp--preset--spacing--40) !important; }
.values-tabs .wp-block-tab-list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;   /* any number of values stays balanced */
	gap: 0.5rem;
	border: 0;
	max-width: 46rem;
	margin-inline: auto;
}
.values-tabs .wp-block-tab-list button {
	padding: 0.4rem 1rem;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.0625rem;
	line-height: 1.2;
	color: var(--wp--preset--color--forest);
	background: var(--wp--preset--color--white);
	border: 1.5px solid var(--wp--preset--color--mist);
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.values-tabs .wp-block-tab-list button:hover { border-color: var(--wp--preset--color--garden); }
.values-tabs .wp-block-tab-list button::before { display: none; } /* core's underline; the filled pill shows selection */
.values-tabs .wp-block-tab-list button[aria-selected="true"] {
	color: var(--wp--preset--color--white);
	background: var(--wp--preset--color--garden);
	border-color: var(--wp--preset--color--garden);
}
.values-tabs .wp-block-tab-list button:focus-visible { outline: 2px solid var(--wp--preset--color--garden); outline-offset: 2px; }
.values-tabs .wp-block-tab-panels { max-width: 40rem; margin: 1rem auto 0; }
.values-tabs .wp-block-tab-panel {
	padding: 1.25rem 1.75rem;
	text-align: center;
	background: var(--wp--preset--color--white);
	border-radius: 12px;
	box-shadow: var(--wp--preset--shadow--soft);
}
.values-tabs .wp-block-tab-panel p { margin: 0; font-size: var(--wp--preset--font-size--medium); line-height: 1.6; }
.values-tabs .wp-block-tab-panel:focus-visible { outline: 2px solid var(--wp--preset--color--garden); outline-offset: 2px; }
@media (max-width: 599px) {
	.values-tabs .wp-block-tab-list button { padding: 0.35rem 0.8rem; font-size: 1rem; }
	.values-tabs .wp-block-tab-panel { padding: 1rem 1.1rem; }
}

/* Links that open a new tab (PDFs, Facebook; set by cottages-core) get a small arrow cue. */
a[target="_blank"]:not(.wp-block-social-link-anchor)::after {
	content: "\2197";
	display: inline-block;
	margin-left: 0.25em;
	font-size: 0.85em;
	text-decoration: none;
}
