/*
 * SiteCare Telefonní seznam – frontend styles
 * Designed to match compag.cz (Impreza theme, Brantner/COMPAG brand)
 * Brand green: #008752 | Gray bg: #e8e8e8 | Font: BrandonText-Bold / Calibri
 */

/* =====================================================================
   Wrapper + theme reset
   ===================================================================== */
.ts-directory {
	max-width: 100%;
	font-family: Calibri, 'BrandonText-Regular', Arial, sans-serif;
	color: #333;
	line-height: 1.5;
}

/* neutralize Impreza/theme margins on headings and tables */
.ts-directory h2,
.ts-directory h3 {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	border: none !important;
	font-size: inherit !important;
	line-height: inherit !important;
}

.ts-directory table {
	margin-bottom: 0 !important;
}

.ts-directory p {
	margin: 0 !important;
}

/* =====================================================================
   Jump navigation (multi-branch)
   ===================================================================== */
.ts-dir-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 32px;
}

.ts-dir-nav-link {
	display: inline-block;
	padding: 8px 20px;
	background: #008752;
	color: #fff;
	font-family: 'BrandonText-Bold', Calibri, Arial, sans-serif;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	text-decoration: none;
	border: 2px solid #008752;
	transition: background 0.18s, color 0.18s;
}

.ts-dir-nav-link:hover {
	background: #fff;
	color: #008752;
}

/* =====================================================================
   Branch section
   ===================================================================== */
.ts-branch {
	margin-bottom: 52px;
	scroll-margin-top: 100px;
}

.ts-branch-title {
	font-family: 'BrandonText-Bold', Calibri, Arial, sans-serif;
	font-size: 22px !important;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #008752;
	margin: 0 0 16px !important;
	padding-bottom: 10px !important;
	border-bottom: 3px solid #008752 !important;
}

/* =====================================================================
   Department group
   ===================================================================== */
.ts-dept {
	margin-bottom: 28px;
}

.ts-dept-title {
	font-family: 'BrandonText-Bold', Calibri, Arial, sans-serif;
	font-size: 13px !important;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #fff;
	background: #008752;
	margin: 0 !important;
	padding: 6px 12px !important;
}

/* =====================================================================
   Contact table
   ===================================================================== */
.ts-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	margin-bottom: 4px;
	table-layout: fixed; /* all tables share the same column proportions */
}

/* fixed column widths — consistent across every table on the page */
.ts-table thead th:nth-child(1),
.ts-table tbody td:nth-child(1) { width: 22%; }

.ts-table thead th:nth-child(2),
.ts-table tbody td:nth-child(2) { width: 36%; }

.ts-table thead th:nth-child(3),
.ts-table tbody td:nth-child(3) { width: 20%; }

.ts-table thead th:nth-child(4),
.ts-table tbody td:nth-child(4) { width: 22%; }

.ts-table thead th {
	text-align: left;
	padding: 7px 12px;
	font-family: 'BrandonText-Bold', Calibri, Arial, sans-serif;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #555;
	background: #e8e8e8;
	border-bottom: 2px solid #c8c8c8;
	overflow: hidden;
}

.ts-table tbody td {
	padding: 9px 12px;
	vertical-align: top;
	border-bottom: 1px solid #e8e8e8;
	color: #333;
	overflow: hidden;
	word-break: break-word;
}

.ts-table tbody tr:last-child td {
	border-bottom: none;
}

.ts-table tbody tr:hover td {
	background: #f5faf7;
}

/* name column bold */
.ts-table tbody td:first-child {
	font-weight: 600;
}

/* phone and email links */
.ts-table a {
	color: #008752;
	text-decoration: none;
}

.ts-table a:hover {
	text-decoration: underline;
	color: #006640;
}

/* =====================================================================
   Responsive
   ===================================================================== */

/* Tablet (≤ 768 px) — drop phone + email to their own line via narrower cols */
@media (max-width: 768px) {
	.ts-table {
		table-layout: auto; /* let browser wrap instead of overflow */
	}

	.ts-table thead th:nth-child(1),
	.ts-table tbody td:nth-child(1) { width: auto; }
	.ts-table thead th:nth-child(2),
	.ts-table tbody td:nth-child(2) { width: auto; }
	.ts-table thead th:nth-child(3),
	.ts-table tbody td:nth-child(3) { width: auto; white-space: nowrap; }
	.ts-table thead th:nth-child(4),
	.ts-table tbody td:nth-child(4) { width: auto; }

	.ts-table thead th {
		font-size: 10px;
		padding: 6px 8px;
	}

	.ts-table tbody td {
		padding: 7px 8px;
		font-size: 13px;
	}
}

/* Mobile (≤ 580 px) — card layout, no thead */
@media (max-width: 580px) {
	.ts-dir-nav {
		flex-direction: column;
	}

	.ts-dir-nav-link {
		text-align: center;
	}

	.ts-branch-title {
		font-size: 17px;
	}

	.ts-dept-title {
		font-size: 12px;
	}

	.ts-table {
		table-layout: auto;
	}

	.ts-table thead {
		display: none;
	}

	.ts-table tbody tr {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 2px 12px;
		margin-bottom: 10px;
		padding: 10px 12px;
		border: 1px solid #e8e8e8;
		border-left: 3px solid #008752;
	}

	.ts-table tbody tr:hover td {
		background: none;
	}

	.ts-table tbody td {
		display: block;
		padding: 1px 0;
		border-bottom: none;
		font-size: 13px;
		overflow: hidden;
		text-overflow: ellipsis;
		word-break: break-word;
	}

	/* name spans full width, bold */
	.ts-table tbody td:nth-child(1) {
		grid-column: 1 / -1;
		font-size: 14px;
		font-weight: 700;
		margin-bottom: 4px;
	}

	/* position spans full width */
	.ts-table tbody td:nth-child(2) {
		grid-column: 1 / -1;
		color: #555;
		margin-bottom: 4px;
	}

	/* phone — left cell */
	.ts-table tbody td:nth-child(3) {
		grid-column: 1;
	}

	/* email — right cell */
	.ts-table tbody td:nth-child(4) {
		grid-column: 2;
	}

	/* hide completely empty cells so grid doesn't leave holes */
	.ts-table tbody td:empty {
		display: none;
	}
}
