/*
 * সহজ's chamfered "angular card" component layer.
 *
 * Ported from the-rationality-lab/assets/rl-angular-cards.css (kept as an
 * untouched reference copy in git history — see
 * ratlab_theme_implementation_plan.md Phase 0.2) with two deliberate
 * changes from the original:
 *   1. Every hardcoded #000/#fff is replaced with সহজ's own --sohoj-*
 *      tokens (brand.css), so these components inherit the light/dark
 *      toggle automatically instead of being permanently black-on-white.
 *   2. Borders are 2px, not RL's 1px, matching brand.css's existing
 *      "2px hard borders, never 1px" convention (A3a mechanics note) so
 *      this new component layer reads as one system with the rest of the
 *      site rather than a visibly different weight bolted on.
 *
 * The chamfer amount itself (--sohoj-cut) is defined once in brand.css so
 * this file and any future one agree on it.
 */

.ang-card {
	position: relative;
	background: var(--sohoj-surface);
	border: 2px solid var(--sohoj-border);
	padding: 18px;
	clip-path: polygon(0 0, calc(100% - var(--sohoj-cut)) 0, 100% var(--sohoj-cut), 100% 100%, var(--sohoj-cut) 100%, 0 calc(100% - var(--sohoj-cut)));
}

.ang-hover {
	transition: transform 0.18s ease;
}

.ang-hover:hover {
	transform: translateY(-3px);
}

.chip,
.ang-btn {
	display: inline-block;
	border: 2px solid var(--sohoj-border);
	background: var(--sohoj-surface);
	color: var(--sohoj-text);
	text-decoration: none;
	padding: 7px 12px;
	line-height: 1;
	font-weight: 700;
	font-family: 'Tiro Bangla', sans-serif;
	user-select: none;
	clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

.chip:hover,
.ang-btn:hover {
	background: var(--sohoj-heading);
	color: var(--sohoj-bg);
	border-color: var(--sohoj-heading);
}

.chip:focus-visible,
.ang-btn:focus-visible {
	outline: 2px solid var(--sohoj-heading);
	outline-offset: 2px;
}

.rl-grid {
	display: grid;
	gap: 22px;
}

.rl-thumb {
	aspect-ratio: 16 / 9;
	display: block;
	position: relative;
	background: var(--sohoj-border-soft);
	border-bottom: 2px solid var(--sohoj-border);
	overflow: hidden;
}

.rl-thumb img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Survey S4.19: no featured image → a navy panel naming the topic (cards) or
   the সহজ wordmark (.sb-thumb), instead of an empty grey box. Fixed navy in
   both themes, like the other solid brand blocks. */
.sohoj-thumb-fallback {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 1rem;
	background: var(--sohoj-primary-navy);
	color: var(--sohoj-bg-light);
	font-family: 'Tiro Bangla', sans-serif;
	font-size: clamp(1.1rem, 2.2vw, 1.5rem);
	line-height: 1.3;
	text-align: center;
}

.sohoj-thumb-fallback::after {
	content: '';
	position: absolute;
	left: 50%;
	bottom: 18%;
	width: 2.5rem;
	height: 3px;
	margin-left: -1.25rem;
	background: var(--sohoj-accent-cyan);
}

.sohoj-thumb-fallback-small {
	padding: 0;
	font-size: 0.85rem;
}

.sohoj-thumb-fallback-small::after {
	display: none;
}

/* ==========================================================================
   Site-wide application — existing buttons, share links, follow icons, and
   the topic-tag pill adopt the chamfer instead of সহজ's older flat-rectangle
   treatment. Pure CSS, targeting classes those components already emit —
   see ratlab_theme_implementation_plan.md Phase 1.3–1.5.
   ========================================================================== */

/* 1.3 — generic buttons site-wide (block-editor buttons, form submits,
   pagination), keeping the amber CTA fill brand.css already sets and just
   adding the chamfer clip-path on top of it. */
.button,
.wp-block-button__link,
input[type="submit"],
button[type="submit"],
.sohoj-search-submit,
.page-numbers {
	border-radius: 0;
	clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

/* 1.4 — share buttons + follow icons: RL's chip mechanics (border, hover
   invert, chamfer) laid over these components' existing markup/colors
   instead of the older flat-rectangle border. */
.sohoj-share-buttons button,
.sohoj-share-buttons a,
.sohoj-social-links a {
	clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

/* 1.5 — topic-tag pill above single-post headlines / on cards. Keeps its
   fixed maroon fill (a deliberate solid-color brand device, same reasoning
   as brand.css's other fixed-color blocks) and just gains the chamfer. */
.sohoj-topic-tag {
	clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

/* ==========================================================================
   Two-column layout + chamfered sidebar boxes — shared by category.php
   (Phase 2.4) and single.php (Phase 3.3-3.5), promoted here from
   rl-archive.css once single.php needed the same primitives, so both
   templates read one definition instead of two.
   ========================================================================== */

.rl-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 1.75rem;
	align-items: start;
}

@media (max-width: 980px) {
	.rl-layout {
		grid-template-columns: 1fr;
	}
}

.rl-sidebar {
	position: relative;
}

.rl-sticky {
	position: sticky;
	top: 1.5rem;
}

.sb-card {
	margin-bottom: 1.5rem;
}

.sb-title {
	font-family: 'Tiro Bangla', sans-serif;
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--sohoj-heading);
	margin: 0 0 0.75rem;
}

.sb-muted {
	font-family: 'Tiro Bangla', sans-serif;
	color: var(--sohoj-text-muted);
	font-size: 0.9rem;
}

.sb-post {
	display: grid;
	grid-template-columns: 60px 1fr;
	gap: 0.65rem;
	align-items: center;
	padding: 0.6rem 0;
	border-top: 2px solid var(--sohoj-border-soft);
}

.sb-post:first-child {
	border-top: none;
	padding-top: 0;
}

.sb-thumb {
	position: relative;
	width: 60px;
	height: 42px;
	background: var(--sohoj-border-soft);
	overflow: hidden;
	border: 2px solid var(--sohoj-border);
}

.sb-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sb-post a {
	font-family: 'Tiro Bangla', sans-serif;
	font-size: 0.9rem;
	line-height: 1.4;
	color: var(--sohoj-text);
	text-decoration: none;
}

.sb-post a:hover {
	color: var(--sohoj-heading);
	text-decoration: underline;
}
