/* Primary menu as a magazine panel (theme 1.5.0, design: Lori). Markup: inc/mega-menu.php, script: assets/js/mega-menu.js.
   Loads after main.css and wins by order and by two-class selectors; the old rules for the plain sub menus stay in main.css, unused. */
.tbg-nav { display: none; min-width: 0; }
/* Two classes on every nav rule on purpose: the Elementor kit link colour (.elementor-kit-1265 a) and the existing `body .tbg-nav__list a { color: inherit }` must not win. */
.tbg-nav .tbg-nav__list > li > a,
.tbg-nav .tbg-nav__trigger {
	display: inline-flex; align-items: center; gap: 6px;
	min-height: 44px; padding: 8px 10px;
	border: 0; border-radius: 10px; background: none;
	font-family: var(--font); font-size: 15px; font-weight: 700; line-height: 1.2; white-space: nowrap;
	color: var(--c-green-800);
	transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.tbg-nav .tbg-nav__list > li > a:hover,
.tbg-nav .tbg-nav__trigger:hover,
.tbg-nav .tbg-nav__mega.is-open > .tbg-nav__trigger { color: var(--c-green-700); background: var(--c-mint); }
/* Current page: mint plus a 3px bar, so it is not colour alone (WCAG 1.4.1). */
.tbg-nav .tbg-nav__list > li.current-menu-item > a,
.tbg-nav .tbg-nav__list > li.current-menu-ancestor > a { color: var(--c-green-700); background: var(--c-mint); box-shadow: inset 0 -3px 0 var(--c-green-700); }
/* The chevron of the "מגזין" button. */
.tbg-nav__trigger::after { content: ''; width: 7px; height: 7px; margin-top: -3px; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(-45deg); transition: transform var(--dur) var(--ease); }
.tbg-nav__mega.is-open > .tbg-nav__trigger::after { margin-top: 3px; transform: rotate(135deg); }
/* Dark green ring, not the site orange (orange is 2.6:1 on white). */
.tbg-nav .tbg-nav__list > li > a:focus-visible,
.tbg-nav .tbg-nav__trigger:focus-visible,
.tbg-mega a:focus-visible { outline: 3px solid var(--c-green-900); outline-offset: 2px; } /* no border-radius here: the pill buttons keep their own */
@media (min-width: 1024px) {
	.tbg-header__inner { min-height: 84px; gap: 16px; }
	.tbg-logo img { height: 54px; }
	.tbg-nav { display: block; flex: 1; }
	.tbg-nav__list { display: flex; justify-content: flex-start; align-items: center; gap: 2px; margin-inline-start: 4px; } /* next to the logo (RTL start), the actions stay on the far side */
	.tbg-header__cta { display: inline-flex; min-height: 50px; padding: 12px 20px; }
	.tbg-header__cta .tbg-icon { width: 22px; height: 22px; }
	.tbg-menu-toggle { display: none; }
}
@media (min-width: 1200px) {
	.tbg-header__inner { gap: 24px; }
	.tbg-nav__list { gap: 4px; }
	.tbg-nav .tbg-nav__list > li > a, .tbg-nav .tbg-nav__trigger { font-size: 16px; padding-inline: 16px; }
	.tbg-search-toggle .tbg-icon, .tbg-fav-link .tbg-icon { width: 28px; height: 28px; }
}
@media (min-width: 1440px) { .tbg-logo img { height: 64px; } .tbg-nav__list { gap: 8px; } }

/* The magazine panel. */
.tbg-nav__mega { position: static; } /* the panel is placed against the sticky header, not against this li */
/* main.css gives every top level item position: relative, which would put the panel inside the narrow li: a stronger selector. */
.tbg-nav .tbg-nav__list > li.tbg-nav__mega { position: static; }
.tbg-mega {
	position: absolute; top: 100%; inset-inline: 0; margin-inline: auto;
	width: min(1180px, calc(100% - 2 * var(--gutter)));
	z-index: 60; padding-top: 8px;
	opacity: 0; visibility: hidden; transform: translateY(6px);
	transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility 0s linear var(--dur);
}
.tbg-nav__mega.is-open > .tbg-mega { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
/* Hover bridge: the pointer can travel from the button to the card without leaving the item. */
.tbg-mega::before { content: ''; position: absolute; inset-inline: 0; top: -24px; height: 24px; }
/* Soft scrim over the page under the header. It never takes clicks. */
.tbg-nav__mega::after {
	content: ''; position: absolute; top: 100%; left: 0; right: 0; height: 100vh; z-index: -1; pointer-events: none;
	background: rgba(0, 62, 48, 0.22); opacity: 0; visibility: hidden;
	transition: opacity var(--dur) var(--ease), visibility 0s linear var(--dur);
}
.tbg-nav__mega.is-open::after { opacity: 1; visibility: visible; transition-delay: 0s; }
.tbg-mega__card { max-height: calc(100vh - 150px); overflow-y: auto; background: #fff; border: 1px solid var(--c-border-soft); border-radius: var(--radius-lg); box-shadow: var(--shadow-panel); }
.tbg-mega__cols { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 26px 12px 22px; }
.tbg-mega__col { padding-inline: 16px; }
.tbg-mega__col + .tbg-mega__col { border-inline-start: 1px solid var(--c-border-soft); }
/* Column title: icon tile plus name, one link to the category. */
.tbg-mega .tbg-mega__head { display: flex; align-items: center; gap: 12px; min-height: 48px; margin-bottom: 8px; border-radius: 12px; font-size: 17px; font-weight: 800; line-height: 1.2; color: var(--c-green-800); }
.tbg-mega__ico { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 14px; background: var(--c-mint); color: var(--c-green-700); transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.tbg-mega__ico .tbg-icon { width: 26px; height: 26px; }
.tbg-mega__name { text-wrap: balance; }
.tbg-mega .tbg-mega__head:hover .tbg-mega__ico { background: var(--c-green-700); color: #fff; }
.tbg-mega .tbg-mega__head:hover .tbg-mega__name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.tbg-mega__posts { display: grid; gap: 2px; }
.tbg-mega .tbg-mega__post { display: block; margin-inline: -10px; padding: 8px 10px; border-radius: 10px; font-size: 15px; font-weight: 500; line-height: 1.35; color: var(--c-green-800); text-wrap: balance; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.tbg-mega .tbg-mega__post:hover { background: var(--c-mint); color: var(--c-green-700); }
.tbg-mega__empty { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--c-mint); font-size: 14px; line-height: 1.5; color: var(--c-green-muted); }
.tbg-mega .tbg-mega__all { margin-top: 14px; color: var(--c-green-800); }
.tbg-mega__all .tbg-icon { transition: transform var(--dur) var(--ease); }
.tbg-mega__all:hover .tbg-icon { transform: translateX(-3px); }
.tbg-mega__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 28px; background: var(--c-mint); border-top: 1px solid var(--c-border-soft); }
.tbg-mega__foot-title { font-size: 15px; font-weight: 800; }
.tbg-mega .tbg-mega__magall { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 8px; border-radius: 10px; font-size: 15px; font-weight: 800; color: var(--c-green-700); }
.tbg-mega .tbg-mega__magall .tbg-icon { width: 18px; height: 18px; transition: transform var(--dur) var(--ease); }
.tbg-mega .tbg-mega__magall:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.tbg-mega .tbg-mega__magall:hover .tbg-icon { transform: translateX(-3px); }
/* Windows high contrast removes backgrounds: the panel keeps a frame. */
@media (forced-colors: active) { .tbg-mega__card { border: 2px solid CanvasText; } }

/* The list inside the mobile drawer. */
.tbg-drawer { position: fixed; inset: 0; z-index: 100; }
.tbg-drawer[hidden] { display: none; }
.tbg-drawer__backdrop { position: absolute; inset: 0; background: rgba(0, 62, 48, 0.55); opacity: 0; transition: opacity 250ms var(--ease); }
.tbg-drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(88vw, 360px); padding: 16px 18px 32px; background: #fff; overflow-y: auto; transform: translateX(100%); transition: transform 250ms var(--ease); display: flex; flex-direction: column; gap: 18px; }
.tbg-drawer.is-open .tbg-drawer__backdrop { opacity: 1; }
.tbg-drawer.is-open .tbg-drawer__panel { transform: none; }
.tbg-drawer__head { display: flex; align-items: center; justify-content: space-between; }
.tbg-drawer__close { width: 44px; height: 44px; border: 0; background: var(--c-mint); border-radius: 50%; font-size: 26px; line-height: 1; }
.tbg-drawer__cta .tbg-btn { width: 100%; }

.tbg-drawer__list > li { border-bottom: 1px solid var(--c-border-soft); }
/* A row: a plain link or an accordion button, same size and look. */
.tbg-drawer .tbg-drawer__row,
.tbg-drawer .tbg-acc__btn {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	width: 100%; min-height: 56px; padding: 12px 4px;
	border: 0; background: none; text-align: start;
	font-family: var(--font); font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--c-green-800);
}
.tbg-acc__btn::after { content: ''; flex: none; width: 9px; height: 9px; margin-block-start: -5px; margin-inline-end: 12px; border: solid var(--c-green-700); border-width: 0 0 2px 2px; transform: rotate(-45deg); transition: transform var(--dur) var(--ease); } /* the margin-top evens out the optical centre of the rotated corner */
.tbg-acc.is-open > .tbg-acc__btn::after { margin-block-start: 5px; transform: rotate(135deg); }
.tbg-acc.is-open > .tbg-acc__btn { color: var(--c-green-700); }
/* Collapsing: the grid row goes from 0fr to 1fr, and hidden content leaves the tab order. */
.tbg-acc__body { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows 220ms var(--ease), visibility 0s linear 220ms; }
.tbg-acc.is-open > .tbg-acc__body { grid-template-rows: 1fr; visibility: visible; transition-delay: 0s; }
.tbg-acc__inner { min-height: 0; overflow: hidden; }
/* The magazine block: a mint tray holding the five categories. */
.tbg-drawer__mag { margin: 0 0 14px; padding: 6px; border-radius: var(--radius-card); background: var(--c-mint); }
.tbg-acc--sub { border-radius: 12px; transition: background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.tbg-acc--sub.is-open { background: #fff; box-shadow: var(--shadow-card); }
.tbg-drawer .tbg-acc--sub > .tbg-acc__btn { min-height: 52px; padding: 8px 10px; gap: 12px; font-size: 16px; }
.tbg-acc--sub > .tbg-acc__btn::after { margin-inline-end: 4px; }
.tbg-acc__ico { flex: none; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 11px; background: #fff; color: var(--c-green-700); }
.tbg-acc--sub.is-open .tbg-acc__ico { background: var(--c-mint); }
.tbg-acc__ico .tbg-icon { width: 22px; height: 22px; }
.tbg-acc__label { flex: 1; }
.tbg-drawer__posts { padding: 0 10px 4px 10px; padding-inline-start: 52px; } /* 52 + the 6px link padding = 58: the posts start under the category name */
.tbg-drawer .tbg-drawer__post { display: block; min-height: 44px; padding: 10px 6px; border-radius: 10px; font-size: 15px; font-weight: 500; line-height: 1.4; color: var(--c-green-800); }
.tbg-drawer .tbg-drawer__all { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 6px; border-radius: 10px; font-size: 15px; font-weight: 800; color: var(--c-green-700); }
.tbg-drawer .tbg-drawer__all .tbg-icon { width: 18px; height: 18px; }
.tbg-drawer__empty { margin: 0 0 4px; padding: 10px 6px; font-size: 14px; line-height: 1.5; color: var(--c-green-muted); }
.tbg-drawer__acc-foot .tbg-drawer__all { padding-inline: 4px; }
.tbg-drawer .tbg-drawer__row:active, .tbg-drawer .tbg-acc__btn:active, .tbg-drawer .tbg-drawer__post:active { background: var(--c-mint); }
.tbg-drawer a:not(.tbg-btn):focus-visible, .tbg-drawer .tbg-acc__btn:focus-visible { outline: 3px solid var(--c-green-900); outline-offset: -3px; border-radius: 10px; }

/* Rows that WordPress or the plugin print without our class (the advertise item is added to the menu by tripbagalil-core): same look as a row. */
.tbg-drawer .tbg-drawer__list > li.menu-item > a { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px; padding: 12px 4px; font-family: var(--font); font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--c-green-800); }
/* The page being read is in the magazine: the button looks like the current page of the bar (mint plus a 3px bar). */
.tbg-nav .tbg-nav__mega.current-menu-ancestor > .tbg-nav__trigger, .tbg-nav .tbg-nav__mega.current-menu-item > .tbg-nav__trigger { color: var(--c-green-700); background: var(--c-mint); box-shadow: inset 0 -3px 0 var(--c-green-700); }
