/**
 * Style modułu interaktywnej agendy.
 * Layout: dni (zakładki) u góry, sale 1/4 po lewej, panele 3/4 po prawej.
 * Styl: jasny, biznesowy, prosty i nowoczesny. Kolory motywu ICOS, Montserrat.
 */

.em-agenda {
	--em-accent: #e6007e;   /* magenta z logo */
	--em-blue: #00aeef;     /* niebieski z logo */
	--em-yellow: #ffcb05;   /* żółty z logo */
	--em-ink: #1a1a1a;
	--em-muted: #6b7280;
	--em-bg: #ffffff;
	--em-bg-soft: #f5f6f8;
	--em-border: #e5e7eb;

	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 30px 0;
	box-sizing: border-box;
	color: var(--em-ink);
	font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.em-agenda *,
.em-agenda *::before,
.em-agenda *::after {
	box-sizing: border-box;
}

/* ---------------------------------------------------------------- Toolbar */

.em-agenda__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 28px;
}

/* ------------------------------------------------------------------- Dni */

.em-agenda__days {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.em-agenda__day {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	padding: 10px 20px;
	background: #fff;
	border: 1px solid var(--em-border);
	border-radius: 6px;
	color: var(--em-muted);
	cursor: pointer;
	transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
	line-height: 1.2;
	font-family: inherit;
}

.em-agenda__day:hover {
	color: var(--em-ink);
	border-color: var(--em-ink);
}

.em-agenda__day.is-active {
	background: var(--em-ink);
	border-color: var(--em-ink);
	color: #fff;
}

.em-agenda__day-weekday {
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.2px;
}

.em-agenda__day-date {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	font-weight: 600;
	opacity: 0.85;
}

/* --------------------------------------------------------------- Szukaj */

.em-agenda__search {
	flex: 1 1 220px;
	max-width: 300px;
	margin-left: auto;
}

.em-agenda__search-input {
	width: 100%;
	padding: 11px 16px;
	background: #fff;
	border: 1px solid var(--em-border);
	border-radius: 6px;
	color: var(--em-ink);
	font-size: 14px;
	font-family: inherit;
	outline: none;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.em-agenda__search-input::placeholder {
	color: var(--em-muted);
}

.em-agenda__search-input:focus {
	border-color: var(--em-accent);
	box-shadow: 0 0 0 3px rgba(230, 0, 126, 0.12);
}

/* --------------------------------------------------------------- Layout */

.em-agenda__day-section {
	display: none;
	grid-template-columns: 1fr 3fr;
	gap: 28px;
	align-items: start;
}

.em-agenda__day-section.is-active {
	display: grid;
}

/* Nagłówek dnia — widoczny tylko w trybie wyszukiwania (wyniki z wielu dni) */
.em-agenda__day-heading {
	display: none;
	margin: 0 0 14px;
	font-size: 16px;
	font-weight: 700;
	color: var(--em-ink);
}

/* --- Tryb wyszukiwania: pokaż wszystkie dni z dopasowaniami, ukryj sale --- */
.em-agenda.is-searching .em-agenda__day-section {
	display: none;
}

.em-agenda.is-searching .em-agenda__day-section.has-matches {
	display: block;
	margin-bottom: 28px;
}

.em-agenda.is-searching .em-agenda__rooms {
	display: none;
}

.em-agenda.is-searching .em-agenda__day-heading {
	display: block;
}

/* ---------------------------------------------------------------- Sale */

.em-agenda__rooms {
	display: flex;
	flex-direction: column;
	gap: 8px;
	position: sticky;
	top: 20px;
}

.em-agenda__rooms-label {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	color: var(--em-muted);
	margin-bottom: 2px;
}

.em-agenda__room {
	width: 100%;
	text-align: left;
	padding: 12px 16px;
	background: #fff;
	border: 1px solid var(--em-border);
	border-radius: 6px;
	color: var(--em-ink);
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.em-agenda__room:hover {
	border-color: var(--em-ink);
}

.em-agenda__room.is-active {
	background: var(--em-accent);
	border-color: var(--em-accent);
	color: #fff;
}

/* -------------------------------------------------------------- Panele */

.em-agenda__panels {
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
}

.em-agenda__panel {
	position: relative;
	display: grid;
	grid-template-columns: 72px 1fr;
	gap: 18px;
	padding: 18px 22px;
	background: #fff;
	border: 1px solid var(--em-border);
	border-radius: 8px;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.em-agenda__panel.is-clickable {
	cursor: pointer;
}

.em-agenda__panel.is-clickable::after {
	content: '';
	position: absolute;
	top: 50%;
	right: 18px;
	width: 9px;
	height: 9px;
	border-right: 2px solid var(--em-muted);
	border-bottom: 2px solid var(--em-muted);
	transform: translateY(-50%) rotate(-45deg);
	transition: border-color 0.18s ease, right 0.18s ease;
}

.em-agenda__panel.is-clickable .em-agenda__panel-body {
	padding-right: 18px;
}

.em-agenda__panel.is-clickable:hover,
.em-agenda__panel.is-clickable:focus-visible {
	border-color: var(--em-accent);
	box-shadow: 0 6px 20px rgba(17, 24, 39, 0.08);
	outline: none;
}

.em-agenda__panel.is-clickable:hover::after,
.em-agenda__panel.is-clickable:focus-visible::after {
	border-color: var(--em-accent);
	right: 14px;
}

.em-agenda__panel.is-clickable:hover .em-agenda__panel-title {
	color: var(--em-accent);
}

.em-agenda__panel.is-break {
	grid-template-columns: 72px 1fr;
	background: var(--em-bg-soft);
}

.em-agenda__panel.is-hidden {
	display: none;
}

/* Czas */

.em-agenda__panel-time {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-variant-numeric: tabular-nums;
}

.em-agenda__time-start {
	font-size: 16px;
	font-weight: 700;
	color: var(--em-ink);
}

.em-agenda__time-end {
	font-size: 13px;
	color: var(--em-muted);
	font-weight: 500;
}

/* Treść */

.em-agenda__panel-body {
	min-width: 0;
}

.em-agenda__panel-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.em-agenda__track {
	display: inline-block;
	padding: 3px 11px;
	border-radius: 4px;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: #fff;
}

.em-agenda__panel-room {
	font-size: 11px;
	color: var(--em-ink);
	text-transform: uppercase;
	letter-spacing: 0.6px;
	font-weight: 700;
}

.em-agenda__room-label {
	color: var(--em-muted);
	font-weight: 600;
}

.em-agenda__panel-title {
	margin: 0 0 6px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--em-ink);
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.em-agenda__panel.is-break .em-agenda__panel-title {
	font-size: 14px;
	color: var(--em-muted);
	text-transform: uppercase;
	letter-spacing: 0.6px;
}

.em-agenda__panel-subtitle {
	margin: 0 0 10px;
	font-size: 14px;
	color: var(--em-muted);
	line-height: 1.55;
	font-weight: 500;
}

.em-agenda__panel-people {
	margin: 0 0 4px;
	font-size: 14px;
	color: var(--em-ink);
	line-height: 1.55;
}

.em-agenda__people-label {
	color: var(--em-muted);
	font-weight: 700;
	margin-right: 4px;
}

/* Prelegenci w karcie: zdjęcie + imię w jednej linii */

.em-agenda__panel-people-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 12px;
}

.em-agenda__panel-person {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.em-agenda__panel-person-name {
	font-size: 14px;
	font-weight: 600;
	color: var(--em-ink);
	line-height: 1.3;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.em-agenda__panel-person-role {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--em-muted);
	padding: 2px 8px;
	border: 1px solid var(--em-border);
	border-radius: 999px;
}

.em-agenda__avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--em-bg-soft);
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px var(--em-border);
	flex-shrink: 0;
	font-size: 13px;
	font-weight: 700;
	color: var(--em-muted);
	text-transform: uppercase;
}

.em-agenda__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.em-agenda__avatar--lg {
	width: 56px;
	height: 56px;
	font-size: 16px;
}

/* -------------------------------------------------------------- Modal */

.em-agenda__modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(17, 24, 39, 0.55);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	transition: opacity 0.25s ease;
	font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.em-agenda__modal-overlay.is-active {
	opacity: 1;
}

.em-agenda__modal {
	position: relative;
	background: #fff;
	border-radius: 10px;
	max-width: 720px;
	width: 100%;
	max-height: 88vh;
	overflow-y: auto;
	box-shadow: 0 20px 60px rgba(17, 24, 39, 0.25);
	transform: translateY(12px);
	transition: transform 0.25s ease;
	color: var(--em-ink, #1a1a1a);
}

.em-agenda__modal-overlay.is-active .em-agenda__modal {
	transform: translateY(0);
}

.em-agenda__modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 38px;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	border-radius: 50%;
	font-size: 30px;
	line-height: 1;
	color: #6b7280;
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease;
}

.em-agenda__modal-close:hover {
	background: #f3f4f6;
	color: #1a1a1a;
}

.em-agenda__modal-content {
	padding: 32px;
}

.em-agenda__modal-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
}

.em-agenda__modal-time {
	font-size: 14px;
	font-weight: 700;
	color: #e6007e;
	font-variant-numeric: tabular-nums;
}

.em-agenda__modal-title {
	margin: 0 0 8px;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.3;
	color: #1a1a1a;
}

.em-agenda__modal-subtitle {
	margin: 0 0 18px;
	font-size: 16px;
	color: #6b7280;
	font-weight: 500;
	line-height: 1.5;
}

.em-agenda__modal-desc {
	font-size: 15px;
	line-height: 1.7;
	color: #374151;
	margin-bottom: 20px;
}

.em-agenda__modal-desc p {
	margin: 0 0 12px;
}

.em-agenda__modal-people {
	margin-top: 20px;
	padding-top: 18px;
	border-top: 1px solid #e5e7eb;
}

.em-agenda__modal-people-title {
	margin: 0 0 12px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: #6b7280;
}

.em-agenda__person {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 18px;
}

.em-agenda__person:last-child {
	margin-bottom: 0;
}

.em-agenda__person-head {
	display: flex;
	align-items: center;
	gap: 14px;
}

.em-agenda__person-bio {
	font-size: 14px;
	line-height: 1.7;
	color: #374151;
}

.em-agenda__person-bio p {
	margin: 0 0 10px;
}

.em-agenda__person-bio p:last-child {
	margin-bottom: 0;
}

.em-agenda__person-info {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.em-agenda__person-name {
	font-size: 15px;
	font-weight: 700;
	color: #1a1a1a;
}

.em-agenda__person-aff {
	font-size: 13px;
	color: #6b7280;
}

/* Stany puste */

.em-agenda__no-results,
.em-agenda__search-empty,
.em-agenda__empty {
	padding: 24px;
	text-align: center;
	color: var(--em-muted);
	font-size: 15px;
	font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ----------------------------------------------------------- Responsywność */

@media (max-width: 900px) {
	.em-agenda__day-section.is-active {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.em-agenda__rooms {
		position: static;
		flex-direction: row;
		flex-wrap: wrap;
		gap: 8px;
	}

	.em-agenda__rooms-label {
		flex-basis: 100%;
		margin-bottom: 0;
	}

	.em-agenda__room {
		width: auto;
		flex: 1 1 auto;
		text-align: center;
	}
}

@media (max-width: 600px) {
	.em-agenda {
		padding: 20px 0;
	}

	.em-agenda__toolbar {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
		margin-bottom: 16px;
	}

	.em-agenda__search {
		max-width: none;
		margin-left: 0;
	}

	.em-agenda__panel,
	.em-agenda__panel.is-break {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.em-agenda__panel-time {
		flex-direction: row;
		align-items: baseline;
		gap: 8px;
	}
}
