/*
 * Baby-name browsing: filter dropdowns, results table and pagination.
 *
 * These rules were previously emitted inline by the shortcodes on every
 * render, and included unscoped `body`, `table`, `th`, `td` and `.pagination`
 * selectors that restyled anything else on the page. Everything is namespaced
 * under .tmc-* now.
 */

.tmc-dropdown,
.tmc-filter-bar {
	--tmc-primary: #af0379;
	--tmc-accent: #ed7117;
	--tmc-surface: #fffffc;
	font-family: 'Segoe UI', sans-serif;
}

/* ---- Single dropdown ([religion_dropdown] etc.) ---- */

.tmc-dropdown {
	margin: 20px 0;
	padding: 20px;
	border: 2px solid var(--tmc-primary);
	border-radius: 10px;
	max-width: 550px;
}

.tmc-dropdown label {
	display: block;
	font-weight: bold;
	color: var(--tmc-primary);
	font-size: 18px;
	margin-bottom: 10px;
}

/* ---- Filter bar ([baby_name_filters]) ---- */

.tmc-filter-bar {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 20px;
	margin: 30px 0;
}

.tmc-filter-group {
	flex: 1 1 18%;
	min-width: 150px;
	max-width: 200px;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.tmc-filter-group label {
	font-weight: bold;
	color: var(--tmc-primary);
	margin-bottom: 6px;
	font-size: 18px;
	text-align: center;
}

/* ---- Shared select styling ---- */

.tmc-dropdown select,
.tmc-filter-select {
	width: 100%;
	box-sizing: border-box;
	background-color: var(--tmc-surface);
	color: var(--tmc-primary);
	border: 2px solid var(--tmc-primary);
	border-radius: 6px;
	padding: 8px;
	font-size: 14px;
	transition: border-color 0.3s ease, color 0.3s ease;
}

.tmc-dropdown select:hover,
.tmc-dropdown select:focus,
.tmc-filter-select:hover,
.tmc-filter-select:focus {
	border-color: var(--tmc-accent);
	color: var(--tmc-accent);
	outline: none;
}

@media screen and (max-width: 768px) {
	.tmc-filter-group {
		flex: 1 1 45%;
		max-width: none;
	}
}

@media screen and (max-width: 480px) {
	.tmc-filter-group {
		flex: 1 1 100%;
	}
}

/* ---- Results table ([baby_names_table]) ---- */

.tmc-names {
	--tmc-primary: #af0379;
	--tmc-accent: #ed7117;
	--tmc-surface: #fffffc;
	font-family: 'Segoe UI', sans-serif;
	color: var(--tmc-primary);
}

.tmc-names__heading {
	color: var(--tmc-primary);
	text-align: center;
}

/* Narrow screens scroll the table itself rather than the whole page. */
.tmc-names__scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.tmc-names__table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 20px;
}

.tmc-names__table th,
.tmc-names__table td {
	border: 2px solid var(--tmc-primary);
	padding: 12px;
	text-align: center;
	font-size: 16px;
}

.tmc-names__table th {
	background-color: var(--tmc-primary);
	color: var(--tmc-surface);
}

.tmc-names__table tbody tr:nth-child(even) {
	background-color: #fdf4f9;
}

.tmc-names__table tbody tr:hover {
	background-color: #ffe3f1;
}

.tmc-names__name a {
	font-size: 1.1em;
	font-weight: bold;
	text-decoration: underline;
	color: #d4007f;
}

.tmc-names__name a:hover {
	background-color: #fff0f7;
	text-decoration: none;
}

.tmc-names__name-wrap {
	display: inline-block;
	position: relative;
	font-size: 16px;
}

.tmc-names__star-group {
	display: inline-flex;
	align-items: flex-start;
	gap: 4px;
	font-size: 75%;
	vertical-align: top;
	margin-left: 5px;
}

/* A real <button> so the star is keyboard reachable and announced. */
.tmc-names__star {
	background: none;
	border: none;
	padding: 0;
	line-height: 1;
	font-size: inherit;
	cursor: pointer;
	color: gray;
	transition: color 0.2s;
}

.tmc-names__star:hover,
.tmc-names__star:focus-visible {
	color: #d4a017;
}

.tmc-names__star.is-selected {
	color: gold;
}

.tmc-names__counter {
	color: #555;
}

/* ---- Pagination ---- */

.tmc-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 5px;
	margin-top: 20px;
}

.tmc-pagination a,
.tmc-pagination span {
	padding: 6px 10px;
	border: 1px solid var(--tmc-primary, #af0379);
	color: var(--tmc-primary, #af0379);
	text-decoration: none;
	border-radius: 4px;
}

.tmc-pagination__current {
	background-color: var(--tmc-primary, #af0379);
	color: #fffffc;
}

.tmc-pagination__gap {
	border: none;
}

/* ---- Shared notice used by the details card ---- */

.tmc-card__notice {
	color: #af0379;
	font-weight: bold;
}

/* ---------------------------------------------------------------------------
 * Facet intro copy ([baby_names_table]) and the crawlable browse block
 * ([baby_name_browse]). The browse block exists because the filter <select>
 * navigates via JavaScript, which a crawler cannot follow.
 * ------------------------------------------------------------------------ */

.tmc-names__intro,
.tmc-names__related {
	color: var(--tmc-primary, #af0379);
	font-size: 15px;
	line-height: 1.6;
	margin: 8px 0 0;
}

.tmc-names__related a {
	color: #d4007f;
	text-decoration: underline;
}

.tmc-browse {
	--tmc-primary: #af0379;
	--tmc-accent: #ed7117;
	font-family: 'Segoe UI', sans-serif;
	margin: 24px 0;
}

.tmc-browse__group + .tmc-browse__group {
	margin-top: 24px;
}

.tmc-browse__title {
	color: var(--tmc-primary);
	font-size: 18px;
	margin: 0 0 10px;
}

.tmc-browse__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.tmc-browse__list li {
	margin: 0;
}

.tmc-browse__list a {
	display: inline-block;
	padding: 6px 12px;
	border: 1px solid var(--tmc-primary);
	border-radius: 6px;
	color: var(--tmc-primary);
	text-decoration: none;
	font-size: 14px;
	line-height: 1.3;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.tmc-browse__list a:hover,
.tmc-browse__list a:focus-visible {
	background-color: var(--tmc-primary);
	color: #fffffc;
}

/* The A-Z row reads better as fixed-width chips. */
.tmc-browse__group--alphabet .tmc-browse__list a {
	min-width: 40px;
	text-align: center;
	font-weight: 600;
}
