/*
Theme Name: Praktijk Kind en Ouder
Author: PixelBroeder
Author URI: https://www.pixelbroeder.nl
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 8.3
Version: 26.03
Text Domain: pko
*/


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

/*
 * Prevents unnecessary scrollbars while handling long lines of preformatted text.
 * https://core.trac.wordpress.org/ticket/63875
 */
:where(pre) {
	overflow-x: auto;
}


/* 
 * Custom styles
 */

.show-on-mobile {
	display: none !important;
}

@media (max-width: 599px) {

	.is-layout-grid {
		grid-template-columns: 1fr;
	}

	.wp-block-spacer {
		max-height: 1rem;
	}

	.hide-on-mobile {
		display: none !important;
	}

	.show-on-mobile {
		display: block !important;
	}
}

@media (min-width: 600px) and (max-width: 1024px) {

	.is-layout-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.hide-on-tablet {
		display: none !important;
	}
}

/* Header styles */
header {
	transform: translateY(0);
	transition: transform 0.5s ease;

	& .logo-small {
		display: none;
	}
}

body.scrolled header {

	/* als er gescrolled is, tonen we het menu altijd bovenaan de pagina */
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	z-index: 9999;
	animation: slideIn 0.5s ease forwards;

	& div {
		padding-block: 0 !important;
	}

	/* als er gescrolled is, wissel dan de logo's om, zodat het kleine logo zichtbaar wordt en het grote logo verdwijnt */
	& .logo-small {
		display: block;
	}

	& .custom-logo {
		display: none;
	}
}

body:has(header .is-menu-open) {
	overflow: hidden;

	& header {
		overflow: auto;
		height: 100dvh;
		position: sticky;
		top: 0;

		& .is-menu-open{
			background-image: url('./assets/images/logo/PKO-vlieger.svg');
			background-repeat: no-repeat;
			background-position: bottom right;
			background-size: 25vw auto;
		}
	}
}

@keyframes slideIn {
	from {
		transform: translateY(-100%);
	}

	to {
		transform: translateY(0);
	}
}