/* Neglia Design — Shared block styles */

/* ============================================
   Service Icons Block
   ============================================
   Single source of truth for the service-icon row.
   Both the Service Icons block (front end + editor
   preview) and page-services.php render .work-icons
   markup, so every rule is keyed to that class.
   Do not duplicate any of this in style.css. */

/* One layout model at every width: a centred flex row that
   wraps. Breakpoints change only the column count and the
   gutter. The column width is derived from those two. */
.work-icons {
	--work-icons-columns: 5;
	--work-icons-gutter: 5.6%;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	column-gap: var(--work-icons-gutter);
	row-gap: 2em;
	margin: 3.2em 0 3.9em;
	text-align: center;
}

.work-icons a {
	/* 99.6% rather than 100% leaves a little slack, so sub-pixel
	   rounding can never wrap the last column onto its own row */
	flex: 0 0 calc(
		(99.6% - (var(--work-icons-columns) - 1) * var(--work-icons-gutter))
		/ var(--work-icons-columns)
	);
	color: var(--wp--preset--color--dark-gray);
	text-decoration: none;
	transition: all 0.3s ease;
}

.work-icons a:hover {
	text-decoration: none;
	transform: scale(1.1);
}

.work-icons svg {
	display: block;
	margin: 0 auto;
	max-width: 72px;
}

.work-icons h2 {
	font-size: 0.9em;
	font-weight: 500;
	letter-spacing: 0.07em;
	margin: 0.8em 0 0;
}

/* Hover colours */
.work-icons .strategy:hover {
	color: var(--wp--preset--color--primary);
}

.work-icons .branding:hover {
	color: var(--wp--preset--color--orange);
}

.work-icons .web-design:hover {
	color: var(--wp--preset--color--green);
}

.work-icons .print-design:hover {
	color: var(--wp--preset--color--blue);
}

.work-icons .illustration:hover {
	color: var(--wp--preset--color--purple);
}

/* Narrow desktop: labels shrink before the columns have to */
@media (min-width: 768px) and (max-width: 991px) {
	.work-icons h2 {
		font-size: 0.7em;
	}
}

/* 782px and below: three columns, so five items land 3 + 2, centred */
@media screen and (max-width: 782px) {
	.work-icons {
		--work-icons-columns: 3;
		--work-icons-gutter: 0%;
		margin: 2em 0 3.5em;
	}

	.work-icons svg {
		max-width: 90px;
	}

	.work-icons h2 {
		font-size: 1em;
	}
}

@media screen and (max-width: 560px) {
	.work-icons svg {
		max-width: 70px;
	}

	.work-icons h2 {
		font-size: 0.8em;
		margin: 0.7em 0 0;
	}
}

@media screen and (max-width: 420px) {
	.work-icons {
		row-gap: 1.5em;
		margin: 1.75em 0 3.25em;
	}

	.work-icons svg {
		max-width: 58px;
	}

	.work-icons h2 {
		font-size: 0.7em;
		letter-spacing: 0.03em;
		margin: 0.6em 0 0;
	}
}

/* ============================================
   More Link
   ============================================
   The oversized chevron text link used to close out intro
   copy ("Learn how we can help you"). Single source of truth
   for both the legacy .more-link class (front-page.php and
   the TinyMCE styles dropdown) and the "More Link" style
   variation on core/button, so the two cannot drift apart.
   Do not redefine either one in style.css.

   Sizing is fluid rather than em-based. The legacy link sat
   inside a paragraph and took 1.5em of that paragraph's own
   fluid size; a button block can be dropped into any context,
   so the identical curve is restated here in rem + vw:
   21px at 320px, rising to 31.2px at 1250px and above. */

.more-link,
.wp-block-button.is-style-more-link .wp-block-button__link {
	display: inline-block;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	font-size: clamp(1.3125rem, 1.0931rem + 1.0968vw, 1.95rem);
	font-weight: 300;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	/* style.css does not load in the editor, so the transition
	   the global a{} rule normally supplies is restated here */
	transition: transform 0.3s;
}

/* Inherit the surrounding colour the way this link always has,
   but step aside when the editor's colour picker sets one. */
.more-link,
.wp-block-button.is-style-more-link .wp-block-button__link:not(.has-text-color) {
	color: inherit;
}

/* Legacy .more-link sits in a paragraph and inherits its 1.8
   line-height. A standalone button has no such parent, and
   theme.json hands core/button a line-height of 1, which would
   crop the chevron, so the variation gets its own value. */
.wp-block-button.is-style-more-link .wp-block-button__link {
	line-height: 1.5;
}

.more-link::after,
.wp-block-button.is-style-more-link .wp-block-button__link::after {
	display: inline-block;
	vertical-align: middle;
	content: '\00bb';
	font-size: 1.2em;
	font-weight: 300;
	margin: -0.3em 0 0 0.3em;
}

.more-link:hover,
.wp-block-button.is-style-more-link .wp-block-button__link:hover,
.wp-block-button.is-style-more-link .wp-block-button__link:focus {
	text-decoration: none;
	transform: translateX(5px);
}

/* Keyboard-only focus ring. The global a:focus{outline:0} rule
   leaves this link with no visible focus state; scoped to the
   block variation so nothing about the existing links changes. */
.wp-block-button.is-style-more-link .wp-block-button__link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
	.more-link,
	.wp-block-button.is-style-more-link .wp-block-button__link {
		transition: none;
	}

	.more-link:hover,
	.wp-block-button.is-style-more-link .wp-block-button__link:hover,
	.wp-block-button.is-style-more-link .wp-block-button__link:focus {
		transform: none;
	}
}

/* ============================================
   Slider Block
   ============================================ */
.wp-block-neglia-slider {
	position: relative;
}

/* Full-width breakout for Gutenberg alignfull */
.wp-block-neglia-slider.alignfull {
	margin-left: calc(-50vw + 50%);
	margin-right: calc(-50vw + 50%);
	width: 100vw;
}

@media screen and (max-width: 991px) {
	/* Clear the fixed header so the whole slide image is visible.
	   See --site-header-height in style.css. */
	.wp-block-neglia-slider {
		margin-top: var(--site-header-height, 95px);
	}
}

@media screen and (max-width: 782px) {
	.wp-block-neglia-slider {
		margin-top: var(--site-header-height, 90px);
	}
}

@media screen and (max-width: 560px) {
	.wp-block-neglia-slider {
		margin-top: var(--site-header-height, 80px);
	}
}

@media screen and (max-width: 420px) {
	.wp-block-neglia-slider {
		margin-top: var(--site-header-height, 70px);
	}
}

.wp-block-neglia-slider .home-slider {
	position: relative;
	list-style: none;
	overflow: hidden;
	width: 100%;
	padding: 0;
	margin: 0;
	z-index: 0;
}

.wp-block-neglia-slider .home-slider li {
	-webkit-backface-visibility: hidden;
	position: absolute;
	display: none;
	margin: 0;
	padding: 0;
	width: 100%;
	left: 0;
	top: 0;
}

.wp-block-neglia-slider .home-slider li:first-child {
	position: relative;
	display: block;
	float: left;
}

.wp-block-neglia-slider .home-slider li:first-child img {
	-webkit-animation: tocolor 3s ease 1s backwards;
	-moz-animation: tocolor 3s ease 1s backwards;
	animation: tocolor 3s ease 1s backwards;
}

@keyframes tocolor {
	from { filter: grayscale(100%) brightness(50%); }
	to   { filter: grayscale(0%) brightness(100%); }
}

@-moz-keyframes tocolor {
	from { -moz-filter: grayscale(100%) brightness(50%); }
	to   { -moz-filter: grayscale(0%) brightness(100%); }
}

@-webkit-keyframes tocolor {
	from { -webkit-filter: grayscale(100%) brightness(50%); }
	to   { -webkit-filter: grayscale(0%) brightness(100%); }
}

.wp-block-neglia-slider .home-slider img {
	display: block;
	height: auto;
	float: left;
	width: 100%;
	border: 0;
	-webkit-box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.25);
	-moz-box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.25);
	box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.25);
}

.wp-block-neglia-slider .slide-content {
	position: absolute;
	bottom: 7%;
	left: 0;
	right: 0;
	text-align: right;
	font-size: 0.7em;
	color: #FFFFFF;
}

.wp-block-neglia-slider .slide-content a {
	color: inherit;
}

.wp-block-neglia-slider .page-header-content {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	color: #FFFFFF;
}

.wp-block-neglia-slider .page-header-content .container {
	position: absolute;
	bottom: 14%;
	left: 0;
	right: 0;
	z-index: 999;
	color: #FFFFFF;
}

.wp-block-neglia-slider .page-header-content h1 {
	font-size: 3.1em;
	font-weight: 700;
	letter-spacing: 0.13em;
	margin: 0.5em 0 0.2em;
	text-transform: uppercase;
}

.wp-block-neglia-slider .page-header-content p {
	font-size: 1.3em;
	margin: 0 0 1.1em;
	max-width: 670px;
	font-weight: 500;
}

.wp-block-neglia-slider .page-header-content .btn {
	color: inherit;
	text-transform: uppercase;
	font-size: 0.9em;
}

@media screen and (max-width: 815px) {
	.wp-block-neglia-slider .page-header-content h1 {
		font-size: 1.3em;
	}

	.wp-block-neglia-slider .page-header-content p {
		font-size: 0.8em;
	}

	.wp-block-neglia-slider .page-header-content .btn {
		display: none;
	}
}

@media screen and (max-width: 782px) {
	/* Height of the credit strip below the image. Declared here, after the
	   base .page-header-content{inset:0} rule, so the override below wins. */
	.wp-block-neglia-slider {
		--slider-credit-space: 2.2rem;
	}

	/* Keep the headline overlay over the image only. Without this it stretches
	   over the credit strip as well and the byline slides down onto the bottom
	   edge of the photo. */
	.wp-block-neglia-slider .page-header-content {
		bottom: var(--slider-credit-space);
	}

	/* The hero is only ~150px tall on phones and the headline overlay fills
	   it, so the project credit sits below the image in normal flow rather
	   than absolutely positioned over it. It previously used a negative
	   bottom offset, which put it outside ul.home-slider and its
	   overflow:hidden clipped it away entirely at every width under 783px.
	   The image is floated, so clear:both is what puts the credit after it
	   rather than alongside. min-height reserves two lines (border-box, so it
	   includes the padding) to keep every slide the same height, otherwise
	   the page shifts ~17px each time a two-line credit rotates in. */
	.wp-block-neglia-slider .slide-content {
		position: static;
		clear: both;
		min-height: var(--slider-credit-space);
		padding-top: 0.4em;
		font-size: 0.7em;
		color: var(--wp--preset--color--dark-gray);
	}

	.wp-block-neglia-slider .slide-content p {
		margin: 0;
		font-size: 1em;
		line-height: 1.35;
	}
}

@media screen and (max-width: 560px) {
	.wp-block-neglia-slider .page-header-content h1 {
		font-size: 1.1em;
	}

	.wp-block-neglia-slider .page-header-content p {
		font-size: 0.7em;
	}
}

@media screen and (max-width: 420px) {
	.wp-block-neglia-slider .page-header-content h1 {
		font-size: 0.9em;
	}

	.wp-block-neglia-slider .page-header-content p {
		font-size: 0.65em;
	}
}
