/*!
 * Theme Name: Sims Limited
 * Theme URI: https://simsltd.com/
 * Author: SiteCare
 * Author URI: https://sitecare.com/
 * Description: A custom theme for Sims Limited.
 * Version: 1.0.0
 * Requires at least: 6.7
 * Tested up to: 6.7
 * Requires PHP: 5.7
 * License: GNU General Public License v2 or later
 * License URI: http://www.gnu.org/licenses/gpl-2.0.html
 * Domain Path: /languages
 * Text Domain: sims-limited
 */

:root {
	counter-reset: section-title;

	--screen-width: 100vw;
	--screen-width-half: 50vw;
	--scrollbar-width: 15px;
	--scrollbar-width-half: calc(var(--scrollbar-width) / 2 );
	--section-line-offset: 22px;

	--bevelled-corner:
		0 0,
		100% 0,
		calc(100% - 0.06px) calc(100% - 50.55px),
		calc(100% - 0.22px) calc(100% - 49.11px),
		calc(100% - 0.5px) calc(100% - 47.7px),
		calc(100% - 0.88px) calc(100% - 46.31px),
		calc(100% - 1.36px) calc(100% - 44.96px),
		calc(100% - 1.95px) calc(100% - 43.66px),
		calc(100% - 2.63px) calc(100% - 42.39px),
		calc(100% - 3.41px) calc(100% - 41.18px),
		calc(100% - 4.29px) calc(100% - 40.03px),
		calc(100% - 5.25px) calc(100% - 38.95px),
		calc(100% - 35.75px) calc(100% - 6.99px),
		calc(100% - 35.75px) calc(100% - 6.99px),
		calc(100% - 37.07px) calc(100% - 5.71px),
		calc(100% - 38.47px) calc(100% - 4.55px),
		calc(100% - 39.96px) calc(100% - 3.51px),
		calc(100% - 41.53px) calc(100% - 2.6px),
		calc(100% - 43.16px) calc(100% - 1.82px),
		calc(100% - 44.84px) calc(100% - 1.18px),
		calc(100% - 46.58px) calc(100% - 0.67px),
		calc(100% - 48.36px) calc(100% - 0.3px),
		calc(100% - 50.17px) calc(100% - 0.08px),
		0 100%;

	--bevelled-corner--small:
		0 0,
		100% 0,
		calc(100% - 0.04px) calc(100% - 34.99px),
		calc(100% - 0.15px) calc(100% - 34px),
		calc(100% - 0.34px) calc(100% - 33.02px),
		calc(100% - 0.61px) calc(100% - 32.06px),
		calc(100% - 0.94px) calc(100% - 31.13px),
		calc(100% - 1.35px) calc(100% - 30.22px),
		calc(100% - 1.82px) calc(100% - 29.35px),
		calc(100% - 2.36px) calc(100% - 28.51px),
		calc(100% - 2.97px) calc(100% - 27.72px),
		calc(100% - 3.64px) calc(100% - 26.96px),
		calc(100% - 24.75px) calc(100% - 4.84px),
		calc(100% - 24.75px) calc(100% - 4.84px),
		calc(100% - 25.66px) calc(100% - 3.95px),
		calc(100% - 26.64px) calc(100% - 3.15px),
		calc(100% - 27.67px) calc(100% - 2.43px),
		calc(100% - 28.75px) calc(100% - 1.8px),
		calc(100% - 29.88px) calc(100% - 1.26px),
		calc(100% - 31.05px) calc(100% - 0.82px),
		calc(100% - 32.25px) calc(100% - 0.46px),
		calc(100% - 33.48px) calc(100% - 0.21px),
		calc(100% - 34.73px) calc(100% - 0.05px),
		0 100%;

	--bevelled-corner--large:
		0% 0%,
		100% 0%,
		100% calc(100% - 78.08px),
		calc(100% - 0.08px) calc(100% - 75.9px),
		calc(100% - 0.33px) calc(100% - 73.74px),
		calc(100% - 0.75px) calc(100% - 71.62px),
		calc(100% - 1.32px) calc(100% - 69.54px),
		calc(100% - 2.05px) calc(100% - 67.52px),
		calc(100% - 2.93px) calc(100% - 65.55px),
		calc(100% - 3.95px) calc(100% - 63.66px),
		calc(100% - 5.13px) calc(100% - 61.84px),
		calc(100% - 6.44px) calc(100% - 60.11px),
		calc(100% - 7.89px) calc(100% - 58.48px),
		calc(100% - 53.68px) calc(100% - 10.49px),
		calc(100% - 53.68px) calc(100% - 10.49px),
		calc(100% - 55.66px) calc(100% - 8.57px),
		calc(100% - 57.77px) calc(100% - 6.83px),
		calc(100% - 60.01px) calc(100% - 5.27px),
		calc(100% - 62.36px) calc(100% - 3.91px),
		calc(100% - 64.8px) calc(100% - 2.74px),
		calc(100% - 67.33px) calc(100% - 1.77px),
		calc(100% - 69.94px) calc(100% - 1px),
		calc(100% - 72.61px) calc(100% - 0.45px),
		calc(100% - 75.33px) calc(100% - 0.11px),
		calc(100% - 78.08px) 100%,
		0% 100%;
}

@media (min-width: 1384px) {
	:root {
		--section-line-offset: 50px;
	}
}


/* CSS Reset
----------------------------------------------------------------------------- */

*,
*::before,
*::after {
	box-sizing: inherit;
}

html {
	box-sizing: border-box;
	-moz-osx-font-smoothing: grayscale;
	-webkit-font-smoothing: antialiased;
	-webkit-text-size-adjust: 100%;
}

b,
strong {
	font-weight: var(--wp--custom--font-weight--semi-bold);
}

ol,
ul {
	padding: 0;
}

ol:where(:not([class*="wp-block"])),
ol:where(.wp-block-list),
ul:where(:not([class*="wp-block"])),
ul:where(.wp-block-list) {
	padding-inline-start: var(--wp--preset--spacing--20);
}

div[class*="wp-block-"] figcaption {
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--x-small);
	margin-bottom: 0;
	margin-top: 20px;
	text-align: center;
}

img,
figure {
	max-width: 100%;
	height: auto;
}


/* Form styles
----------------------------------------------------------------------------- */

input,
button,
textarea,
select {
	font: inherit;
}

input[type="button"],
input[type="email"],
input[type="search"],
input[type="submit"],
input[type="text"],
textarea {
	-webkit-appearance: none;
	appearance: none;
}

input:not([type="submit"]),
select,
textarea {
	color: var(--wp--preset--color--contrast);
	border-radius: 5px;
	border: solid 1px var(--wp--preset--color--neutral-light);
	padding: .5em 1em;
	font-size: var(--wp--preset--font-size--small);
	background-color: #fff;
}

select {
	-webkit-appearance: none;
	appearance: none;
	background-image:
		linear-gradient(45deg, transparent 50%, gray 50%),
		linear-gradient(135deg, gray 50%, transparent 50%);
	background-position:
		calc(100% - 20px) calc(1em + 2px),
		calc(100% - 15px) calc(1em + 2px);
	background-repeat: no-repeat;
	background-size:
		5px 5px,
		5px 5px;
	padding-right: 2.25em;

	&:focus {
		background-image:
			linear-gradient(45deg, gray 50%, transparent 50%),
			linear-gradient(135deg, transparent 50%, gray 50%);
		background-position:
			calc(100% - 15px) 1em,
			calc(100% - 20px) 1em;
	}
}

input:focus-visible,
textarea:focus-visible {
	outline-color: var(--wp--preset--color--neutral-dark);
}

input[type="checkbox"],
input[type="image"],
input[type="radio"] {
	width: auto;
}

label {
	width: 100%;
	display: block;
}

::placeholder {
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--small);
	opacity: 0.75;
}


/* Helper styles
----------------------------------------------------------------------------- */

a.more-link {
	display: block;
}

/* Inline code */
*:not(.wp-block-code) > code {
	background-color: var(--wp--preset--color--tertiary);
	font-weight: var(--wp--custom--font-weight--medium);;
	padding: 3px 5px;
	position: relative;
	border-radius: 3px;
}

.site {
	margin-top: 0;
	position: relative;
}

.site-preheader {
	&:empty {
		display: none;
	}

	a {
		text-decoration: none;
	}
}

.page-template-page-header-overlay {
	.site-header {
		position: absolute;
		top: 0;
		right: 0;
		left: 0;
		z-index: 100;
	}
}

.site-footer {
	a {
		text-decoration: none;

		&:hover {
			text-decoration: underline;
		}
	}

	.footer-links {
		p {
			line-height: 1.2;
		}
	}
}

.sims-archived-reports {
	.facetwp-load-more {
		color: var(--wp--preset--color--white);
	}
}

.sims-card {
	align-content: stretch;
	display: flex;
	flex-direction: column;
	height: 100%;

	.sims-card__content {
		display: flex;
		flex: 1 0 auto;
		flex-direction: column;
	}

	.wp-block-post-excerpt {
		display: flex;
		flex: 1 0 auto;
		flex-direction: column;

		.wp-block-post-excerpt__more-text {
			font-size: var(--wp--preset--font-size--base);
			font-weight: var(--wp--custom--font-weight--semi-bold);
			margin-top: auto;
			padding-top: var(--wp--preset--spacing--30);
		}
	}

	.sims-card__footer {
		margin-top: auto;
	}
}

.sims-corporate-document {
	a {
		&:after {
			display: none !important;
		}
	}
}

.sims-event-webcast-link {
	text-decoration: none;

	&:hover {
		text-decoration: underline;
	}
}

.sims-featured-story .wp-block-post-excerpt__more-link {
	background-color: var(--wp--preset--color--accent);
	border-radius: 10px;
	border-width: 0;
	color: var(--wp--preset--color--base);
	cursor: pointer;
	font-size: var(--wp--preset--font-size--base);
	font-weight: var(--wp--custom--font-weight--medium);
	filter: none;
	margin-top: var(--wp--preset--spacing--30);
	padding: 0.5em 1em; /* Match theme.json */
	transition: none;

	&:focus,
	&:hover {
		background-color: var(--wp--preset--color--neutral);
		color: var(--wp--preset--color--base);
		filter: brightness(0.9);
		text-decoration: none !important;
	}
}

.sims-investor-widget,
.sims-linkify {
	a {
		text-decoration: none;

		&:after {
			content: "";
			display: block;
			position: absolute;
			top: 0;
			right: 0;
			bottom: 0;
			left: 0;
		}
	}

	&.wp-block-cover {
		.wp-block-cover__background {
			z-index: -1;
		}

		.wp-block-cover__image-background {
			z-index: -2;
		}

		.wp-block-cover__inner-container {
			position: static;
		}
	}
}

.sims-news {
	.facetwp-load-more {
		background-color: transparent;
		border-radius: 10px;
		border-width: 0;
		box-shadow: inset 0 0 0 2px currentColor;
		color: var(--wp--preset--color--primary-alt) !important;
		cursor: pointer;
		font-size: var(--wp--preset--font-size--x-small);
		font-weight: var(--wp--custom--font-weight--medium);
		filter: none;
		margin-top: var(--wp--preset--spacing--50);
		padding: 0.5em 1em; /* Match theme.json */
		transition: none;

		&:focus,
		&:hover {
			background-color: var(--wp--preset--color--primary-alt);
			color: var(--wp--preset--color--base) !important;
			filter: brightness(0.9);
			text-decoration: none !important;
		}
	}
}

.sims-presentation-row__links {
	min-width: 20px;
}

.sims-quick-link {
	a {
		text-decoration: none;

		&:hover {
			text-decoration: underline;
		}
	}
}

.sims-tag {
	background: #283d49;
	border-radius: 20px;
	color: var(--wp--preset--color--tertiary);
	display: inline-block;
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: var(--wp--custom--font-weight--bold);
	letter-spacing: 0.3em;
	padding: 0.5em 1em;
	position: absolute;
	top: 1em;
	right: 1em;
	text-transform: uppercase;
}

.sims-zoomify {
	.wp-block-cover__image-background {
		transition: transform 0.25s ease-in-out;
	}

	&:hover {
		.wp-block-cover__image-background {
			transform: scale(1.1);
		}
	}
}

.sims-news .facetwp-load-more,
a.sims-card__footer,
.sims-card__footer a,
.wp-block-button > a,
.wp-block-post-excerpt__more-link,
.wp-block-read-more,
.sims-direct-contact-links .is-style-button-link a,
.leadership-template .is-style-button-link a {
	position: relative;
	text-decoration: none;

	&:after {
		border-top: 3px solid transparent;
		border-bottom: 3px solid transparent;
		border-left: 3px solid currentColor;
		content: "";
		display: inline-block;
		height: 0;
		margin-left: 0.5em;
		position: relative;
		top: -2px;
		width: 0;
	}

	&:not(.wp-element-button):hover {
		text-decoration: underline;
	}

	&.wp-element-button:not(.has-x-small-font-size) {
		&:after {
			top: -3px;
		}
	}
}

/* Remove arrow from buttons next to icon blocks. */
.wp-block-outermost-icon-block + .wp-block-buttons a {
	&:after {
		display: none;
	}
}

.is-style-clipped-border {
	background: var(--wp--preset--color--secondary);
	border-radius: 24px;
	clip-path: polygon(var(--bevelled-corner--small));
	position: relative;

	&:after {
		background: #fff;
		border-radius: 24px;
		clip-path: polygon(var(--bevelled-corner--small));
		content: "";
		position: absolute;
		top: 1.25px;
		right: 1.25px;
		bottom: 1.25px;
		left: 1.25px;
		transition: background-color 0.2s ease-in-out;
		z-index: -1;
	}

	&.has-hover:hover {
		&:after {
			background-color: var(--wp--preset--color--secondary);
		}
	}

	.has-secondary-background-color & {
		background-color: #a5c9e2;

		&:after {
			background: var(--wp--preset--color--secondary);
		}

		&.has-hover:hover {
			&:after {
				background-color: #fff;
			}
		}
	}
}

.is-truncated,
.wp-block-post-title.is-truncated > a {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
}

.is-truncated--2,
.wp-block-post-title.is-truncated--2 > a {
	-webkit-line-clamp: 2;
}

.facetwp-facet-presentations {
	display: flex;
	flex-direction: row;
	gap: var(--wp--preset--spacing--40);

	.facetwp-counter {
		display: none;
	}

	.facetwp-radio {
		background-image: none;
		color: var(--wp--preset--color--secondary-alt);
		font-size: var(--wp--preset--font-size--medium);
		font-weight: var(--wp--custom--font-weight--semi-bold);
		opacity: 0.65;
		padding: 0 0 0.5rem 0;

		/* &:first-child {
			display: none;
		} */

		&:not(.disabled):hover {
			color: var(--wp--preset--color--accent);
			opacity: 1;
		}

		&.checked {
			background-image: none;
			border-bottom: 2px solid  var(--wp--preset--color--accent);
			color: var(--wp--preset--color--accent);
			opacity: 1;
		}
	}
}

.facetwp-type-pager {
	text-align: center;
}

.facetwp-load-more {
	background: transparent;
	border-width: 0;
	cursor: pointer;
	font-size: var(--wp--preset--font-size--base);
	font-weight: var(--wp--custom--font-weight--medium);
}

.facetwp-reset {
	background-color: transparent;
	border: none;
	border-radius: 10px;
	box-shadow: inset 0 0 0 2px currentColor;
	color: var(--wp--preset--color--primary-alt);
	cursor: pointer;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	padding: 0.5em 1em;
	transition: none;

	&:focus,
	&:hover {
		background-color: var(--wp--preset--color--primary-alt);
		box-shadow: none;
		color: var(--wp--preset--color--base) !important;
		filter: none;
	}
}

.facetwp-facet-entity_name {
	opacity: 0.4;
	pointer-events: none;

	&.is-active {
		opacity: 1;
		pointer-events: all;
	}
}

.is-hidden {
	display: none;
}

.horizontal-scroll {
	max-width: calc(var(--wp--style--global--content-size) + (100vw - var(--wp--style--global--content-size))/2 );
	overflow-x: auto;

	&::-webkit-scrollbar {
		display: none;
	}

	ul {
		display: flex;
		flex-direction: row;

		li {
			min-width: 500px;
		}
	}
}

.pull-right,
.wp-block-query.pull-right {
	overflow: hidden;
	margin-right: calc(var(--wp--style--root--padding-right) * -1) !important;
	max-width: calc(var(--wp--style--global--content-size) + (100vw - var(--wp--style--global--content-size))/2 );
}

@media (max-width: 620px) {
	.sims-archived-reports {
		.wp-block-columns {
			flex-wrap: wrap !important;
		}

		.wp-block-column:last-child {
			flex: 1 1 100% !important;

			> .wp-block-group {
				justify-content: flex-start;
			}
		}
	}

	.sims-investor-reports {
		grid-template-columns: 2fr;
	}
}

@media (min-width: 480px) and (max-width: 600px) {
	.sims-corporate-documents .corporate-document-template {
		grid-template-columns: 1fr 1fr !important;
	}
}

@media (max-width: 781px) {
	.hide-on-mobile {
		display: none;
	}
}

@media (min-width: 782px) {
	.hide-on-desktop {
		display: none;
	}

	.sims-direct-contact-links {
		> .wp-block-column {
			&:not(:first-child) {
				padding-left: 40px;
			}

			&:not(:last-child) {
				border-right: 1px solid var(--wp--preset--color--neutral-light);
				padding-right: 40px;
			}
		}
	}
}
