/*
 * PhoenixSS templates (templates/*.html): Job Search, Job, News, Article, Text
 * page, 404. Loaded everywhere, front end and editor (Site Editor included).
 * The core blocks these use have their own files in assets/css/blocks/
 * (breadcrumbs, pagination, category pills, badges), as do the Phoenix blocks
 * (src/job-filters, src/job-details).
 */

/* Linked post titles (news cards, job rows, search results) keep the
   heading's colour; only the hover underline marks them as links. */
.wp-block-post-title a { color: inherit; }

/* ------------------------------------------------------------- Job Search
 * archive-job.html. Filters sit beside the results from 1024px; below that
 * they stack, folded behind the "Filter" toggle (src/job-filters). Each job:
 * title, location and date, a few lines of the ad and "View Job →" (client's
 * layout, Sep 2026); the spacing is set on the blocks (margin top).
 */

.pss-job-results__bar { gap: 20px; }
.pss-job-results__bar .wp-block-query-total { margin: 0; }
.pss-job-results > .wp-block-columns { align-items: flex-start; }

.wp-block-post-template.pss-job-rows { display: flex; flex-direction: column; gap: 12px; }
.wp-block-post-template.pss-job-rows > li { margin: 0; }

.pss-job-row {
	padding: 36px 40px;
	border: 1px solid var(--wp--custom--line--paper);
	border-radius: var(--wp--custom--radius--lg);
	background: var(--wp--preset--color--surface-paper-2);
}
.pss-job-row .wp-block-post-title a { text-decoration: none; }
/* Location | work type as a plain line, the date under it. */
.pss-job-row__meta .pss-job-details--meta { display: block; color: inherit; font: inherit; }
.pss-job-row__meta .pss-job-details__icon { display: none; }
.pss-job-row .wp-block-post-excerpt { max-width: 640px; }
.pss-job-row .wp-block-post-excerpt__excerpt { margin: 0; }
.pss-job-row .wp-block-post-excerpt__more-text { display: none; }

@media (max-width: 1023.98px) {
	.pss-job-results > .wp-block-columns { flex-wrap: wrap !important; }
	.pss-job-results > .wp-block-columns > .wp-block-column { flex-basis: 100% !important; }
	/* Folded filters: drop their column so the results follow the count. */
	.pss-job-results > .wp-block-columns > .wp-block-column:has(> .pss-job-filters.is-collapsible:not(.is-open)) { display: none; }
	.pss-job-results > .wp-block-columns { margin-top: var(--wp--preset--spacing--ml) !important; }
}
@media (max-width: 599.98px) {
	.pss-job-row { padding: 28px 20px; }
}

/* -------------------------------------------------------------------- Job
 * single-job.html: the listing card and the "Role information" card.
 */

.pss-job__card,
.pss-job__aside {
	box-sizing: border-box;
	border: 1px solid var(--wp--custom--line--paper);
	border-radius: var(--wp--custom--radius--md);
}
.pss-job__card {
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding: clamp(20px, 5.6vw, 80px) clamp(12px, 5.6vw, 80px);
}
.pss-job__card > *,
.pss-job__aside > * { margin-block: 0; }
.pss-job__card > .pss-job__rule { width: 100%; margin: 20px 0; border: 0; border-top: 1px solid var(--wp--custom--line--paper); opacity: 1; }
.pss-job__card > .wp-block-buttons { margin-top: 20px; }

.pss-job__aside { display: flex; flex-direction: column; gap: 10px; padding: 30px clamp(12px, 2.1vw, 30px); }
.pss-job__aside > .wp-block-heading { margin-bottom: 0; }
.pss-job__aside > .wp-block-buttons { margin-top: 0; }

@media (min-width: 782px) {
	/* Below the header while it's showing (main.css). */
	.pss-job__aside {
		position: sticky;
		top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--pss-header-offset, 0px) + 24px);
		transition: top 0.45s var(--pss-ease);
	}
}

/* --------------------------------------------------------- Long-form text
 * One style for written content: the job ad, the article body and text pages
 * (Privacy, Terms). Headings in Figma's Title style (DM Sans semibold: H2
 * 22px, H3 20px, H4 to H6 16px), copy in Body/Regular (Inter 15/160%), links
 * underlined.
 */
:is(.pss-job__description, .pss-article__content, .pss-text) > * { margin-block: 0; }
:is(.pss-job__description, .pss-article__content, .pss-text) > * + * { margin-block-start: 20px; }
:is(.pss-job__description, .pss-article__content, .pss-text) > * + :is(h2, h3, h4, h5, h6) { margin-block-start: 40px; }
:is(.pss-job__description, .pss-article__content, .pss-text) > :is(h2, h3, h4, h5) + :is(h3, h4, h5, h6) { margin-block-start: 20px; }
:is(.pss-job__description, .pss-article__content, .pss-text) :is(h2, h3, h4, h5, h6) {
	font-family: var(--wp--preset--font-family--label);
	font-size: var(--wp--preset--font-size--title);
	font-weight: 600;
	line-height: 1.3;
	text-transform: none;
}
:is(.pss-job__description, .pss-article__content, .pss-text) h3 { font-size: var(--wp--preset--font-size--h-5); }
:is(.pss-job__description, .pss-article__content, .pss-text) :is(h4, h5, h6) { font-size: var(--wp--preset--font-size--label); }
:is(.pss-job__description, .pss-article__content, .pss-text) > :is(p, ul, ol):not(.is-style-callout) {
	font-size: var(--wp--preset--font-size--body);
	line-height: 1.6;
}
:is(.pss-job__description, .pss-article__content, .pss-text) > :is(ul, ol) { padding-left: 1.25em; }
:is(.pss-job__description, .pss-article__content, .pss-text) a:where(:not(.wp-element-button)) { text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------- News
 * home.html, archive.html, index.html; cards: patterns/news-cards.php.
 */

.wp-block-post-template.pss-news-grid { gap: 60px 40px; }
.wp-block-post-template.pss-news-grid > li { margin: 0; }

@media (max-width: 1023.98px) {
	.wp-block-post-template.pss-news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 24px; }
}
@media (max-width: 599.98px) {
	.wp-block-post-template.pss-news-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}

.pss-news-card { display: flex; flex-direction: column; gap: 20px; height: 100%; }
.pss-news-card > * { margin-block: 0; }
.pss-news-card__media { position: relative; }
.pss-news-card__media .wp-block-post-featured-image { margin: 0; overflow: hidden; border-radius: var(--wp--custom--radius--md); }
.pss-news-card__media .wp-block-post-featured-image img { transition: transform 0.6s var(--pss-ease); }
/* A subtle zoom on hover, like the industry tiles. */
.pss-news-card:has(a:hover) .pss-news-card__media .wp-block-post-featured-image img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) {
	.pss-news-card__media .wp-block-post-featured-image img { transition: none; }
	.pss-news-card:has(a:hover) .pss-news-card__media .wp-block-post-featured-image img { transform: none; }
}
.pss-news-card__media .wp-block-post-featured-image img { width: 100%; height: 100%; object-fit: cover; }
/* The category badge sits 20px in from the photo's top and left edges (no
   block-spacing margin: it floats over the photo). */
.pss-news-card__media .wp-block-post-terms { position: absolute; top: 20px; left: 20px; right: 20px; z-index: 1; margin: 0; }
.pss-news-card .wp-block-post-date { color: var(--wp--preset--color--text-on-paper-dim); }
.pss-news-card .wp-block-post-title a { text-decoration: none; }
/* Only "Learn more" reacts to hover, also when the photo or title is hovered. */
.pss-news-card:has(a:hover) .pss-news-card__more { text-decoration: underline; }
.pss-news-card:has(a:hover) .pss-news-card__more .pss-arrow { translate: 4px 0; }
.pss-news-card__more { margin-top: auto; font-size: var(--wp--preset--font-size--label); font-weight: 600; }

/* ---------------------------------------------------------------- Article
 * single.html: the featured image with the article card lifted over it.
 */

/* Figma: the photo is 501px tall on desktop and 471px on phones; the card's
   text is inset 100px from its sides on desktop and 10px on phones. */
.pss-article {
	--pss-article-hero: clamp(471px, 34.8vw, 501px);
	--pss-article-inset: clamp(10px, calc(9vw - 29.6px), 100px);
}
.pss-article > .pss-article__hero { margin-block: 0; }
.pss-article > .pss-article__hero img { width: 100%; height: var(--pss-article-hero); object-fit: cover; }
.pss-article > .pss-article__card {
	position: relative;
	z-index: 1;
	box-sizing: border-box;
	max-width: 874px;
	margin-top: calc(160px - var(--pss-article-hero));
	border: 1px solid var(--wp--custom--line--paper);
	border-radius: var(--wp--custom--radius--lg);
}
.pss-article__head {
	padding: 50px var(--pss-article-inset);
	border-bottom: 1px solid var(--wp--custom--line--paper);
	text-align: center;
}
.pss-article__byline { row-gap: 8px; }
.pss-article__byline > * { margin: 0; }
/* The category badge: 20px after the byline (Figma), on a line of its own on phones. */
.pss-article__byline .wp-block-post-terms { margin-left: calc(20px - 0.3em); }
@media (max-width: 781.98px) {
	.pss-article__byline .wp-block-post-terms { flex-basis: 100%; justify-content: center; margin: calc(20px - 8px) 0 0; }
}
.pss-article__content { padding: clamp(20px, 3.5vw, 50px) var(--pss-article-inset); }
/* Latest articles: 20px under the heading on phones, 40px on desktop (Figma).
   Block spacing can't hold a fluid value, so phones get it here. */
@media (max-width: 781.98px) {
	.pss-article__more > .wp-block-query { margin-block-start: 20px; }
}

/* -------------------------------------------------------------- Text page
 * page-text.html (Privacy Policy, Terms): Figma "Plain Text".
 */

/* Its text uses the long-form style above. */

/* -------------------------------------------------------------------- 404 */

.pss-404 .pss-404__code {
	margin: 0;
	font-size: clamp(120px, 14vw, 200px);
	line-height: 1.1;
}
.pss-404 .wp-block-buttons { gap: 20px; }

/* Search results: titles are H2 (they sit right under the page's H1) but keep
   the spacing they had as H4s. */
.search .wp-block-post-template .wp-block-post-title { margin-block: 1.33em; }
