/*
 * Vendix base styles.
 *
 * Colors follow the Vendix design system when it is on (Vendix → Settings): its
 * --vendix-color-* tokens exist only then. Otherwise the neutral fallbacks apply.
 * Elementor Site Settings → Theme Style overrides the body, link, heading, button
 * and form styles with its own selectors.
 * Logical properties (inline/block) keep the layout right in RTL.
 *
 * This file loads on every page while the base styles are on (Customizer →
 * Vendix → Layout). blog.css (post lists and posts), comments.css (comment list
 * and form) and page-title.css (page title options) load after it only on the
 * pages that use them.
 */

:root {
	--vt-text: var(--vendix-color-text, #333333);
	--vt-heading: var(--vendix-color-heading, #1f2328);
	--vt-accent: var(--vendix-color-primary, #1f6feb);
	--vt-accent-contrast: #ffffff;
	--vt-muted: var(--vendix-color-muted, #6b7280);
	--vt-border: var(--vendix-color-border, #e5e7eb);
	--vt-surface: var(--vendix-color-bg-light, #f6f7f9);
	--vt-radius: 4px;
	--vt-gutter: 20px;
	--vt-sidebar: 300px;
	--vt-space: 2.5rem;
}

/* Base ---------------------------------------------------------------- */

html {
	line-height: 1.15;
	-webkit-text-size-adjust: 100%;
	/*
	 * The font stacks go on the root element and the body inherits them. A font
	 * that a plugin sets on the body, such as the Vendix design system for the
	 * entire site, then wins in LTR and RTL alike, and a plugin font left empty
	 * (inherit) still gets these stacks instead of the browser default.
	 */
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
	/*
	 * Goes on to the window, where it acts as hidden. Because the root element
	 * has a value of its own, the body keeps its clip (below) instead of handing
	 * it to the window, and the body does the actual cutting, so scripts and
	 * focus cannot scroll the page sideways either.
	 */
	overflow-x: clip;
}

/* Right-to-left sites: system fonts with Arabic, Persian and Hebrew glyphs. */
html[dir="rtl"] {
	font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Naskh Arabic", "Noto Sans Hebrew", "Geeza Pro", Arial, sans-serif;
}

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

body {
	margin: 0;
	background-color: #ffffff;
	color: var(--vt-text);
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.5;
	overflow-wrap: break-word;
	/*
	 * Cuts what sticks out sideways, such as the scrollbar-wide strip of a 100vw
	 * full width block, so the page never scrolls sideways. Unlike hidden, clip
	 * makes no scroll container, so the sticky header keeps sticking. The body
	 * always exists, also when a plugin replaces the output of header.php and
	 * footer.php.
	 */
	overflow-x: clip;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin-block-start: 0.5rem;
	margin-block-end: 1rem;
	color: var(--vt-heading);
	font-family: inherit;
	font-weight: 600;
	line-height: 1.2;
	/* A long word without spaces breaks instead of running out of the column. */
	overflow-wrap: anywhere;
}

h1 {
	font-size: 2.5rem;
}

h2 {
	font-size: 2rem;
}

h3 {
	font-size: 1.75rem;
}

h4 {
	font-size: 1.5rem;
}

h5 {
	font-size: 1.25rem;
}

h6 {
	font-size: 1rem;
}

p {
	margin-block-start: 0;
	margin-block-end: 0.9rem;
}

a {
	background-color: transparent;
	color: var(--vt-accent);
	text-decoration: none;
}

a:hover,
a:active {
	text-decoration: underline;
}

img {
	max-width: 100%;
	height: auto;
	border-style: none;
}

hr {
	height: 0;
	overflow: visible;
	border: 0;
	border-block-start: 1px solid var(--vt-border);
}

pre {
	font-family: monospace, monospace;
	font-size: 1em;
	white-space: pre-wrap;
}

code,
kbd,
samp {
	font-family: monospace, monospace;
	font-size: 1em;
}

b,
strong {
	font-weight: bolder;
}

small {
	font-size: 80%;
}

sub,
sup {
	position: relative;
	font-size: 75%;
	line-height: 0;
	vertical-align: baseline;
}

sub {
	bottom: -0.25em;
}

sup {
	top: -0.5em;
}

blockquote {
	margin-inline: 0;
	padding-inline-start: 1.25rem;
	border-inline-start: 3px solid var(--vt-border);
	font-style: italic;
}

/*
 * Figures, such as a [caption] image of classic content or imported block markup.
 * WordPress resets their browser margins only in its block library, which is not
 * always loaded (content without block comments, some optimisation settings), so
 * the theme resets them the same way, with no side margins and a space below, and
 * keeps a figure within the column. Element weight: the rules of the blocks and of
 * the WordPress classes (below) still win.
 */
figure {
	max-width: 100%;
	margin-block: 0 1em;
	margin-inline: 0;
}

figcaption {
	color: var(--vt-muted);
	font-size: 0.875rem;
	font-style: italic;
	line-height: 1.4;
}

/*
 * A caption under the image or media of a figure, spaced as the media blocks of
 * WordPress space theirs. The captions of the gallery and table blocks keep the
 * spacing of their block.
 */
figure:where(:not(.wp-block-gallery, .wp-block-table)) > * + figcaption {
	margin-block-start: 0.5em;
}

[hidden],
template {
	display: none;
}

/* Forms --------------------------------------------------------------- */

label {
	display: inline-block;
	line-height: 1;
	vertical-align: middle;
}

button,
input,
optgroup,
select,
textarea {
	margin: 0;
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.5;
}

input[type="date"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="text"],
input[type="time"],
input[type="url"],
select,
textarea {
	width: 100%;
	padding: 0.5rem 1rem;
	border: 1px solid #8c8f94;
	border-radius: var(--vt-radius);
	transition: border-color 0.2s;
}

input[type="date"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="text"]:focus,
input[type="time"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
	/* A visible focus ring for keyboard and mouse users; it does not depend on
	   the border color, which page builders may restyle. */
	border-color: var(--vt-accent);
	outline: 2px solid var(--vt-accent);
	outline-offset: 1px;
}

textarea {
	overflow: auto;
	resize: vertical;
}

[type="button"],
[type="submit"],
button {
	display: inline-block;
	border: 1px solid var(--vt-accent);
	border-radius: var(--vt-radius);
	background-color: transparent;
	color: var(--vt-accent);
	font-size: 1rem;
	text-align: center;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s;
}

/*
 * The spacing of a theme button. A button that WordPress draws as a block button
 * (wp-block-button__link), such as the product button of the WooCommerce blocks,
 * keeps the spacing of its block and of the site's global button style.
 */
[type="button"]:where(:not(.wp-block-button__link)),
[type="submit"]:where(:not(.wp-block-button__link)),
button:where(:not(.wp-block-button__link)) {
	padding: 0.5rem 1rem;
}

[type="button"]:hover,
[type="button"]:focus,
[type="submit"]:hover,
[type="submit"]:focus,
button:hover,
button:focus {
	background-color: var(--vt-accent);
	color: var(--vt-accent-contrast);
}

[type="button"]:focus:not(:focus-visible),
[type="submit"]:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
	outline: none;
}

[type="checkbox"],
[type="radio"] {
	padding: 0;
}

[type="search"] {
	-webkit-appearance: textfield;
	outline-offset: -2px;
}

[type="search"]::-webkit-search-decoration {
	-webkit-appearance: none;
}

/* Tables -------------------------------------------------------------- */

table {
	width: 100%;
	margin-block-end: 15px;
	border-collapse: collapse;
	border-spacing: 0;
	font-size: 0.9em;
}

/*
 * On small screens a wide content table scrolls inside itself, not the page.
 * WooCommerce tables (shop_table) have a phone layout of their own.
 */
@media (max-width: 767px) {
	.page-content table:not(.shop_table) {
		display: block;
		max-width: 100%;
		overflow-x: auto;
	}
}

table td,
table th {
	padding: 12px 15px;
	border: 1px solid var(--vt-border);
	line-height: 1.5;
	vertical-align: top;
}

table th {
	font-weight: 700;
}

table tbody > tr:nth-child(odd) > td,
table tbody > tr:nth-child(odd) > th {
	background-color: var(--vt-surface);
}

/* WordPress classes --------------------------------------------------- */

/* alignleft and alignright are physical sides in WordPress, also in RTL. */
.alignleft {
	float: left;
	margin-right: 1rem;
}

.alignright {
	float: right;
	margin-left: 1rem;
}

.aligncenter {
	display: block;
	clear: both;
	margin-inline: auto;
}

/*
 * Full width: as wide as the window. With a classic (not overlay) scrollbar 100vw
 * is wider than the page by the scrollbar; the body clips that strip (Base).
 * Core resets the margins of the old gallery markup
 * (.wp-block-gallery:not(.has-nested-images) { margin: 0 }), which would leave a
 * full width gallery unshifted and sticking out, so that case is listed with a
 * higher weight. Next to the sidebar there is no breakout (Layout).
 */
.alignfull,
.wp-block-gallery.alignfull:not(.has-nested-images) {
	width: 100vw;
	max-width: 100vw;
	margin-inline: calc(50% - 50vw);
}

.wp-caption {
	max-width: 100%;
	margin-block-end: 1.25rem;
}

.wp-caption img {
	display: block;
	margin-inline: auto;
}

.wp-caption-text,
.gallery-caption {
	margin: 0;
	padding: 0.5rem 0;
	color: var(--vt-muted);
	font-size: 0.875rem;
}

.sticky,
.bypostauthor {
	display: block;
}

.post-password-form {
	max-width: 500px;
	margin: 50px auto;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	top: 5px;
	left: 5px;
	z-index: 100000;
	display: block;
	width: auto;
	height: auto;
	padding: 12px 24px;
	clip: auto !important;
	clip-path: none;
	background-color: #eeeeee;
	color: #333333;
	font-size: 1rem;
	line-height: normal;
	text-decoration: none;
}

/* Layout -------------------------------------------------------------- */

.vt-container {
	width: 100%;
	max-width: var(--vt-container, 1140px);
	margin-inline: auto;
	padding-inline: var(--vt-gutter);
}

.vt-layout-boxed .site-main {
	padding-block: var(--vt-space);
}

.vt-layout-boxed.vt-no-spacing .site-main {
	padding-block: 0;
}

/* A full width page keeps its title area as wide as the boxed content. */
.vt-layout-full .page-header {
	max-width: var(--vt-container, 1140px);
	margin-inline: auto;
	padding-block-start: var(--vt-space);
	padding-inline: var(--vt-gutter);
}

.vt-layout-full.vt-no-spacing .page-header {
	padding-block-start: 0;
}

@media (min-width: 992px) {
	.vt-has-sidebar .vt-content-area {
		display: grid;
		grid-template-columns: minmax(0, 1fr) var(--vt-sidebar);
		gap: 3rem;
	}

	.vt-sidebar-start .vt-content-area {
		grid-template-columns: var(--vt-sidebar) minmax(0, 1fr);
	}

	.vt-sidebar-start .vt-content-area .site-main {
		order: 2;
	}

	.vt-has-sidebar .widget-area {
		padding-block: var(--vt-space);
	}

	/*
	 * Next to the sidebar a full width block stays in its column: the 100vw
	 * breakout (WordPress classes) would be centred on the column, not on the
	 * window, and cut off. Wide blocks have no breakout in this theme.
	 */
	.vt-has-sidebar .alignfull,
	.vt-has-sidebar .wp-block-gallery.alignfull:not(.has-nested-images) {
		width: auto;
		max-width: 100%;
		margin-inline: 0;
	}
}

/* Page title ---------------------------------------------------------- */

.page-header {
	margin-block-end: 2rem;
}

.page-header .entry-title {
	margin-block: 0;
}

.archive-description {
	margin-block-start: 0.75rem;
	color: var(--vt-muted);
}

.archive-description p:last-child {
	margin-block-end: 0;
}

.vt-breadcrumbs {
	margin-block-end: 0.75rem;
	color: var(--vt-muted);
	font-size: 0.875rem;
	overflow-wrap: anywhere;
}

.vt-breadcrumbs li {
	min-width: 0;
}

.vt-breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	margin: 0;
	padding: 0;
	list-style: none;
}

.vt-breadcrumbs li + li::before {
	content: "/";
	margin-inline: 0.5rem;
	opacity: 0.6;
}

.vt-breadcrumbs a {
	color: inherit;
}

/* Content ------------------------------------------------------------- */

/* Links in the text are underlined; link buttons (below) are not. */
.page-content a:where(:not(.button, .wp-block-button__link, .wp-block-file__button, .wp-element-button)) {
	text-decoration: underline;
}

/*
 * Link buttons in the content, also when the block library of WordPress is not
 * loaded (content without block comments, some optimisation settings).
 *
 * A link with the button class, as classic content and many plugins write it,
 * has the look of the theme buttons (Forms), and its label wraps, so a long one
 * fits a phone screen. WooCommerce draws its own buttons.
 */
.page-content a.button:where(:not(.woocommerce a, .woocommerce-page a)) {
	display: inline-block;
	margin-block: 0.25rem;
	padding: 0.5rem 1rem;
	border: 1px solid var(--vt-accent);
	border-radius: var(--vt-radius);
	background-color: transparent;
	color: var(--vt-accent);
	font-size: 1rem;
	line-height: 1.5;
	text-align: center;
	transition: background-color 0.2s, color 0.2s;
}

.page-content a.button:where(:not(.woocommerce a, .woocommerce-page a)):hover,
.page-content a.button:where(:not(.woocommerce a, .woocommerce-page a)):focus {
	background-color: var(--vt-accent);
	color: var(--vt-accent-contrast);
}

/*
 * The button block markup of WordPress keeps the site's button style (Global
 * Styles). Without the block library it still gets the layout of the block: the
 * buttons in a row that wraps, each one as high as its padding. No weight, so the
 * block library and the layout styles of WordPress win where they are loaded.
 */
:where(.wp-block-buttons) {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--style--block-gap, 0.5em);
}

:where(.wp-block-button__link) {
	display: inline-block;
}

/* No link button is underlined, also on hover. */
.page-content :where(a.button, .wp-block-button__link, .wp-block-file__button, .wp-element-button):hover {
	text-decoration: none;
}

/* Search and not found ------------------------------------------------ */

.search-form {
	position: relative;
	max-width: 420px;
	margin-block-end: 2rem;
}

.search-form .search-field {
	padding-inline-end: 3rem;
}

.search-form .search-submit {
	position: absolute;
	inset-block: 0;
	inset-inline-end: 0;
	display: inline-flex;
	align-items: center;
	padding-inline: 0.75rem;
	border: 0;
	color: var(--vt-muted);
}

.search-form .search-submit:hover,
.search-form .search-submit:focus {
	background-color: transparent;
	color: var(--vt-accent);
}

.vt-not-found {
	text-align: center;
}

.vt-not-found .vt-breadcrumbs ol {
	justify-content: center;
}

.vt-not-found .search-form {
	margin-inline: auto;
}

/* Widgets: the blog sidebar and the footer columns -------------------- */

.widget {
	margin-block-end: 2rem;
	overflow-wrap: anywhere;
}

.widget-title {
	font-size: 1.125rem;
}

.widget ul {
	margin: 0;
	padding-inline-start: 1.1rem;
}

@media print {
	*,
	*::before,
	*::after {
		background: transparent !important;
		box-shadow: none !important;
		color: #000000 !important;
		text-shadow: none !important;
	}

	a,
	a:visited {
		text-decoration: underline;
	}
}
