/**
 * Coffee Lab — shared primitives: Mtavruli headings, buttons, badges,
 * grids and empty states.
 */

[class^="cl-"],
[class*=" cl-"],
[class^="cl-"] *,
[class*=" cl-"] * {
	box-sizing: border-box;
}

/* ---------------------------------------------------------------------------
 * Georgian Mtavruli
 *
 * Georgian has a dedicated set of capitals ("Mtavruli", U+1C90–U+1CBA).
 * Browsers map Mkhedruli to Mtavruli through text-transform:uppercase using the
 * Unicode 11 case mapping, and the `case` OpenType feature keeps punctuation
 * aligned with the taller capitals.
 *
 * `.cl-mtavruli` alone is inert: it only switches on when the document is
 * Georgian (body.cl-lang-ka), so a single template serves both languages — the
 * English version keeps its normal sentence case, the Georgian one renders in
 * Mtavruli exactly like the reference site.
 *
 * The line-height and letter-spacing below keep the capitals sitting on the
 * SAME line box as the surrounding text, so a title never jumps or re-wraps
 * when the language changes.
 * ------------------------------------------------------------------------ */

.cl-lang-ka .cl-mtavruli,
.cl-is-georgian .cl-mtavruli,
.cl-mtavruli--forced,
.cl-mtavruli--ka {
	text-transform: uppercase;
	font-feature-settings: "case" 1;
	font-variant-caps: normal;
	line-height: inherit;
	font-synthesis: none;
}

/* Georgian capitals carry more optical weight — pull the tracking in a touch
   and keep the block on one line box. */
.cl-lang-ka .cl-mtavruli,
.cl-is-georgian .cl-mtavruli,
.cl-mtavruli--ka {
	letter-spacing: -0.005em;
	text-wrap: balance;
}

/* Latin text inside a forced-uppercase heading keeps a hair of tracking so it
   does not look cramped next to Mtavruli. */
.cl-mtavruli--forced:not(.cl-mtavruli--ka) {
	letter-spacing: 0.01em;
}

/* ---------------------------------------------------------------------------
 * Layout helpers
 * ------------------------------------------------------------------------ */

.cl-container {
	width: 100%;
	max-width: var(--cl-container);
	margin-inline: auto;
	padding-inline: var(--cl-gutter);
}

.cl-container--wide {
	max-width: var(--cl-container-wide);
}

.cl-grid {
	display: grid;
	grid-template-columns: repeat(var(--cl-cols, 4), minmax(0, 1fr));
	gap: var(--cl-grid-gap, 24px);
}

@media (max-width: 1024px) {
	.cl-grid {
		grid-template-columns: repeat(var(--cl-cols-tablet, 3), minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.cl-grid {
		grid-template-columns: repeat(var(--cl-cols-mobile, 2), minmax(0, 1fr));
		gap: var(--cl-grid-gap-mobile, 14px);
	}
}

/* ---------------------------------------------------------------------------
 * Section heading
 * ------------------------------------------------------------------------ */

.cl-section-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 40px;
}

.cl-section-head--bare {
	justify-content: flex-end;
	margin-bottom: 24px;
}

.cl-section-head__main {
	min-width: 0;
}

.cl-section-head__aside {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
}

.cl-section-head__eyebrow {
	display: block;
	margin-bottom: 10px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 1.4px;
	text-transform: uppercase;
	color: var(--cl-grey-500);
}

.cl-section-head__title {
	margin: 0;
	font-family: var(--cl-font-heading);
	font-size: clamp(26px, 3.4vw, 44px);
	font-weight: 700;
	line-height: 1.15;
	color: var(--cl-text);
}

.cl-section-head__text {
	margin: 14px 0 0;
	max-width: 560px;
	color: var(--cl-text-muted);
	line-height: 1.65;
}

.cl-section-head__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	color: var(--cl-text);
	text-decoration: none;
	white-space: nowrap;
	transition: gap var(--cl-dur) var(--cl-ease), opacity var(--cl-dur) var(--cl-ease);
}

.cl-section-head__link:hover {
	gap: 14px;
	opacity: .72;
}

@media (max-width: 767px) {
	.cl-section-head {
		flex-direction: column;
		align-items: stretch;
		gap: 16px;
	}

	.cl-section-head[style*="center"] .cl-section-head__aside {
		justify-content: center;
	}
}

/* ---------------------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------------------ */

.cl-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 16px 32px;
	border: 1px solid transparent;
	border-radius: var(--cl-radius-pill);
	background-color: var(--cl-black);
	color: var(--cl-white);
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
	-webkit-appearance: none;
	appearance: none;
	transition:
		background-color var(--cl-dur) var(--cl-ease),
		color var(--cl-dur) var(--cl-ease),
		border-color var(--cl-dur) var(--cl-ease),
		transform var(--cl-dur) var(--cl-ease),
		box-shadow var(--cl-dur) var(--cl-ease);
}

.cl-btn:hover {
	background-color: var(--cl-white);
	color: var(--cl-black);
	border-color: var(--cl-black);
	transform: translateY(-2px);
}

.cl-btn:active {
	transform: translateY(0);
}

.cl-btn:focus-visible {
	outline: 2px solid var(--cl-black);
	outline-offset: 3px;
}

.cl-btn--outline {
	background-color: transparent;
	color: var(--cl-black);
	border-color: var(--cl-grey-300);
}

.cl-btn--outline:hover {
	background-color: var(--cl-black);
	color: var(--cl-white);
	border-color: var(--cl-black);
}

.cl-btn--light {
	background-color: var(--cl-white);
	color: var(--cl-black);
}

.cl-btn--light:hover {
	background-color: transparent;
	color: var(--cl-white);
	border-color: var(--cl-white);
}

.cl-btn--ghost {
	background-color: transparent;
	color: currentColor;
	border-color: transparent;
	padding-inline: 0;
}

.cl-btn--ghost:hover {
	transform: none;
	opacity: .7;
	background-color: transparent;
	border-color: transparent;
	color: currentColor;
}

.cl-btn--sm {
	padding: 11px 20px;
	font-size: 14px;
}

.cl-btn--block {
	width: 100%;
}

.cl-btn.is-disabled,
.cl-btn[disabled] {
	opacity: .45;
	pointer-events: none;
}

.cl-btn.is-loading {
	position: relative;
	color: transparent !important;
	pointer-events: none;
}

.cl-btn.is-loading svg {
	opacity: 0;
}

.cl-btn.is-loading::after {
	content: "";
	position: absolute;
	inset: 50% auto auto 50%;
	width: 18px;
	height: 18px;
	margin: -9px 0 0 -9px;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	color: var(--cl-white);
	animation: cl-spin .7s linear infinite;
}

.cl-btn--outline.is-loading::after,
.cl-btn--light.is-loading::after {
	color: var(--cl-black);
}

.cl-btn.is-added {
	background-color: var(--cl-success);
	border-color: var(--cl-success);
	color: var(--cl-white);
}

@keyframes cl-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ---------------------------------------------------------------------------
 * Badges, chips & pills
 * ------------------------------------------------------------------------ */

.cl-badge {
	display: inline-flex;
	align-items: center;
	padding: 6px 12px;
	border-radius: var(--cl-radius-pill);
	background-color: var(--cl-black);
	color: var(--cl-white);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .4px;
	line-height: 1;
}

.cl-badge--muted {
	background-color: var(--cl-grey-200);
	color: var(--cl-grey-700);
}

.cl-badge--light {
	background-color: var(--cl-white);
	color: var(--cl-black);
}

.cl-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	border: 1px solid var(--cl-grey-200);
	border-radius: var(--cl-radius-pill);
	background-color: var(--cl-white);
	color: var(--cl-text);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
	transition:
		background-color var(--cl-dur) var(--cl-ease),
		color var(--cl-dur) var(--cl-ease),
		border-color var(--cl-dur) var(--cl-ease);
}

.cl-chip:hover {
	border-color: var(--cl-grey-400);
}

.cl-chip.is-active,
.cl-chip[aria-pressed="true"] {
	background-color: var(--cl-black);
	border-color: var(--cl-black);
	color: var(--cl-white);
}

/* ---------------------------------------------------------------------------
 * Empty state & editor notice
 * ------------------------------------------------------------------------ */

.cl-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 72px 24px;
	border: 1px dashed var(--cl-grey-300);
	border-radius: var(--cl-radius-lg);
	color: var(--cl-text-muted);
	text-align: center;
}

.cl-empty__icon {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background-color: var(--cl-grey-100);
	color: var(--cl-grey-500);
}

.cl-empty p {
	margin: 0;
	font-size: 16px;
}

.cl-editor-notice {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 28px;
	border: 1px dashed var(--cl-grey-300);
	border-radius: var(--cl-radius-md);
	background-color: var(--cl-grey-50);
	color: var(--cl-grey-600);
	text-align: center;
	font-size: 14px;
}

.cl-editor-notice strong {
	color: var(--cl-black);
	font-size: 15px;
}

/* ---------------------------------------------------------------------------
 * Utilities
 * ------------------------------------------------------------------------ */

.cl-sr-only,
.cl-post-card .screen-reader-text,
.cl-product-card .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.cl-icon {
	flex-shrink: 0;
	display: block;
}

@media (prefers-reduced-motion: reduce) {
	.cl-btn,
	.cl-chip,
	.cl-section-head__link {
		transition-duration: .01ms;
	}

	.cl-btn:hover {
		transform: none;
	}
}
