/* =============================================================
   YesEarth Eco — Header "Apps" launcher
   Scoped under .ye-apps / .ye-apps-m; consumes the theme's tokens.
   The green button colours are component variables so they can be
   overridden; the theme's brand colour is teal, so these greens are
   defined locally.
   ============================================================= */

.ye-apps {
	--apps-btn-bg:     #EAF3DE;
	--apps-btn-border: #3B6D11;
	--apps-btn-text:   #27500A;
	position: relative;
	display: inline-flex;
}

/* ---- Button ---- */
.ye-apps__btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 6px 12px;
	border: 1px solid var(--apps-btn-border);
	border-radius: 8px;
	background: var(--apps-btn-bg);
	color: var(--apps-btn-text);
	font-family: var(--ye-font-body);
	font-weight: 500;
	font-size: .92rem;
	line-height: 1.1;
	cursor: pointer;
	transition: background .2s var(--ye-ease), box-shadow .2s var(--ye-ease), transform .2s var(--ye-ease);
}
.ye-apps__btn:hover {
	background: #e0eecd;
	color: var(--apps-btn-text);
	transform: none;
	box-shadow: var(--ye-shadow-sm);
}
.ye-apps__btn svg { display: block; }
.ye-apps__btn-ico { display: inline-flex; }
.ye-apps__btn-chev { display: inline-flex; transition: transform .25s var(--ye-ease); }
.ye-apps__btn[aria-expanded="true"] .ye-apps__btn-chev { transform: rotate(180deg); }
.ye-apps__btn:focus-visible { outline: 3px solid var(--ye-gold); outline-offset: 2px; }

/* ---- Panel ---- */
.ye-apps__panel {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	width: 290px;
	max-width: calc(100vw - 32px);
	background: #fff;
	border: 1px solid #e6e6e6;
	border-radius: 12px;
	box-shadow: 0 18px 44px rgba(20, 32, 29, 0.16);
	padding: 8px;
	z-index: 200;
	/* Hidden by default; shown via .is-open (JS) or :focus-within (no-JS). */
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	pointer-events: none;
	transition: opacity .2s var(--ye-ease), transform .2s var(--ye-ease), visibility .2s;
}
/* JS present: reveal only when toggled open. */
.ye-apps--js.is-open > .ye-apps__panel {
	opacity: 1;
	visibility: visible;
	transform: none;
	pointer-events: auto;
}
/* No-JS fallback: reveal while focus is inside the component. */
.ye-apps:not(.ye-apps--js):focus-within > .ye-apps__panel {
	opacity: 1;
	visibility: visible;
	transform: none;
	pointer-events: auto;
}

.ye-apps__caption {
	margin: 4px 8px 6px;
	font-size: .72rem;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: #8a8f8c;
}

.ye-apps__list { list-style: none; margin: 0; padding: 0; }

.ye-apps__row {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 10px;
	border-radius: 9px;
	color: var(--ye-ink);
	text-decoration: none;
	transition: background .18s var(--ye-ease);
}
.ye-apps__row:hover,
.ye-apps__row:focus-visible { background: #f3f4f2; color: var(--ye-ink); }
.ye-apps__row:focus-visible { outline: 3px solid var(--ye-gold); outline-offset: -1px; }

.ye-apps__tile {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	border-radius: 9px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--tile-bg, var(--ye-cream));
	color: var(--tile-fg, var(--ye-teal-deep));
}
.ye-apps__tile svg { display: block; }

.ye-apps__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ye-apps__name { font-size: 13px; font-weight: 500; line-height: 1.25; }
.ye-apps__desc { font-size: 12px; color: #6c736f; line-height: 1.3; }

.ye-apps__ext { margin-left: auto; color: #b2b7b3; flex: 0 0 auto; display: inline-flex; }
.ye-apps__row:hover .ye-apps__ext { color: var(--ye-teal-dark); }

.ye-apps__foot {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 6px 0 2px;
	padding: 10px 10px 4px;
	border-top: 1px solid #eee;
	font-size: 12px;
	color: #7b817d;
}
.ye-apps__foot svg { flex: 0 0 auto; color: #9aa09c; }

/* Hide the desktop launcher at the theme's mobile breakpoint. */
@media (max-width: 991px) {
	.ye-apps { display: none; }
}

/* =============================================================
   Mobile — Apps section inside the menu drawer
   ============================================================= */
.ye-apps-m { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--ye-line-soft); }
.ye-apps-m__head {
	font-family: var(--ye-font-head);
	font-size: 1rem;
	margin: 0 0 6px;
	color: var(--ye-ink);
}
.ye-apps-m__list { list-style: none; margin: 0; padding: 0; }
.ye-apps-m__list li { border-bottom: 1px solid var(--ye-line-soft); }
.ye-apps-m__list a {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 12px 4px;
	color: var(--ye-ink);
	text-decoration: none;
}
.ye-apps-m__list .ye-apps__text { flex: 1 1 auto; }
.ye-apps-m__list .ye-apps__name { font-weight: 600; font-size: .95rem; }
.ye-apps-m__list .ye-apps__ext,
.ye-apps-m__list .ye-apps__name + .ye-apps__desc { color: var(--ye-body); }
.ye-apps-m .ye-apps__foot { border-top: 0; color: var(--ye-muted); }

/* The drawer section should never show on desktop. */
@media (min-width: 992px) {
	.ye-apps-m { display: none; }
}
