/* TECHCRUSH MEDIA — Design v2
 * თემის სტილების ზემოდან მოდებული დახვეწა: იერარქია, კონტრასტი, ფორმების სისტემა, წვდომადობა.
 * თემის ფაილები არ იცვლება; ამ ფაილის გამორთვა საიტს ძველ იერზე აბრუნებს.
 *
 * ფორმების სისტემა:  6 ბეჯი · 10 კონტროლი · 14 ბარათი · 16 დიდი ზედაპირი · 999 აბრეშუმი
 * აქცენტი: ფერადი შევსება თეთრ ტექსტზე = --tc-fill (≥ 4.5:1); წითელი ტექსტი = --tc-red-ink
 */

:root {
	--tc-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
	--tc-r-badge: 6px;
	--tc-r-control: 10px;
	--tc-r-card: 14px;
	--tc-r-surface: 16px;
	--tc-fill: #d4342d;
	--tc-fill-hover: #bd2c26;
	--tc-red-ink: #c4271f;
	--tc-focus: #c4271f;
	--tc-hair: rgba(17, 19, 24, 0.1);
	--tc-muted: #5b6270;
	--tc-measure: 46rem;
}

body.is-dark-theme {
	--tc-red-ink: #ff6f66;
	--tc-focus: #ff9a92;
	--tc-hair: rgba(255, 255, 255, 0.1);
	--tc-muted: rgba(234, 238, 245, 0.72);
}

html {
	scroll-padding-top: 96px;
}

::selection {
	background: color-mix(in srgb, var(--cg-primary, #ef3f37) 38%, transparent);
}

/* ─────────── ფოკუსი: ერთი, თანმიმდევრული რგოლი ─────────── */

body :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--tc-focus);
	outline-offset: 3px;
}

body :where(input, textarea, select):focus-visible {
	outline-offset: 1px;
}

/* ─────────── სათაურების რიტმი (ქართული ტექსტი: მეტი ინტერლიენი) ─────────── */

body :where(h1, h2, h3) {
	text-wrap: balance;
}

body .cg-section-head h2,
body .cg-home-sidebar h2,
body .cg-sidebar-panel h2,
body .widget-title {
	font-size: clamp(19px, 0.7vw + 15px, 23px);
	line-height: 1.25;
}

body .cg-section-head {
	margin-bottom: 20px;
}

/* ─────────── განცხადების ზორი: კონტრასტი ─────────── */

body .cg-announce-strip {
	background: var(--tc-fill);
}

body .cg-announce-tag {
	border-radius: var(--tc-r-badge);
	color: #b3231c;
}

/* ─────────── ჰედერი: ტაბლეტზე მოქმედებები მარჯვნივ ─────────── */

@media (max-width: 900px) {
	body .cg-header-inner {
		grid-template-columns: auto 1fr;
	}

	body .cg-header-actions {
		justify-self: end;
	}
}

body .cg-icon-button {
	transition: background 0.2s var(--tc-ease), border-color 0.2s var(--tc-ease), color 0.2s var(--tc-ease), transform 0.2s var(--tc-ease);
}

/* ─────────── დიდი ზედაპირები: ერთი რადიუსი ─────────── */

body .cg-hero-card,
body .cg-home-sidebar,
body .cg-podcast-band,
body .cg-newsletter,
body .cg-projects-section .cg-project-card,
body .cg-archive-hero,
body .cg-page-header,
body .cg-search-hero,
body .cg-author-hero,
body .cg-author-box,
body .cg-sidebar-panel,
body .cg-widget {
	border-radius: var(--tc-r-surface);
}

body .cg-card,
body .cg-adjacent,
body .cg-category-card,
body .cg-project-card {
	border-radius: var(--tc-r-card);
}

body .cg-outline-link,
body .cg-podcast-band a,
body .cg-newsletter input,
body .cg-newsletter button,
body .cg-feed-filter,
body .cg-cat-filter a {
	border-radius: var(--tc-r-control);
}

body .cg-feed-filter button {
	border-radius: 7px;
}

body .cg-section-badge {
	border-radius: var(--tc-r-badge);
}

/* ─────────── შევსებული აქცენტები: თეთრი ტექსტი ≥ 4.5:1 ─────────── */

body .cg-feed-filter button.is-active,
body.is-dark-theme .cg-feed-filter button.is-active,
body.is-dark-theme .cg-cat-filter a.is-active,
body.is-dark-theme .page-numbers.current,
body .cg-podcast-band a,
body.is-dark-theme .cg-podcast-band a,
body .cg-newsletter button,
body.is-dark-theme .cg-newsletter button,
body .cg-section-badge--design,
body.is-dark-theme .cg-section-badge--design {
	background: var(--tc-fill);
	color: #fff;
}

body .cg-podcast-band a:hover,
body.is-dark-theme .cg-podcast-band a:hover,
body .cg-newsletter button:hover,
body.is-dark-theme .cg-newsletter button:hover {
	background: var(--tc-fill-hover);
	color: #fff;
}

/* ─────────── ბარათი: სათაური მეთაურობს ─────────── */

body .cg-card {
	position: relative;
	transition: transform 0.28s var(--tc-ease), box-shadow 0.28s var(--tc-ease), border-color 0.28s var(--tc-ease);
}

body .cg-card-body {
	gap: 8px;
	padding: 16px 18px 18px;
}

body .cg-card-body > .cg-card-meta {
	margin-top: auto;
}

/* სექციის ბეჯი სურათზე ზის (ქვიზის ბარათების მსგავსად), ტექსტის ბლოკში კი ერთი წყნარი ეტიკეტი რჩება */
body .cg-card:not(.cg-card-large) .cg-section-badge {
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border-radius: 999px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
	left: 12px;
	margin: 0;
	padding: 5px 11px;
	position: absolute;
	top: 12px;
	z-index: 3;
}

body.is-dark-theme .cg-card:not(.cg-card-large) .cg-section-badge--tech {
	background: rgba(8, 11, 16, 0.74);
	border-color: rgba(255, 255, 255, 0.2);
	color: #fff;
}

body .cg-card .cg-card-cat {
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.55;
	position: relative;
	z-index: 2;
}

body:not(.is-dark-theme) .cg-card .cg-card-cat,
body:not(.is-dark-theme) .cg-mini-post .cg-mini-cat {
	color: var(--tc-red-ink) !important;
}

body .cg-card h3 {
	font-size: clamp(16px, 0.35vw + 14.6px, 18px);
	font-weight: 750;
	line-height: 1.4;
}

body .cg-card:not(.cg-card-large) h3 {
	font-size: clamp(16px, 0.35vw + 14.6px, 18px);
}

body .cg-card-body > p:not(.cg-card-meta) {
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	color: var(--tc-muted);
	display: -webkit-box;
	font-size: 14px;
	line-height: 1.65;
	margin: 0;
	overflow: hidden;
}

body .cg-card-meta {
	color: var(--tc-muted);
	font-size: 12.5px;
}

/* მთლიანი ბარათი დაჭერადია: ბმული სათაურზე იჭიმება, ბეჯი და კატეგორია ცალკე ბმულებად რჩება */
body .cg-card:not(.cg-card-large):not(.cg-quiz-card) h3 a::after {
	content: "";
	inset: 0;
	position: absolute;
	z-index: 1;
}

body .cg-card-image {
	overflow: hidden;
}

body .cg-card-image img {
	transition: transform 0.6s var(--tc-ease);
}

@media (hover: hover) and (pointer: fine) {
	body .cg-card:hover {
		transform: translateY(-3px);
	}

	body .cg-card:hover .cg-card-image img {
		transform: scale(1.04);
	}

	body .cg-card:hover h3 a {
		color: var(--tc-red-ink);
	}
}

@media (hover: none) {
	body .cg-card:hover {
		transform: none;
	}
}

/* ─────────── ბოლო სიახლეების სია (გვერდითი პანელი) ─────────── */

body .cg-mini-post {
	gap: 14px;
}

body .cg-mini-post .cg-mini-cat {
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.5;
	margin-bottom: 4px;
}

body .cg-mini-post strong {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.42;
}

body .cg-mini-post span > em:last-child {
	color: var(--tc-muted);
	font-size: 12px;
	margin-top: 4px;
}

body .cg-mini-post img {
	border-radius: 10px;
}

@media (hover: hover) and (pointer: fine) {
	body .cg-mini-post:hover strong {
		color: var(--tc-red-ink);
	}
}

/* ─────────── მთავარი სლაიდერი: წაკითხვადობა ─────────── */

body .cg-hero-card {
	isolation: isolate;
}

body .cg-hero-card::before {
	background:
		linear-gradient(90deg, rgba(6, 8, 12, 0.9) 0%, rgba(6, 8, 12, 0.8) 46%, rgba(6, 8, 12, 0.42) 66%, rgba(6, 8, 12, 0.1) 84%, rgba(6, 8, 12, 0) 94%),
		linear-gradient(0deg, rgba(6, 8, 12, 0.62) 0%, rgba(6, 8, 12, 0) 38%);
	content: "";
	inset: 0;
	pointer-events: none;
	position: absolute;
	z-index: 0;
}

body .cg-hero-card > * {
	z-index: 1;
}

@media (max-width: 760px) {
	/* ვიწო ეკრანზე ტექსტი მთლიან სიგრძეს იკივებს, ამიტომ დაჩრდილვა ქვემოდან მოდის და სურათი ზემოთ რჩება ხილული */
	body .cg-hero-card {
		min-height: 470px;
	}

	body .cg-hero-card::before {
		background: linear-gradient(0deg, rgba(6, 8, 12, 0.94) 0%, rgba(6, 8, 12, 0.8) 46%, rgba(6, 8, 12, 0.18) 100%);
	}
}

body .cg-hero-card .cg-hero-slide {
	align-items: flex-end;
	display: flex;
	padding-bottom: 6px;
}

body .cg-hero-card .cg-hero-title,
body .cg-hero-card h1 {
	font-size: clamp(27px, 1.2vw + 20px, 36px);
	line-height: 1.17;
	margin: 14px 0 14px;
	text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

body .cg-hero-card p {
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	display: -webkit-box;
	line-height: 1.75;
	overflow: hidden;
	text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}

body .cg-hero-card .cg-hero-cat {
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

body .cg-hero-card .cg-hero-cat {
	color: #ff8f87 !important;
}

/* ─────────── გვერდების გადამრთველი (მარჯვენა რელსი) ─────────── */

body .cg-step-slider-dots button {
	min-height: 36px;
	min-width: 26px;
}

/* ─────────── პოდკასტის ზორი ─────────── */

body .cg-podcast-band > div:first-child > span {
	color: #ff8f87;
	font-size: 11px;
	letter-spacing: 0.14em;
}

body .cg-podcast-band::after {
	-webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.32) 34%, #000 80%);
	mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.32) 34%, #000 80%);
	opacity: 0.55;
}

body .cg-podcast-band h2 {
	font-size: clamp(22px, 0.9vw + 17px, 28px);
	text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

body .cg-podcast-player {
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	background: rgba(8, 10, 14, 0.58);
	border-color: rgba(255, 255, 255, 0.16);
	border-radius: var(--tc-r-card);
}

body .cg-podcast-player em {
	color: rgba(255, 255, 255, 0.9);
}

/* ─────────── პროექტები: მთლიან სიგრძეზე ─────────── */

body .cg-projects-section .cg-project-strip {
	width: 100%;
}

/* ─────────── ფუტერი ─────────── */

body .cg-footer-grid {
	gap: 40px 48px;
	grid-template-columns: minmax(240px, 1.5fr) repeat(3, minmax(0, 1fr));
}

@media (max-width: 1100px) {
	body .cg-footer-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	body .cg-footer-brand {
		grid-column: 1 / -1;
	}
}

@media (max-width: 560px) {
	body .cg-footer-grid {
		grid-template-columns: 1fr;
	}
}

body .cg-footer-section h2 {
	font-size: 12px;
	letter-spacing: 0.12em;
}

body .cg-footer-menu a {
	color: rgba(243, 246, 251, 0.86);
	font-size: 14.5px;
	font-weight: 600;
	transition: color 0.18s var(--tc-ease);
}

body .cg-footer-menu a:hover {
	color: #fff;
	text-decoration: underline;
	text-decoration-color: var(--cg-primary, #ef3f37);
	text-decoration-thickness: 2px;
	text-underline-offset: 5px;
}

body .cg-footer-brand p {
	font-size: 14px;
	line-height: 1.75;
	max-width: 34ch;
}

body .cg-logo-footer {
	align-items: center;
	gap: 12px;
	max-width: none;
	white-space: nowrap;
}

body .cg-logo-footer::after {
	color: #fff;
	content: "TECHCRUSH MEDIA";
	font-family: var(--cg-font-heading, inherit);
	font-size: 17px;
	font-weight: 800;
	letter-spacing: 0.02em;
}

body:not(.is-dark-theme) .cg-site-footer .cg-logo-footer::after {
	color: inherit;
}

/* ─────────── სტატია: საკითხავი ტიპოგრაფია ─────────── */

body.single .cg-entry-content > :where(p, ul, ol, h2, h3, h4, blockquote, figcaption, .wp-block-heading) {
	max-width: var(--tc-measure);
}

body.single .cg-entry-content {
	hyphens: manual;
	overflow-wrap: break-word;
}

body.single .cg-entry-content > p {
	font-size: 17.5px;
	line-height: 1.95;
	margin: 0 0 1.35em;
}

@media (max-width: 600px) {
	body.single .cg-entry-content > p {
		font-size: 17px;
		line-height: 1.85;
	}
}

body.single .cg-entry-content > :where(h2, .cg-entry-h) {
	font-family: var(--cg-font-heading, inherit);
	font-size: clamp(21px, 0.9vw + 17px, 26px);
	font-weight: 800;
	line-height: 1.3;
	margin: 2.1em 0 0.7em;
	padding-top: 0.15em;
	scroll-margin-top: 110px;
}

body.single .cg-entry-content > h3 {
	font-family: var(--cg-font-heading, inherit);
	font-size: clamp(18px, 0.5vw + 16px, 21px);
	font-weight: 750;
	line-height: 1.35;
	margin: 1.8em 0 0.6em;
}

/* სათაურად გამოწერილი პარაგრაფი (თუ ფილტრი არ ვრცელდება) */
body.single .cg-entry-content > p:has(> :is(strong, b):only-child):not(:has(a)) {
	font-family: var(--cg-font-heading, inherit);
	font-size: clamp(20px, 0.8vw + 16.5px, 25px);
	line-height: 1.32;
	margin-bottom: 0.7em;
	margin-top: 2em;
}

body.single .cg-entry-content > p:has(> :is(strong, b):only-child):not(:has(a)) :is(strong, b) {
	font-weight: 800;
}

body.single .cg-entry-content figure {
	margin: 2em 0 2.2em;
}

body.single .cg-entry-content figcaption {
	border-left: 2px solid var(--tc-hair);
	color: var(--tc-muted);
	font-family: var(--cg-font-meta, inherit);
	font-size: 13.5px;
	line-height: 1.65;
	margin-top: 12px;
	padding-left: 12px;
}

body.single .cg-entry-content figure img {
	border-radius: var(--tc-r-card);
}

body.single .cg-entry-content blockquote {
	border-left: 3px solid var(--cg-primary, #ef3f37);
	font-size: 1.06em;
	font-style: normal;
	line-height: 1.8;
	margin: 1.8em 0;
	padding: 4px 0 4px 20px;
}

body.single .cg-entry-content a:not(.wp-block-button__link) {
	text-decoration: underline;
	text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	transition: text-decoration-color 0.2s var(--tc-ease), color 0.2s var(--tc-ease);
}

body.single .cg-entry-content a:not(.wp-block-button__link):hover {
	text-decoration-color: currentColor;
}

body.single .cg-entry-content ul,
body.single .cg-entry-content ol {
	line-height: 1.85;
	padding-left: 1.3em;
}

body.single .cg-entry-content li + li {
	margin-top: 0.4em;
}

body.single h1 {
	font-size: clamp(27px, 1.5vw + 20px, 40px);
	line-height: 1.22;
}

/* ─────────── არქივის სათაური ─────────── */

body .cg-archive-hero h1,
body .cg-page-header h1 {
	font-size: clamp(28px, 1.6vw + 20px, 42px);
	line-height: 1.18;
}

/* ─────────── შემცირებული მოძრაობა ─────────── */

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	body *,
	body *::before,
	body *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}

	body .cg-card:hover,
	body .cg-card:hover .cg-card-image img {
		transform: none;
	}
}

/* სტატიის ბმულები ღია თემაში: ტექსტის კონტრასტი ≥ 4,5:1 */
body:not(.is-dark-theme) .cg-entry-content a:not(.wp-block-button__link) {
	color: var(--tc-red-ink);
}
