/*
Theme Name: Wikimedia Enterprise
Theme URI: https://enterprise.wikimedia.com
Author: Wikimedia Enterprise
Author URI: https://enterprise.wikimedia.com
Description: WordPress theme for Wikimedia Enterprise using Full Site Editor Block theme.
Requires at least: 6.0
Tested up to: 6.9.4
Requires PHP: 7.4
Version: 1.2.7
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wikimedia-enterprise-theme

Initial release based on Twenty Twenty-Two WordPress Theme
*/
* {
	box-sizing: border-box;
}

/*
 * Smooth scroll to anchor links.
 */
html {
	scroll-behavior: smooth;
}

/*
 * Font smoothing.
 */
body {
	-moz-osx-font-smoothing: grayscale;
	-webkit-font-smoothing: antialiased;
}

/*
 * Hack: This stylesheet is included with the editor and body is converted to .editor-styles-wrapper.
 * This was causing the editor background to be smoke when in the design the smoke color background is
 * only for the margins around the main page, which is white background. So, to ensure this can't occur
 * in the editor, we need higher specificty on the body
 */
html > body {
	background-color: #e9ecef;
}

/*
 * Text and navigation link styles.
 * Necessary until the following issue is resolved in Gutenberg:
 * https://github.com/WordPress/gutenberg/issues/38277
 */
a {
	font-weight: 500;
	text-decoration: none !important;
	transition: color 0.3s ease-in-out, filter 0.3s ease-in-out;
}

/* Override font weight for links inside navigation, buttons, and headings */
nav a,
h1 a,
h2 a,
h3 a,
h4 a,
h5 a,
h6 a,
.wp-block-navigation a,
.wp-block-button a,
.wp-block-button__link {
	font-weight: 700;
}

/* Linked images adjust brightness on hover */
a:hover:not(:has(img)),
a:focus:not(:has(img)) {
	filter: brightness(175%);
}

/*
 * Lists & Blockquotes
 */
ul,
ol {
	padding-inline-start: 1.15rem;
}

/*
 * Blockquotes
 */
blockquote.wp-block-quote {
	border-image: linear-gradient(180deg, var(--wp--preset--color--secondary) 1.65%, var(--wp--preset--color--primary)) 1 100%;
	border-width: 5px;
	padding: 1rem;
	background-color: var(--wp--preset--color--mist);
}

blockquote.wp-block-quote cite::before {
	content: "\2014 \2009";
}

/*
 * Button Styles
 */
.wp-block-button__link,
.wp-block-search__button,
.wp-block-file .wp-block-file__button {
	transition: filter 0.3s ease, transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* force min width for Button in <main> */
:where(main) .wp-block-button__link {
	min-width: 240px;
}

/*
 * TODO: Remove custom hover styles once the following Gutenberg
 * issue is resolved: https://github.com/WordPress/gutenberg/issues/27075
 * it's now moved to https://github.com/WordPress/gutenberg/issues/38277
*/
.wp-block-button__link:hover,
.wp-block-search__button:hover,
.wp-block-file .wp-block-file__button:hover {
	filter: brightness(80%);
	transform: translateY(-4px);
}

/*
 * Design calls for wrapper to have max size. Apply default background here.
 */
.wp-site-blocks {
	max-width: var(--wp--custom--content-width--full);
	margin: 0 auto;
	background-color: var(--wp--preset--color--background);
	position: relative;
	padding-top: 79px;
}

/*
 * Header Position, Fixed & Scroll Styles
 */
.wp-site-blocks > header {
	position: fixed;
	top: 0;
	right: 0;
	left: 50%;
	transform: translateX(-50%);
	max-width: calc(100% - (2 * var(--wp--custom--spacing--outer)));
	width: calc(100% - (2 * var(--wp--custom--spacing--outer)));
	transition: top 0.2s ease-in;
	z-index: 5;
}

@media only screen and (min-width: 1152px) {

	.wp-site-blocks > header {
		width: calc(var(--wp--custom--content-width--full) - (2 * var(--wp--custom--spacing--outer)));
		max-width: calc(var(--wp--custom--content-width--full) - (2 * var(--wp--custom--spacing--outer)));
	}
}

.wp-site-blocks > header.hidden {
	top: -80px;
}

/*
 * Header Nav Mobile Handling
 */
@media only screen and (max-width: 840px) {

	/** Docs Sidebar Menu Control **/
	.mobile-menu-control {
		position: absolute;
		top: 50%;
		right: var(--wp--custom--spacing--outer);
		transform: translateY(-50%);
		background: transparent;
		appearance: none;
		margin: 0;
		padding: 0;
		border: 0;
		color: var(--wp--preset--color--white);
	}

	header > .wp-block-group > .wp-block-group > .wp-block-navigation {
		display: none !important;
	}

	header > .wp-block-group > .wp-block-group > .mobile-menu-control {
		display: block;
	}

	.mobile-menu {
		position: absolute;
		top: 100%;
		right: -1000px;
		z-index: 10;
		margin-top: 0 !important;
		transition: right 0.2s ease;
	}

	.mobile-menu.open {
		right: 0;
	}

	.mobile-menu > .wp-block-group {
		height: calc(100vh - 79px);
	}

	.mobile-menu > .wp-block-group > .wp-block-group {
		margin-top: auto;
	}

	.wp-site-blocks > .mobile-menu.wp-block-template-part > .wp-block-group.has-background {
		margin: 0 !important;
	}
}

@media only screen and (max-width: 840px) and (orientation: landscape) {

	.mobile-menu.open .wp-block-navigation {
		--navigation-layout-align: baseline;
		--navigation-layout-direction: row;
	}
}

@media only screen and (min-width: 841px) {

	.mobile-menu,
	.mobile-menu-control {
		display: none !important;
	}
}

/*
 * Responsive menu container padding.
 * This ensures the responsive container inherits the same
 * spacing defined above. This behavior may be built into
 * the Block Editor in the future.
 * syntax: top | left & right | bottom
 */
.wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--wp--custom--spacing--outer) var(--wp--custom--spacing--outer) var(--wp--custom--spacing--large);
}

/*
 * Main Blocks styles
 */
/* stylelint-disable no-descending-specificity */
.wp-site-blocks,
body > .is-root-container,
.edit-post-visual-editor__post-title-wrapper,
.wp-block-group.alignfull,
.wp-block-group.has-background,
.wp-block-cover.alignfull {
	padding-inline: var(--wp--custom--spacing--outer);
}

.wp-site-blocks .alignfull,
.wp-site-blocks > .wp-block-group.has-background,
.wp-site-blocks > .wp-block-cover,
body > .is-root-container > .wp-block-cover,
.wp-site-blocks > .wp-block-template-part > .wp-block-group.has-background,
.wp-site-blocks > .wp-block-template-part > .wp-block-cover,
.wp-site-blocks > main > .entry-content > .wp-block-group.has-background,
.wp-site-blocks > main > .entry-content > .wp-block-cover,
body > .is-root-container > .wp-block-template-part > .wp-block-group.has-background,
body > .is-root-container > .wp-block-template-part > .wp-block-cover,
.is-root-container .wp-block[data-align="full"] {
	margin-inline: calc(-1 * var(--wp--custom--spacing--outer)) !important;
	width: unset;
}

.wp-site-blocks .wp-block-group:where(.has-background) {
	padding-block: var(--wp--custom--spacing--outer);
}

.is-root-container .wp-block[data-align="full"] > .wp-block-group,
.is-root-container .wp-block[data-align="full"] > .wp-block-cover {
	padding-inline: var(--wp--custom--spacing--outer);
}

.wp-site-blocks > * + * > .wp-block-cover:first-child,
.wp-site-blocks > * + * > .entry-content > .wp-block-cover:first-child,
.wp-site-blocks > * + * > .wp-block-group.has-background:first-child,
.wp-site-blocks > * + * > .entry-content > .wp-block-group.has-background:first-child {
	margin-top: calc(-1 * var(--wp--style--block-gap)) !important;
}

.wp-site-blocks > * + .wp-block-cover,
.wp-site-blocks > * + .wp-block-group.has-background,
.wp-site-blocks > * + * > .wp-block-cover + .wp-block-cover,
.wp-site-blocks > * + * > .wp-block-cover + .wp-block-group.has-background,
.wp-site-blocks > * + * .entry-content > .wp-block-cover + .wp-block-cover,
.wp-site-blocks > * + * .entry-content > .wp-block-cover + .wp-block-group.has-background,
.wp-site-blocks > * + * > .wp-block-group.has-background + .wp-block-cover,
.wp-site-blocks > * + * > .wp-block-group.has-background + .wp-block-group.has-background,
.wp-site-blocks > * + * .entry-content > .wp-block-group.has-background + .wp-block-cover,
.wp-site-blocks > * + * .entry-content > .wp-block-group.has-background + .wp-block-group.has-background,
.wp-site-blocks > footer {
	margin-top: 0 !important;
}

/* Blocks inside columns don't have negative margins. */
.wp-site-blocks .wp-block-columns .wp-block-column .alignfull,
.is-root-container .wp-block-columns .wp-block-column .wp-block[data-align="full"],
/* We also want to avoid stacking negative margins. */
.wp-site-blocks .alignfull:not(.wp-block-group) .alignfull,
.is-root-container .wp-block[data-align="full"] > *:not(.wp-block-group) .wp-block[data-align="full"] {
	margin-inline: auto !important;
	width: inherit;
}
/* stylelint-enable no-descending-specificity */

/* Ensure links in cover blocks inherit color; mostly for /blog/tag/* pages */
.wp-block-cover__inner-container p a {
	color: inherit
}

/*
 * Utility Styles
 *
 * Remove top margin on first child inside is-layout-flow
 * Usage: Add `.remove-top-margin` to any parent block where you want
 * to suppress default WordPress top spacing.
 */
:root :where(.is-layout-flow) > *.remove-top-margin {
	margin-block-start: 0 !important;
}

/*
 * Visually Hidden
 */
.visually-hidden {
	clip: rect(0 0 0 0);
	-webkit-clip-path: inset(50%);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

mark.has-secondary-color {
	display: inline-block;
	background: var(--wp--preset--gradient--horizontal-secondary-to-primary);
	background-clip: text;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

@media only screen and (max-width: 600px) {

	.wp-block-buttons.is-centered-mobile {
		justify-content: center;
	}
}

/*
 * Blog/Article Content styles
 */

/* Custom Style: Cover Block has Dim on Mobile */
@media only screen and (max-width: 780px) {

	.wp-block-cover.is-style-dim-on-mobile .wp-block-cover__background {
		opacity: 0.75 !important;
	}

	.wp-block-cover.is-style-dim-on-mobile .wp-block-cover__background:not([class*="-background-color"]) {
		background-color: #000;
	}
}

/* cover block sizing */
@media only screen and (min-width: 781px) {

	.single-post .wp-block-cover {
		min-height: 340px;
	}

	.single-post .wp-block-cover__inner-container {
		max-width: 80%;
	}
}

/* blog post titles adjustments */
.single-post .wp-block-cover h1.wp-block-post-title,
.single-post .wp-block-cover time {
	text-wrap: balance;
	filter: drop-shadow(1px 1px 4px #000);
}

/* blog post list items */
.single-post p + ul,
.single-post p + ol {
	margin-top: 0.5rem;
}

.single-post .wp-block-image img {
	border-radius: 6px;
}

/* blog index/root & archive template */
.blog .wp-block-post-title a {
	text-wrap: pretty;
}

.blog .wp-block-post-title a,
.blog .news-latest-post .wp-block-post-title a {
	display: inline-block;
	background: var(--wp--preset--gradient--horizontal-secondary-to-primary);
	background-clip: text;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.blog .wp-block-post-excerpt__excerpt {
	text-wrap: balance;
}

.blog .wp-block-post-title a:hover,
.blog .wp-block-post-title a:focus {
	filter: none;
}

.blog .wp-block-post {
	transition: 0.2s ease;
}

.blog .wp-block-post .wp-block-post-featured-image {
	border-radius: 6px;
	overflow: hidden; /* for img transition */
}

/*
 * Make sure primary input mechanism can hover over elements.
 * Fixes oddity in firefox mobile.
 */
@media (hover: hover) {

	.blog .wp-block-post:hover {
		opacity: 0.7;
		cursor: pointer;
	}

	.blog .wp-block-post .wp-block-post-featured-image img {
		transition: 0.2s ease;
	}

	.blog .wp-block-post:hover .wp-block-post-featured-image img {
		transform: scale(1.05, 1.05);
	}

	.blog .news-latest-post .wp-block-post:hover .wp-block-post-featured-image img {
		transform: scale(1.02, 1.02);
	}
}

/*
 * Inline code styling
 */
:where(:not(pre.wp-block-code)) > code {
	display: inline-block;
	white-space: break-spaces;
	margin: 0;
	font-size: 90%;
	font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
	padding: 0.02rem 0.3rem;
	background: var(--wp--preset--color--blizzard);
	border-radius: 6px;
}

@media only screen and (max-width: 600px) {

	/* some response fields are long causing side-scroll on phones */
	:where(:not(pre.wp-block-code)) > code {
		word-break: break-all;
	}
}
