/* ============================================================
   Newsroom page styles
   Loaded only on page-newsroom.php (see acme_newsroom_assets()).

   Sections:
     1. Page bg + container resets
     2. Hero (reuses .flex-hero spacing)
     3. Featured post banner (full-bleed image + overlay + content)
     4. Filter pills (5 button states locked — Elementor-pink defeat)
     5. Post grid (3-col / 2-col / 1-col responsive)
     6. Pagination
     7. Empty state
   ============================================================ */

/* ---------- 1. Page chrome ---------- */
/* Default body bg is navy (style.css) — light pages must explicitly opt out.
   Selector matches both `.page-template-page-newsroom` and
   `.page-template-page-newsroom-php` body-class variants WP emits. */
body.page-template-page-newsroom,
body.page-template-page-newsroom-php {
	background: #fff;
}

.newsroom-page {
	display: block;
	background: #fff;
}

/* ---------- 2. Hero (LIGHT) ---------- */
/* Light-bg hero matching the rest of the flex-page system (e.g. .flex-ti
   uses white bg / navy text). Section-top padding clears the fixed
   floating-pill header (~120px) the same way flex-hero does, just without
   the navy fill. Title is uppercase display font, navy — consistent with
   the H1 conventions on the existing flex pages. */
.newsroom-hero {
	background: #fff;
	color: var(--color-navy);
	padding: clamp(140px, 14vw, 200px) 0 clamp(40px, 4vw, 72px);
	position: relative;
}

.newsroom-hero__inner {
	max-width: 900px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.newsroom-hero__headline {
	margin: 4px 0 8px;
	color: var(--type-title-color);
}

.newsroom-hero__body {
	/* Site body clamp — see feedback_typography_system.md */
	font-size: var(--type-body-size);
	font-weight: 500;
	line-height: 1.6;
	color: var(--type-body-color);
	max-width: 680px;
	margin: 0;
}

/* ---------- 3. Featured post banner (contained / boxed) ---------- */
/* The wrap supplies vertical rhythm; .container constrains width;
   .newsroom-featured is the boxed card sitting inside the container. */
.newsroom-featured-wrap {
	margin-bottom: clamp(40px, 5vw, 72px);
}

.newsroom-featured {
	position: relative;
	min-height: clamp(380px, 46vw, 520px);
	display: flex;
	align-items: flex-end;
	color: #fff;
	/* 12px matches .single-product__hero-image — the site's standard for
	   hero-scale image surfaces. overflow: hidden clips the bg image and
	   gradient overlay to the rounded corners. */
	border-radius: 12px;
	overflow: hidden;
	isolation: isolate;
}

.newsroom-featured__bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	z-index: 0;
}

/* Placeholder: navy fill + the site grid pattern (dots over thin lines).
   Same visual language as the homepage CTA grid overlay so missing images
   still feel on-brand instead of like a broken image. */
.newsroom-featured__bg--placeholder {
	background-color: var(--color-navy);
	background-image:
		radial-gradient(var(--grid-dot-light, rgba(255, 255, 255, 0.18)) 1.4px, transparent 1.6px),
		linear-gradient(to right, var(--grid-line-light, rgba(255, 255, 255, 0.05)) 1px, transparent 1px),
		linear-gradient(to bottom, var(--grid-line-light, rgba(255, 255, 255, 0.05)) 1px, transparent 1px);
	background-size:
		var(--grid-size, 70px) var(--grid-size, 70px),
		var(--grid-size, 70px) var(--grid-size, 70px),
		var(--grid-size, 70px) var(--grid-size, 70px);
	background-position: 0 0;
}

/* When the section is image-less, soften the gradient overlay so the grid
   stays visible behind the title. Same left-to-right direction. */
.newsroom-featured--placeholder .newsroom-featured__overlay {
	background: linear-gradient(
		to right,
		rgba(6, 1, 67, 0.55) 0%,
		rgba(6, 1, 67, 0.15) 60%,
		rgba(6, 1, 67, 0) 100%
	);
}

/* Left-heavy navy gradient: text sits in the left half over the strongest
   navy fill, image stays mostly visible on the right. */
.newsroom-featured__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to right,
		rgba(6, 1, 67, calc(var(--newsroom-overlay, 0.55) + 0.15)) 0%,
		rgba(6, 1, 67, calc(var(--newsroom-overlay, 0.55) * 0.45)) 55%,
		rgba(6, 1, 67, 0) 100%
	);
	z-index: 1;
}

.newsroom-featured__inner {
	position: relative;
	z-index: 2;
	max-width: 640px;
	width: 100%;
	padding: clamp(36px, 5vw, 56px) clamp(28px, 4vw, 48px);
}

/* Eyebrow uses site classes .hp-eyebrow + .hp-eyebrow--light for typography
   and color (white on dark overlay). Only the bottom margin is local. */
.newsroom-featured__eyebrow {
	margin: 0 0 12px;
}

/* Section-level h2 — must NEVER reach hero h1 size. Matches the site's
   .flex-ti__headline (used by all in-page section callouts site-wide):
   clamp(26px, 3vw, 42px), uppercase, display font, 0.01em tracking, 1.1 lh.
   Color override (#fff) for the dark image overlay. */
.newsroom-featured__title {
	margin: 0 0 16px;
	color: var(--type-heading-color-dark);
}

.newsroom-featured__excerpt {
	/* Site body clamp — see feedback_typography_system.md */
	margin: 0 0 24px;
	color: var(--type-body-color-dark);
	opacity: 0.92;
	max-width: 560px;
}

.newsroom-featured__cta {
	display: inline-block;
}

/* ---------- 4. Filter pills ---------- */
.newsroom-filters {
	padding: 0 0 clamp(24px, 2.5vw, 40px);
}

.newsroom-filters__row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 24px;
	align-items: center;
	border-bottom: 1px solid rgba(6, 1, 67, 0.06);
	padding-bottom: 16px;
}

/* All 5 states locked — Elementor / hello-elementor inject pink/red
   :focus + :active that bleeds through every <button>.
   See feedback_button_state_locks.md */
.newsroom-pill,
.newsroom-pill:focus,
.newsroom-pill:focus-visible {
	background: transparent !important;
	color: var(--color-navy) !important;
	border: 0 !important;
	border-radius: 0 !important;
	padding: 6px 2px !important;
	font-family: var(--font-body) !important;
	font-size: clamp(15px, 0.3vw + 13px, 17px) !important;
	font-weight: 500 !important;
	letter-spacing: 0.01em !important;
	cursor: pointer !important;
	outline: none !important;
	box-shadow: none !important;
	position: relative !important;
	transition: opacity 0.18s ease, color 0.18s ease !important;
	opacity: 0.7 !important;
}

.newsroom-pill:hover {
	background: transparent !important;
	color: var(--color-navy) !important;
	opacity: 1 !important;
	outline: none !important;
	box-shadow: none !important;
}

.newsroom-pill:active {
	background: transparent !important;
	color: var(--color-navy) !important;
	opacity: 1 !important;
	outline: none !important;
	box-shadow: none !important;
}

/* Active pill — underline matches limeiq mock */
.newsroom-pill.is-active,
.newsroom-pill.is-active:focus,
.newsroom-pill.is-active:focus-visible {
	opacity: 1 !important;
	color: var(--color-navy) !important;
}

.newsroom-pill.is-active::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -17px;
	height: 1.5px;
	background: var(--color-navy);
}

/* ---------- 5. Post grid ---------- */
.newsroom-grid-wrap {
	padding: 0 0 clamp(64px, 7vw, 120px);
}

/* Grid + cards are independent layers.
   - Cards are plain content blocks (no borders, no pseudo-element dots).
   - The decorative grid (lines + intersection dots) is drawn by an SVG
     overlay that JS injects into .newsroom-grid (see newsroom-grid.js).
   - The overlay measures actual visible-card positions and draws lines /
     dots at those exact pixel positions. Filter changes + window resize
     trigger a recompute, so the pattern always matches the cards on
     screen — including the case where cards are hidden by the filter. */

.newsroom-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0;
	position: relative;
}

.newsroom-card {
	position: relative;
	background: #fff;
	display: flex;
	flex-direction: column;
}

/* SVG overlay: covers the entire grid area, painted on top of the cards
   but with pointer-events disabled so card links remain clickable.
   Content is generated by newsroom-grid.js. */
.newsroom-grid__overlay {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 2;
}

.newsroom-grid__overlay svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible; /* let edge dots render fully outside the grid box */
}

/* Filtered-out state — JS toggles .is-hidden */
.newsroom-card.is-hidden {
	display: none !important;
}

.newsroom-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
	text-decoration: none;
	padding: clamp(16px, 1.5vw, 24px);
	gap: clamp(16px, 1.5vw, 22px);
}

.newsroom-card__link:hover .newsroom-card__media img {
	transform: scale(1.03);
}
.newsroom-card__link:hover .newsroom-card__title {
	color: var(--color-accent);
}
.newsroom-card__link:hover .newsroom-card__arrow {
	background: var(--color-navy);
	color: #fff;
	border-color: var(--color-navy);
}

.newsroom-card__media {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #f0f1f5;
}

.newsroom-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

/* Card-image fallback when post has no featured image — mirrors the
   featured-banner placeholder treatment (navy + brand grid). */
.newsroom-card__placeholder {
	position: absolute;
	inset: 0;
	background-color: var(--color-navy);
	background-image:
		radial-gradient(rgba(255, 255, 255, 0.18) 1.2px, transparent 1.4px),
		linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
	background-size: 28px 28px, 28px 28px, 28px 28px;
}

/* Subtle wordmark on the placeholder so empty cards read as
   intentional brand surfaces, not "image failed to load". */
.newsroom-card__placeholder::after {
	content: "AVIONIC";
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	font-family: var(--font-display, "commuters-sans"), sans-serif;
	font-weight: 700;
	letter-spacing: 0.18em;
	font-size: clamp(14px, 1.5vw, 18px);
	color: rgba(255, 255, 255, 0.45);
}

.newsroom-card__body {
	display: flex;
	flex-direction: column;
	gap: 12px;
	flex: 1;
}

.newsroom-card__title {
	/* Mid-size card title — matches .hp-market-card__title clamp */
	margin: 0;
	color: var(--type-item-color);
	transition: color 0.18s ease;
}

.newsroom-card__meta {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: auto;
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 500;
	color: var(--color-navy);
	padding-top: 8px;
}

.newsroom-card__cat {
	color: var(--color-navy);
}

.newsroom-card__sep {
	color: var(--color-navy);
	opacity: 0.5;
}

.newsroom-card__date {
	color: var(--color-navy);
	opacity: 0.7;
}

/* Site shared arrow.svg via mask — same pattern as flex-timeline arrows
   and split-accordion item arrows. Natural orientation is up-right (↗),
   which is what we want for the "open post" affordance. The wrapper is
   the square button box; ::before is the masked arrow filled with
   currentColor so it inherits hover state from the wrapper. */
.newsroom-card__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	margin-left: auto;
	border: 1px solid rgba(6, 1, 67, 0.15);
	background: #fff;
	color: var(--color-navy);
	transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.newsroom-card__arrow::before {
	content: "";
	display: block;
	width: 12px;
	height: 12px;
	background-color: currentColor;
	-webkit-mask: url('icons/arrow.svg') no-repeat center / contain;
	        mask: url('icons/arrow.svg') no-repeat center / contain;
}

/* ---------- 6. Pagination ---------- */
.newsroom-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin-top: clamp(40px, 4vw, 64px);
}

.newsroom-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid rgba(6, 1, 67, 0.06);
	background: #fff;
	color: var(--color-navy);
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.newsroom-pagination .page-numbers:hover {
	background: var(--color-navy);
	border-color: var(--color-navy);
	color: #fff;
}

.newsroom-pagination .page-numbers.current {
	background: var(--color-navy);
	border-color: var(--color-navy);
	color: #fff;
}

.newsroom-pagination .page-numbers.dots {
	border-color: transparent;
	background: transparent;
}

/* ---------- 7. Empty state ---------- */
.newsroom-empty {
	font-family: var(--font-body);
	font-size: var(--type-body-size);
	font-weight: 500;
	color: var(--color-navy);
	opacity: 0.7;
	text-align: center;
	padding: clamp(40px, 5vw, 80px) 0;
	margin: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
	.newsroom-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 640px) {
	.newsroom-grid {
		grid-template-columns: 1fr;
	}
	.newsroom-featured {
		min-height: 480px;
	}
	.newsroom-filters__row {
		gap: 6px 18px;
	}
	.newsroom-pill {
		font-size: 14px !important;
	}
}

/* ============================================================
   Newsroom card excerpt — 3-line clamp under the title.
   Replaces the category badge that lived in __meta. Pulls from
   get_the_excerpt() which falls back to auto-generated content
   when no manual excerpt is set.
   ============================================================ */
.newsroom-card__excerpt {
    color: var(--type-body-color);
    opacity: 0.72;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   LINKEDIN FEED — live Elfsight feed below the post grid.
   White section, navy hairline divider from the grid above,
   eyebrow + .section-heading head, then the embed fills .container.
   ============================================================ */

/* When the LinkedIn section follows the grid, the grid drops its big
   bottom padding — the gap between the two sections supplies the rhythm
   (no divider line; sections flow together on the white page). */
.newsroom-grid-wrap:has(+ .newsroom-linkedin-wrap) {
    padding-bottom: clamp(40px, 5vw, 72px);
}

.newsroom-linkedin-wrap {
    background: #fff;
    padding: clamp(48px, 6vw, 88px) 0 clamp(64px, 7vw, 110px);
}

.newsroom-linkedin__head {
    max-width: 900px;
    margin: 0 0 clamp(24px, 3vw, 40px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.newsroom-linkedin__title {
    margin: 0;
    color: var(--color-navy);
}

/* The Elfsight app renders its own grid here; keep it edge-to-edge in
   the container and let the widget handle its internal responsiveness. */
.newsroom-linkedin__feed {
    position: relative;
    min-height: 200px;
}

/* The featured image is anchored near its top, so a portrait keeps the face
   inside the wide banner. The placeholder keeps its own pattern. */
.newsroom-featured .newsroom-featured__bg:not(.newsroom-featured__bg--placeholder) {
	background-position: center 8%;
}

/* A portrait featured image fills the right half of the banner and fades into
   a navy left half that holds the text; on phones it is a band above the text.
   The top of the frame is kept, so a head and shoulders portrait shows the
   face and shoulders. */
.newsroom-featured--portrait {
	background-color: var(--color-navy);
}
.newsroom-featured.newsroom-featured--portrait .newsroom-featured__bg {
	left: auto;
	width: 50%;
	background-position: center 6%;
	-webkit-mask-image: linear-gradient(to right, transparent 0, #000 30%);
	mask-image: linear-gradient(to right, transparent 0, #000 30%);
}
.newsroom-featured--portrait .newsroom-featured__overlay {
	display: none;
}
.newsroom-featured--portrait .newsroom-featured__inner {
	max-width: 50%;
}
@media (max-width: 640px) {
	.newsroom-featured.newsroom-featured--portrait {
		flex-direction: column;
		align-items: stretch;
		min-height: 0;
	}
	.newsroom-featured.newsroom-featured--portrait .newsroom-featured__bg {
		position: relative;
		inset: auto;
		width: 100%;
		aspect-ratio: 4 / 3;
		-webkit-mask-image: none;
		mask-image: none;
	}
	.newsroom-featured--portrait .newsroom-featured__inner {
		max-width: none;
	}
}

/* A portrait card image keeps the top of its frame. */
.newsroom-card__media img.newsroom-card__img--portrait {
	object-position: center 6%;
}
