/**
 * KCAI PARTICIPATING SHELTER LAYER — styles.
 *
 * Companion to kcai-shelters.js. Kept separate from kcai-petmap.css for the
 * same reason the JS is separate: a surface can take the pet map without taking
 * the shelter layer, and the shelter layer must not be able to restyle a pet
 * marker by accident.
 *
 * Every selector is prefixed `kcs-`. The pet map owns `kpm-`.
 */

/* --------------------------------------------------------------- the marker */

/*
 * SQUARE, NOT ROUND. See the note in kcai-shelters.js — the silhouette is the
 * primary way a shelter is told apart from a pet, so the border-radius here is
 * load-bearing and not a style preference. Anything approaching 50% starts
 * reading as a pet marker.
 */
.kcs-pin {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 26%;
	background: linear-gradient(180deg, #12212F 0%, #0A141D 100%);
	border: 2.5px solid #FEFEFE;
	box-shadow: 0 2px 10px rgba(4, 12, 20, .45), 0 0 0 1px rgba(0, 164, 253, .35);
	color: #00A4FD;
	box-sizing: border-box;
}

.kcs-pin.is-selected {
	border-color: #00A4FD;
	box-shadow: 0 4px 18px rgba(0, 62, 100, .5), 0 0 0 4px rgba(0, 164, 253, .3);
}

/*
 * A shelter with no connected feed is visibly quieter than one with numbers.
 * The map should not present an unknown as though it were a live reading, and
 * de-emphasis is the honest visual equivalent of the missing badge.
 */
.kcs-pin--none {
	background: linear-gradient(180deg, #23303B 0%, #18232C 100%);
	color: #8FA3B4;
	box-shadow: 0 2px 8px rgba(4, 12, 20, .35);
}

.kcs-pin__body {
	position: absolute;
	inset: 14%;
	display: block;
}

.kcs-pin__body svg { width: 100%; height: 100%; display: block; }

/* ------------------------------------------------------------- count badges */

/*
 * Badges sit on the LOWER rim and outside the square, the same decision the pet
 * markers reached: a badge over the icon covers the thing it is labelling.
 * Cat left, dog right, consistently — position is the non-colour half of the
 * species signal, so the pair is still readable without hue.
 */
.kcs-pin__count {
	position: absolute;
	bottom: -7px;
	min-width: 19px;
	height: 19px;
	padding: 0 4px;
	border-radius: 10px;
	background: var(--kcs-c, #7C8B9C);
	color: #FFFFFF;
	font: 700 11px/19px system-ui, -apple-system, "Segoe UI", sans-serif;
	text-align: center;
	border: 2px solid #FEFEFE;
	box-shadow: 0 1px 4px rgba(4, 12, 20, .4);
	box-sizing: border-box;
	font-variant-numeric: tabular-nums;
}

.kcs-pin__count--cat { left: -8px; }
.kcs-pin__count--dog { right: -8px; }

/*
 * The "no counts" dash is centred rather than sitting in either species slot.
 * A dash in the cat position would read as "no cats, dogs unknown".
 */
.kcs-pin__count--none {
	left: 50%;
	transform: translateX(-50%);
	background: #56687A;
	letter-spacing: .5px;
}

/* -------------------------------------------------------------- demo ribbon */

/*
 * Fabricated data announces itself ON THE MAP, not only in the card. A
 * reviewer scanning a screenshot must be able to see which buildings are
 * invented without opening each one.
 */
.kcs-pin__demo {
	position: absolute;
	top: -9px;
	left: 50%;
	transform: translateX(-50%);
	padding: 0 4px;
	border-radius: 3px;
	background: #0A141D;
	color: #FFD9C7;
	border: 1px solid #FF5C1F;
	font: 800 8px/13px system-ui, -apple-system, "Segoe UI", sans-serif;
	letter-spacing: .6px;
	font-style: normal;
	white-space: nowrap;
}

/* ----------------------------------------------------------------- the card */

.kcs-card {
	--kcs-ink: #0A141D;
	--kcs-dim: #4A5C6D;
	color: var(--kcs-ink);
	font: 400 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.kcs-card__demo {
	margin: 0 0 10px;
	padding: 7px 9px;
	border-radius: 6px;
	background: #FFF1EA;
	border: 1px solid #FF5C1F;
	color: #8A2E00;
	font-size: 11.5px;
	font-weight: 700;
	line-height: 1.45;
	letter-spacing: .2px;
}

.kcs-card__name {
	margin: 0 0 6px;
	font-size: 19px;
	line-height: 1.25;
	font-weight: 800;
	letter-spacing: -.01em;
}

/* The state chip is text plus a shape, never a bare colour swatch. */
.kcs-card__state {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 8px;
	padding: 3px 9px 3px 7px;
	border-radius: 20px;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: .3px;
	text-transform: uppercase;
}

.kcs-card__state i {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex: none;
}

.kcs-card__state--live    { background: #E6F7EC; color: #10633A; }
.kcs-card__state--live i  { background: #12A05C; }
.kcs-card__state--partner { background: #E8F4FF; color: #0B4F7A; }
.kcs-card__state--partner i { background: #00A4FD; border-radius: 2px; }
.kcs-card__state--none    { background: #EEF1F4; color: #3F5162; }
.kcs-card__state--none i  { background: transparent; border: 2px dashed #7C8B9C; }

.kcs-card__area {
	margin: 0 0 10px;
	color: var(--kcs-dim);
	font-size: 13px;
}

.kcs-card__counts {
	display: flex;
	gap: 10px;
	margin: 0 0 8px;
}

.kcs-num {
	flex: 1 1 0;
	padding: 8px 10px;
	border-radius: 8px;
	background: #F5F7F9;
	border-left: 4px solid var(--kcs-c, #7C8B9C);
}

.kcs-num b {
	display: block;
	font-size: 24px;
	line-height: 1.1;
	font-weight: 800;
	color: var(--kcs-c, #0A141D);
	font-variant-numeric: tabular-nums;
}

.kcs-num span {
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .6px;
	text-transform: uppercase;
	color: var(--kcs-dim);
}

/*
 * The refusal to show a number is styled as a statement, not as an error or an
 * empty slot. It occupies the space the counts would have.
 */
.kcs-card__nocounts {
	margin: 0 0 8px;
	padding: 10px;
	border-radius: 8px;
	background: #F5F7F9;
	border-left: 4px dashed #7C8B9C;
	color: #3F5162;
	font-size: 13px;
}

.kcs-card__updated,
.kcs-card__dist {
	margin: 0 0 6px;
	font-size: 12px;
	color: var(--kcs-dim);
}

.kcs-card__dist span { opacity: .8; }

.kcs-card__blurb {
	margin: 8px 0 12px;
	font-size: 12.5px;
	line-height: 1.5;
	color: #3F5162;
}

.kcs-card__go {
	display: block;
	min-height: 44px;
	padding: 12px 14px;
	border-radius: 8px;
	background: #00A4FD;
	color: #04121C;
	font-weight: 800;
	font-size: 14px;
	text-align: center;
	text-decoration: none;
	box-sizing: border-box;
}

.kcs-card__go:hover,
.kcs-card__go:focus-visible { background: #33B8FE; }

/* ------------------------------------------------------------ dark surface */

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .kcs-card { --kcs-ink: #EAF2F8; --kcs-dim: #9DB0C0; }
	:root:not([data-theme="light"]) .kcs-num,
	:root:not([data-theme="light"]) .kcs-card__nocounts { background: #16222C; }
	:root:not([data-theme="light"]) .kcs-card__demo { background: #2A1508; color: #FFC9AC; }
}

:root[data-theme="dark"] .kcs-card { --kcs-ink: #EAF2F8; --kcs-dim: #9DB0C0; }
:root[data-theme="dark"] .kcs-num,
:root[data-theme="dark"] .kcs-card__nocounts { background: #16222C; }
:root[data-theme="dark"] .kcs-card__demo { background: #2A1508; color: #FFC9AC; }

/* ------------------------------------------------------------ reduced motion */

@media (prefers-reduced-motion: reduce) {
	.kcs-pin, .kcs-pin__count { transition: none !important; }
}
