/* ============================================================
   23-episodes-menu.css — grouping in the Episodes mega menu
   ------------------------------------------------------------
   The dropdown holds three kinds of destination:

     1  All Episodes   the whole directory
     2  12 series      under a "Series" label
     3  Bonus Content  everything that isn't a series episode

   13-header-boxed.css lays the submenu out with `columns: 3`,
   which flows every item through the same three tracks, so a
   section label or a rule could never span the dropdown. This
   file switches that container to a grid.

   Ricky 2026-11-19: "Don't have the 'all episodes' and 'bonus
   content' buttons take up full width." They each sit on their
   own row but occupy ONE column; the full-width elements are
   the label and the hairline, which are pseudo-elements of the
   <ul> rather than menu items.

   Keyed on `fb-all-episodes` / `fb-bonus`, set on the menu item
   records (Appearance -> Menus -> CSS Classes), not on
   :first-child/:last-child — position would silently restyle a
   different series the moment the menu is reordered.
   ============================================================ */

@media (min-width: 1025px) {

	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li.fb-mega > ul.sub-menu {
		columns: initial;
		
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		column-gap: 28px;
		row-gap: 1px;
		align-content: start;
	}

	/* Band order. The series carry no class of their own, so they take the
	   base order and the three named groups are placed around them. */
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li.fb-mega > ul.sub-menu > li {
		order: 3;
	}

	/* Band 1 — the directory. One column wide, on its own row. */
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li.fb-mega > ul.sub-menu > li.fb-all-episodes {
		order: 1;
		grid-column: 1;
	}
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li.fb-mega > ul.sub-menu > li.fb-all-episodes > a {
		font-weight: 600;
	}

	/* Band 2 — the "Series" label, spanning the dropdown, carrying the rule
	   that separates it from All Episodes above. */
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li.fb-mega > ul.sub-menu::before {
		content: "Series";
		order: 2;
		grid-column: 1 / -1;
		margin: 8px 0 6px;
		padding: 10px 8px 0;
		border-top: 1px solid var(--awb-color3);
		color: var(--awb-color6);
		font-size: 11px;
		font-weight: 700;
		letter-spacing: .14em;
		text-transform: uppercase;
	}

	/* Band 3 — a full-width hairline, then Bonus Content at one column. */
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li.fb-mega > ul.sub-menu::after {
		content: "";
		order: 4;
		grid-column: 1 / -1;
		margin: 9px 0 2px;
		border-top: 1px solid var(--awb-color3);
	}
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li.fb-mega > ul.sub-menu > li.fb-bonus {
		order: 5;
		grid-column: 1;
	}
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li.fb-mega > ul.sub-menu > li.fb-bonus > a {
		font-weight: 600;
	}
}

/* ---- collapsed / mobile menu ---------------------------------------
   Every row already carries Avada's own 1px divider, so another one says
   nothing. The band break is made with a tinted lead row and a heavier
   rule above Bonus Content. No "Series" label here: the mega menu is a
   desktop construct and the mobile list is one column, where the tint and
   the rule already separate the three groups.
   -------------------------------------------------------------------- */
@media (max-width: 1024px) {

	.fusion-mobile-nav-holder li.fb-all-episodes > a,
	ul.fusion-mobile-menu li.fb-all-episodes > a {
		font-weight: 600;
		/* !important: Avada's dynamic CSS sets the mobile menu item
		   background and loads AFTER the child theme, so an
		   equal-specificity rule here is silently dropped. */
		background: hsla(var(--awb-color4-h), var(--awb-color4-s), var(--awb-color4-l), calc(var(--awb-color4-a) - 86%)) !important;
	}

	.fusion-mobile-nav-holder li.fb-bonus,
	ul.fusion-mobile-menu li.fb-bonus {
		border-top: 2px solid var(--awb-color3) !important;
	}
	.fusion-mobile-nav-holder li.fb-bonus > a,
	ul.fusion-mobile-menu li.fb-bonus > a {
		font-weight: 600;
	}
}
