/**
 * MEMOT theme styles — careers.
 *
 * The Careers page job list ([memot_jobs]), the job detail page
 * (single-memot_job) and the application page (single-memot_job-apply). The
 * application form itself is styled by pages/forms.css, shared with Contact;
 * this file only adds the layout around it and the application form's own
 * full-width fields. Markup: inc/careers.php.
 */

/* -------------------------------------------------------------------------- *
 * Shared: job facts (location / type / closing date) and the closed notice
 * -------------------------------------------------------------------------- */

.memot-job-facts {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
	color: var(--wp--preset--color--slate);
	font-size: 0.9375rem;
}

.memot-job-facts__item {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.memot-job-facts__icon {
	flex: none;
	width: 1rem;
	height: 1rem;
	color: var(--wp--preset--color--brand);
}

.memot-job-closed {
	display: inline-block;
	margin: 0;
	padding: 0.6rem 1rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--memot-radius);
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
	font-size: 0.9375rem;
	font-weight: 600;
}

/* -------------------------------------------------------------------------- *
 * Careers page: hero
 *
 * Copy (intro, perks, actions) beside one photo in an arch-topped frame — the
 * arch picks up the canopy the rubber rows form overhead in the picture. An
 * amber hairline arch sits offset behind it (same amber as the eyebrow tick)
 * and a small tapping-cups photo overlaps the frame's lower corner.
 * -------------------------------------------------------------------------- */

/* The shared page-hero gradient fades into sand, the same color as the
   Open Positions band below, so the two ran together. Here the green holds
   and deepens toward the bottom instead, giving the hero a clear lower edge
   against the sand band. Mixed from the brand token, not a new color. */
.memot-careers-hero {
	overflow-x: clip; /* the offset arch and inset may overhang on narrow screens */
	background: linear-gradient(180deg, color-mix(in srgb, var(--wp--preset--color--brand) 8%, var(--wp--preset--color--paper)) 0%, color-mix(in srgb, var(--wp--preset--color--brand) 14%, var(--wp--preset--color--sand)) 100%);
}

/* Butt the next band against the hero: the flow layout's block gap would show
   as a white strip between two tinted bands. */
.memot-careers-hero + .alignfull {
	margin-block-start: 0;
}

.memot-careers-hero__grid {
	margin-top: 0;
	margin-bottom: 0;
}

.memot-careers-hero h1 {
	max-width: 14ch;
}

.memot-careers-hero__lead {
	max-width: 48ch;
	text-wrap: pretty;
}

.memot-careers-hero__perks {
	margin-top: var(--wp--preset--spacing--50);
}

.memot-careers-hero__actions {
	margin-top: var(--wp--preset--spacing--60);
}

.memot-careers-hero__stage {
	position: relative;
	width: min(100%, 28rem);
	margin-left: auto;
	aspect-ratio: 4 / 5;
}

.memot-careers-hero__stage::before {
	content: "";
	position: absolute;
	inset: 0;
	border: 2px solid var(--wp--preset--color--harvest);
	transform: translate(1.25rem, -1.25rem);
	pointer-events: none;
}

/* Arch: 50% of a 4:5 frame's width = 40% of its height, so the top is a true
   semicircle. Longhands, because the shorthand needs the "/" form for this. */
.memot-careers-hero__stage::before,
.memot-careers-hero__photo {
	border-top-left-radius: 50% 40%;
	border-top-right-radius: 50% 40%;
	border-bottom-right-radius: var(--memot-radius-lg);
	border-bottom-left-radius: var(--memot-radius-lg);
}

/* Both photos are core Image blocks (so editors can swap them).
   `.wp-block-image` outranks core's image-block margin and `height: auto`,
   and the photo covers whatever frame it is given. */
.wp-block-image:is(.memot-careers-hero__photo, .memot-careers-hero__inset) {
	margin: 0;
	overflow: hidden;
}

.memot-careers-hero__photo {
	position: relative;
	height: 100%;
	background: var(--wp--preset--color--brand); /* holds the frame's shape while the photo loads */
	box-shadow: var(--memot-shadow-lg);
}

.wp-block-image:is(.memot-careers-hero__photo, .memot-careers-hero__inset) img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.memot-careers-hero__inset {
	position: absolute;
	bottom: 9%;
	left: -14%;
	width: 40%;
	aspect-ratio: 1;
	border: 6px solid var(--wp--preset--color--paper);
	border-radius: var(--memot-radius-lg);
	box-shadow: var(--memot-shadow-lg);
}

@media (max-width: 781px) {

	.memot-careers-hero h1 {
		max-width: 100%;
	}

	.memot-careers-hero__stage {
		width: min(calc(100% - 2.5rem), 22rem);
		margin: var(--wp--preset--spacing--50) auto 0;
	}

	.memot-careers-hero__stage::before {
		transform: translate(0.75rem, -0.75rem);
	}

	.memot-careers-hero__inset {
		left: -6%;
		width: 36%;
	}
}

/* Entrance: pre-hidden only when memot-motion.js will animate it in. */
.memot-anim .memot-careers-hero :where(.memot-careers-hero__eyebrow, h1, .memot-careers-hero__lead, .memot-careers-hero__perks, .memot-careers-hero__actions, .memot-careers-hero__stage, .memot-careers-hero__inset) {
	opacity: 0;
	will-change: transform, opacity;
}

/* -------------------------------------------------------------------------- *
 * Careers page: open positions list
 *
 * One full-width row per job — easier to scan than a card grid once titles,
 * summaries and facts are all present. The "View details" link is stretched
 * over the whole row (::after) so the row is one click target, while the
 * link text stays the accessible name (plus aria-describedby → job title).
 * -------------------------------------------------------------------------- */

.memot-jobs__count {
	margin: 0 0 var(--wp--preset--spacing--40);
	color: var(--wp--preset--color--slate);
	font-size: 0.9375rem;
}

.memot-jobs__count strong {
	color: var(--wp--preset--color--ink);
}

.memot-jobs__list {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	margin: 0;
	padding: 0;
	list-style: none;
}

.memot-job {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: var(--wp--preset--spacing--50);
	padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--60);
	background: var(--wp--preset--color--paper);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--memot-radius);
	box-shadow: var(--memot-shadow-sm);
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.memot-job:hover,
.memot-job:focus-within {
	transform: translateY(-2px);
	box-shadow: var(--memot-shadow-md);
	border-color: color-mix(in srgb, var(--wp--preset--color--brand-bright) 35%, var(--wp--preset--color--line));
}

.memot-job:focus-within {
	outline: 2px solid var(--wp--preset--color--brand-bright);
	outline-offset: 2px;
}

.memot-job__main {
	display: grid;
	gap: 0.6rem;
	justify-items: start;
	min-width: 0;
}

.memot-job__main .memot-tag {
	margin: 0;
}

.memot-job__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.2;
}

.memot-job__summary {
	margin: 0;
	max-width: 70ch;
	color: var(--wp--preset--color--slate);
}

.memot-job__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.7rem 1.35rem;
	border: 1px solid var(--wp--preset--color--brand-bright);
	border-radius: 999px;
	color: var(--wp--preset--color--brand);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.18s ease, color 0.18s ease;
}

.memot-job__cta::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

/* The stretched ::after carries the click; the row's outline shows focus. */
.memot-job__cta:focus-visible {
	outline: none;
	background: var(--wp--preset--color--brand-bright);
	color: var(--wp--preset--color--paper);
}

.memot-job:hover .memot-job__cta {
	background: var(--wp--preset--color--brand-bright);
	color: var(--wp--preset--color--paper);
}

.memot-job__cta-icon {
	width: 1rem;
	height: 1rem;
	transition: transform 0.18s ease;
}

.memot-job:hover .memot-job__cta-icon {
	transform: translateX(3px);
}

@media (max-width: 781px) {

	.memot-job {
		grid-template-columns: 1fr;
		gap: var(--wp--preset--spacing--40);
		padding: var(--wp--preset--spacing--50);
	}

	.memot-job__cta {
		justify-self: start;
	}
}

/* -------------------------------------------------------------------------- *
 * Job detail page
 * -------------------------------------------------------------------------- */

.memot-job-hero .memot-lead {
	max-width: 60ch;
}

.memot-job-hero-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1.25rem;
}

.memot-job-hero-meta .memot-tag {
	margin: 0;
}

.memot-job-hero-meta .memot-job-facts {
	color: var(--wp--preset--color--ink);
}

/* Description on the left, sticky summary card on the right. */
.memot-job-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
	align-items: start;
	gap: var(--wp--preset--spacing--80);
}

.memot-job-body {
	min-width: 0;
	max-width: 72ch;
}

.memot-job-body > * + * {
	margin-top: var(--wp--preset--spacing--40);
}

.memot-job-body h2.wp-block-heading {
	margin: 0;
	font-size: var(--wp--preset--font-size--xx-large);
}

.memot-job-overview > :first-child {
	margin-top: 0;
}

.memot-job-body > .memot-job-details {
	margin-top: var(--wp--preset--spacing--70);
}

.memot-job-section {
	margin-top: var(--wp--preset--spacing--70);
	scroll-margin-top: var(--memot-header-space);
}

.memot-job-details > .memot-job-section:first-child {
	margin-top: 0;
}

.memot-job-section .memot-checklist {
	margin-top: var(--wp--preset--spacing--40);
}

.memot-job-summary {
	position: sticky;
	top: calc(var(--memot-header-space) + var(--wp--preset--spacing--30));
	padding: var(--wp--preset--spacing--50);
	background: var(--wp--preset--color--sand);
	border-radius: var(--memot-radius-lg);
}

.memot-job-summary__title {
	margin: 0 0 var(--wp--preset--spacing--40);
	font-size: var(--wp--preset--font-size--large);
}

.memot-job-summary__list {
	margin: 0 0 var(--wp--preset--spacing--50);
}

.memot-job-summary__row {
	display: grid;
	gap: 0.15rem;
	padding: 0.75rem 0;
	border-top: 1px solid var(--wp--preset--color--line);
}

.memot-job-summary__row:last-child {
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.memot-job-summary__row dt {
	color: var(--wp--preset--color--slate);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.memot-job-summary__row dd {
	margin: 0;
	color: var(--wp--preset--color--ink);
	font-weight: 600;
}

.memot-job-apply--block .wp-block-button,
.memot-job-apply--block .wp-block-button__link {
	width: 100%;
}

.memot-job-apply--block .wp-block-button__link {
	box-sizing: border-box;
	text-align: center;
}

@media (max-width: 960px) {

	.memot-job-layout {
		grid-template-columns: 1fr;
		gap: var(--wp--preset--spacing--70);
	}

	.memot-job-summary {
		position: static;
	}
}

/* -------------------------------------------------------------------------- *
 * Application page
 * -------------------------------------------------------------------------- */

.memot-apply {
	display: grid;
	grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
	align-items: start;
	gap: var(--wp--preset--spacing--80);
}

.memot-apply__form {
	padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--50);
	background: var(--wp--preset--color--paper);

	/* Stays ink on its paper panel whatever text color the block is given. */
	color: var(--wp--preset--color--ink);
}

.memot-apply__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--xx-large);
}

.memot-apply__position {
	margin: var(--wp--preset--spacing--20) 0 0;
	color: var(--wp--preset--color--slate);
}

.memot-apply__position strong {
	color: var(--wp--preset--color--ink);
}

.memot-apply__note {
	margin: var(--wp--preset--spacing--20) 0 var(--wp--preset--spacing--50);
	color: var(--wp--preset--color--slate);
	font-size: 0.875rem;
}

.memot-apply__form .memot-job-closed {
	margin-top: var(--wp--preset--spacing--50);
}

/* Application form fields that span both grid columns (name/email/phone pair
   up in two columns, as on Contact). Matched on CF7's `data-name`, i.e. the
   field names fixed in scripts/seed-careers.php. */
.memot-apply .wpcf7-form > p:has([data-name="your-name"]),
.memot-apply .wpcf7-form > p:has([data-name="your-intro"]),
.memot-apply .wpcf7-form > p:has([data-name="your-cv"]),
.memot-apply .wpcf7-form > p:has([data-name="consent"]),
.memot-apply .wpcf7-form > p:has(.wpcf7-submit),
.memot-apply .wpcf7-form > div.wpcf7-response-output {
	grid-column: 1 / -1;
}

.memot-apply textarea.wpcf7-form-control {
	height: 150px;
}

.memot-apply input[type="file"].wpcf7-form-control {
	padding: 0.75rem;
	background: var(--wp--preset--color--sand);
	border-style: dashed;
	cursor: pointer;
}

.memot-apply input[type="file"].wpcf7-form-control::file-selector-button {
	margin-right: 0.875rem;
	padding: 0.45rem 1rem;
	border: 1px solid var(--wp--preset--color--brand-bright);
	border-radius: 999px;
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--brand);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.memot-apply .memot-apply__hint {
	display: block;
	margin-top: 0.35rem;
	color: var(--wp--preset--color--slate);
	font-size: 0.8125rem;
	font-weight: 400;
	letter-spacing: normal;
	text-transform: none;
}

/* The consent checkbox reads as a sentence, not an uppercase field label. CF7
   gives its wrapper the generic .wpcf7-form-control class, so undo the text
   input chrome forms.css applies to that class. */
.memot-apply .wpcf7-acceptance.wpcf7-form-control {
	padding: 0;
	background: none;
	border: 0;
	box-shadow: none;
}

.memot-apply .wpcf7-acceptance label {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	color: var(--wp--preset--color--ink);
	font-size: 0.875rem;
	font-weight: 400;
	letter-spacing: normal;
	text-transform: none;
}

.memot-apply .wpcf7-acceptance input {
	flex: none;
	width: 1.1rem;
	height: 1.1rem;
	margin-top: 0.15rem;
	accent-color: var(--wp--preset--color--brand-bright);
}

.memot-apply .wpcf7-acceptance .wpcf7-list-item {
	margin: 0;
}

.memot-apply__aside {
	display: grid;
	gap: var(--wp--preset--spacing--50);
	padding-top: var(--wp--preset--spacing--40);
}

.memot-apply__aside-title {
	margin: 0;
	font-size: var(--wp--preset--font-size--large);
}

.memot-apply__steps {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: memot-step;
}

.memot-apply__steps li {
	position: relative;
	padding-left: 2.75rem;
	color: var(--wp--preset--color--slate);
	counter-increment: memot-step;
}

.memot-apply__steps li::before {
	content: counter(memot-step);
	position: absolute;
	top: -0.1rem;
	left: 0;
	display: grid;
	place-items: center;
	width: 1.9rem;
	height: 1.9rem;
	border-radius: 999px;
	background: var(--wp--preset--color--sand);
	color: var(--wp--preset--color--brand);
	font-size: 0.875rem;
	font-weight: 700;
}

.memot-apply__aside .memot-job-facts {
	flex-direction: column;
	padding-top: var(--wp--preset--spacing--40);
	border-top: 1px solid var(--wp--preset--color--line);
}

@media (max-width: 960px) {

	.memot-apply {
		grid-template-columns: 1fr;
		gap: var(--wp--preset--spacing--60);
	}
}

@media (max-width: 600px) {

	.memot-apply__form {
		padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
	}
}

/* -------------------------------------------------------------------------- *
 * Job blocks: a text color set in the editor (.has-text-color on the block's
 * root) carries through to the parts that otherwise pin their own ink/slate.
 * Without one, these rules don't match and the defaults above stand.
 * -------------------------------------------------------------------------- */

.memot-job-hero-meta.has-text-color .memot-job-facts,
.memot-job-details.has-text-color :is(h2, .memot-checklist li),
.memot-job-summary.has-text-color :is(.memot-job-summary__title, dt, dd),
.memot-apply.has-text-color .memot-apply__aside :is(.memot-apply__aside-title, .memot-apply__steps li, .memot-job-facts) {
	color: inherit;
}

@media (prefers-reduced-motion: reduce) {

	.memot-job,
	.memot-job__cta,
	.memot-job__cta-icon {
		transition: none;
	}

	.memot-job:hover,
	.memot-job:focus-within,
	.memot-job:hover .memot-job__cta-icon {
		transform: none;
	}
}
