/*
Theme Name: CEM Theme
Theme URI: https://cem-bydgoszcz.pl
Author: Centrum Edukacji Montessori Bydgoszcz
Description: Block theme dla Centrum Edukacji Montessori Bydgoszcz. Migracja pixel-perfect z Hugo (Figma source).
Version: 0.1.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cem-theme
*/

/*
 * style.css to wymóg WP (header). Główne style są w assets/css/main.css —
 * skopiowane 1:1 z Hugo (assets/css/main.css w repo Hugo).
 *
 * Tu zostaje tylko jedna sekcja: aliasy CSS variables, żeby tokeny WP
 * (--wp--preset--*) mapowały się na nazwy używane przez CSS Hugo
 * (--color-bg, --color-green, …) — i odwrotnie. Inne pliki CSS Hugo
 * używają nazw oryginalnych, theme.json używa wpresetów dla edytora.
 */

:root {
	/* WP preset → Hugo alias (dla CSS Hugo). */
	--color-bg:          var(--wp--preset--color--bg);
	--color-bg-soft:     var(--wp--preset--color--bg-soft);
	--color-green:       var(--wp--preset--color--green);
	--color-green-dark:  var(--wp--preset--color--green-dark);
	--color-orange:      var(--wp--preset--color--orange);
	--color-yellow:      var(--wp--preset--color--yellow);
	--color-cream:       var(--wp--preset--color--cream);
}

/* WP wstawia .wp-site-blocks jako wrapper między <body> a contentem.
   Hugo tego nie ma — header jest direct child body. Jeśli .wp-site-blocks
   ma overflow-x: clip, staje się scope dla position:sticky, a że ma height
   całej strony i nie scrolluje (scroll jest na body), sticky NIE działa.
   Horizontal clip aplikujemy tylko na <body> (z Hugo main.css).
   .wp-site-blocks zostawiamy w pełni przezroczyste. */

/* Mobile menu scroll-lock — body.is-menu-open. */
body.is-menu-open {
	position: fixed;
	inset: 0;
	overflow: hidden;
}

/* Hugo .site-header ma position:sticky, ale w block themie WP owija ją w
   <header class="wp-block-template-part"> — ten wrapper ma height = dziecka
   (85px), wiec sticky scope dla .site-header jest do tego maluchatkiego
   wrappera i odpina sie po pierwszym pikselu scrolla. Promujemy sticky
   na sam wrapper template-part (jego scope to body — pelna strona). */
header.wp-block-template-part:has(> .site-header) {
	position: sticky;
	top: 0;
	z-index: 100;
}
