/*
Theme Name: Endonova
Theme URI: https://www.endonova.cz
Description: Custom block theme for the Endonova endocrinology clinic (MUDr. Jana Černá, Ostrava). Calm, clinical design; Czech language; no external font/CDN calls.
Author: Endonova
Version: 0.1.5
Requires at least: 6.5
Tested up to: 6.7
Requires PHP: 8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: endonova
*/

/* Block themes are styled mainly through theme.json. Add only the few rules
   that theme.json cannot express here. */

/* Horizontal breathing room — content and menu don't touch the screen edges. */
main.wp-block-group,
footer.wp-block-group,
.wp-block-post-content,
.wp-block-post-content > .alignfull.is-layout-constrained {
	padding-left: var(--wp--preset--spacing--30);
	padding-right: var(--wp--preset--spacing--30);
}

/* Header */
.wp-site-blocks {
	overflow-x: clip;
}

.site-header {
	max-width: 100vw;
	box-sizing: border-box;
	border-bottom: 1px solid #e4edee;
}

.site-header__bar {
	box-sizing: border-box;
	width: 100%;
	max-width: 1160px;
	margin-inline: auto;
	gap: 1.25rem 1.75rem;
}

.site-header__bar > * {
	min-width: 0;
}

/* Site logo in the header. */
.endonova-logo img {
	display: block;
	height: 46px;
	width: auto;
}

/* Navigation — underline grows on hover, stays on the current page. */
.wp-block-navigation .wp-block-navigation-item__content {
	position: relative;
	padding-bottom: 5px;
	font-weight: 500;
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
	transition: color 0.15s ease;
}

.wp-block-navigation .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	border-radius: 2px;
	background: var(--wp--preset--color--primary);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.2s ease;
}

.wp-block-navigation .wp-block-navigation-item__content:hover,
.wp-block-navigation .wp-block-navigation-item__content:focus {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}

.wp-block-navigation .wp-block-navigation-item__content:hover::after,
.wp-block-navigation .wp-block-navigation-item__content:focus::after,
.wp-block-navigation .wp-block-navigation-item__content[aria-current]::after {
	transform: scaleX(1);
}

.wp-block-navigation .wp-block-navigation-item__content[aria-current] {
	color: var(--wp--preset--color--primary);
	font-weight: 700;
}

/* Compact the header on small screens. */
@media (max-width: 700px) {
	.site-header__bar {
		gap: 0.75rem;
	}

	.endonova-logo img {
		height: 40px;
	}
}

/* On phones the menu collapses to a toggle — hide the CTA so the bar stays clean. */
@media (max-width: 600px) {
	.site-header .wp-block-buttons {
		display: none;
	}
}

/* Mobile overlay menu — clean centered layout with generous tap targets.
   Overrides WordPress's `items-justified-right` which would otherwise pin
   the items to the right edge of the overlay. */
@media (max-width: 600px) {
	/* Force every flex container in the open overlay to center its items horizontally,
	   beating WP's `align-items: var(--navigation-layout-align, initial)` (which is flex-end here). */
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
		align-items: center !important;
		text-align: center;
		width: 100%;
	}

	/* Generous vertical spacing between items. */
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
		gap: 1.5rem !important;
	}

	/* Each item sized to its text — flex parent's align-items:center then centers them horizontally. */
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
		width: auto !important;
		text-align: center !important;
	}

	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
		justify-content: center !important;
		text-align: center !important;
		font-size: 1.25rem;
	}

	/* Hide the desktop hover/active underline — it spans the full link box and looks odd full-width. */
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content::after {
		display: none !important;
	}
}

/* Subtle visit counter in the footer. */
.endonova-visits {
	display: block;
	margin-top: 0.4rem;
	text-align: center;
	font-size: 0.8rem;
	opacity: 0.55;
}

/* Contact form. */
.endonova-form {
	margin-top: var(--wp--preset--spacing--40);
}

.endonova-form__hint {
	font-size: 0.9rem;
	color: var(--wp--preset--color--muted);
}

.endonova-form__row {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin: 0 0 1.1rem;
}

.endonova-form__row label {
	font-weight: 600;
}

.endonova-form input[type="text"],
.endonova-form input[type="email"],
.endonova-form input[type="tel"],
.endonova-form textarea {
	width: 100%;
	padding: 0.6rem 0.7rem;
	border: 1px solid #c5d5d8;
	border-radius: 6px;
	background: #fff;
	font: inherit;
}

.endonova-form input:focus,
.endonova-form textarea:focus {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 1px;
	border-color: var(--wp--preset--color--primary);
}

.endonova-form__row--check label {
	display: flex;
	gap: 0.5rem;
	font-weight: 400;
}

.endonova-form button {
	padding: 0.8rem 1.7rem;
	border: 0;
	border-radius: 6px;
	background: var(--wp--preset--color--primary);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.endonova-form button:hover {
	background: var(--wp--preset--color--primary-dark);
}

/* Spam honeypot — hidden from real visitors, without affecting page width. */
.endonova-form__hp {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.endonova-form__notice {
	margin-bottom: 1.2rem;
	padding: 0.8rem 1rem;
	border-radius: 6px;
}

.endonova-form__notice--ok {
	background: #e3f3ec;
	border-left: 4px solid #1f9d6b;
}

.endonova-form__notice--error {
	background: #fbe9e7;
	border-left: 4px solid #c0392b;
}

.endonova-form__notice ul {
	margin: 0;
	padding-left: 1.2rem;
}

