/**
 * Public CSS Styles for Diversa News Layouts
 * Handcrafted to be clean, modern, fully responsive and easy to customize.
 */

/* General container styling */
.diversa-news {
	display: block;
	width: 100%;
	box-sizing: border-box;
}

.diversa-news * {
	box-sizing: border-box;
}

.diversa-news-empty {
	color: #6b7280;
	font-style: italic;
	padding: 15px 0;
	text-align: center;
}

/* Item base styles */
.diversa-item {
	display: flex;
	background: transparent;
	margin-bottom: 20px;
	padding-bottom: 20px;
	border-bottom: 1px solid #f3f4f6;
	transition: all 0.3s ease;
}

.diversa-item:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

/* Meta info */
.diversa-meta {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 8px;
	font-size: 13px;
	color: #6b7280;
}

.diversa-source-logo {
	font-size: 14px;
	line-height: 1;
}

.diversa-source {
	font-weight: 600;
	color: #374151;
}

.diversa-separator {
	color: #d1d5db;
}

.diversa-date {
	font-size: 12px;
}

/* Title link */
.diversa-title {
	font-size: 18px;
	font-weight: 700;
	line-height: 1.4;
	margin: 0 0 8px 0;
}

.diversa-title a {
	color: #1f2937;
	text-decoration: none;
	transition: color 0.2s ease;
}

.diversa-title a:hover {
	color: #4f46e5;
}

/* Excerpt */
.diversa-excerpt {
	font-size: 14px;
	line-height: 1.6;
	color: #4b5563;
	margin: 0;
}

/* Image wrapper */
.diversa-image-wrap {
	flex-shrink: 0;
	overflow: hidden;
	border-radius: 8px;
	background-color: #f3f4f6;
	display: flex;
	align-items: center;
	justify-content: center;
}

.diversa-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.diversa-item:hover .diversa-image {
	transform: scale(1.05);
}


/* ==========================================
   LAYOUT: LIST (Default)
   ========================================== */
.diversa-layout-list .diversa-item {
	gap: 20px;
}

.diversa-layout-list .diversa-image-wrap {
	width: 180px;
	height: 120px;
}

@media (max-width: 600px) {
	.diversa-layout-list .diversa-item {
		flex-direction: column;
		gap: 12px;
	}
	.diversa-layout-list .diversa-image-wrap {
		width: 100%;
		height: 200px;
	}
}


/* ==========================================
   LAYOUT: CARDS
   ========================================== */
.diversa-layout-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 24px;
}

.diversa-layout-cards .diversa-item {
	flex-direction: column;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 0;
	margin-bottom: 0;
	overflow: hidden;
	background-color: #ffffff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.diversa-layout-cards .diversa-item:hover {
	transform: translateY(-4px);
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	border-color: #d1d5db;
}

.diversa-layout-cards .diversa-image-wrap {
	width: 100%;
	height: 180px;
	border-radius: 0;
}

.diversa-layout-cards .diversa-content-wrap {
	padding: 20px;
}

.diversa-layout-cards .diversa-title {
	font-size: 16px;
}


/* ==========================================
   LAYOUT: COMPACT
   ========================================== */
.diversa-layout-compact .diversa-item {
	padding-bottom: 12px;
	margin-bottom: 12px;
	border-bottom: 1px dashed #e5e7eb;
}

.diversa-layout-compact .diversa-title {
	font-size: 15px;
	font-weight: 600;
	margin-bottom: 0;
}

.diversa-layout-compact .diversa-meta {
	font-size: 12px;
	margin-bottom: 4px;
}


/* ==========================================
   LAYOUT: SIDEBAR
   ========================================== */
.diversa-layout-sidebar .diversa-item {
	flex-direction: column;
	padding-bottom: 16px;
	margin-bottom: 16px;
}

.diversa-layout-sidebar .diversa-title {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
	margin-bottom: 0;
}

.diversa-layout-sidebar .diversa-meta {
	font-size: 11px;
	margin-bottom: 6px;
}

/* ==========================================================================
   WIDGET: DIVERSA RESPONSIVE MENU
   ========================================================================== */

.diversa-menu-container {
	display: block;
	width: 100%;
	position: relative;
}

/* --- Desktop Menu --- */
.diversa-menu-desktop-wrap {
	display: block;
}

.diversa-menu-desktop {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	list-style: none;
	margin: 0;
	padding: 0;
	align-items: center;
}

.diversa-menu-desktop .menu-item {
	position: relative;
}

.diversa-menu-desktop .menu-link-wrapper {
	display: flex;
	align-items: center;
	gap: 6px;
}

.diversa-menu-desktop .menu-link {
	text-decoration: none;
	font-weight: 600;
	padding: 10px 0;
	display: block;
	transition: color 0.2s ease;
	border-bottom: 3px solid transparent;
}

.diversa-menu-desktop .desktop-submenu-indicator {
	display: inline-flex;
	align-items: center;
	color: inherit;
	opacity: 0.6;
}

/* Desktop Submenu (Dropdown) */
.diversa-menu-desktop .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	background: #ffffff;
	min-width: 210px;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	border: 1px solid #f3f4f6;
	display: none;
	list-style: none;
	padding: 10px 0;
	margin: 0;
	z-index: 9999;
	border-radius: 8px;
}

.diversa-menu-desktop .sub-menu .menu-item {
	width: 100%;
}

.diversa-menu-desktop .sub-menu .menu-link-wrapper {
	padding: 0;
}

.diversa-menu-desktop .sub-menu .menu-link {
	padding: 10px 20px;
	width: 100%;
	font-weight: 500;
	font-size: 14px;
	border-bottom: none;
}

.diversa-menu-desktop .sub-menu .menu-link:hover {
	background-color: #f9fafb;
}

/* Show Submenu on Hover */
.diversa-menu-desktop .menu-item-has-children:hover > .sub-menu {
	display: block;
	animation: diverseFadeIn 0.2s ease;
}

@keyframes diverseFadeIn {
	from { opacity: 0; transform: translateY(4px); }
	to { opacity: 1; transform: translateY(0); }
}

/* --- Mobile Menu Trigger (Hamburger) --- */
.diversa-menu-toggle {
	display: none;
	border: none;
	background: transparent;
	cursor: pointer;
	padding: 8px;
	border-radius: 4px;
	flex-direction: column;
	gap: 5px;
	width: 40px;
	height: 40px;
	align-items: center;
	justify-content: center;
}

.diversa-menu-toggle span {
	display: block;
	width: 22px;
	height: 2px;
	background-color: #1f2937;
	border-radius: 2px;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

/* --- Mobile Off-Canvas Drawer (Gaveta) --- */
.diversa-menu-drawer-wrapper {
	position: fixed;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	height: 100vh;
	width: 100vw;
	z-index: 99999;
	visibility: hidden;
	transition: visibility 0.35s;
}

.diversa-menu-drawer-wrapper.open {
	visibility: visible;
}

.diversa-menu-drawer-overlay {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	background-color: rgba(0, 0, 0, 0.4);
	opacity: 0;
	transition: opacity 0.35s ease;
}

.diversa-menu-drawer-wrapper.open .diversa-menu-drawer-overlay {
	opacity: 1;
}

.diversa-menu-drawer {
	position: absolute;
	top: 0;
	bottom: 0;
	height: 100vh;
	width: 320px;
	max-width: 85%;
	background-color: #ffffff;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
	display: flex;
	flex-direction: column;
	transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
	z-index: 2;
}

/* Side Specific Positions */
.drawer-side-left .diversa-menu-drawer {
	left: 0;
	transform: translateX(-100%);
}

.drawer-side-right .diversa-menu-drawer {
	right: 0;
	transform: translateX(100%);
}

.diversa-menu-drawer-wrapper.open .diversa-menu-drawer {
	transform: translateX(0) !important;
}

/* Header inside Drawer */
.diversa-menu-drawer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid #f3f4f6;
}

.diversa-menu-drawer-title {
	font-weight: 700;
	font-size: 20px;
	color: #111827;
}

.diversa-menu-drawer-close {
	border: none;
	background: transparent;
	font-size: 32px;
	font-weight: 300;
	cursor: pointer;
	color: #9ca3af;
	line-height: 1;
	padding: 0;
	transition: color 0.2s;
}

.diversa-menu-drawer-close:hover {
	color: #111827;
}

/* Body and links inside Drawer */
.diversa-menu-drawer-body {
	flex: 1;
	overflow-y: auto;
	padding: 16px 0;
}

.diversa-menu-mobile {
	list-style: none;
	margin: 0;
	padding: 0;
}

.diversa-menu-mobile .menu-item {
	display: block;
	width: 100%;
}

.diversa-menu-mobile .menu-link-wrapper {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 24px;
	border-bottom: 1px solid #f3f4f6;
}

.diversa-menu-mobile .menu-link {
	text-decoration: none;
	font-size: 16px;
	font-weight: 500;
	color: #374151;
	flex: 1;
	transition: color 0.2s;
	display: block;
}

.diversa-menu-mobile .submenu-toggle-trigger {
	border: none;
	background: transparent;
	cursor: pointer;
	padding: 4px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #e53935; /* default red chevron color */
	transition: transform 0.25s ease;
	outline: none;
}

.diversa-menu-mobile .submenu-toggle-trigger .chevron-svg {
	transition: transform 0.25s ease;
}

/* Rotation of chevron when submenu is open */
.diversa-menu-mobile .menu-item.open > .menu-link-wrapper .chevron-svg {
	transform: rotate(90deg);
}

/* Mobile sub-menu drawer styles */
.diversa-menu-mobile .sub-menu {
	list-style: none;
	padding: 0 0 0 16px;
	margin: 0;
	background-color: #f9fafb;
	display: none;
	border-left: 2px solid #e5e7eb;
}

.diversa-menu-mobile .sub-menu .menu-link-wrapper {
	padding: 10px 24px;
	border-bottom: 1px solid #f3f4f6;
}

.diversa-menu-mobile .sub-menu .menu-link {
	font-size: 14px;
	font-weight: 400;
	color: #4b5563;
}

/* Prevent scroll on body */
body.diversa-menu-active {
	overflow: hidden !important;
}

/* --- Responsive Media Queries --- */
@media (max-width: 767px) {
	.diversa-menu-desktop-wrap {
		display: none;
	}
	
	.diversa-menu-toggle {
		display: flex;
	}
}
