/**
 * JNews Account Menu — Elementor Widget Styles
 *
 * Scoped CSS for the child theme's Account Menu widget.
 * All selectors are prefixed with .jnews-acw to avoid collisions.
 *
 * @package JNews Child
 */

/* =====================================================================
   Container
   ===================================================================== */
.jnews-acw {
	position: relative;
	display: flex;
	align-items: center;
}

/* =====================================================================
   Shared List Reset
   ===================================================================== */
.jnews-acw .jnews-acw__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 10px;
}

.jnews-acw .jnews-acw__list li {
	position: relative;
	list-style: none;
}

/* =====================================================================
   Logged-Out — Login / Register Links
   ===================================================================== */
.jnews-acw .jnews-acw__link {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	text-decoration: none;
	transition: color 0.25s ease;
	white-space: nowrap;
	font-size: 14px;
	line-height: 1.4;
}

.jnews-acw .jnews-acw__link i,
.jnews-acw .jnews-acw__link svg {
	transition: color 0.25s ease, fill 0.25s ease;
	font-size: inherit;
	width: 1em;
	height: 1em;
}

/* =====================================================================
   Logged-In — User Link
   ===================================================================== */
.jnews-acw .jnews-acw__user-item {
	position: relative;
}

.jnews-acw .jnews-acw__user-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	text-decoration: none;
	transition: color 0.25s ease;
	white-space: nowrap;
	font-size: 14px;
	line-height: 1.4;
	cursor: pointer;
}

/* Avatar */
.jnews-acw .jnews-acw__avatar {
	border-radius: 50%;
	vertical-align: middle;
	object-fit: cover;
}

/* =====================================================================
   Dropdown Menu
   ===================================================================== */
.jnews-acw .jnews-acw__dropdown {
	list-style: none;
	margin: 0;
	padding: 8px 0;
	position: absolute;
	top: 100%;
	right: 0;
	min-width: 180px;
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
	z-index: 999;
}

/* Show on hover — only on the front-end (not inside the Elementor editor) */
body:not(.elementor-editor-active) .jnews-acw .jnews-acw__user-item:hover > .jnews-acw__dropdown {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* Dropdown items */
.jnews-acw .jnews-acw__dropdown li {
	margin: 0;
	padding: 0;
	list-style: none;
	transition: background-color 0.2s ease;
}

.jnews-acw .jnews-acw__dropdown a {
	display: block;
	padding: 8px 18px;
	text-decoration: none;
	white-space: nowrap;
	font-size: 13px;
	line-height: 1.5;
	transition: color 0.2s ease, background-color 0.2s ease;
}

/* =====================================================================
   Dropdown Alignment — controlled via prefix_class on the Elementor
   widget wrapper.  Default is "right" (dropdown anchored to the right
   edge of the trigger).
   ===================================================================== */

/* Right-aligned (default) */
.jnews-acw-dropdown-align-right .jnews-acw__dropdown {
	left: auto;
	right: 0;
}

/* Left-aligned */
.jnews-acw-dropdown-align-left .jnews-acw__dropdown {
	left: 0;
	right: auto;
}

/* Center-aligned */
.jnews-acw-dropdown-align-center .jnews-acw__dropdown {
	left: 50%;
	right: auto;
	transform: translateX(-50%) translateY(8px);
}

body:not(.elementor-editor-active) .jnews-acw-dropdown-align-center .jnews-acw__user-item:hover > .jnews-acw__dropdown {
	transform: translateX(-50%) translateY(0);
}
