/* Edgekink app-chrome — mobile top bar (hamburger drawer + search pane) + bottom nav.
 *
 * Dark-glass aesthetic: near-black blurred panes, a single hot accent, generous
 * touch targets, spring-eased slide transitions. Mobile-first; injected top-bar
 * buttons are hidden >=783px where the parent's own header nav takes over. */

:root {
	--ek-accent: #ff2b5e;
	--ek-glass: rgba(16, 16, 20, 0.86);
	--ek-ink: #f4f4f6;
}

/* ---- Injected top-bar buttons ------------------------------------------- */

.ek-appbtn {
	-webkit-appearance: none;
	appearance: none;
	display: none; /* shown on mobile only (media query below) */
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: transform 0.12s ease, opacity 0.12s ease;
}
.ek-appbtn svg { width: 32px; height: 32px; display: block; }

/* "EK" wordmark replacing the site title in the top bar (set by app-chrome.js).
   Edgy mark: a deep-crimson -> hot-red gradient clipped into the letters, a slight
   forward italic skew, tight tracking, and a soft red glow so it pops off the dark
   bar. !important + the bumped size beat the parent's `.logo .logo-text` rule. */
.ek-logo {
	display: inline-block;
	font-weight: 900;
	font-size: 27px !important;
	letter-spacing: -0.5px;
	line-height: 1;
	font-style: italic;
	text-decoration: none;
	color: #b00029 !important; /* fallback where background-clip:text isn't supported */
	background: linear-gradient(135deg, #ff3a63 0%, #b00029 78%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	transform: skewX(-7deg);
	filter: drop-shadow(0 1px 7px rgba(255, 43, 94, 0.45));
}
.ek-appbtn:active { transform: scale(0.88); opacity: 0.8; }

@media (max-width: 782px) {
	.ek-appbtn { display: inline-flex; }
	/* Retire the parent's grid switcher + its own hamburger; ours replace them. */
	header.ek-appified .display-switcher,
	header.ek-appified #menu-mobile-icon { display: none !important; }
	/* Brand hugs the hamburger on the left; search is pushed to the far right. */
	header.ek-appified .logo { margin-right: auto !important; padding-left: 4px; min-width: 0; }
	header.ek-appified .logo .logo-text {
		font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
	}
	header.ek-appified { gap: 4px; }
}
@media (min-width: 783px) {
	.ek-appbtn { display: none !important; }
}

/* ---- Backdrop + slide-in panes ------------------------------------------ */

.ek-backdrop {
	position: fixed;
	inset: 0;
	z-index: 1000;
	background: rgba(0, 0, 0, 0.5);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.28s ease, visibility 0.28s ease;
}
.ek-backdrop.is-open { opacity: 1; visibility: visible; }

body.ek-pane-open { overflow: hidden; }

.ek-pane {
	position: fixed;
	top: 0;
	bottom: 0;
	z-index: 1001;
	display: flex;
	flex-direction: column;
	background: var(--ek-glass);
	-webkit-backdrop-filter: blur(20px) saturate(1.3);
	backdrop-filter: blur(20px) saturate(1.3);
	color: var(--ek-ink);
	will-change: transform;
	transition: transform 0.34s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Left drawer (policy links) */
.ek-drawer {
	left: 0;
	width: 82%;
	max-width: 330px;
	transform: translateX(-104%);
	border-right: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: 24px 0 70px rgba(0, 0, 0, 0.55);
	padding-top: env(safe-area-inset-top);
}
.ek-drawer.is-open { transform: translateX(0); }

.ek-drawer-head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 18px 16px 12px;
}
.ek-drawer-brand {
	font-size: 22px; font-weight: 800; letter-spacing: 0.3px; color: var(--ek-accent);
}
.ek-drawer-links { display: flex; flex-direction: column; padding: 6px 8px 0; }
.ek-drawer-link {
	padding: 14px 14px; border-radius: 12px;
	color: #e7e7ea; text-decoration: none; font-size: 16px; font-weight: 600;
}
.ek-drawer-link:hover, .ek-drawer-link:active { background: rgba(255, 255, 255, 0.07); color: #fff; }
.ek-drawer-foot {
	margin-top: auto;
	padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
	color: rgba(255, 255, 255, 0.35); font-size: 12px;
}

/* Right search pane (full width on mobile) */
.ek-search {
	right: 0; left: 0;
	transform: translateX(102%);
	background: rgba(11, 11, 13, 0.96);
}
.ek-search.is-open { transform: translateX(0); }

.ek-search-head {
	display: flex; align-items: center; gap: 10px;
	padding: 14px 14px;
	padding-top: calc(14px + env(safe-area-inset-top));
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.ek-search-form { position: relative; flex: 1; display: flex; align-items: center; }
.ek-search-ic {
	position: absolute; left: 14px; display: flex; align-items: center;
	color: rgba(255, 255, 255, 0.5); pointer-events: none;
}
.ek-search-ic svg { width: 20px; height: 20px; }
.ek-search-input {
	width: 100%; height: 46px; padding: 0 16px 0 44px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	background: rgba(255, 255, 255, 0.06);
	color: #fff; font-size: 16px; outline: none;
	transition: border-color 0.15s ease, background 0.15s ease;
}
.ek-search-input::placeholder { color: rgba(255, 255, 255, 0.45); }
.ek-search-input:focus { border-color: var(--ek-accent); background: rgba(255, 255, 255, 0.09); }

.ek-trending { padding: 22px 18px; }
.ek-trending-title {
	font-size: 12px; text-transform: uppercase; letter-spacing: 1.4px;
	color: rgba(255, 255, 255, 0.5); margin: 0 0 14px;
}
.ek-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.ek-chip {
	padding: 9px 14px; border-radius: 999px;
	background: rgba(255, 255, 255, 0.07);
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: #fff; font-size: 14px; font-weight: 600; text-decoration: none;
	transition: background 0.15s ease, transform 0.1s ease;
}
.ek-chip:hover { background: rgba(255, 255, 255, 0.13); }
.ek-chip:active { transform: scale(0.95); }
.ek-chip-ph { opacity: 0.5; }

/* Shared round icon button (drawer close / search back) */
.ek-iconbtn {
	flex: 0 0 auto;
	display: flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
	background: rgba(255, 255, 255, 0.06); color: #fff; cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: transform 0.12s ease, background 0.15s ease;
}
.ek-iconbtn svg { width: 22px; height: 22px; }
.ek-iconbtn:hover { background: rgba(255, 255, 255, 0.12); }
.ek-iconbtn:active { transform: scale(0.9); }

/* ---- Bottom nav (Home · Explore · Categories) --------------------------- */

.ek-footer { display: flex !important; align-items: center; justify-content: space-around; }
/* Retire the parent's own footer items; ours replace them in the same bar. */
.ek-footer > :not(.ek-navitem) { display: none !important; }

.ek-navitem {
	flex: 1 1 0;
	display: flex; flex-direction: column; align-items: center; gap: 4px;
	padding: 8px 0 7px; margin: 0; border: 0; background: transparent;
	color: rgba(255, 255, 255, 0.66); text-decoration: none; cursor: pointer;
	font: inherit; -webkit-tap-highlight-color: transparent;
	transition: transform 0.1s ease, color 0.15s ease;
}
.ek-navitem svg { width: 26px; height: 26px; display: block; }
.ek-navlabel { font-size: 11px; font-weight: 600; letter-spacing: 0.2px; }
.ek-navitem.is-active { color: var(--ek-accent); }
.ek-navitem:active { transform: scale(0.93); }

/* ---- Bottom sheet (Categories) ------------------------------------------ */

.ek-sheet {
	top: auto;
	bottom: 0;
	left: 0; right: 0;
	height: auto;
	max-height: 72vh;
	transform: translateY(102%);
	border-top-left-radius: 20px;
	border-top-right-radius: 20px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: 0 -22px 70px rgba(0, 0, 0, 0.55);
	padding-bottom: calc(18px + env(safe-area-inset-bottom));
}
.ek-sheet.is-open { transform: translateY(0); }
.ek-sheet::before {
	content: '';
	position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
	width: 40px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.25);
}
.ek-sheet-head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 18px 18px 10px;
}
.ek-sheet-title { font-size: 19px; font-weight: 800; color: #fff; }
.ek-cats-grid {
	display: flex; flex-wrap: wrap; gap: 10px;
	padding: 6px 18px 4px;
	overflow-y: auto;
}
.ek-cat {
	padding: 10px 16px; border-radius: 999px;
	background: rgba(255, 255, 255, 0.07);
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: #fff; font-size: 15px; font-weight: 600; text-decoration: none;
	transition: background 0.15s ease, transform 0.1s ease;
}
.ek-cat:hover { background: rgba(255, 255, 255, 0.13); }
.ek-cat:active { transform: scale(0.96); }

/* Logged-in only: drop the top panes below the WP admin bar so their headers
 * aren't clipped (real visitors have no admin bar, so top:0 is correct for them). */
@media screen and (max-width: 782px) {
	body.admin-bar .ek-drawer,
	body.admin-bar .ek-search { top: 46px; }
}

@media (prefers-reduced-motion: reduce) {
	.ek-pane, .ek-backdrop { transition-duration: 0.01ms; }
}
