/* ==========================================================================
   CTO List (M1 scaffold) — shared listing family scope.
   ONE scope/stylesheet/script for the whole listing family (posts index,
   category, tag, author, date archives, search, 404) per 02-review.md fix #2
   ("pin ONE listing scope + one CSS file + one JS file... recommend
   .cto-list / cto-list.css / cto-list.js"). Component rules (.cards/.card/
   .load-more-wrap) are copied verbatim from assets/css/cto-home.css so the
   grid stays pixel-identical to the home "Últimas notícias" block. Enqueued
   only once the listing family is live (functions.php
   ctorio_child_enqueue_cto_list); inert during M1 (CTORIO_CHILD_LISTING_LIVE
   is false).
   ========================================================================== */

.cto-list {
	--ink:        #262321;
	--ink-soft:   #5c554e;
	--accent:     #EF1C1C;
	--accent-ink: #ffffff;
	--radius:     6px;

	--cream:       #FBF9F4;
	--card-fill:   #FFFFFF;
	--hairline:    #ECE7DC;
	--card-shadow: 0 1px 2px rgba(60,50,35,0.06);

	--accent-wash-1: rgba(239,28,28,.16);
	--accent-wash-2: rgba(239,28,28,.04);

	--font-body: "Helvetica Neue", Arial, "Segoe UI", Roboto, system-ui, sans-serif;
	--font-ui:   system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

	--space-1: 8px;
	--space-2: 16px;
	--space-3: 24px;
	--space-4: 40px;
	--space-section: 64px;

	--maxw-page: 1180px;

	background: var(--cream);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	display: block;
}

.cto-list * { box-sizing: border-box; }
.cto-list img { max-width: 100%; display: block; }

.cto-list .shell {
	max-width: var(--maxw-page);
	margin: 0 auto;
	padding: var(--space-section) var(--space-3) 0;
}
.cto-list .shell:last-child { padding-bottom: var(--space-section); }

/* ---- Split section heading (shared with home/single) -------------------- */
.cto-list .heading-split {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 var(--space-2);
}
.cto-list .heading-split .rule {
	width: 3px;
	align-self: stretch;
	min-height: 30px;
	background: var(--accent);
	flex: 0 0 auto;
}
.cto-list .heading-split h2 {
	margin: 0;
	font-size: 26px;
	line-height: 1.1;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--ink);
	font-weight: 300;
}
.cto-list .heading-split h2 b { font-weight: 800; }

.cto-list .archive-meta {
	font-family: var(--font-ui);
	font-size: 14px;
	color: var(--ink-soft);
	margin: 0 0 var(--space-4);
}

.cto-list .entry-eyebrow {
	font-family: var(--font-ui);
	text-transform: uppercase;
	letter-spacing: .16em;
	font-size: 12px;
	font-weight: 800;
	color: var(--accent);
	margin: 0 0 10px;
}
.cto-list .entry-title {
	font-size: 34px;
	line-height: 1.18;
	margin: 0 0 10px;
	font-weight: 700;
	color: var(--ink);
}

/* ---- Author hero (byline header) ---------------------------------------- */
.cto-list .author-hero {
	text-align: center;
	padding-top: var(--space-section);
	padding-bottom: 0;
}
.cto-list .author-avatar {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	margin: 0 auto var(--space-2);
	box-shadow: 0 2px 6px rgba(60, 50, 35, .28);
	border: 2px solid #fff;
}
.cto-list .author-eyebrow {
	font-family: var(--font-ui);
	text-transform: uppercase;
	letter-spacing: .16em;
	font-size: 12px;
	font-weight: 800;
	color: var(--accent);
	margin: 0 0 6px;
}
.cto-list .author-name {
	font-size: 34px;
	line-height: 1.18;
	font-weight: 700;
	color: var(--ink);
	margin: 0 0 6px;
}
.cto-list .author-count {
	font-family: var(--font-ui);
	color: var(--ink-soft);
	margin: 0;
}

/* ---- Card grid (copied verbatim from cto-home.css .cards/.card) --------- */
.cto-list .cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--space-3);
}
.cto-list .card {
	background: var(--card-fill);
	border: 1px solid var(--hairline);
	border-radius: var(--radius);
	box-shadow: var(--card-shadow);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	transition: transform .15s ease;
}
.cto-list .card:hover { transform: translateY(-2px); }
.cto-list .card .photo {
	aspect-ratio: 4 / 3;
	position: relative;
	overflow: hidden;
	background:
		linear-gradient(135deg, var(--accent-wash-1), var(--accent-wash-2)),
		repeating-linear-gradient(45deg, rgba(0,0,0,.03) 0 12px, transparent 12px 24px),
		var(--hairline);
	display: grid;
	place-items: center;
}
.cto-list .card .photo span {
	font-family: var(--font-ui);
	font-size: 11px;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--ink-soft);
	opacity: .7;
}
.cto-list .card .photo img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.cto-list .card .card-title {
	font-size: 18px;
	line-height: 1.25;
	font-weight: 700;
	padding: var(--space-2);
	margin: 0;
	color: var(--ink);
}
.cto-list .card .card-title .clamp {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.cto-list .card .card-more {
	font-family: var(--font-ui);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .02em;
	color: var(--accent);
	padding: 0 var(--space-2) var(--space-2);
	margin: 0;
}

.cto-list .load-more-wrap {
	text-align: center;
	margin-top: var(--space-4);
}
.cto-list .load-more-wrap .btn {
	width: auto;
	max-width: 100%;
	padding: 12px 28px;
}

.cto-list .btn {
	font-family: var(--font-ui);
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 10px 20px;
	border-radius: var(--radius);
	background: var(--accent);
	color: var(--accent-ink);
	border: none;
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: .06em;
}
.cto-list .btn:hover { filter: brightness(1.06); }

/* ---- Empty state (reused for posts-index/archive/tag/author/search) ----- */
.cto-list .no-comments {
	color: var(--ink-soft);
	font-size: 14.5px;
	background: var(--cream);
	border: 1px solid var(--hairline);
	border-radius: var(--radius);
	padding: 14px 16px;
	max-width: 640px;
}
.cto-list .no-comments p:last-child { margin-bottom: 0; }
.cto-list .no-comments a {
	color: var(--accent);
	font-weight: 700;
	text-decoration: none;
}
.cto-list .no-comments a:hover,
.cto-list .no-comments a:focus-visible { text-decoration: underline; }

/* ---- Search refine form (shared searchform.php) -------------------------- */
.cto-list .search-form {
	display: flex;
	gap: var(--space-2);
	max-width: 520px;
	margin: var(--space-2) 0 0;
}
.cto-list .search-field {
	flex: 1 1 auto;
	font-family: var(--font-ui);
	font-size: 15px;
	color: var(--ink);
	background: #fff;
	border: 1px solid var(--hairline);
	border-radius: var(--radius);
	padding: 12px 14px;
}
.cto-list .search-field:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 2px;
}
.cto-list .search-empty { max-width: 640px; }
.cto-list .search-empty .search-form { margin-top: var(--space-2); }

/* ---- 404 helpful-links tile grid ----------------------------------------- */
.cto-list.cto-404 .links-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--space-2);
	list-style: none;
	margin: 0;
	padding: 0;
}
.cto-list.cto-404 .links-grid li { list-style: none; }
.cto-list.cto-404 .links-grid a {
	display: block;
	background: var(--card-fill);
	border: 1px solid var(--hairline);
	border-radius: var(--radius);
	padding: var(--space-2);
	text-decoration: none;
	color: var(--ink);
	font-weight: 700;
}
.cto-list.cto-404 .links-grid a:hover { color: var(--accent); }
.cto-list .back-home-wrap { text-align: center; }

/* Focus ring (a11y), matches the site-wide rule. */
.cto-list a:focus-visible,
.cto-list button:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 2px;
	border-radius: 4px;
}

/* ---- Responsive ----------------------------------------------------------- */
@media (max-width: 900px) {
	.cto-list .cards { grid-template-columns: repeat(2, 1fr); }
	.cto-list.cto-404 .links-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
	.cto-list .cards { grid-template-columns: 1fr; }
	.cto-list.cto-404 .links-grid { grid-template-columns: 1fr; }
	.cto-list .search-form { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
	.cto-list * { transition: none !important; animation: none !important; }
	.cto-list .card:hover { transform: none; }
}
