/*
Theme Name: PlusPort Direct
Theme URI: https://plusport.com/
Author: PlusPort
Author URI: https://plusport.com/
Description: PlusPort Direct — block theme for PlusPort, styled after cursus.plusport.com.
Version: 0.1.2
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 8.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: plusport-direct
Tags: block-theme, full-site-editing
*/

/* -------------------------------------------------------------------------
 * Smooth anchor scrolling
 *
 * Animate scrolling for all same-page (#anchor) links site-wide. The header
 * is `position: sticky`, so `scroll-padding-top` offsets targets so they are
 * not hidden underneath it when scrolled into view. Disabled for users who
 * prefer reduced motion.
 * ---------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

html {
	scroll-padding-top: 6rem;
}

/* -------------------------------------------------------------------------
 * Mobile navigation overlay
 *
 * The header navigation uses `items-justified-right`, which is correct for
 * the inline desktop menu but leaves the mobile fullscreen overlay
 * right-aligned with large empty gaps and flush (un-indented) submenus.
 * These rules only take effect while the overlay is open, so the desktop
 * menu is unaffected.
 * ---------------------------------------------------------------------- */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	align-items: stretch;
	justify-content: flex-start;
	padding-top: 2.5rem;
	padding-inline: 0.5rem;
}

/* Repeated `__container` class raises specificity above the core
 * `.is-menu-open .wp-block-navigation__container.items-justified-right`
 * rule, which otherwise forces `align-items: flex-end` and a 30px gap. */
.wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation__container.wp-block-navigation__container {
	align-items: stretch;
	justify-content: flex-start;
	gap: 0;
	width: 100%;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	width: 100%;
}

.wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation-item
	> .wp-block-navigation-item__content {
	display: block;
	width: 100%;
	padding-block: 0.9rem;
	text-align: left;
}

/* Submenu parent ("Cursussen"): core forces a flex column aligned to
 * `flex-end`, pushing the label and its child list to the right. Repeated
 * class beats that 3-class core selector so we can left-align everything. */
.wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation-submenu.wp-block-navigation-submenu {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: flex-start;
}

.wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation-submenu
	> .wp-block-navigation-item__content {
	width: 100%;
	text-align: left;
}

/* Submenu children: indented, lighter and tighter than top-level items. */
.wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation__submenu-container.wp-block-navigation__submenu-container {
	position: static;
	width: 100%;
	min-width: 0;
	gap: 0;
	padding-left: 1rem;
	margin-top: 0;
	align-items: stretch;
	background: transparent;
	border: 0;
	box-shadow: none;
}

.wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation__submenu-container
	.wp-block-navigation-item__content {
	padding-block: 0.6rem;
	font-size: 0.9rem;
	opacity: 0.85;
}

/* -------------------------------------------------------------------------
 * Ninja Forms — align the contact form with the theme design system
 * (Inter body text, Poppins labels/button, green accents, pill submit).
 * The extra `.nf-form-cont` prefix raises specificity above Ninja Forms'
 * own opinionated stylesheet so these rules win regardless of load order.
 * ---------------------------------------------------------------------- */
.nf-form-cont .nf-form-content {
	max-width: none;
	font-family: var(--wp--preset--font-family--inter);
	color: var(--wp--preset--color--dark-blue);
}

.nf-form-cont .nf-form-content .nf-field-container {
	margin-bottom: 1.25rem;
}

/* Labels */
.nf-form-cont .nf-form-content .nf-field-label label,
.nf-form-cont .nf-form-content .nf-field-label .label {
	font-family: var(--wp--preset--font-family--poppins);
	font-weight: 500;
	font-size: 0.98rem;
	color: var(--wp--preset--color--dark-blue);
	margin-bottom: 0.4rem;
	opacity: 1;
}

.nf-form-cont .nf-form-content .ninja-forms-req-symbol {
	color: var(--wp--preset--color--green);
}

/* Text inputs, textarea and select */
.nf-form-cont .nf-form-content input:not([type=button]):not([type=submit]),
.nf-form-cont .nf-form-content textarea,
.nf-form-cont .nf-form-content select {
	width: 100%;
	box-sizing: border-box;
	height: auto;
	font-family: var(--wp--preset--font-family--inter);
	font-size: 1rem;
	line-height: 1.5;
	color: var(--wp--preset--color--dark-blue);
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--cool-grey);
	border-radius: 12px;
	padding: 0.85rem 1rem;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.nf-form-cont .nf-form-content input:not([type=button]):not([type=submit])::placeholder,
.nf-form-cont .nf-form-content textarea::placeholder {
	color: var(--wp--preset--color--muted);
}

.nf-form-cont .nf-form-content textarea {
	min-height: 140px;
	resize: vertical;
}

/* Focus state */
.nf-form-cont .nf-form-content input:not([type=button]):not([type=submit]):focus,
.nf-form-cont .nf-form-content textarea:focus,
.nf-form-cont .nf-form-content select:focus {
	outline: none;
	border-color: var(--wp--preset--color--green);
	box-shadow: 0 0 0 3px rgba(0, 169, 96, 0.18);
}

/* Error state */
.nf-form-cont .nf-form-content .nf-error.field-wrap input:not([type=button]),
.nf-form-cont .nf-form-content .nf-error.field-wrap textarea,
.nf-form-cont .nf-form-content input.ninja-forms-field-error,
.nf-form-cont .nf-form-content textarea.ninja-forms-field-error {
	border-color: #e2401c;
}

.nf-form-cont .nf-form-content .nf-error-msg {
	color: #e2401c;
	font-size: 0.85rem;
	margin-top: 0.35rem;
}

/* Submit button — matches the theme's green pill button */
.nf-form-cont .nf-form-content .submit-wrap {
	margin-top: 0.5rem;
}

.nf-form-cont .nf-form-content input[type=button],
.nf-form-cont .nf-form-content input[type=submit],
.nf-form-cont .nf-form-content .submit-wrap input {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	min-height: 50px;
	font-family: var(--wp--preset--font-family--poppins);
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.3;
	color: var(--wp--preset--color--white);
	background: var(--wp--preset--color--green);
	border: 0;
	border-radius: 999px;
	padding: 0.75rem 2rem;
	cursor: pointer;
	box-shadow: none;
	transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.2s;
}

.nf-form-cont .nf-form-content input[type=button]:hover,
.nf-form-cont .nf-form-content input[type=submit]:hover,
.nf-form-cont .nf-form-content .submit-wrap input:hover {
	background: var(--wp--preset--color--dark-green);
	transform: translateY(-3px);
}

/* Success / response message */
.nf-form-cont .nf-response-msg,
.nf-form-cont .nf-form-content .nf-response-msg {
	font-family: var(--wp--preset--font-family--inter);
	color: var(--wp--preset--color--dark-green);
	background: var(--wp--preset--color--soft-green);
	border: 1px solid var(--wp--preset--color--green);
	border-radius: 16px;
	padding: 1.25rem 1.5rem;
}
