/*
Theme Name: Devon Flower Company
Author: Leah Clark
Author URI: https://leahclark.net
Description: The WordPress theme for the Devon Flower Company website
Requires PHP: 7.2
Version: 1.3
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dfc
*/

/*
 * Link styles
 * https://github.com/WordPress/gutenberg/issues/42319
 */
a {
	text-decoration-thickness: 1px !important;
	text-underline-offset: .1em;
}

/* Focus styles */
:where(.wp-site-blocks *:focus) {
	outline-width: 2px;
	outline-style: solid;
}

/* Increase the bottom margin on submenus, so that the outline is visible. */
.wp-block-navigation .wp-block-navigation-submenu .wp-block-navigation-item:not(:last-child) {
	margin-bottom: 3px;
}

/* Increase the outline offset on the parent menu items, so that the outline does not touch the text. */
.wp-block-navigation .wp-block-navigation-item .wp-block-navigation-item__content {
	outline-offset: 4px;
}

/* Remove outline offset from the submenus, otherwise the outline is visible outside the submenu container. */
.wp-block-navigation .wp-block-navigation-item ul.wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	outline-offset: 0;
}

/*
 * Progressive enhancement to reduce widows and orphans
 * https://github.com/WordPress/gutenberg/issues/55190
 */
h1, h2, h3, h4, h5, h6, blockquote, caption, figcaption, p {
	text-wrap: pretty;
}

/*
 * Change the position of the more block on the front, by making it a block level element.
 * https://github.com/WordPress/gutenberg/issues/65934
*/
.more-link {
	display: block;
}

.big-header {
	text-shadow: 0px 2px 2px oklch(0 0 0 / .5);
	position: relative;
	z-index: 999;

	h1 {
		place-self: center;
		margin: auto;
	}

	header {
		display: contents;
	}


	.dfc-nav {
		position: absolute;
	}
}

.small-header {
	font-stretch: 1000%;
}

.dfc-nav {
	nav {
		font-stretch: 1000%;
	}
}

.woocommerce-nonsense {
	position: absolute;
	right: 0;
}

strong {
	font-weight: 700;
}

.page-title {
	font-style: italic;
	font-weight: 100;
	color: var(--wp--preset--color--accent-6);
	user-select: none;
	position: relative;
	z-index: -99;
}

.site-logo {
	font-stretch: ultra-expanded;
	font-weight: 400;
}

.copyright, .wc-block-formatted-money-amount, .price {
	font-variant-numeric: lining-nums;
}

.price {
	justify-self: end;
}

/* ridiculous hack: hide the register bit when logged in by checking if the
   woocommerce navigation is visible */
:root:has(.woocommerce-MyAccount-navigation) .register-bit {
	display: none;
}

.align-baseline {
	align-items: baseline;
}

.wp-block-woocommerce-product-button {
	margin-top: -1rem;
	gap: 0;

	> span > a {
		padding-top: 0;
		margin: 0;
	}
}

.categories-tags ul {
	padding: 0;
	list-style: none;
	display: flex;
	gap: 1rem;
	flex-wrap: wrap;

	li {
		display: flex;
		align-items: center;
		background-color: oklch(from var(--wp--preset--color--accent-4) .9 c h);

		a {
			background-color: oklch(from var(--wp--preset--color--accent-4) .95 c h);

			padding: .25rem .5rem;

			text-decoration: none;

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

		a + span {
			font-variant-numeric: lining-nums;
			display: block;
			padding: .25rem .5rem;

			&::after, &::before {
				content: "";
			}
		}
	}
}

.shop-sidebar {
	color: oklch(0.5 0 0);
}

.shop-sidebar h2 {
	color: black;
	font-size: var(--wp--preset--font-size--medium);
	font-variant: all-small-caps;
	margin-bottom: 0;
	
	& + * {
		margin-top: 0;
	}
}

.shop-sidebar :has(+ .wp-block-woocommerce-product-filter-price-slider) {
	margin-bottom: 0;
}

.shop-sidebar h3 {
	font-variant: all-small-caps;
	font-size: var(--wp--preset--font-size--small);

}

.shop-sidebar input {
	font-size: var(--wp--preset--font-size--small);
	font-family: inherit;
	font-variant-numeric: lining-nums;
	border-color: var(--wp--preset--color--accent-6) !important;
	border-radius: 0 !important;
	outline: none;
	color: black;

	&:focus-visible {
		outline: 4px solid oklch(from var(--wp--preset--color--accent-1) l c h / .25);
		border-color: var(--wp--preset--color--accent-1) !important;
	}
}

.categories ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.separator {
	display: flex;
	align-items: center;
	white-space: nowrap;
	justify-content: center;
	width: 100%;
	gap: 1rem;

	&::after, &::before {
		display: block;
		content: "";
		background-color: oklch(from var(--wp--preset--color--accent-4) .85 c h);
		height: 1px;
		width: 100%;
	}
}

.small-caps {
	font-variant: small-caps;
}