/**
 * DIGIHUB Marketplace — фронтенд стилове.
 *
 * БРАНД (одит 2026-07-11, docs/brand-audit.md): стойностите са мапнати към
 * UiCore променливите на активната тема edih-digihub-marketplace, с hex
 * fallback от живия сайт. Смяна на глобален цвят в темата се отразява
 * автоматично и тук.
 *
 * Дизайн език (редизайн 2026-07-11, сесия 2): бели карти с меки сенки върху
 * светлосиния фон на темата, монограм-аватари, пил-баджове, инлайн SVG икони,
 * стрелки в долен колонтитул на картите (по модел на модерните директории).
 */

:root {
	--dh-primary: var(--uicore-primary-color, #00C49A);        /* тюркоаз */
	--dh-primary-dark: #00a582;                                 /* hover на тюркоаза */
	--dh-secondary: var(--uicore-secondary-color, #532DF5);     /* виолет */
	--dh-accent: var(--uicore-accent-color, #D1345B);           /* малина */
	--dh-text: var(--uicore-headline-color, #223548);
	--dh-text-muted: #5a6b7c;
	--dh-bg: var(--uicore-white-color, #ffffff);
	--dh-bg-soft: var(--uicore-light-color, #F8FCFC);
	--dh-border: var(--ui-border-color, #d7e4eb);
	--dh-ok: #1a7f37;
	--dh-warn: #b45309;
	--dh-err: #b91c1c;
	--dh-radius: var(--ui-radius-sm, 9.5px);
	--dh-radius-lg: 16px;
	--dh-shadow: 0 6px 24px rgba(34, 53, 72, 0.07);
	--dh-shadow-hover: 0 10px 32px rgba(34, 53, 72, 0.12);
	--dh-font: var(--uicore-text-font-family, "Ubuntu Sans"), sans-serif;
	--dh-font-heading: var(--uicore-primary-font-family, "Ubuntu"), sans-serif;
	/* тинтове за аватари и баджове */
	--dh-tint-0-bg: rgba(0, 196, 154, 0.14);   --dh-tint-0-fg: #00795f;
	--dh-tint-1-bg: rgba(83, 45, 245, 0.12);   --dh-tint-1-fg: #4326c4;
	--dh-tint-2-bg: rgba(209, 52, 91, 0.12);   --dh-tint-2-fg: #ab2648;
	--dh-tint-3-bg: rgba(34, 83, 141, 0.12);   --dh-tint-3-fg: #22538d;
}

/* ---------- Общи ---------- */
.dh-icon { vertical-align: -0.15em; flex: 0 0 auto; }

/* ---------- Известия ---------- */
.dh-notice {
	padding: 12px 16px;
	border-radius: var(--dh-radius);
	margin: 0 0 20px;
	border: 1px solid var(--dh-border);
	font-family: var(--dh-font);
}
.dh-notice--ok   { background: #ecfdf5; border-color: #a7f3d0; color: var(--dh-ok); }
.dh-notice--err  { background: #fef2f2; border-color: #fecaca; color: var(--dh-err); }
.dh-notice--wait { background: #fffbeb; border-color: #fde68a; color: var(--dh-warn); }

/* ---------- Аватари (монограми) ---------- */
.dh-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	font-family: var(--dh-font-heading);
	font-weight: 700;
	font-size: 1rem;
	letter-spacing: 0.02em;
	flex: 0 0 auto;
	user-select: none;
}
.dh-avatar--sm { width: 26px; height: 26px; border-radius: 8px; font-size: 0.7rem; }
.dh-avatar--lg { width: 72px; height: 72px; border-radius: 18px; font-size: 1.6rem; }
.dh-avatar--h0 { background: var(--dh-tint-0-bg); color: var(--dh-tint-0-fg); }
.dh-avatar--h1 { background: var(--dh-tint-1-bg); color: var(--dh-tint-1-fg); }
.dh-avatar--h2 { background: var(--dh-tint-2-bg); color: var(--dh-tint-2-fg); }
.dh-avatar--h3 { background: var(--dh-tint-3-bg); color: var(--dh-tint-3-fg); }

/* ---------- Форми (бяла карта върху фона на темата) ---------- */
.dh-form {
	max-width: 680px;
	font-family: var(--dh-font);
	background: var(--dh-bg);
	border: 1px solid var(--dh-border);
	border-radius: var(--dh-radius-lg);
	padding: 28px;
	box-shadow: var(--dh-shadow);
	box-sizing: border-box;
}
.dh-form h2 { margin-top: 0; font-family: var(--dh-font-heading); }
.dh-field { margin: 0 0 18px; }
.dh-field label,
.dh-field__label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--dh-text);
}
.dh-field input[type="text"],
.dh-field input[type="email"],
.dh-field input[type="url"],
.dh-field input[type="password"],
.dh-field input[type="datetime-local"],
.dh-field select,
.dh-field textarea,
.dh-form input[type="text"],
.dh-form input[type="password"] {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--dh-border);
	border-radius: var(--dh-radius);
	background: var(--dh-bg);
	color: var(--dh-text);
	box-sizing: border-box;
}
.dh-field input:focus,
.dh-field select:focus,
.dh-field textarea:focus {
	outline: 2px solid var(--dh-primary);
	outline-offset: 1px;
	border-color: var(--dh-primary);
}
.dh-field--consent label { font-weight: 400; }
.dh-form input[type="checkbox"] { accent-color: var(--dh-primary-dark); }

/* Чекбокс групи като чипове */
.dh-checkgroup { display: flex; flex-wrap: wrap; gap: 8px; }
.dh-check {
	font-weight: 400 !important;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0 !important;
	padding: 7px 14px;
	border: 1px solid var(--dh-border);
	border-radius: 999px;
	background: var(--dh-bg);
	cursor: pointer;
	font-size: 0.92em;
	transition: border-color 0.12s ease, background 0.12s ease;
}
.dh-check:hover { border-color: var(--dh-primary); }
.dh-check:has(input:checked) {
	background: var(--dh-tint-0-bg);
	border-color: var(--dh-primary);
	color: var(--dh-tint-0-fg);
	font-weight: 600 !important;
}
.dh-check input { margin: 0; }

.dh-form__hint { color: var(--dh-text-muted); font-size: 0.9em; margin-bottom: 0; }
.dh-form__hint a { white-space: nowrap; }
.dh-hp { position: absolute !important; left: -9999px !important; height: 1px; overflow: hidden; }

/* ---------- Бутони ---------- */
.dh-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 10px 20px;
	border-radius: 999px;
	border: 1px solid var(--dh-primary);
	color: var(--dh-text);
	background: transparent;
	text-decoration: none;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}
.dh-btn:hover { background: var(--dh-bg-soft); }
/* Тъмен текст върху тюркоаза — бяло върху #00C49A не покрива WCAG AA. */
.dh-btn--primary { background: var(--dh-primary); border-color: var(--dh-primary); color: var(--dh-text); }
.dh-btn--primary:hover { background: var(--dh-primary-dark); border-color: var(--dh-primary-dark); color: var(--dh-text); }
.dh-btn--small { padding: 6px 14px; font-size: 0.9em; }

/* ---------- Баджове ---------- */
.dh-badges { margin: 0 0 4px; line-height: 1.9; }
.dh-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 11px;
	border-radius: 999px;
	background: var(--dh-bg-soft);
	border: 1px solid var(--dh-border);
	color: var(--dh-text-muted);
	font-size: 0.78em;
	font-weight: 600;
	margin: 0 4px 4px 0;
	white-space: nowrap;
}
.dh-badge--dh_org_type,
.dh-badge--dh_resource_type,
.dh-badge--type { background: var(--dh-tint-1-bg); border-color: transparent; color: var(--dh-tint-1-fg); }
.dh-badge--dh_sector { background: var(--dh-tint-0-bg); border-color: transparent; color: var(--dh-tint-0-fg); }
.dh-badge--dh_target_group { background: var(--dh-tint-3-bg); border-color: transparent; color: var(--dh-tint-3-fg); }
.dh-badge--more { background: transparent; }

/* ---------- Карти ---------- */
.dh-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
	margin: 20px 0;
}
.dh-card {
	position: relative;
	border: 1px solid var(--dh-border);
	border-radius: var(--dh-radius-lg);
	padding: 20px 20px 0;
	background: var(--dh-bg);
	display: flex;
	flex-direction: column;
	gap: 10px;
	box-shadow: var(--dh-shadow);
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.dh-grid .dh-card:hover { box-shadow: var(--dh-shadow-hover); transform: translateY(-2px); }
.dh-card__thumb img { width: 100%; height: auto; border-radius: calc(var(--dh-radius-lg) - 6px); display: block; }
.dh-card__logo img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; display: block; }
.dh-card__title { margin: 0; font-size: 1.08rem; line-height: 1.35; font-family: var(--dh-font-heading); }
.dh-card__title a { color: var(--dh-text); text-decoration: none; position: relative; z-index: 2; }
.dh-card__title a:hover { color: var(--dh-secondary); }
.dh-card__excerpt { color: var(--dh-text-muted); font-size: 0.92em; flex-grow: 1; }
.dh-card__meta {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: var(--dh-text-muted);
	font-size: 0.85em;
	margin-right: 12px;
}

/* Долен колонтитул на карта */
.dh-card__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	border-top: 1px solid var(--dh-border);
	margin: 4px -20px 0;
	padding: 12px 20px;
	min-height: 46px;
	box-sizing: border-box;
}
.dh-card__foot-label { font-size: 0.88em; font-weight: 600; color: var(--dh-text-muted); }
.dh-card__org {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.88em;
	color: var(--dh-secondary);
	text-decoration: none;
	font-weight: 600;
	position: relative;
	z-index: 2;
	min-width: 0;
}
.dh-card__org span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh-card__org:hover span:last-child { text-decoration: underline; }
.dh-card__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--dh-bg-soft);
	color: var(--dh-text);
	flex: 0 0 auto;
	transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
	position: relative;
	z-index: 2;
}
.dh-card:hover .dh-card__arrow { background: var(--dh-primary); transform: translateX(2px); }
/* Линк-покривало: цялата карта е кликаема, без да чупи вложените линкове */
.dh-card__cover { position: absolute; inset: 0; z-index: 1; border-radius: var(--dh-radius-lg); }

/* Карта на организация в „Общност“ */
.dh-card--org__head { display: flex; align-items: center; gap: 12px; }
.dh-card--org__head .dh-card__meta { margin: 2px 0 0; display: flex; }

/* Карта на събитие */
.dh-card--event__head { display: flex; align-items: flex-start; gap: 14px; }
.dh-card--event__head .dh-card__meta { display: flex; margin: 4px 0 0; }
.dh-date-tile {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 54px;
	padding: 8px 6px;
	border-radius: 12px;
	background: var(--dh-tint-1-bg);
	color: var(--dh-tint-1-fg);
	flex: 0 0 auto;
}
.dh-date-tile__day { font-family: var(--dh-font-heading); font-weight: 700; font-size: 1.35rem; line-height: 1.1; }
.dh-date-tile__month { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Профил на организация ---------- */
.dh-profile-head {
	display: flex;
	gap: 18px;
	align-items: flex-start;
	background: var(--dh-bg);
	border: 1px solid var(--dh-border);
	border-radius: var(--dh-radius-lg);
	box-shadow: var(--dh-shadow);
	padding: 24px;
	margin: 0 0 24px;
}
.dh-profile-head__main { min-width: 0; }
.dh-profile-head__main .dh-badges { margin-bottom: 10px; }
.dh-profile-head__contacts { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.dh-contact-link {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: var(--dh-text);
	text-decoration: none;
	font-size: 0.94em;
	font-weight: 500;
}
.dh-contact-link .dh-icon { color: var(--dh-text-muted); }
a.dh-contact-link:hover span { text-decoration: underline; color: var(--dh-secondary); }
.dh-profile-about { max-width: 760px; margin-bottom: 8px; }

.dh-profile-section { margin: 28px 0 0; }
.dh-section-title {
	display: flex;
	align-items: center;
	gap: 9px;
	font-family: var(--dh-font-heading);
	font-size: 1.15rem;
	margin: 0 0 14px;
}
.dh-section-title .dh-icon { color: var(--dh-primary-dark); }
.dh-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 7px;
	border-radius: 999px;
	background: var(--dh-bg-soft);
	border: 1px solid var(--dh-border);
	color: var(--dh-text-muted);
	font-size: 0.72em;
	font-weight: 700;
}

/* Мини-карти (списъци в профил) */
.dh-minigrid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 12px;
}
.dh-minicard {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	background: var(--dh-bg);
	border: 1px solid var(--dh-border);
	border-radius: var(--dh-radius-lg);
	box-shadow: var(--dh-shadow);
	text-decoration: none;
	color: var(--dh-text);
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.dh-minicard:hover { box-shadow: var(--dh-shadow-hover); transform: translateY(-1px); color: var(--dh-text); }
.dh-minicard__body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dh-minicard__body strong { font-family: var(--dh-font-heading); font-size: 0.98rem; line-height: 1.3; }
.dh-minicard__excerpt { color: var(--dh-text-muted); font-size: 0.85em; }
.dh-minicard__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--dh-bg-soft);
	flex: 0 0 auto;
	transition: background 0.15s ease, transform 0.15s ease;
}
.dh-minicard:hover .dh-minicard__arrow { background: var(--dh-primary); transform: translateX(2px); }

/* Линк-карти (материали, файлове) */
.dh-linkcards { display: flex; flex-wrap: wrap; gap: 10px; }
.dh-linkcard {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 11px 16px;
	background: var(--dh-bg);
	border: 1px solid var(--dh-border);
	border-radius: var(--dh-radius-lg);
	box-shadow: var(--dh-shadow);
	text-decoration: none;
	color: var(--dh-text);
	font-weight: 500;
	font-size: 0.94em;
	transition: box-shadow 0.15s ease, border-color 0.15s ease;
	max-width: 100%;
}
.dh-linkcard span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh-linkcard .dh-icon { color: var(--dh-primary-dark); }
a.dh-linkcard:hover { border-color: var(--dh-primary); box-shadow: var(--dh-shadow-hover); }

/* Карта „Публикувано от“ */
.dh-author-card {
	display: flex;
	align-items: center;
	gap: 14px;
	background: var(--dh-bg);
	border: 1px solid var(--dh-border);
	border-radius: var(--dh-radius-lg);
	box-shadow: var(--dh-shadow);
	padding: 16px 20px;
	margin-top: 28px;
}
.dh-author-card__main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.dh-author-card__label { color: var(--dh-text-muted); font-size: 0.8em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.dh-author-card__main strong { font-family: var(--dh-font-heading); }

/* Мета на събитие (single) */
.dh-event-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 22px;
	background: var(--dh-bg);
	border: 1px solid var(--dh-border);
	border-radius: var(--dh-radius-lg);
	box-shadow: var(--dh-shadow);
	padding: 16px 20px;
	margin: 0 0 24px;
}
.dh-event-meta__actions { display: inline-flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }

/* ---------- Филтри ---------- */
.dh-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	padding: 16px;
	background: var(--dh-bg);
	border: 1px solid var(--dh-border);
	border-radius: var(--dh-radius-lg);
	box-shadow: var(--dh-shadow);
	margin-bottom: 20px;
}
.dh-filters input[type="search"],
.dh-filters select {
	padding: 9px 12px;
	border: 1px solid var(--dh-border);
	border-radius: var(--dh-radius);
	min-width: 160px;
	background: var(--dh-bg);
	color: var(--dh-text);
}
/* Темата разпъва полетата на 100% — тук ги връщаме в реда на филтъра. */
.dh-filters input[type="search"] { flex: 1 1 200px; width: auto; }
.dh-filters select { flex: 0 1 auto; width: auto; max-width: 240px; }
.dh-filters .dh-btn { flex: 0 0 auto; }
.dh-filters__reset { color: var(--dh-text-muted); font-size: 0.9em; }

/* ---------- Табло ---------- */
.dh-dash-menu {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 14px;
	margin-top: 20px;
}
.dh-dash-menu__item {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 18px;
	border: 1px solid var(--dh-border);
	border-radius: var(--dh-radius-lg);
	text-decoration: none;
	color: var(--dh-text);
	background: var(--dh-bg);
	box-shadow: var(--dh-shadow);
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.dh-dash-menu__item:hover { border-color: var(--dh-primary); box-shadow: var(--dh-shadow-hover); transform: translateY(-2px); }
.dh-dash-menu__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 11px;
	background: var(--dh-tint-0-bg);
	color: var(--dh-tint-0-fg);
	margin-bottom: 6px;
}
.dh-dash-menu__item span:not(.dh-dash-menu__icon) { color: var(--dh-text-muted); font-size: 0.88em; }
.dh-dash-menu__item--logout .dh-dash-menu__icon { background: #fef2f2; color: var(--dh-err); }
.dh-dash-menu__item--logout strong { color: var(--dh-err); }

/* ---------- Таблица „Моите публикации“ ---------- */
.dh-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	background: var(--dh-bg);
	border: 1px solid var(--dh-border);
	border-radius: var(--dh-radius-lg);
	overflow: hidden;
	box-shadow: var(--dh-shadow);
}
.dh-table th { background: var(--dh-bg-soft); }
.dh-table th, .dh-table td {
	text-align: left;
	padding: 12px 16px;
	border-bottom: 1px solid var(--dh-border);
	vertical-align: top;
}
.dh-table tr:last-child td { border-bottom: 0; }
.dh-status {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 0.82em;
	font-weight: 600;
}
.dh-status--ok   { background: #ecfdf5; color: var(--dh-ok); }
.dh-status--wait { background: #fffbeb; color: var(--dh-warn); }
.dh-status--err  { background: #fef2f2; color: var(--dh-err); }
.dh-note { color: var(--dh-warn); }

/* ---------- Събития: табове ---------- */
.dh-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.dh-tab {
	padding: 8px 18px;
	border-radius: 999px;
	border: 1px solid var(--dh-border);
	text-decoration: none;
	color: var(--dh-text);
	font-weight: 600;
	background: var(--dh-bg);
}
.dh-tab.is-active { background: var(--dh-primary); border-color: var(--dh-primary); color: var(--dh-text); }

/* ---------- Видео ---------- */
.dh-video { position: relative; padding-bottom: 56.25%; height: 0; margin-bottom: 20px; }
.dh-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: var(--dh-radius-lg); }

/* ---------- Разни ---------- */
.dh-linklist { padding-left: 18px; }
.dh-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	color: var(--dh-text-muted);
	text-align: center;
	padding: 44px 24px;
	background: var(--dh-bg);
	border: 1px dashed var(--dh-border);
	border-radius: var(--dh-radius-lg);
}
.dh-empty__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--dh-bg-soft);
	color: var(--dh-text-muted);
	margin-bottom: 4px;
}
.dh-empty__title { color: var(--dh-text); font-family: var(--dh-font-heading); font-size: 1.05rem; }
.dh-empty__text { max-width: 420px; font-size: 0.94em; }
.dh-empty__cta { margin-top: 10px; display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.dh-pagination ul { display: flex; gap: 6px; list-style: none; padding: 0; flex-wrap: wrap; }
.dh-pagination a, .dh-pagination span {
	display: inline-block;
	padding: 6px 13px;
	border: 1px solid var(--dh-border);
	border-radius: 999px;
	text-decoration: none;
	color: var(--dh-text);
	background: var(--dh-bg);
}
.dh-pagination .current { background: var(--dh-primary); color: var(--dh-text); border-color: var(--dh-primary); }
.dh-home-section { margin: 40px 0; }
.dh-home-section h2, .dh-dashboard h2 { font-family: var(--dh-font-heading); }

/* ---------- Мобилни ---------- */
@media (max-width: 600px) {
	.dh-filters { flex-direction: column; align-items: stretch; }
	.dh-filters select { max-width: none; }
	.dh-form { padding: 20px; }
	.dh-profile-head { flex-direction: column; padding: 20px; }
	.dh-event-meta__actions { margin-left: 0; }
	.dh-table thead { display: none; }
	.dh-table td { display: block; border-bottom: 0; }
	.dh-table tr { border-bottom: 1px solid var(--dh-border); display: block; padding: 8px 0; }
	.dh-table tr:last-child { border-bottom: 0; }
}
