/*
Theme Name: Margaux Cortier Portfolio
Theme URI: https://margauxcortier.fr
Author: Thomas Navarro
Author URI: https://github.com/thomasnavarro
Description: Thème FSE pour présenter les réalisations de Margaux Cortier.
Requires at least: 6.8
Tested up to: 6.8
Requires PHP: 8.0
Version: 1.2
Text Domain: mc-portfolio

/*
 * Link styles
 * https://github.com/WordPress/gutenberg/issues/42319
 */
a {
	text-decoration-thickness: 1px !important;
	text-underline-offset: 0.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. */
/* stylelint-disable selector-class-pattern */
.wp-block-navigation
	.wp-block-navigation-item
	.wp-block-navigation-item__content {
	outline-offset: 4px;
}
/* stylelint-enable selector-class-pattern */

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

/*
 * 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;
}

.is-style-positive-zindex {
	z-index: 10;
	position: relative;
}

.is-style-filter--categories {
	.wp-block-query-filter__radio-group,
	.wp-block-query-filter__checkbox-group {
		gap: 0;
	}

	input[type="radio"],
	input[type="checkbox"] {
		display: none;
	}

	label {
		cursor: pointer;
		text-transform: uppercase;
		font-weight: 300;
		padding-inline: 0.25em;
		border-bottom: 1px solid var(--wp--preset--color--accent-6);
	}

	/* Cacher le premier label (Tous) */
	label:first-child {
		display: none;
	}

	input[type="radio"]:checked + label,
	input[type="checkbox"]:checked + label,
	label:has(input[type="radio"]:checked),
	label:has(input[type="checkbox"]:checked) {
		font-weight: 700;
		border-bottom: 1px solid var(--wp--preset--color--contrast);
	}
}

.is-style-filter--tags {
	.wp-block-query-filter__radio-group,
	.wp-block-query-filter__checkbox-group {
		gap: 0;
	}

	input[type="radio"],
	input[type="checkbox"] {
		display: none;
	}

	label {
		cursor: pointer;
		text-transform: uppercase;
		font-weight: 300;
		padding-inline: 0.25em;
		border-bottom: 1px solid var(--wp--preset--color--accent-6);
	}

	input[type="radio"]:checked + label,
	input[type="checkbox"]:checked + label,
	label:has(input[type="radio"]:checked),
	label:has(input[type="checkbox"]:checked) {
		font-weight: 700;
		border-bottom: 1px solid var(--wp--preset--color--contrast);
	}
}

.wc-block-product-gallery-dialog__images img {
	object-fit: contain;
}

.wc-block-product-gallery-large-image {
	aspect-ratio: unset;
}

.home {
	header.wp-block-template-part {
		height: 65px;
	}

	main {
		margin-top: -65px !important;
	}
}

@media (max-width: 782px) {
	.is-style-slider-mobile {
		display: flex !important;
		flex-wrap: nowrap;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		padding-bottom: calc(var(--wp--style--block-gap) / 2);
		-webkit-overflow-scrolling: touch;
	}

	.is-style-slider-mobile.is-layout-grid > * {
		flex: 0 0 75%;
		max-width: 360px;
		scroll-snap-align: start;
	}

	.is-style-slider-mobile.is-layout-grid::-webkit-scrollbar {
		height: calc(var(--wp--style--block-gap) / 4);
	}

	.is-style-slider-mobile.is-layout-grid::-webkit-scrollbar-thumb {
		background: rgba(0, 0, 0, 0.2);
		border-radius: 10px;
	}
}
