/* Novask additional/editor-shared styles. Keep global overrides here so the
 * block editor (add_editor_style) and the front end stay visually in sync. */

/* Keep Elementor's default "Boxed" sections matching the theme's 1200px
 * container. This does NOT touch sections where "Stretch Section" (Full
 * Width) has been explicitly enabled in Elementor — those are meant to,
 * and still will, go edge-to-edge, exactly as chosen per-section. */
.elementor-section.elementor-section-boxed > .elementor-container {
	max-width: var(--novask-container);
}

.novask-header.is-scrolled { box-shadow: 0 2px 10px rgba(0,0,0,.06); }

.novask-hero { position: relative; overflow: hidden; }
.novask-hero img { width: 100%; height: auto; }

.novask-portfolio-grid,
.novask-team-grid,
.novask-gallery-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 24px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.novask-category-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 20px;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Shared full-width, fixed-position base for BOTH mega menu types.
   Visibility is fully JS-controlled via the "is-open" class (mega-menu.js) — a pure
   :hover chain breaks the instant the mouse crosses the header's padding on its way
   down into the fixed-position panel. Fixed + left:0 + width:100% keeps it from
   overflowing the right edge no matter where the trigger item sits in the nav. */
.novask-primary-nav .sub-menu.novask-mega-fullwidth {
	display: none !important;
	position: fixed;
	left: 0;
	top: 0; /* overwritten inline by JS with the header's actual bottom edge */
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-top: 1px solid var(--novask-border);
	border-bottom: 1px solid var(--novask-border);
	border-radius: 0;
	box-shadow: 0 16px 24px rgba(0, 0, 0, .08);
	z-index: 1000;
	max-height: 75vh;
	overflow-y: auto;
}
/* Every dropdown/mega submenu is now JS-managed via the "is-open" class
   (mega-menu.js) — this one rule covers all three menu types. */
.novask-primary-nav .sub-menu.is-open {
	display: flex !important;
}

/* Caret icon (added by JS only to top-level items that have a working dropdown) */
.novask-caret {
	display: inline-flex;
	align-items: center;
	margin-left: 6px;
	vertical-align: middle;
	transition: transform .2s ease;
}
.novask-primary-nav > ul > li:hover .novask-caret {
	transform: rotate(180deg);
}

.novask-primary-nav > ul > li > a {
	position: relative;
}
.novask-primary-nav > ul > li > a::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: 24px;
	width: 0;
	height: 2px;
	border-radius: 2px;
	background: var(--novask-accent);
	transition: width .3s ease;
}
.novask-primary-nav > ul > li:hover > a::after,
.novask-primary-nav > ul > li > a:focus::after {
	width: 100%;
}

/* Normal (non-mega) dropdown: proper spacing + block-level links + a wide-enough
   box so longer link text doesn't wrap awkwardly. Scoped to top-level items
   WITHOUT the mega classes so it never touches either mega menu's internals. */
.novask-primary-nav > ul > li:not(.mega-menu-ajax):not(.mega-menu-columns) > .sub-menu {
	position: fixed;
	top: 0; /* overwritten inline by JS with the header's actual bottom edge */
	left: 0; /* overwritten inline by JS with the trigger item's left edge */
	min-width: 220px;
	padding: 6px;
	z-index: 1000;
	box-shadow: 0 12px 20px rgba(0, 0, 0, .08);
}
.novask-primary-nav > ul > li:not(.mega-menu-ajax):not(.mega-menu-columns) > .sub-menu li {
	padding: 0;
	opacity: 0;
	transform: translateY(14px);
}
.novask-primary-nav > ul > li:not(.mega-menu-ajax):not(.mega-menu-columns) > .sub-menu.content-ready li {
	animation: novask-mega-slide-up .3s ease forwards;
}
.novask-primary-nav > ul > li:not(.mega-menu-ajax):not(.mega-menu-columns) > .sub-menu.content-ready li:nth-child(1) { animation-delay: .03s; }
.novask-primary-nav > ul > li:not(.mega-menu-ajax):not(.mega-menu-columns) > .sub-menu.content-ready li:nth-child(2) { animation-delay: .07s; }
.novask-primary-nav > ul > li:not(.mega-menu-ajax):not(.mega-menu-columns) > .sub-menu.content-ready li:nth-child(3) { animation-delay: .11s; }
.novask-primary-nav > ul > li:not(.mega-menu-ajax):not(.mega-menu-columns) > .sub-menu.content-ready li:nth-child(4) { animation-delay: .15s; }
.novask-primary-nav > ul > li:not(.mega-menu-ajax):not(.mega-menu-columns) > .sub-menu.content-ready li:nth-child(5) { animation-delay: .19s; }
.novask-primary-nav > ul > li:not(.mega-menu-ajax):not(.mega-menu-columns) > .sub-menu.content-ready li:nth-child(6) { animation-delay: .23s; }
.novask-primary-nav > ul > li:not(.mega-menu-ajax):not(.mega-menu-columns) > .sub-menu li > a {
	white-space: nowrap;
}

/* Universal "spinner for ~1s, then reveal" overlay — used by ALL three menu
   types (normal dropdown, AJAX category menu, 4-column menu). Note: no extra
   "position" rule needed here — the base .sub-menu is already position:absolute
   (or position:fixed for mega panels), which is enough of a positioning context
   for this absolutely-positioned overlay. */
.novask-mega-spinner-overlay {
	display: none;
	position: absolute;
	inset: 0;
	align-items: center;
	justify-content: center;
	background: #fff;
	z-index: 5;
}
.novask-primary-nav .sub-menu.is-loading .novask-mega-spinner-overlay {
	display: flex;
}
.novask-primary-nav .sub-menu.is-loading > *:not(.novask-mega-spinner-overlay) {
	visibility: hidden;
}

.novask-primary-nav .sub-menu.novask-mega-panel {
	flex-wrap: nowrap;
	align-items: stretch;
	flex-direction: row;
}
.novask-mega-categories {
	display: flex;
	flex-direction: column;
	flex: 0 0 260px;
	border-right: 1px solid var(--novask-border);
	overflow-y: auto;
	background: var(--novask-bg);
}
.novask-mega-categories li {
	list-style: none;
	padding: 0;
	margin: 0;
}
.novask-mega-preview {
	flex: 1 1 auto;
	padding: 28px 32px;
	min-width: 0;
	overflow-y: auto;
}
.novask-mega-preview-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}
.novask-mega-preview-item {
	display: flex;
	flex-direction: column;
	gap: 8px;
	color: var(--novask-text);
	text-decoration: none;
	opacity: 0;
	transform: translateY(28px);
	animation: novask-mega-slide-up .5s ease forwards;
}
.novask-mega-preview-item:nth-child(1) { animation-delay: .04s; }
.novask-mega-preview-item:nth-child(2) { animation-delay: .11s; }
.novask-mega-preview-item:nth-child(3) { animation-delay: .18s; }
.novask-mega-preview-item:nth-child(4) { animation-delay: .25s; }
.novask-mega-preview-item:nth-child(5) { animation-delay: .32s; }
@keyframes novask-mega-slide-up {
	from { opacity: 0; transform: translateY(28px); }
	to   { opacity: 1; transform: translateY(0); }
}
.novask-mega-preview-thumb {
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: var(--novask-radius);
	background: var(--novask-border);
}
.novask-mega-preview-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.novask-mega-preview-title {
	font-size: .85em;
	font-weight: 600;
	line-height: 1.4;
}
.novask-mega-placeholder {
	color: var(--novask-muted);
	font-size: .9em;
	margin: 0;
}
.novask-mega-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 160px;
}
.novask-mega-spinner {
	width: 30px;
	height: 30px;
	border: 3px solid var(--novask-border);
	border-top-color: var(--novask-accent);
	border-radius: 50%;
	display: inline-block;
	animation: novask-mega-spin .7s linear infinite;
}
@keyframes novask-mega-spin {
	to { transform: rotate(360deg); }
}

/* =========================================================
   4-COLUMN MEGA MENU (plain nested links, no AJAX)
   Build in Appearance > Menus:
     - Top-level item, CSS Class: mega-menu-columns
       - 4x second-level items  -> become the 4 column headings
         - any number of third-level items -> plain links inside that column
   Pure default wp_nav_menu() output; no custom walker needed.
   Shares .novask-mega-fullwidth (same fixed/full-width sizing as the AJAX menu).
========================================================= */
.novask-primary-nav .sub-menu.novask-mega-columns-panel {
	flex-direction: row;
	gap: 32px;
	padding: 32px max(24px, calc((100% - var(--novask-container)) / 2));
}
.novask-mega-columns-panel > li {
	flex: 1 1 0;
	min-width: 0;
	padding: 0;
}
.novask-mega-columns-panel > li > a {
	display: block;
	width: max-content;
	max-width: 100%;
	box-sizing: border-box;
	border: 0;
	outline: 0;
	font-weight: 700;
	text-transform: uppercase;
	font-size: 14px;
	letter-spacing: .04em;
	color: var(--novask-primary);
	margin: 0 0 12px 0;
}
.novask-mega-columns-panel > li > .sub-menu {
	display: block !important;
	position: static;
	background: none;
	border: 0;
	padding: 0;
	min-width: 0;
	box-shadow: none;
}
.novask-mega-columns-panel > li > .sub-menu > li {
	padding: 0;
}

/* =========================================================
   UNIFIED SUBMENU LINK DESIGN — shared by normal dropdown + AJAX category
   list (padded hover pill + underline). The 5-column menu's inner links get
   their own lighter style right below (no padding, no animation, underline
   sized to the text only).
========================================================= */
.novask-primary-nav > ul > li:not(.mega-menu-ajax):not(.mega-menu-columns) > .sub-menu li > a,
.novask-mega-categories li > a {
	position: relative;
	display: block;
	padding: 9px 16px;
	margin: 2px 6px;
	border-radius: 6px;
	font-weight: 500;
	font-size: 13px;
	line-height: 1.4;
	color: var(--novask-text);
	text-decoration: none;
	transition: background .2s ease, color .2s ease;
}
.novask-primary-nav > ul > li:not(.mega-menu-ajax):not(.mega-menu-columns) > .sub-menu li > a::after,
.novask-mega-categories li > a::after {
	content: '';
	position: absolute;
	left: 16px;
	right: 16px;
	bottom: 5px;
	height: 2px;
	border-radius: 2px;
	background: var(--novask-accent);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform .25s ease;
}
.novask-primary-nav > ul > li:not(.mega-menu-ajax):not(.mega-menu-columns) > .sub-menu li:hover > a,
.novask-primary-nav > ul > li:not(.mega-menu-ajax):not(.mega-menu-columns) > .sub-menu li > a:focus,
.novask-mega-categories li:hover > a,
.novask-mega-categories li > a:focus {
	background: #f4f4f5;
	color: var(--novask-accent);
}
.novask-primary-nav > ul > li:not(.mega-menu-ajax):not(.mega-menu-columns) > .sub-menu li:hover > a::after,
.novask-primary-nav > ul > li:not(.mega-menu-ajax):not(.mega-menu-columns) > .sub-menu li > a:focus::after,
.novask-mega-categories li:hover > a::after,
.novask-mega-categories li > a:focus::after {
	transform: scaleX(1);
}

/* 5-column menu inner links: no padding, no background, no animation — just
   text with an underline sized to the text's own width (not the column's
   full width). Block + width:max-content (not inline-block) to avoid any
   inline-formatting-context quirk that could nudge layout on hover/focus. */
.novask-mega-columns-panel > li > .sub-menu a {
	position: relative;
	display: block;
	width: max-content;
	max-width: 100%;
	box-sizing: border-box;
	padding: 0;
	margin: 0 0 6px 0;
	border: 0;
	outline: 0;
	font-weight: 400;
	font-size: 13px;
	line-height: 1.6;
	color: var(--novask-text);
	text-decoration: none;
	transition: color .2s ease;
}
.novask-mega-columns-panel > li > .sub-menu a::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: var(--novask-accent);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform .25s ease;
	pointer-events: none;
}
.novask-mega-columns-panel > li > .sub-menu a:hover,
.novask-mega-columns-panel > li > .sub-menu a:focus {
	color: var(--novask-accent);
}
.novask-mega-columns-panel > li > .sub-menu a:hover::after,
.novask-mega-columns-panel > li > .sub-menu a:focus::after {
	transform: scaleX(1);
}

@media (max-width: 900px) {
	.novask-primary-nav .sub-menu.novask-mega-fullwidth {
		max-height: 80vh;
	}
	.novask-primary-nav .sub-menu.novask-mega-panel {
		flex-direction: column;
	}
	.novask-mega-categories {
		flex: 0 0 auto;
		flex-direction: row;
		flex-wrap: wrap;
		border-right: none;
		border-bottom: 1px solid var(--novask-border);
		overflow: visible;
	}
	.novask-mega-preview-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.novask-primary-nav .sub-menu.novask-mega-columns-panel {
		flex-direction: column;
	}
	.novask-mega-columns-panel > li {
		flex: 1 1 auto;
	}
}

/* ---------- Header polish ---------- */
.novask-header { background: rgba(255,255,255,.92); }
/* blur lives on a pseudo-element: backdrop-filter on the header itself would make it the containing block of the fixed-position mega panels and offset them */
.novask-header::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; -webkit-backdrop-filter: saturate(1.6) blur(12px); backdrop-filter: saturate(1.6) blur(12px); }
/* sit below the WordPress admin bar when logged in */
.admin-bar .novask-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .novask-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .novask-header { top: 0; } }
.novask-header-inner { min-height: 76px; }
.novask-site-title { font-weight: 800; letter-spacing: -.03em; }
.novask-primary-nav a { font-weight: 500; font-size: 15px; letter-spacing: -.005em; }
.novask-primary-nav > ul > li > a { height: 76px; line-height: 76px; }
.novask-cart-contents { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; color: var(--novask-primary); background: #f4f4f7; transition: background .2s ease, color .2s ease; }
.novask-cart-contents:hover { background: var(--novask-accent); color: #fff; }
.novask-cart-count { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--novask-accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 19px; text-align: center; box-shadow: 0 0 0 2px #fff; }
button, input, select, textarea { font-family: inherit; }
