/*
 * Colour name pages and the A–Z index (includes/colors.php). Loaded after
 * shades.css, which supplies the shared chips, FAQ, copy buttons and toast.
 */
.tg-color .cl-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; margin: 4px 0 36px; }
.tg-color .cl-big { position: relative; min-height: 300px; border-radius: 28px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.tg-color .cl-big span { position: absolute; left: 22px; bottom: 20px; display: grid; font: 600 15px/1.3 'SF Mono', 'Fira Code', ui-monospace, monospace; }
.tg-color .cl-big b { font: 800 28px/1.15 inherit; font-family: inherit; letter-spacing: -.02em; }
.tg-color .cl-big .sh-copy { position: absolute; right: 18px; bottom: 18px; }
.tg-color .cl-codes h2 { margin-top: 0; }
.tg-color .cl-codes table { width: 100%; border-collapse: collapse; margin: 0 0 12px; }
.tg-color .cl-codes th { width: 92px; padding: 9px 8px 9px 0; text-align: left; font-size: 13px; color: #6E6E78; font-weight: 700; border-bottom: 1px solid #EFEFF4; }
.tg-color .cl-codes td { padding: 7px 0; border-bottom: 1px solid #EFEFF4; }
.tg-color .cl-codes td:last-child { text-align: right; width: 80px; }
.tg-color .cl-codes code { font-size: 14px; background: none; padding: 0; }
.tg-color .cl-about p { max-width: 820px; line-height: 1.7; color: #333; }
.tg-color .cl-about a, .tg-color .sh-sub a { color: #4B3CC9; font-weight: 600; }

.tg-color .cl-scale { display: grid; grid-template-columns: repeat(19, minmax(0, 1fr)); gap: 4px; }
.tg-color .cl-chip { display: grid; gap: 4px; min-width: 0; }
.tg-color .cl-sw { position: relative; height: 70px; padding: 0; margin: 0; border: 0; border-radius: 10px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.tg-color .cl-sw em { position: absolute; left: 0; right: 0; bottom: 6px; font: 600 10px/1 'SF Mono', 'Fira Code', ui-monospace, monospace; font-style: normal; text-align: center; opacity: 0; transition: opacity .12s; }
.tg-color .cl-sw:hover em, .tg-color .cl-sw:focus-visible em { opacity: 1; }
.tg-color .cl-chip > span, .tg-color .cl-chip > a { font-size: 11.5px; color: #6E6E78; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-color .cl-chip > a { color: #4B3CC9; font-weight: 600; text-decoration: none; }

.tg-color .cl-harm { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.tg-color .cl-harm-row { padding: 14px; border: 1px solid #EDEDF2; border-radius: 18px; background: #fff; }
.tg-color .cl-harm-row h3 { margin: 0 0 10px; font-size: 15px; }
.tg-color .cl-harm-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tg-color .cl-harm-chips .cl-sw { height: 84px; }
.tg-color .cl-harm-chips .cl-sw em { opacity: 1; }

.tg-color .cl-contrast { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tg-color .cl-ct { padding: 22px; border-radius: 20px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.tg-color .cl-ct b { display: block; font-size: 22px; margin-bottom: 4px; }
.tg-color .cl-ct span { font: 700 16px/1 'SF Mono', 'Fira Code', ui-monospace, monospace; }
.tg-color .cl-ct ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0 !important; padding: 0 !important; list-style: none; }
.tg-color .cl-ct li { margin: 0 !important; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.tg-color .cl-ct li.is-pass { background: #E7F8EE; color: #14532D; }
.tg-color .cl-ct li.is-fail { background: #FDE8E8; color: #7F1D1D; }
.tg-color .cl-css pre { white-space: pre-wrap !important; }

.tg-color .cl-similar { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.tg-color .cl-sim { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 8px; border: 1px solid #EDEDF2; border-radius: 14px; background: #fff; color: #111; text-decoration: none; }
.tg-color .cl-sim:hover { border-color: #111; }
.tg-color .cl-sim i { grid-row: span 2; width: 34px; height: 34px; border-radius: 9px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.tg-color .cl-sim b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-color .cl-sim small { font: 500 11.5px/1.2 'SF Mono', 'Fira Code', ui-monospace, monospace; color: #6E6E78; }
.tg-color .cl-sim[hidden], .tg-color .cl-fam[hidden] { display: none !important; }
.tg-color .cl-find { display: flex; align-items: center; gap: 12px; margin: 0 0 24px; }
.tg-color .cl-find label { font-weight: 700; font-size: 14px; }
.tg-color .cl-find input { flex: 1; max-width: 420px; padding: 11px 16px !important; border-radius: 999px !important; font-size: 15px !important; }
.tg-color .cl-fam h2 a { color: inherit; text-decoration: none; }

/* Shade cards on the Shades pages link to the colour pages. */
.tg-shades .sh-card button.sh-sw { width: 100%; padding: 0; margin: 0; border: 0; border-radius: 0; cursor: pointer; }
.tg-shades .sh-card a.sh-meta { color: inherit; text-decoration: none; }
.tg-shades .sh-card a.sh-meta:hover b { color: #4B3CC9; }

@media (max-width: 860px) {
	.tg-color .cl-top { grid-template-columns: 1fr; }
	.tg-color .cl-big { min-height: 200px; }
	.tg-color .cl-scale { grid-template-columns: repeat(10, minmax(0, 1fr)); }
	.tg-color .cl-contrast { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .tg-color .cl-scale { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

html[data-theme="dark"] .tg-color .cl-codes th, html[data-theme="dark"] .tg-color .cl-codes td { border-color: rgba(255, 255, 255, .08); color: #EDEDF2; }
html[data-theme="dark"] .tg-color .cl-about p { color: #C9C9D4; }
html[data-theme="dark"] .tg-color .cl-harm-row, html[data-theme="dark"] .tg-color .cl-sim { background: #15151D; border-color: rgba(255, 255, 255, .09); color: #EDEDF2; }
html[data-theme="dark"] .tg-color .cl-chip > span, html[data-theme="dark"] .tg-color .cl-sim small { color: #9393A3; }
html[data-theme="dark"] .tg-color .cl-about a, html[data-theme="dark"] .tg-color .sh-sub a, html[data-theme="dark"] .tg-color .cl-chip > a { color: #C4B5FD; }
