/*
 * Flexible project template only (loaded on Flexible projects).
 * Everything else reuses the legacy styles in 2019-dc.css, which is not edited.
 *
 * v1.1: every new rule is scoped to .dc-flex (a class on each Flexible row) or to a
 * .dc-flex-* class that only Flexible markup prints, so nothing here can reach a
 * legacy project page, the home page or any other page.
 *
 * Breakpoints follow 2019-dc.css: phone under 40em (640 px), tablet 40em-69.99em,
 * desktop 70em (1120 px) and up, wide desktop 100em (1600 px) and up.
 */

/* ---------- Sizes per band (the legacy values, used by the new text styles) ---------- */
.dc-flex {
	--dcf-body: 10px;   /* body text, as .project-page p */
	--dcf-title: 14px;  /* heading, as .project-page h4 */
	--dcf-pull: 13px;   /* highlight */
	--dcf-pb: 6px;      /* space under a paragraph */
	--dcf-pad: 3px;     /* padding round each image box = inset of an image edge from the row edge */
	--dcf-h: 316px;     /* row height */
}

@media print, screen and (min-width: 70em) {
	.dc-flex {
		--dcf-body: 13px;
		--dcf-title: 16px;
		--dcf-pull: 16px;
		--dcf-pb: 12px;
		--dcf-pad: 5px;
		--dcf-h: 524px;
	}
}

@media print, screen and (min-width: 100em) {
	.dc-flex {
		--dcf-body: 16px;
		--dcf-title: 20px;
		--dcf-pull: 20px;
		--dcf-pad: 6px;
		--dcf-h: 700px;
	}
}

@media screen and (max-width: 39.9375em) {
	.dc-flex {
		--dcf-body: 12px;
		--dcf-title: 16px;
		--dcf-pull: 14px;
		--dcf-pb: 8px;
		--dcf-pad: 2px;
	}
}

/* ---------- Image boxes: notes and video ---------- */
.dc-flex .project_image_bg {
	position: relative;
}

/* ---------- Captions on images (v1.2; replaces the v1.1 "note" rule) ---------- */
/* Every caption is name (600, 13 px) and optional status (400, 12 px). Three styles:
   dark text, light text (soft shadow) and the white box (the v1.1 look, the default). */
.dc-flex .dc-cap {
	position: absolute;
	z-index: 2;
	display: flex;
	max-width: 90%;
	font-family: 'Open Sans', sans-serif;
	line-height: 1.25;
	text-align: left;
	pointer-events: none; /* the click goes to the image underneath */
}

.dc-flex .dc-cap-name {
	display: block;
	font-size: 13px;
	font-weight: 600;
}

.dc-flex .dc-cap-status {
	display: block;
	font-size: 12px;
	font-weight: 400;
}

/* Dark and light: 7 px from the left, 5 px from the bottom. With no status the name
   simply sits on the bottom line. */
.dc-flex .dc-cap--dark,
.dc-flex .dc-cap--light {
	left: 7px;
	bottom: 5px;
	flex-direction: column;
}

.dc-flex .dc-cap--dark {
	color: #111;
}

.dc-flex .dc-cap--light {
	color: #fff;
	text-shadow: 0 0 8px rgba(0, 0, 0, 0.45);
}

/* White box: black on translucent white in the bottom left corner, name and status
   on one line (the v1.1 note, light underline included). */
.dc-flex .dc-cap--box {
	left: 0;
	bottom: 0;
	flex-direction: row;
	gap: 6px;
	padding: 4px 10px;
	background: rgba(255, 255, 255, 0.78);
	color: #000;
}

.dc-flex .dc-cap--box .dc-cap-name {
	font-size: 11px;
	font-weight: 400;
	text-decoration: underline;
	text-decoration-color: rgba(0, 0, 0, 0.35);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.dc-flex .dc-cap--box .dc-cap-status {
	font-size: 11px;
}

/* Optional underline on the name (dark and light styles; the box always has one). */
.dc-flex .dc-cap--u .dc-cap-name {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

/* ---------- Headline over an image (v1.2): live text, sized by the image's own width ---------- */
.dc-flex .project_image_bg {
	container-type: inline-size;
}

.dc-flex .dc-flex-hl {
	position: absolute;
	inset: 6% 6% 16% 6%;
	z-index: 2;
	display: flex;
	pointer-events: none;
	transform: translate(var(--hl-dx, 0%), var(--hl-dy, 0%));
}

.dc-flex .dc-flex-hl > span {
	display: block;
	max-width: 100%;
	font-family: 'Open Sans', sans-serif;
	font-weight: var(--hl-w, 600);
	font-style: var(--hl-i, normal);
	/* Percent of the image's own width, never below the minimum. */
	font-size: max(var(--hl-min, 14px), calc(var(--hl-size, 8) * 1cqw));
	line-height: 1.02;
	letter-spacing: -0.01em;
	color: rgb(var(--hl-rgb, 255, 255, 255));
	opacity: var(--hl-op, 1);
}

.dc-flex .dc-hl-v-top { align-items: flex-start; }
.dc-flex .dc-hl-v-middle { align-items: center; }
.dc-flex .dc-hl-v-bottom { align-items: flex-end; }
.dc-flex .dc-hl-h-left { justify-content: flex-start; text-align: left; }
.dc-flex .dc-hl-h-center { justify-content: center; text-align: center; }
.dc-flex .dc-hl-h-right { justify-content: flex-end; text-align: right; }

/* ---------- Project tiles (v1.2): one link round the whole tile ---------- */
.dc-flex .dc-flex-tile {
	position: relative;
}

.dc-flex .dc-tile-link {
	display: block;
	position: relative;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.dc-flex .dc-tile-link:hover img.box_cover {
	opacity: 0.93;
}

.dc-flex .dc-tile-link:focus-visible {
	outline: 3px solid #2a7fa8;
	outline-offset: -3px;
}

/* "View project" link at the end of a text panel. */
.dc-flex .dc-flex-viewproject {
	margin: 6px 0 0;
	padding: 0;
}

.dc-flex .dc-flex-viewproject a {
	font-size: var(--dcf-body);
	font-weight: 600;
	color: #2a7fa8;
	text-decoration: none;
}

.dc-flex .dc-flex-viewproject a:hover {
	text-decoration: underline;
}

@media screen and (max-width: 39.9375em) {
	.dc-flex .dc-hl-hide-phone {
		display: none;
	}

	/* "Hide on phone" rows (v1.2). */
	.dc-flex.dc-flex-hide-phone {
		display: none;
	}

	/* Phone split rows (text on one side, portrait on the other): the portrait side
	   alternates from row to row. The markup puts the portrait first (left); every
	   other split row reverses it. */
	.dc-flex .dc-flex-split--right {
		flex-direction: row-reverse;
	}
}

/* Video: the featured image is a button with a small play symbol, top right. */
.dc-flex-video {
	position: relative;
}

.dc-flex-video-button {
	display: block;
	position: relative;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	overflow: hidden;
}

.dc-flex-video-button:focus-visible {
	outline: 3px solid #fff;
	outline-offset: -6px;
	box-shadow: inset 0 0 0 6px #000;
}

.dc-flex-video-play {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 28px;
	height: 28px;
	line-height: 28px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.65);
	color: #fff;
	font-size: 12px;
	text-align: center;
	pointer-events: none;
}

.dc-flex-video-play .fa {
	padding-left: 2px; /* optically centres the triangle */
}

@media (prefers-reduced-motion: no-preference) {
	.dc-flex-video-button:hover .dc-flex-video-play {
		background: rgba(0, 0, 0, 0.85);
	}
}

/* Project status under the place line (v1.2): 600 weight, practice green, 12 px. */
.project-page.dc-flex p.dc-flex-status,
.dc-flex .dc-flex-status {
	margin: 0;
	padding: 0 0 6px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
	color: #2d5d3a;
}

/* ---------- Formatted text (text panels, all-text row, text boxes) ---------- */
.dc-flex .dc-flex-rich > :first-child {
	margin-top: 0;
}

.dc-flex .dc-flex-rich p {
	margin: 0;
	padding: 0 0 var(--dcf-pb);
}

/* Heading: as the project title (Open Sans, weight 100, grey). */
.dc-flex .dc-flex-rich h3 {
	margin: 0 0 2px;
	padding: 0;
	font-family: 'Open Sans', sans-serif;
	font-size: var(--dcf-title);
	font-weight: 100;
	line-height: 1.5;
	color: #666;
	break-after: avoid;
}

/* Sub-heading: Open Sans 400, grey, body size. */
.dc-flex .dc-flex-rich h4 {
	margin: 0 0 4px;
	padding: 0;
	font-family: 'Open Sans', sans-serif;
	font-size: var(--dcf-body);
	font-weight: 400;
	line-height: 1.5;
	color: #666;
	break-after: avoid;
}

.dc-flex .dc-flex-rich strong,
.dc-flex .dc-flex-rich b {
	font-weight: 400;
}

.dc-flex .dc-flex-rich em {
	font-style: italic;
}

.dc-flex .dc-flex-rich a {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.dc-flex .dc-flex-rich ul,
.dc-flex .dc-flex-rich ol {
	margin: 0 0 6px;
	padding: 0 0 0 18px;
	break-inside: avoid;
}

.dc-flex .dc-flex-rich ul {
	list-style: disc outside;
}

.dc-flex .dc-flex-rich ol {
	list-style: decimal outside;
}

.dc-flex .dc-flex-rich li {
	margin: 0;
	padding: 0 0 4px;
	font-family: 'Open Sans', sans-serif;
	font-size: var(--dcf-body);
	line-height: 1.5;
}

/* Highlight: a pull-out paragraph with a thin line on the left. */
.dc-flex .dc-flex-rich p.dc-highlight {
	margin: 6px 0 14px;
	padding: 0 0 0 14px;
	border-left: 1px solid #999;
	font-size: var(--dcf-pull);
	line-height: 1.5;
	color: #666;
	break-inside: avoid;
}

/* Quote style keeps its opening mark (drawn by blockquote::before in 2019-dc.css);
   paragraphs inside a quote take the quote's own size and get no extra quote marks. */
.dc-flex blockquote.dc-flex-rich p {
	font-size: inherit;
	line-height: inherit;
}

.dc-flex .testimonial p::before,
.dc-flex .testimonial p::after {
	content: none;
}

/* ---------- "Text instead of" panels (rows R1, R2, R3a, R3b) ---------- */
.dc-flex .dc-flex-textcell {
	height: var(--dcf-h);
	padding: var(--dcf-pad);
	overflow: hidden;
	text-align: left;
}

.dc-flex .dc-flex-panel {
	height: 100%;
	padding: 12px 18px 10px 14px;
	overflow-y: auto;
	background: #fff;
	text-align: left;
	scrollbar-width: thin;
}

.dc-flex .dc-flex-panel::-webkit-scrollbar {
	width: 4px;
	background-color: #fff;
}

.dc-flex .dc-flex-panel::-webkit-scrollbar-track {
	-webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
	background-color: #f1f1f1;
}

.dc-flex .dc-flex-panel::-webkit-scrollbar-thumb {
	background-color: #b4b4b4;
	border: 1px solid #666;
}

/* ---------- "All text (full width)" row ---------- */
.dc-flex .dc-flex-alltext-cell {
	padding: 0 var(--dcf-pad); /* so the lines meet the outer edges of the images above and below */
	text-align: left;
}

.dc-flex .dc-flex-alltext-inner {
	margin: 6px 0;
	padding: 22px 6% 12px;
	border-top: 1px solid transparent;
	border-bottom: 1px solid transparent;
}

.dc-flex .dc-flex-alltext-inner.has-lines {
	border-top-color: #ccc;
	border-bottom-color: #ccc;
}

.dc-flex .dc-flex-alltext-title {
	margin: 0 0 10px;
	padding: 0;
}

.dc-flex .dc-flex-cols {
	columns: 2;
	column-gap: 48px;
}

/* ---------- Read more (phone only; shown by js/dc-flexible.js when the text is long) ---------- */
.dc-flex .dc-flex-readmore {
	margin: 4px 0 8px;
	padding: 0;
	border: 0;
	background: none;
	font: 600 12px 'Open Sans', Arial, sans-serif;
	color: #2a7fa8;
	cursor: pointer;
}

.dc-flex .dc-flex-readmore[hidden] {
	display: none;
}

/* ---------- Phone (under 640 px) ---------- */
@media screen and (max-width: 39.9375em) {
	/* All Flexible text 12 px (the legacy pages use 9 px; they keep it), titles 16 px. */
	.project-page.dc-flex p,
	.project-page.dc-flex li,
	.project-page.dc-flex blockquote,
	.project-page.dc-flex blockquote span {
		font-size: var(--dcf-body);
	}

	.project-page.dc-flex h4 {
		font-size: var(--dcf-title);
	}

	/* Opening: title and place full width at the very top. */
	.dc-flex .dc-flex-title-phone {
		padding: 10px 6px 4px;
		text-align: left;
	}

	/* Rows with a text panel: the text comes first, then the row's images. */
	.dc-flex .dc-flex-textcell {
		height: auto;
		order: -1;
		overflow: visible;
	}

	.dc-flex .dc-flex-panel {
		height: auto;
		padding: 12px 14px 6px;
		overflow: visible;
	}

	.dc-flex .dc-flex-alltext-inner {
		padding: 16px 14px 6px;
	}

	.dc-flex .dc-flex-cols {
		columns: 1;
	}

	/* Long text folds after about 12 lines (12 px x 1.5 line height x 12). */
	.dc-flex .dc-flex-fold.is-folded .dc-flex-body {
		max-height: calc(var(--dcf-body) * 18);
		overflow: hidden;
		-webkit-mask-image: linear-gradient(#000 60%, transparent);
		mask-image: linear-gradient(#000 60%, transparent);
	}
}

/* ---------- Flexible on Pages (v1.2, part 6) ---------- */
/* Pages opening: the text panel has no scrollbar and no fixed height. */
.dc-flex .dc-flex-pageopen-text {
	padding: calc(var(--dcf-pad) + 6px) calc(var(--dcf-pad) + 12px);
	text-align: left;
	font-size: var(--dcf-body);
}

.dc-flex .dc-flex-pageopen-title {
	margin: 0 0 10px;
	padding: 0;
	font-size: var(--dcf-title);
	font-weight: 400;
}

/* Section divider: light 20 px title and a 1 px #ccc line across the full width. */
.dc-flex .dc-flex-divider-cell {
	padding: 18px var(--dcf-pad) 0;
	text-align: left;
}

.dc-flex .dc-flex-divider-title {
	margin: 0;
	padding: 0 0 8px;
	font-size: 20px;
	font-weight: 300;
	line-height: 1.2;
	border-bottom: 1px solid #ccc;
}

/* Black bar: #111, white text, 8 px padding. */
.dc-flex .dc-flex-bar-cell {
	padding: 6px var(--dcf-pad);
	text-align: left;
}

.dc-flex .dc-flex-bar-inner {
	padding: 8px;
	background: #111;
	color: #fff;
}

.dc-flex .dc-flex-bar-inner .dc-flex-bar-heading {
	margin: 0;
	padding: 0;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.3;
	color: #fff;
}

.dc-flex .dc-flex-bar-inner .dc-flex-bar-line {
	margin: 2px 0 0;
	padding: 0;
	font-size: 12px;
	font-weight: 300;
	line-height: 1.4;
	color: #fff;
}

.dc-flex .dc-flex-bar-line a {
	color: #fff;
	text-decoration: underline;
}

/* Sector list: lines between items, none above the first, no arrows. */
.dc-flex .dc-flex-sectors-cell {
	padding: 6px var(--dcf-pad);
	text-align: left;
}

.dc-flex .dc-flex-sectors-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.dc-flex .dc-flex-sectors-list li {
	margin: 0;
	padding: 0;
	border-top: 1px solid #ccc;
}

.dc-flex .dc-flex-sectors-list li:first-child {
	border-top: 0;
}

.dc-flex .dc-flex-sectors-list a {
	display: block;
	padding: 10px 0;
	font-size: 20px;
	font-weight: 300;
	color: #111;
	text-decoration: none;
}

.dc-flex .dc-flex-sectors-list a:hover {
	text-decoration: underline;
}
