/* trove.css: the Trove, the Lorebook's item catalog (table, filters, item pages). Colours from lorebook.css. */

#content.tv-wrap {
	padding: 24px 32px 48px;
	box-sizing: border-box;
	width: 100%;
	max-width: 1500px;
	margin: 0 auto;
	color: var(--lb-ink);
}

.tv-wrap h1 {
	font-family: 'Marcellus', Georgia, serif;
	font-weight: 400;
	color: var(--lb-rust);
	font-size: 2.6rem;
	margin: 0 0 8px;
	text-align: left;
}

.tv-wrap .lb-summary {
	max-width: 760px;
	margin-bottom: 18px;
}

/* ---------- filters ---------- */

.tv-controls {
	background: var(--lb-paper);
	border: 1px solid var(--lb-line);
	border-radius: 6px;
	padding: 12px 14px 8px;
	margin: 0 0 20px;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 10px 16px;
	align-items: center;
}

.tv-controls input[type="search"] {
	width: 100%;
	box-sizing: border-box;
	font-size: 1rem;
	padding: 9px 12px;
	border: 1px solid var(--lb-line);
	border-radius: 4px;
	background: #fff;
	color: var(--lb-ink);
}

.tv-cats {
	grid-column: 1 / -1;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

#content .tv-chip,
#content .tv-reset {
	width: auto !important; /* general.css forces buttons to 100% !important on phones */
}

#content .tv-chip {
	margin: 0;
	padding: 5px 11px;
	font-size: 0.86rem;
	border-radius: 999px;
	border: 1px solid var(--lb-line);
	background: #fff;
	color: var(--lb-ink);
	transition: none;
}

#content .tv-chip:hover:not(:disabled) {
	background: var(--lb-bone);
}

#content .tv-chip[aria-pressed="true"] {
	background: var(--lb-rust);
	border-color: var(--lb-rust);
	color: #fff;
}

.tv-method {
	font-size: 0.9rem;
	color: var(--lb-ink-soft);
	white-space: nowrap;
}

.tv-method select {
	width: auto;
	margin: 0 0 0 6px;
	font-size: 0.95rem;
	padding: 7px 8px;
	border: 1px solid var(--lb-line);
	border-radius: 4px;
	background: #fff;
	color: var(--lb-ink);
}

.tv-count {
	grid-column: 1 / -1;
	margin: 0;
	font-size: 0.85rem;
	color: var(--lb-ink-soft);
}

.tv-nothing {
	padding: 24px 0;
	color: var(--lb-ink-soft);
}

#content .tv-reset {
	width: auto;
	display: inline;
	margin-left: 8px;
	padding: 6px 12px;
}

/* ---------- the table ---------- */

.tv-cat {
	margin-bottom: 36px;
}

.tv-cat h2 {
	font-size: 1.5rem;
	text-transform: none;
	letter-spacing: normal;
	margin: 0 0 8px;
	text-align: left;
	color: var(--lb-ink);
}

.tv-cat-count,
.tv-fam span {
	font-size: 0.8rem;
	font-weight: 400;
	color: var(--lb-ink-soft);
	margin-left: 4px;
}

/* general.css centres and boxes every th / td and makes th position: relative (which would undo sticky). */
.tv-table th,
.tv-table td,
.tv-up th,
.tv-up td {
	border: 0;
	text-align: left;
	cursor: auto;
}

.tv-table th:hover {
	background-color: inherit;
}

.tv-table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	font-size: 0.9rem;
	line-height: 1.45;
	background: #fff;
}

.tv-table thead th {
	text-align: left;
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--lb-ink-soft);
	padding: 8px 10px;
	border-bottom: 2px solid var(--lb-line);
	background: var(--lb-paper);
}

.tv-table td {
	padding: 8px 10px;
	border-bottom: 1px solid #f1ebe2;
	vertical-align: top;
}

.tv-table td.tv-icon,
.tv-table th.tv-icon {
	width: 44px;
	padding-right: 0;
}

.tv-table td.tv-icon img,
.tv-noicon {
	display: block;
	border-radius: 4px;
	background: var(--lb-bone);
}

.tv-table td:nth-child(2) {
	min-width: 140px;
}

.tv-table td:nth-child(7) {
	min-width: 220px;
	color: var(--lb-ink-soft);
}

/* Family rows stick under the filters while their items scroll by. */
.tv-table .tv-fam th {
	position: sticky;
	top: var(--tv-fam-top, 0px);
	z-index: 2;
	text-align: left;
	background: var(--lb-bone);
	color: var(--lb-rust);
	font-size: 0.95rem;
	padding: 7px 10px;
	border-bottom: 1px solid var(--lb-line);
}

.tv-name {
	font-weight: 700;
	color: var(--lb-ink);
	text-decoration: none;
}

.tv-name:hover,
.tv-table a:hover {
	color: var(--lb-rust);
	text-decoration: underline;
}

.tv-table a {
	color: var(--lb-rust);
}

.tv-alts {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tv-alts li + li {
	margin-top: 6px;
	padding-top: 6px;
	border-top: 1px dashed var(--lb-line);
}

.tv-role {
	display: inline-block;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--lb-ink-soft);
	background: var(--lb-bone);
	border-radius: 3px;
	padding: 0 5px;
}

.tv-found,
.tv-none-tool,
.tv-makes,
.tv-meta {
	color: var(--lb-ink-soft);
	font-style: italic;
}

.tv-partof {
	display: block;
	margin-top: 4px;
	font-style: italic;
}

tr[hidden],
tbody[hidden],
section[hidden] {
	display: none;
}

/* ---------- an item page ---------- */

.tv-back {
	margin: 10px 0 14px;
	font-size: 0.92rem;
}

.tv-back a {
	color: var(--lb-rust);
}

.tv-item-head {
	display: flex;
	gap: 18px;
	align-items: center;
	margin: 6px 0 14px;
}

.tv-item-head img,
.tv-item-head .tv-noicon {
	flex: none;
	border-radius: 8px;
	background: var(--lb-bone);
	border: 1px solid var(--lb-line);
}

.tv-item-head h1 {
	margin: 0 0 4px;
}

.tv-item-head .tv-meta {
	margin: 0;
	font-size: 0.95rem;
}

.tv-stats {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 1px;
	background: var(--lb-line);
	border: 1px solid var(--lb-line);
	border-radius: 6px;
	overflow: hidden;
	margin: 0 0 18px;
}

.tv-stats div {
	background: #fff;
	padding: 8px 12px;
}

.tv-stats dt {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--lb-ink-soft);
}

.tv-stats dd {
	margin: 2px 0 0;
}

.tv-recipe {
	border: 1px solid var(--lb-line);
	border-left: 4px solid var(--lb-rust);
	border-radius: 4px;
	padding: 4px 14px 6px;
	margin: 0 0 12px;
	background: #fff;
}

.lb-page .tv-recipe h3 {
	margin: 8px 0 4px;
}

.lb-page .tv-recipe ul {
	list-style: none;
	padding: 0;
}

.tv-k {
	display: inline-block;
	min-width: 84px;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--lb-ink-soft);
}

.tv-hint {
	color: var(--lb-ink-soft);
	font-size: 0.93rem;
}

.lb-page ul.tv-cols {
	columns: 2;
	column-gap: 28px;
}

.tv-scroll {
	overflow-x: auto;
}

.tv-up {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.92rem;
	margin-bottom: 12px;
}

.tv-up th {
	text-align: left;
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--lb-ink-soft);
	border-bottom: 2px solid var(--lb-line);
	padding: 6px 8px;
}

.tv-up td {
	padding: 7px 8px;
	border-bottom: 1px solid #f1ebe2;
	vertical-align: top;
}

/* ---------- phones and narrow windows: each row becomes a card ---------- */

@media (max-width: 900px) {
	#content.tv-wrap {
		padding: 16px 16px 32px;
	}

	.tv-wrap h1 {
		font-size: 2.1rem;
	}

	.tv-controls {
		grid-template-columns: 1fr;
		position: static;
	}

	.tv-table thead {
		display: none;
	}

	.tv-table,
	.tv-table tbody,
	.tv-table tr,
	.tv-table td {
		display: block;
		width: 100%;
		box-sizing: border-box;
	}

	.tv-table tbody tr:not(.tv-fam) {
		display: grid;
		grid-template-columns: 48px minmax(0, 1fr);
		column-gap: 10px;
		padding: 10px 6px;
		border-bottom: 1px solid var(--lb-line);
	}

	.tv-table tr[hidden] {
		display: none;
	}

	.tv-table td {
		border: none;
		padding: 2px 0;
		grid-column: 2;
	}

	.tv-table td.tv-icon {
		grid-column: 1;
		grid-row: 1 / span 8;
		width: auto;
	}

	.tv-table td[data-empty] {
		display: none;
	}

	.tv-table td[data-label]:not(:nth-child(2))::before {
		content: attr(data-label);
		display: inline-block;
		min-width: 78px;
		font-size: 0.7rem;
		font-weight: 700;
		letter-spacing: 0.06em;
		text-transform: uppercase;
		color: var(--lb-ink-soft);
	}

	.tv-table td:nth-child(2) {
		min-width: 0;
		font-size: 1rem;
	}

	.tv-table td:nth-child(7) {
		min-width: 0;
	}

	.tv-table .tv-fam th {
		display: block;
	}

	.tv-item-head img,
	.tv-item-head .tv-noicon {
		width: 88px;
		height: 88px;
	}

	.lb-page ul.tv-cols {
		columns: 1;
	}

	.tv-up thead {
		display: none;
	}

	.tv-up,
	.tv-up tbody,
	.tv-up tr,
	.tv-up td {
		display: block;
	}

	.tv-up tr {
		border-bottom: 1px solid var(--lb-line);
		padding: 6px 0;
	}

	.tv-up td {
		border: none;
		padding: 2px 0;
	}

	.tv-up td::before {
		content: attr(data-label);
		display: inline-block;
		min-width: 78px;
		font-size: 0.7rem;
		font-weight: 700;
		text-transform: uppercase;
		color: var(--lb-ink-soft);
	}
}
