/* Collection sidebar - filters, collections menu, more like this. Flat, no gradients.
   Master copy: ~/.claude/skills/fix-collection-content/sidebar/ - installed by collection_sidebar.py.
   Per-site colours: override the --cf-* variables in collection-sidebar-site.css. */
:root {
	--cf-ink: #1f2a37;
	--cf-muted: #637083;
	--cf-line: #e4e8ee;
	--cf-soft: #f4f6f9;
	--cf-accent: #2a7f8c;
	--cf-accent-soft: #e6f3f5;
	--cf-radius: 14px;
}

.sidebarContainer.cfSidebar { width: 290px; animation: none; padding-top: 30px; }
.pageWrapper { animation: none; gap: 32px; }
.collectionHeaderContainer h1::after { background: var(--cf-accent); }

.cfPanel { font-size: 14px; color: var(--cf-ink); }
.cfPanel h2, .cfPanel h3 { margin: 0; font: inherit; }
.cfPanel ul { list-style: none; margin: 0; padding: 0; }
.cfPanel button { font: inherit; cursor: pointer; }

.cfCard {
	background: #fff;
	border: 1px solid var(--cf-line);
	border-radius: var(--cf-radius);
	padding: 18px 18px 14px;
	margin-bottom: 20px;
}
.cfCardHead { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.cfCardHead h2 { font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--cf-muted); }
.cfHeadNote { font-size: 12px; color: var(--cf-muted); }
.cfReset { background: none; border: 0; padding: 0; color: var(--cf-accent); font-size: 13px; font-weight: 600; }
.cfReset:hover { text-decoration: underline; }

/* search boxes */
.cfSearch { position: relative; display: block; margin-bottom: 6px; }
.cfSearch i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--cf-muted); font-size: 13px; pointer-events: none; }
.cfSearch input, .cfSort {
	width: 100%;
	box-sizing: border-box;
	height: 40px;
	padding: 0 12px 0 34px;
	border: 1px solid var(--cf-line);
	border-radius: 10px;
	background: var(--cf-soft);
	font: inherit;
	color: var(--cf-ink);
	transition: border-color .15s, background .15s;
}
.cfSort { padding-left: 12px; appearance: auto; }
.cfSearch input:focus, .cfSort:focus { outline: none; border-color: var(--cf-accent); background: #fff; box-shadow: 0 0 0 3px var(--cf-accent-soft); }
.cfSearchSmall input { height: 36px; }

/* filter groups */
.cfGroup { border-top: 1px solid var(--cf-line); padding: 12px 0 4px; margin-top: 12px; }
.cfGroup:first-of-type { margin-top: 14px; }
.cfGroupHead { display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; margin-bottom: 8px; }
.cfGroupHead::-webkit-details-marker { display: none; }
.cfGroupHead h3 { font-weight: 700; font-size: 14px; }
.cfGroupHead i { font-size: 11px; color: var(--cf-muted); transition: transform .2s; }
details.cfGroup:not([open]) .cfGroupHead { margin-bottom: 4px; }
details.cfGroup:not([open]) .cfGroupHead i { transform: rotate(-90deg); }

.cfCheck { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 8px; cursor: pointer; line-height: 1.3; }
.cfCheck:hover { background: var(--cf-soft); }
.cfCheck input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cfBox { flex: none; width: 18px; height: 18px; border: 1.5px solid #b7c0cc; border-radius: 5px; background: #fff; display: grid; place-items: center; transition: all .15s; }
.cfRadio .cfBox { border-radius: 50%; }
.cfCheck input:checked + .cfBox { background: var(--cf-accent); border-color: var(--cf-accent); }
.cfCheck input:checked + .cfBox::after { content: ''; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.cfRadio input:checked + .cfBox::after { width: 6px; height: 6px; border: 0; border-radius: 50%; background: #fff; transform: none; }
.cfCheck input:focus-visible + .cfBox { box-shadow: 0 0 0 3px var(--cf-accent-soft); }
.cfLabel { flex: 1; }
.cfCheck input:checked ~ .cfLabel { font-weight: 600; }
.cfCount { flex: none; min-width: 22px; padding: 1px 7px; border-radius: 20px; background: var(--cf-soft); color: var(--cf-muted); font-size: 12px; text-align: center; box-sizing: border-box; }
.cfCount:empty { display: none; }
li.cfEmpty .cfCheck { opacity: .4; }

.cfCollapsed .cfExtra { display: none; }
.cfMore { background: none; border: 0; padding: 6px 4px; color: var(--cf-accent); font-weight: 600; font-size: 13px; }
.cfMore:hover { text-decoration: underline; }
.cfApply { display: none; }

/* collections menu */
.cfCollectionList { margin-top: 6px; }
.cfNavGroup + .cfNavGroup { border-top: 1px solid var(--cf-line); margin-top: 8px; padding-top: 4px; }
.cfNavTitle { font-size: 11px !important; font-weight: 700 !important; letter-spacing: .1em; text-transform: uppercase; color: var(--cf-muted); padding: 10px 4px 4px; }
.cfCollectionList.cfSearching .cfExtra { display: list-item; }
.cfCollectionList.cfSearching + .cfMore { display: none; }
.cfCollectionList a {
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	padding: 8px 10px; margin: 0 -6px; border-radius: 8px;
	color: var(--cf-ink); text-decoration: none; line-height: 1.3;
	position: relative; transition: background .15s, color .15s;
}
.cfCollectionList a:hover { background: var(--cf-soft); color: var(--cf-accent); }
.cfCollectionList .cfActive a { background: var(--cf-accent-soft); color: var(--cf-accent); font-weight: 700; }
.cfCollectionList .cfActive a::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--cf-accent); }
.cfCollectionList .cfActive .cfCount { background: #fff; color: var(--cf-accent); }

/* more like this */
.cfLike li + li { border-top: 1px solid var(--cf-line); }
.cfLike a { display: flex; align-items: center; gap: 12px; padding: 9px 0; color: var(--cf-ink); text-decoration: none; font-size: 13px; line-height: 1.35; }
.cfLike a:hover span { color: var(--cf-accent); }
.cfLike img { flex: none; width: 52px; height: 52px; object-fit: contain; border-radius: 8px; border: 1px solid var(--cf-line); background: #fff; }
.cfLike span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* results bar + loading */
.cfBar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 24px 0 6px; scroll-margin-top: 20px; font-size: 14px; }
.cfBar[hidden] { display: none; }
.cfBarCount { font-weight: 700; color: var(--cf-ink); margin-right: 6px; }
.cfChip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 1px solid var(--cf-accent); border-radius: 20px; background: var(--cf-accent-soft); color: var(--cf-accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.cfChip i { font-size: 11px; }
.cfChip:hover { background: #fff; }
.cfBarClear { background: none; border: 0; color: var(--cf-muted); text-decoration: underline; font: inherit; font-size: 13px; cursor: pointer; }
#theResults { transition: opacity .15s; }
#theResults.cfLoading { opacity: .45; pointer-events: none; }
.cfNone { text-align: center; padding: 50px 20px; border: 1px dashed var(--cf-line); border-radius: var(--cf-radius); margin: 20px 0; color: var(--cf-muted); }
.cfNone .cfReset { margin-top: 8px; font-size: 15px; }

.cfMobileToggle, .cfPanelTop, .cfScrim { display: none; }

/* mobile + tablet: sidebar becomes a slide-in drawer */
@media only screen and (max-width: 1024px) {
	.sidebarContainer.cfSidebar { display: block; width: auto; padding: 16px 15px 0; }
	.cfMobileToggle {
		display: flex; align-items: center; justify-content: center; gap: 10px;
		width: 100%; height: 46px; border: 1px solid var(--cf-line); border-radius: 12px;
		background: #fff; color: var(--cf-ink); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
	}
	.cfMobileToggle i { color: var(--cf-accent); }
	.cfMobileBadge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 11px; background: var(--cf-accent); color: #fff; font-size: 12px; }
	.cfMobileBadge[hidden] { display: none; }
	.cfPanel {
		position: fixed; z-index: 10001; top: 0; right: 0; bottom: 0;
		width: min(380px, 90vw); overflow-y: auto; overscroll-behavior: contain;
		background: var(--cf-soft); padding: 0 14px 90px; box-sizing: border-box;
		transform: translateX(105%); transition: transform .25s ease; visibility: hidden;
	}
	body.cfOpen { overflow: hidden; }
	body.cfOpen .cfPanel { transform: none; visibility: visible; box-shadow: -8px 0 30px rgba(0,0,0,.15); }
	.cfPanelTop { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1; margin: 0 -14px 14px; padding: 14px; background: #fff; border-bottom: 1px solid var(--cf-line); font-weight: 700; font-size: 16px; }
	.cfClose { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--cf-soft); color: var(--cf-ink); font-size: 16px; }
	.cfScrim { display: block; position: fixed; inset: 0; z-index: 10000; background: rgba(15,23,32,.45); }
	.cfScrim[hidden] { display: none; }
	.cfApply {
		display: block; position: fixed; bottom: 14px; right: 14px; width: calc(min(380px, 90vw) - 28px);
		height: 50px; border: 0; border-radius: 12px; background: var(--cf-accent); color: #fff; font-weight: 700; font-size: 15px;
	}
	body:not(.cfOpen) .cfApply { display: none; }
	.cfCheck { padding: 9px 4px; }
}

/* homepage: the sidebar has its own sort, and the collections grid loses its gradient */
.pageWrapper:has(.cfSidebar) .sortByContainer { display: none; }
.collectionsGridContainer { background: #fff; border-color: var(--cf-line); box-shadow: none; }
.collectionsGridTitle { background: none; -webkit-text-fill-color: currentColor; color: var(--cf-ink); }
.collectionGridItem:hover { border-color: var(--cf-accent); box-shadow: 0 6px 18px rgba(31,42,55,.08); }
.collectionGridItem:hover .collectionGridItemTitle { color: var(--cf-accent); }

/* long page lists (big feeds on the homepage) wrap instead of pushing the phone layout sideways */
.paginationContainer { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; max-width: 100%; }
