/* ============================================================
   COLOR PAGES (page-templates/color.php, colors.php)
   --c is the color, --on the text color that reads on it, --comp its complement.
   ============================================================ */

.swc { --rim: rgba(255, 255, 255, 0.09); --spring: cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ---------- Hero: the color, full width ---------- */

.swc-hero {
	position: relative;
	padding: clamp(18px, 3vw, 28px) 0 clamp(36px, 6vw, 72px);
	background: var(--c);
	color: var(--on);
	box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}
.swc-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.85rem; font-weight: 700; opacity: 0.85; }
.swc-crumbs a { color: inherit; text-decoration: none; }
.swc-crumbs a:hover { color: inherit; text-decoration: underline; }

.swc-hero-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; margin-top: clamp(28px, 6vw, 70px); }
.swc-kicker { margin: 0 0 8px; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.8; }
.swc-title { margin: 0; color: inherit; font: 700 clamp(2.8rem, 9vw, 6rem)/0.95 var(--mono); letter-spacing: -0.04em; }
.swc-title span { display: block; margin-top: 10px; font: 900 clamp(1.5rem, 4vw, 2.4rem)/1.1 var(--sans); letter-spacing: -0.03em; }
.swc-lede { max-width: 46em; margin: 18px 0 0; font-size: 1.05rem; line-height: 1.6; opacity: 0.92; }
.swc-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }

.swc-pill {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 42px; padding: 0 18px;
	border: 0; border-radius: 999px;
	background: transparent; color: inherit;
	font: 800 0.92rem var(--sans); text-decoration: none; cursor: pointer;
	box-shadow: inset 0 0 0 2px currentColor;
	transition: transform 200ms var(--spring), background-color 150ms ease;
}
.swc-pill:hover { color: inherit; transform: translateY(-1px); }
.swc-hero .swc-pill:hover { background: color-mix(in srgb, var(--on) 12%, transparent); }
.swc-pill--solid { background: var(--on); color: var(--c); box-shadow: none; }
.swc-hero .swc-pill--solid:hover { background: var(--on); color: var(--c); }
.swc-body .swc-pill { color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.3); }
.swc-body .swc-pill--solid, .swc-index .swc-pill--solid { background: #fff; color: #000; box-shadow: none; }

.swc-step { display: flex; flex-direction: column; gap: 6px; }
.swc-step a { display: block; min-width: 130px; padding: 12px 16px; border-radius: 14px; color: var(--on); font-weight: 800; font-size: 0.85rem; text-decoration: none; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--on) 30%, transparent), 0 8px 18px rgba(0, 0, 0, 0.18); transition: transform 200ms var(--spring); }
.swc-step a:hover { color: var(--on); transform: translateX(-3px); }

/* ---------- Body ---------- */

.swc-body { padding-top: clamp(30px, 5vw, 56px); }
.swc-sec { margin-bottom: clamp(44px, 6vw, 72px); }
.swc-sec .swh-h2 { margin-bottom: 8px; }
.swc-sub { margin: 0 0 18px; color: var(--text-2); }
.swc-fine { margin-top: 10px; font-size: 0.85rem; }
.swc-fine a { color: #fff; }
.swc-h3 { margin: 16px 0 8px; color: var(--text-3); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.swc-ad { margin-bottom: clamp(40px, 6vw, 64px); }

/* Codes */
.swc-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 14px; }
.swc-code {
	position: relative;
	display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
	padding: 14px 40px 14px 16px;
	border: 0; border-radius: 14px;
	background: var(--card); color: #fff; text-align: left; cursor: copy;
	box-shadow: inset 0 0 0 1px var(--rim);
	transition: background-color 150ms ease, transform 200ms var(--spring);
}
.swc-code:hover { background: var(--card-2); transform: translateY(-1px); }
.swc-code span { color: var(--text-3); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.swc-code b { display: flex; align-items: center; gap: 8px; font: 600 1rem var(--mono); word-break: break-all; }
.swc-code small { color: var(--text-3); font-size: 0.78rem; }
.swc-code > i {
	position: absolute; right: 14px; top: 50%;
	width: 16px; height: 16px; margin-top: -8px;
	background: var(--text-3);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='12' height='12' rx='2'/%3E%3Cpath d='M5 15V5a2 2 0 0 1 2-2h10'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='12' height='12' rx='2'/%3E%3Cpath d='M5 15V5a2 2 0 0 1 2-2h10'/%3E%3C/svg%3E") center / contain no-repeat;
}
.swc-code:hover > i { background: #fff; }
.swc-code--pms, .swc-code--wide { grid-column: 1 / -1; }
.swc-chip { display: inline-block; width: 18px; height: 18px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); }

/* Swatch rows: each swatch links to its own page */
.swc-row { display: flex; overflow: hidden; border-radius: 16px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 12px 26px -14px rgba(0, 0, 0, 0.7); }
.swc-row a { position: relative; flex: 1; display: flex; align-items: flex-end; justify-content: center; min-width: 0; padding: 0 2px 8px; text-decoration: none; transition: flex 240ms var(--spring); }
.swc-row a:hover { flex: 1.6; }
.swc-row span { overflow: hidden; font: 700 0.68rem var(--mono); white-space: nowrap; opacity: 0; transition: opacity 150ms ease; }
.swc-row a:hover span, .swc-row a:focus-visible span { opacity: 1; }
.swc-row--scale { height: 64px; }
.swc-row--scale a:first-child { flex: 1.4; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5); }
.swc-row--harmony { height: 96px; }
.swc-row--harmony span { opacity: 1; }

.swc-harmonies { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.swc-harmony { overflow: hidden; border-radius: 18px; background: var(--card); box-shadow: inset 0 0 0 1px var(--rim); }
.swc-harmony .swc-row { border-radius: 0; box-shadow: none; }
.swc-harmony-text { padding: 14px 16px 16px; }
.swc-harmony-text h3 { margin: 0 0 4px; color: #fff; font-size: 1.05rem; font-weight: 900; }
.swc-harmony-text p { margin: 0 0 10px; color: var(--text-2); font-size: 0.9rem; line-height: 1.5; }
.swc-harmony-text a { color: #fff; font-size: 0.88rem; font-weight: 800; text-decoration: none; }
.swc-harmony-text a:hover { text-decoration: underline; }

/* Contrast boxes */
.swc-contrast { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.swc-cbox { position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 150px; padding: 16px; border-radius: 16px; box-shadow: inset 0 0 0 1px rgba(128, 128, 128, 0.3); }
.swc-cbox-aa { font-size: 2.6rem; font-weight: 900; line-height: 1; }
.swc-cbox p { margin: 0; font-weight: 700; font-size: 0.9rem; }
.swc-cbox-ratio { margin-top: auto; font: 700 1.2rem var(--mono); }
.swc-grade { position: absolute; top: 14px; right: 14px; padding: 3px 10px; border-radius: 999px; font-style: normal; font-weight: 900; font-size: 0.75rem; }
.swc-grade--aaa, .swc-grade--aa { background: #16a34a; color: #fff; }
.swc-grade--lg { background: #e9c46a; color: #000; }
.swc-grade--no { background: #dc2626; color: #fff; }

/* Color blindness */
.swc-cvd { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.swc-cvd-item { display: flex; flex-direction: column; gap: 4px; }
.swc-cvd-item a { display: block; aspect-ratio: 4 / 3; margin-bottom: 6px; border-radius: 16px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 10px 22px -12px rgba(0, 0, 0, 0.7); transition: transform 200ms var(--spring); }
.swc-cvd-item a:hover { transform: translateY(-3px); }
.swc-cvd-item b { color: #fff; font-size: 0.95rem; }
.swc-cvd-item span { color: var(--text-3); font-size: 0.82rem; line-height: 1.4; }

/* In use */
.swc-use { display: grid; grid-template-columns: 1.3fr 1fr; grid-template-rows: auto auto; gap: 12px; }
.swc-use-card { grid-row: span 2; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: clamp(20px, 3vw, 32px); border-radius: 20px; background: #fff; color: #1a1a1a; }
.swc-use-badge { padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--c) 18%, #fff); color: #1a1a1a; font-size: 0.75rem; font-weight: 900; box-shadow: inset 0 0 0 1.5px var(--c); }
.swc-use-h { margin: 0; color: var(--c); font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 900; letter-spacing: -0.03em; line-height: 1.1; -webkit-text-stroke: 0.2px rgba(0, 0, 0, 0.15); }
.swc-use-p { margin: 0; color: #444; line-height: 1.55; }
.swc-use-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 6px; }
.swc-use-btn { padding: 11px 20px; border-radius: 999px; background: var(--c); color: var(--on); font-weight: 800; }
.swc-use-link { color: var(--c); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; filter: saturate(1.1); }
.swc-use-dark { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 12px; min-height: 160px; padding: 20px; overflow: hidden; border-radius: 20px; background: #0d0d12; color: #fff; }
.swc-use-dark p { margin: 0; font-weight: 800; }
.swc-use-dot { position: absolute; top: 18px; right: 18px; width: 54px; height: 54px; border-radius: 50%; background: var(--c); }
.swc-use-dot--2 { right: 82px; width: 34px; height: 34px; top: 28px; opacity: 0.6; }
.swc-use-dot--3 { right: 126px; width: 20px; height: 20px; top: 36px; opacity: 0.3; }
.swc-use-grad { display: flex; align-items: flex-end; min-height: 110px; padding: 16px; border-radius: 20px; background: linear-gradient(120deg, var(--c), var(--comp)); background: linear-gradient(in oklch 120deg, var(--c), var(--comp)); }
.swc-use-grad span { padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.45); color: #fff; font-size: 0.8rem; font-weight: 800; }

/* Similar colors, brands */
.swc-similar, .swc-brands { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.swc-sim, .swc-brand, .swc-tile {
	display: flex; flex-direction: column; gap: 2px;
	padding: 8px 8px 12px;
	border-radius: 16px;
	background: var(--card); color: #fff; text-decoration: none;
	box-shadow: inset 0 0 0 1px var(--rim);
	transition: transform 200ms var(--spring), background-color 150ms ease;
}
.swc-sim:hover, .swc-brand:hover, .swc-tile:hover { color: #fff; background: var(--card-2); transform: translateY(-3px); }
.swc-sim i, .swc-brand i, .swc-tile i { display: block; aspect-ratio: 3 / 2; margin-bottom: 8px; border-radius: 10px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.swc-sim b, .swc-brand b, .swc-tile b { padding: 0 4px; font-size: 0.9rem; font-weight: 800; }
.swc-sim span, .swc-brand span, .swc-tile span { padding: 0 4px; color: var(--text-3); font: 600 0.78rem var(--mono); }

.swc-faq { padding: 14px 0; border-top: 1px solid var(--rim); }
.swc-faq summary { color: #fff; font-weight: 800; cursor: pointer; }
.swc-faq p { margin: 8px 0 0; color: var(--text-2); line-height: 1.6; }

/* Lookup */
.swc-explore { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.swc-search { flex: 1 1 320px; }
.swc-search label { display: block; margin: 0 0 8px 4px; color: #fff; font-weight: 800; }
.swc-search div { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 16px; border-radius: 999px; background: var(--card-2); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18); }
.swc-search div:focus-within { box-shadow: inset 0 0 0 2px #fff; }
.swc-search span { color: var(--text-3); font: 700 1.1rem var(--mono); }
.swc-search input { flex: 1; min-width: 0; padding: 8px 0; border: 0; outline: 0; background: transparent; color: #fff; font: 600 16px var(--mono); text-transform: uppercase; }
.swc-search input[aria-invalid="true"] { color: #fca5a5; }
.swc-search--big { max-width: 520px; margin-top: 22px; }

/* ---------- /colors/ index ---------- */

.swc-index-intro { padding-bottom: 10px; }
.swc-index-jump { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 22px 0 0; }
.swc-index-jump a { padding: 6px 12px; border-radius: 999px; background: var(--card); color: var(--text-2); font-size: 0.85rem; font-weight: 700; text-decoration: none; box-shadow: inset 0 0 0 1px var(--rim); }
.swc-index-jump a:hover { color: #fff; }
.swc-index-jump .swc-pill { min-height: 32px; margin-left: 4px; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.3); }
.swc-family { margin: clamp(36px, 5vw, 56px) 0; scroll-margin-top: 90px; }
.swc-family .swh-h2 span { color: var(--text-3); font-size: 0.9rem; font-weight: 700; }
.swc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 14px; }

@media (max-width: 760px) {
	.swc-hero-in { grid-template-columns: 1fr; }
	.swc-step { flex-direction: row; }
	.swc-step a { flex: 1; min-width: 0; text-align: center; }
	.swc-use { grid-template-columns: 1fr; }
	.swc-use-card { grid-row: auto; }
	.swc-harmonies { grid-template-columns: 1fr; }
	.swc-row--scale { height: 52px; }
	.swc-row span { display: none; }
	.swc-row--harmony span { display: block; font-size: 0.6rem; }
}

/* ---------- Swatch posts: the photo and write-up ---------- */

.swc-story { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; gap: clamp(20px, 4vw, 44px); }
.swc-story.is-text { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.swc-story-photo { position: relative; margin: 0; overflow: hidden; border-radius: 22px; box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.7); }
.swc-story-photo img { display: block; width: 100%; height: auto; }
.swc-story-photo figcaption {
	position: absolute; left: 14px; bottom: 14px;
	display: inline-flex; align-items: center; gap: 8px;
	padding: 6px 12px 6px 6px; border-radius: 999px;
	background: rgba(10, 10, 14, 0.7);
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
	color: #fff; font: 700 0.85rem var(--mono);
}
.swc-story-photo figcaption i { width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
.swc-story-text { color: var(--text-2); font-size: 1.05rem; line-height: 1.7; }
.swc-story-text > :first-child { margin-top: 0; }
.swc-story-text h2, .swc-story-text h3 { color: #fff; }
.swc-story-text a { color: #fff; }

@media (max-width: 760px) {
	.swc-story { grid-template-columns: minmax(0, 1fr); }
}

.swc-colls { margin: 0 0 14px; }
.swc-colls a span { margin-left: 4px; color: var(--text-3); font-weight: 600; }
.swc-colls a[aria-current] { background: #fff; color: #000; box-shadow: none; }
.swc-colls a[aria-current] span { color: #555; }
