/*
 * SSI Projects — minimal CSS. The [ssi_projects] browser + cards render into the
 * theme's existing classes (project_taxonomy_fetch, project_post_item, …) and are
 * styled by the site's own CSS — NOTHING here targets those. This file styles only
 * genuinely-new elements the theme has no class for: the completed text list, and
 * the gallery lightbox. Detail-page / piece-shortcode rules are for the opt-in
 * plugin detail render. Palette matches SSI_Projects_Style_Reference.md.
 */

/* --- Completed text list (wireframe §2). Column-count so entries flow
 *     top->bottom per column (matches the PDF order). New element, on-palette. --- */
/* Selectors are prefixed with .project_completed_section to outrank the
 * Elementor kit rule `.elementor-kit-6 h2/p` (specificity 0,1,1). */
/* No horizontal padding / no inner max-width: the section sits inside the page's
 * Elementor container, so content aligns to that container's left edge (the same
 * edge as the CATEGORY heading below). Heading is left-aligned to match. */
.project_completed_section { padding: 70px 0; }
.project_completed_section .project_completed_inner { max-width: none; margin: 0; }
/* Orange section heading: Source Sans 3 60 (Gary 2026-07-31). Every property is
 * restated because `.elementor-kit-6 h2` (0,1,1) would otherwise win on
 * font-family/size/weight/line-height/colour. */
.project_completed_section .project_completed_heading {
	font-family: "Source Sans 3", sans-serif;
	font-size: 60px;
	line-height: 1.15;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
	color: var(--ssi-orange, #F26E22);
	text-align: center;
	margin: 0 0 40px;
}
/* "Completed Projects" set bold inside the heading (Change Order 01 item 1). The
 * ONLY new class in that change order, because no theme class covers a partial
 * bold run inside a heading.
 *
 * Family, size, colour, letter-spacing and transform are all inherited from the
 * heading above and deliberately NOT re-declared — the span changes weight and
 * nothing else.
 *
 * Weight 700 is safe here and is a real face, not synthetic: the heading resolves
 * to Source Sans 3, a Google font Elementor loads at 200-900. The faux-bold
 * BLOCKER applies to the six Eurostile faces, which are registered in Elementor
 * Custom Fonts at font-weight: normal — on those, weight 700 can only synthesise.
 * If this heading is ever moved onto a Eurostile face, drop the weight here and
 * switch the span to "Eurostile Bold Updated" instead. */
.project_completed_section .project_completed_heading .ssi-heading-strong {
	font-weight: 700;
}
/* grid-auto-flow:column fills top->bottom per column (3/3/3/2 for 11 entries)
 * while SHARING ROW TRACKS, so every row starts level across all four columns and
 * the project names line up. `column-count` cannot do this — each column flows
 * independently, so one two-line title knocks its column out of step. Row counts
 * come from PHP (--ssi-rows / --ssi-rows-2) so the flow adapts to the count. */
.project_completed_section .project_completed_grid {
	display: grid;
	/* FOUR columns, pinned. `grid-auto-columns` used to generate however many
	 * columns the item count implied, so a site with 9 entries rendered THREE
	 * 500px columns instead of four — which is exactly why staging and Local
	 * looked different. Column count must not be a side effect of how much data
	 * happens to be present. */
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-template-rows: repeat(var(--ssi-rows, 3), auto);
	column-gap: 40px;
	row-gap: 25px;             /* row spacing between entries */
	align-items: start;        /* short entries sit at the top of their row track */
}
/* Each item places itself, from the balanced distribution computed in PHP
 * (ssi_projects_column_placement). --c4/--r4 for the 4-column desktop grid,
 * --c2/--r2 for the 2-column tablet grid. Auto-flow is not used at all, so the
 * number of occupied columns no longer depends on the entry count. */
.project_completed_section .project_completed_item {
	grid-column: var(--c4, auto);
	grid-row: var(--r4, auto);
	break-inside: avoid;
	margin: 0;
}
/* Whole list is Eurostile 20 / line-height 26 (Gary 2026-07-31).
 * Project name: ALL CAPS, bold, #00193B.
 *
 * FAUX-BOLD FIX (2026-08-06, Change Order 01 verification). This rule used to say
 * `font-family: "Eurostile"` + `font-weight: 700`. All six Eurostile faces are
 * registered in Elementor Custom Fonts at font-weight: normal, so 700 had nothing
 * to resolve to and the browser SYNTHESISED the bold — the logged BLOCKER, in the
 * list directly under the heading this change order bolds. The bold requirement is
 * met the sanctioned way instead: switch to the real bold face and pin the weight
 * to normal so nothing stacks synthetic bold on top of it. Same visual intent,
 * genuine glyphs. */
.project_completed_section .project_completed_name {
	font-family: "Eurostile Bold Updated", sans-serif;
	font-size: 20px;
	line-height: 26px;
	font-weight: normal;
	letter-spacing: 0;
	text-transform: uppercase;
	color: var(--ssi-navy, #00193B);
	margin: 0 0 4px;
}
/* Sub-content: the data's own capitalisation (no transform applied — forcing
 * `capitalize` would also capitalise "and"/"on" inside scope strings), #707070. */
.project_completed_section .project_completed_line {
	font-family: "Eurostile", sans-serif;
	font-size: 20px;
	line-height: 26px;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
	color: var(--ssi-grey, #707070);
	margin: 0;
}
/* Labels ("Year:", "Location:", …) are the bold run — same size, same colour.
 * Same faux-bold fix as the project name above: the real bold face, weight pinned
 * to normal. `<b>`'s UA default is font-weight: bolder, so the weight has to be
 * reset here explicitly or the browser synthesises on top of the bold face. */
.project_completed_section .project_completed_line b {
	font-family: "Eurostile Bold Updated", sans-serif;
	font-weight: normal;
	color: var(--ssi-grey, #707070);
}

/* 4 columns -> 2 at tablet -> 1 at phone. Elementor-kit breakpoints (1024 / 767).
 * Rows are re-declared per breakpoint so the column flow (and the row alignment)
 * still holds at 2 and 1 column. */
@media (max-width: 1024px) {
	.project_completed_section { padding: 50px 0; }
	.project_completed_section .project_completed_grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-template-rows: repeat(var(--ssi-rows-2, 6), auto);
		column-gap: 30px;
	}
	.project_completed_section .project_completed_item {
		grid-column: var(--c2, auto);
		grid-row: var(--r2, auto);
	}
	.project_completed_section .project_completed_heading { font-size: 40px; margin: 0 0 30px; }
}
@media (max-width: 767px) {
	.project_completed_section .project_completed_grid {
		grid-auto-flow: row;
		grid-template-rows: none;
		grid-template-columns: 1fr;
	}
	/* Single column — drop the explicit placement or every item stacks on row 1. */
	.project_completed_section .project_completed_item {
		grid-column: 1;
		grid-row: auto;
	}
	.project_completed_section .project_completed_heading { font-size: 30px; }
}

/* --- Gallery + lightbox (new element) --- */
.ssi-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 0.75rem;
	margin: 1.5rem 0;
}
.ssi-gallery__item { display: block; }
.ssi-gallery__img { display: block; width: 100%; height: auto; border-radius: 4px; cursor: zoom-in; }

.ssi-lightbox {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(0, 25, 59, 0.9);
	z-index: 99999;
}
.ssi-lightbox.is-open { display: flex; }
.ssi-lightbox__img { max-width: 92vw; max-height: 86vh; display: block; }
.ssi-lightbox__btn {
	position: absolute;
	background: transparent;
	border: 0;
	color: var(--ssi-white, #FFFFFF);
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
	padding: 0.5rem 1rem;
}
.ssi-lightbox__close { top: 0.5rem; right: 0.5rem; }
.ssi-lightbox__prev { left: 0.5rem; top: 50%; transform: translateY(-50%); }
.ssi-lightbox__next { right: 0.5rem; top: 50%; transform: translateY(-50%); }

/* --- Single-project detail page ([ssi_project_detail]) -----------------------
 *     Matches SSI_Project_Specific_Visual.png: chevron H1, then three columns —
 *     light meta panel | cover image | stacked thumbnail column.
 *     Tokens: #00193B body+labels, #707070 muted, #F7F5F6 panel.
 *     Type:   Eurostile 20 labels, Source Sans 3 20 values, Source Sans 3 33 H1.
 * ------------------------------------------------------------------------- */

/* CSS-only body-width fix: template #2057 puts the Post Content widget in a 2/3
 * column beside a 1/3 "value box" column. Hide the value box, make the content
 * column full width. FLAG: these are hardcoded Elementor element ids — brittle if
 * the template is ever rebuilt. Pure stylesheet; template untouched. */
.elementor-element.elementor-element-ddeb735 { display: none !important; }
.elementor-element.elementor-element-8935aa4 {
	width: 100% !important;
	max-width: 100% !important;
	padding-left: 40px !important;
	padding-right: 40px !important;
}

.ssi-project-detail {
	font-family: "Source Sans 3", sans-serif;
	color: var(--ssi-navy, #00193B);
}

/* --- Project name + leading chevron --------------------------------------
 * SOURCE SANS 3 33 / medium. NOT Montserrat: per Gary 2026-07-31, nothing in the
 * Projects section uses Montserrat — the section is Eurostile + Source Sans 3
 * throughout. The rest of the site uses Montserrat for h1; the Projects section
 * deliberately does not. The kit sets h1 to 60px/800/uppercase, so size, weight
 * and transform all have to be restated here.
 * The chevron is a pseudo-element, so it stays out of the accessible name.
 * Selector must out-specify `.elementor-kit-N h1` (0,1,1) — a bare class (0,1,0)
 * loses to it. */
.ssi-project-detail h1.ssi-project-detail__title {
	font-family: "Source Sans 3", sans-serif;
	font-size: 33px;
	font-weight: 500;          /* medium, per Gary 2026-07-31 */
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: none;
	color: var(--ssi-navy, #00193B);
	margin: 0 0 18px;
}
.ssi-project-detail__title::before {
	content: "\203A";
	margin-right: .35em;
	font-weight: 500;
	color: var(--ssi-navy, #00193B);
}

/* --- Three-column layout --------------------------------------------------
 * Column ratios measured off the approved visual (294 : 798 : 256 at 1382 content
 * width). The cover carries a 3:2 aspect so the grid row has a definite height;
 * the meta panel and thumb column then stretch to match it, exactly as drawn. */
.ssi-project-detail__layout {
	display: grid;
	grid-template-columns: 22fr 59fr 19fr;
	gap: 18px;
	align-items: stretch;
}
.ssi-project-detail__layout > .project_single_fetch { grid-column: 1; grid-row: 1; }
.ssi-project-detail__layout > .ssi-detail-gallery__lead { grid-column: 2; grid-row: 1; }
.ssi-project-detail__layout > .ssi-detail-gallery__thumbs { grid-column: 3; grid-row: 1; }
.ssi-project-detail__layout > .ssi-detail-gallery__more { grid-column: 2 / -1; grid-row: 2; }

/* 1 photo (or none): no thumbnail column, cover takes the full width. */
.ssi-project-detail__layout--nothumbs { grid-template-columns: 22fr 78fr; }
.ssi-project-detail__layout--nothumbs > .ssi-detail-gallery__lead { grid-column: 2 / -1; }

/* --- Meta panel -----------------------------------------------------------
 * Reuses the theme's project_single_fetch > fetch_lists > fetchtitle/fetchvalue.
 * post-2057.css styles those for a DARK navy value box (bg #1a4b67, white Inter
 * text, white hairline), so the panel's colours have to be restated. The 1px
 * bottom rule already exists there — this only recolours it and drops it on the
 * last row. FLAG: #707070 is the palette's only grey, so the hairline reads
 * heavier than the mockup's. One-line alternative noted in the report. */
.ssi-project-detail .project_single_fetch {
	background: var(--ssi-offwhite, #F7F5F6);
	box-shadow: none;
	border: 0;
	padding: 30px 26px;
	margin: 0;
	width: auto;
	max-width: none;
}
.ssi-project-detail .project_single_fetch .fetch_lists {
	display: flex;              /* theme already sets flex-direction:column, which is
	                               exactly the label-above-value stack we want */
	padding: 0 0 16px;
	margin: 0 0 16px;
	column-gap: 0;
	border-bottom: 1px solid var(--ssi-grey, #707070);
}
.ssi-project-detail .project_single_fetch .fetch_lists:last-child {
	border-bottom: 0;
	padding-bottom: 0;
	margin-bottom: 0;
}
/* Labels are bold only: no uppercase, no letter-spacing, no colour shift.
 * Real bold face + weight normal, not "Eurostile" + 700 — see the faux-bold note
 * on .project_completed_name above. */
.ssi-project-detail .project_single_fetch .fetchtitle {
	font-family: "Eurostile Bold Updated", sans-serif;
	font-size: 20px;
	font-weight: normal;
	line-height: 1.4;
	letter-spacing: 0;
	text-transform: none;
	color: var(--ssi-navy, #00193B);
	margin: 0 0 6px;
}
.ssi-project-detail .project_single_fetch .fetchvalue {
	font-family: "Source Sans 3", sans-serif;
	font-size: 20px;
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: 0;
	color: var(--ssi-navy, #00193B);
}
.ssi-project-detail .project_single_fetch .fetchvalue a { color: var(--ssi-navy, #00193B); text-decoration: none; }
.ssi-project-detail .project_single_fetch .fetchvalue a:hover { color: var(--ssi-orange, #F26E22); text-decoration: underline; }

/* --- Gallery --------------------------------------------------------------
 * Cover 3:2; three thumbs stacked beside it at the same aspect, so 3 thumbs +
 * 2 gaps == the cover height, which is what the visual shows. */
.ssi-detail-gallery__lead { display: block; }
.ssi-detail-gallery__leadimg {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	cursor: zoom-in;
}
/* The cover (3:2) must set the row height, NOT the thumbnails. A thumb column
 * sized by its content contributes its full max-content height to grid row
 * sizing and ends up taller than the cover. `height:0` removes it from that
 * calculation; `min-height:100%` then stretches it back to the row height the
 * cover established, so the stack always ends level with the cover. */
.ssi-detail-gallery__thumbs {
	display: grid;
	grid-template-rows: repeat(3, minmax(0, 1fr));
	gap: 14px;
	height: 0;
	min-height: 100%;
	overflow: hidden;
}
.ssi-detail-gallery__more {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 18px;
	margin-top: 18px;
}
.ssi-detail-gallery__thumb { display: block; overflow: hidden; min-height: 0; }
.ssi-detail-gallery__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	cursor: zoom-in;
}
/* The overflow row has no fixed row height, so give those thumbs the same 3:2. */
.ssi-detail-gallery__more .ssi-detail-gallery__thumb img { height: auto; aspect-ratio: 3 / 2; }

/* Description has NO placement in the approved visual — reported, not invented.
 * The renderer does not output it; this rule waits for a slot to be chosen. */
.ssi-project-detail__desc { font-size: 20px; line-height: 1.55; color: var(--ssi-navy, #00193B); margin: 24px 0 0; }

/* Optional legacy sidebar (off by default — filter `ssi_projects_detail_sidebar`). */
.ssi-project-detail__sidebar { margin-top: 34px; }
.ssi-project-detail .ssi-detail-related__title {
	/* Real bold face + weight normal — same faux-bold rule as above. */
	font-family: "Eurostile Bold Updated", sans-serif;
	color: var(--ssi-blue, #245E82); font-size: 20px; font-weight: normal; line-height: 1.2; margin: 0 0 12px;
}
.ssi-project-detail .ssi-detail-related ul { list-style: none; margin: 0; padding: 0; }
.ssi-project-detail .ssi-detail-related li { margin: 0 0 7px; }
.ssi-project-detail .ssi-detail-related a { color: var(--ssi-navy, #00193B); text-decoration: none; font-size: 20px; line-height: 1.3; }
.ssi-project-detail .ssi-detail-related a:hover { color: var(--ssi-orange, #F26E22); }

/* --- Detail responsive ----------------------------------------------------
 * Breakpoints follow the Elementor kit (1024 / 767), the site's authoritative
 * responsive system. TABLET: cover full width, thumbs in a row beneath.
 * PHONE: single stack with the meta panel BELOW the cover. */
@media (max-width: 1024px) {
	/* TABLET: single column — meta panel, then the cover at full width, then the
	 * thumbs as a horizontal row beneath it. */
	.ssi-project-detail__layout,
	.ssi-project-detail__layout--nothumbs {
		grid-template-columns: 1fr;
		gap: 20px;
	}
	.ssi-project-detail__layout > .project_single_fetch { grid-column: 1; grid-row: 1; }
	.ssi-project-detail__layout > .ssi-detail-gallery__lead { grid-column: 1; grid-row: 2; }
	.ssi-project-detail__layout > .ssi-detail-gallery__thumbs { grid-column: 1; grid-row: 3; }
	.ssi-project-detail__layout > .ssi-detail-gallery__more { grid-column: 1; grid-row: 4; }
	/* Undo the desktop height trick — in a row of its own the column has no parent
	 * height to resolve min-height:100% against and would collapse to nothing. */
	.ssi-project-detail__layout > .ssi-detail-gallery__thumbs,
	.ssi-project-detail__layout > .ssi-detail-gallery__more {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		grid-template-rows: none;
		gap: 14px;
		height: auto;
		min-height: 0;
		margin-top: 0;
		overflow: visible;
	}
	.ssi-detail-gallery__thumb img { height: auto; aspect-ratio: 3 / 2; }
	.ssi-project-detail h1.ssi-project-detail__title { font-size: 28px; }
}

@media (max-width: 767px) {
	/* PHONE: same single stack, but the meta panel moves BELOW the cover. */
	.ssi-project-detail__layout > .ssi-detail-gallery__lead { grid-row: 1; }
	.ssi-project-detail__layout > .ssi-detail-gallery__thumbs { grid-row: 2; }
	.ssi-project-detail__layout > .ssi-detail-gallery__more { grid-row: 3; }
	.ssi-project-detail__layout > .project_single_fetch { grid-row: 4; }
	.ssi-project-detail h1.ssi-project-detail__title { font-size: 24px; }
	.ssi-project-detail .project_single_fetch { padding: 22px 20px; }
}

/* --- PHASE 2: category archive (card grid). Reuses theme card classes; adds
 *     layout + uniform card height + on-palette pager. --- */
.ssi-archive-wrap { max-width: 1580px; margin: 0 auto; padding: 48px 50px; }
.ssi-archive { display: grid; grid-template-columns: 426px 1fr; gap: 48px; align-items: start; }

/* Sidebar nav, section heading and the whole CARD COMPONENT: NO RULES HERE BY
 * DESIGN. project_category_name_static, project_posts_wrap, project_post_item,
 * project_image_wrap, project_content_wrap, project_subcat_name and
 * project_title are all styled by the child theme's ssi-contract.css, which now
 * loads on every template. The plugin's former copies were deleted 2026-07-31
 * (STYLE_AUDIT.md BLOCKER-1/2/3). Cards lay out from the theme's own
 * `.project_posts_wrap{display:flex;gap:30px}` + `.project_post_item{width:48%}`
 * — same 2-up result the grid override produced. Do not re-add them here. */

/* Text-only (non-featured) entries above the grid */
.ssi-archive__textlist { list-style: none; margin: 0 0 34px; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 30px; }
.ssi-archive__textitem { font-size: 20px; line-height: 1.4; color: var(--ssi-navy, #00193B); }
.ssi-archive__textname { display: block; font-weight: 700; color: var(--ssi-blue, #245E82); text-decoration: none; text-transform: uppercase; letter-spacing: .3px; margin-bottom: 2px; }
.ssi-archive__textname:hover { color: var(--ssi-orange, #F26E22); }
.ssi-archive__textmeta { display: block; color: var(--ssi-grey, #707070); }
.ssi-archive__textmeta b { color: var(--ssi-grey, #707070); font-weight: 700; }

/* Pagination — on-palette */
.ssi-archive__pager { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; }
.ssi-archive__pager .page-numbers {
	display: inline-block; min-width: 40px; text-align: center; padding: 9px 14px;
	border: 1px solid var(--ssi-grey, #707070); border-radius: 2px; color: var(--ssi-blue, #245E82); text-decoration: none;
	font-family: "Source Sans 3", sans-serif; font-size: 16px; line-height: 1;
}
.ssi-archive__pager a.page-numbers:hover { border-color: var(--ssi-orange, #F26E22); color: var(--ssi-orange, #F26E22); }
.ssi-archive__pager .page-numbers.current { background: var(--ssi-blue, #245E82); border-color: var(--ssi-blue, #245E82); color: var(--ssi-white, #FFFFFF); font-weight: 700; }
.ssi-archive__pager .page-numbers.next,
.ssi-archive__pager .page-numbers.prev { background: var(--ssi-orange, #F26E22); border-color: var(--ssi-orange, #F26E22); color: var(--ssi-white, #FFFFFF); text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.ssi-archive__pager .page-numbers.next:hover,
.ssi-archive__pager .page-numbers.prev:hover { color: var(--ssi-white, #FFFFFF); opacity: .9; }
.ssi-archive__empty { color: var(--ssi-grey, #707070); font-style: italic; }

@media (max-width: 1024px) {
	.ssi-archive { grid-template-columns: 1fr; gap: 30px; }
	.ssi-archive-wrap { padding: 40px 24px; }
	.ssi-archive__textlist { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
	.ssi-archive-wrap { padding: 30px 16px; }
}
