/*
 * Author: Tobalt — https://tobalt.lt
 * Tandemum editorial layouts — used on /darbai/ + /irankiai/ archives + single templates.
 * Reuses tandemum brand palette (pink #ff7582, blue #2fbdff, dark #181a1c) + Outfit/Open Sans.
 * Structure/interactivity adapted from Lovable references; visual identity stays tandemum.
 *
 * Sections in this file:
 *   1. Editorial hero (mixed-type H1 with italic emphasis)
 *   2. Filter chips (client-side JS-driven)
 *   3. Portfolio 2-col grid (Lovable Halcyon pattern)
 *   4. Tools 3-col gradient grid (Lovable Kuriame Įrankius pattern)
 *   5. Single portfolio refinements (hero polish, KPI rhythm, slices)
 *   6. Single irankis refinements
 *   7. Scroll-reveal animation
 *   8. Mobile responsive
 */

/* =========================================================================
 * 1. EDITORIAL HERO
 * Big editorial H1 with italic emphasis. Used on archives + singles.
 * ========================================================================= */
.editorial-hero {
	padding: 8rem 0 4rem;
}
.editorial-hero .container {
	max-width: 1200px;
}
.editorial-hero__eyebrow {
	display: inline-block;
	font-family: "Open Sans", sans-serif;
	font-size: 0.875rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #828385;
	margin-bottom: 1.25rem;
}
.editorial-hero__title {
	font-family: "Outfit", sans-serif;
	font-size: clamp(2.5rem, 6vw, 5rem);
	font-weight: 500;
	line-height: 1.05;
	letter-spacing: -0.02em;
	color: #181a1c;
	margin: 0 0 1.5rem;
	max-width: 900px;
	text-wrap: balance;
}
.editorial-hero__title em {
	font-style: italic;
	font-weight: 400;
	color: #ff7582;
}
.editorial-hero__title em.alt {
	color: #2fbdff;
}
.editorial-hero__lead {
	font-family: "Open Sans", sans-serif;
	font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
	font-weight: 400;
	line-height: 1.55;
	color: #4a4b4d;
	max-width: 640px;
	margin: 0;
}
.editorial-hero__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 2rem;
	margin-top: 2rem;
	font-family: "Open Sans", sans-serif;
	font-size: 0.875rem;
	color: #828385;
}

/* =========================================================================
 * 2. FILTER CHIPS
 * JS-driven (data-cat attribute). Active state matches tandemum brand.
 * ========================================================================= */
.editorial-filter {
	padding: 1rem 0 3rem;
	border-bottom: 1px solid #edf1f5;
}
.editorial-filter__bar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}
.editorial-filter__chip {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1.125rem;
	border: 1px solid #d9dbe0;
	border-radius: 999px;
	background: #fff;
	color: #181a1c;
	font-family: "Open Sans", sans-serif;
	font-size: 0.875rem;
	font-weight: 500;
	letter-spacing: 0.01em;
	cursor: pointer;
	transition: all 0.2s ease;
	text-decoration: none;
}
.editorial-filter__chip:hover {
	border-color: #181a1c;
	background: #f8f9fa;
}
.editorial-filter__chip[aria-pressed="true"] {
	background: #181a1c;
	border-color: #181a1c;
	color: #fff;
}
.editorial-filter__chip-count {
	font-size: 0.75rem;
	font-weight: 400;
	color: inherit;
	opacity: 0.6;
}
.editorial-filter__chip[aria-pressed="true"] .editorial-filter__chip-count {
	opacity: 0.7;
}

/* =========================================================================
 * 3. PORTFOLIO GRID — full-bleed 3-col smaller items, vertical scroll
 * Updated 2026-05-25: from 2-col container-bound to 3-col full-bleed.
 * Items smaller for denser scroll; image quality bumped to "full" + srcset.
 * ========================================================================= */
.editorial-portfolio {
	padding: 3rem 0 6rem;
}
/* Full-bleed: override .container max-width inside this section only */
.editorial-portfolio > .container {
	max-width: none !important;
	padding-left: clamp(1.5rem, 3vw, 3rem);
	padding-right: clamp(1.5rem, 3vw, 3rem);
	width: 100%;
}
.editorial-portfolio__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2.5rem 1.75rem;
}
.editorial-portfolio__card {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	transition: transform 0.3s ease;
}
.editorial-portfolio__card:hover {
	color: inherit;
	text-decoration: none;
}
.editorial-portfolio__cover {
	position: relative;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	border-radius: 10px;
	background: #f1f5f9;
	margin-bottom: 1rem;
}
.editorial-portfolio__cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	image-rendering: -webkit-optimize-contrast;
	transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.editorial-portfolio__card:hover .editorial-portfolio__cover img {
	transform: scale(1.04);
}
.editorial-portfolio__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem 0.875rem;
	font-family: "Open Sans", sans-serif;
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #828385;
	margin-bottom: 0.375rem;
}
.editorial-portfolio__meta-cat {
	color: #ff7582;
}
.editorial-portfolio__title {
	font-family: "Outfit", sans-serif;
	font-size: clamp(1.125rem, 1.5vw, 1.4375rem);
	font-weight: 500;
	line-height: 1.25;
	letter-spacing: -0.01em;
	color: #181a1c;
	margin: 0;
	text-wrap: balance;
}
.editorial-portfolio__title em {
	font-style: italic;
	font-weight: 400;
	color: #ff7582;
}
.editorial-portfolio__tagline {
	font-family: "Open Sans", sans-serif;
	font-size: 0.875rem;
	color: #4a4b4d;
	margin-top: 0.375rem;
	line-height: 1.45;
}

/* Empty state */
.editorial-empty {
	text-align: center;
	padding: 6rem 0;
	color: #828385;
	font-family: "Open Sans", sans-serif;
}

/* =========================================================================
 * 4. TOOLS 3-COL GRADIENT GRID
 * Lovable Kuriame Įrankius pattern: 3-col cards with gradient backgrounds.
 * Gradients use tandemum pink/blue palette in 6 deterministic variants.
 * ========================================================================= */
.editorial-tools {
	padding: 4rem 0 8rem;
}
.editorial-tools__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2rem;
}
.editorial-tools__card {
	position: relative;
	display: flex;
	flex-direction: column;
	border-radius: 16px;
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	background: #f1f5f9;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	min-height: 320px;
}
.editorial-tools__card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 32px rgba(24, 26, 28, 0.08);
	color: inherit;
	text-decoration: none;
}
.editorial-tools__cover {
	flex: 0 0 160px;
	display: flex;
	align-items: flex-start;
	justify-content: flex-start;
	padding: 1.25rem;
}
.editorial-tools__status {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.375rem 0.875rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.85);
	font-family: "Open Sans", sans-serif;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: #181a1c;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}
.editorial-tools__body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	padding: 1.5rem 1.5rem 1.75rem;
	background: #fff;
}
.editorial-tools__title {
	font-family: "Outfit", sans-serif;
	font-size: 1.25rem;
	font-weight: 500;
	line-height: 1.3;
	color: #181a1c;
	margin: 0 0 0.625rem;
	text-wrap: balance;
}
.editorial-tools__desc {
	font-family: "Open Sans", sans-serif;
	font-size: 0.9375rem;
	color: #4a4b4d;
	line-height: 1.55;
	margin: 0 0 1.25rem;
	flex: 1 1 auto;
}
.editorial-tools__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-family: "Open Sans", sans-serif;
	font-size: 0.875rem;
	font-weight: 600;
	color: #181a1c;
	margin-top: auto;
}
.editorial-tools__cta::after {
	content: "→";
	transition: transform 0.2s ease;
}
.editorial-tools__card:hover .editorial-tools__cta::after {
	transform: translateX(4px);
}

/* 2 brand-color gradients alternating (per Tomas: only 2 colors total). Pink + blue. */
.editorial-tools__card:nth-child(odd) .editorial-tools__cover { background: linear-gradient(135deg, #ff7582 0%, #ffb5b5 100%); }
.editorial-tools__card:nth-child(even) .editorial-tools__cover { background: linear-gradient(135deg, #2fbdff 0%, #a0e0ff 100%); }

/* =========================================================================
 * 5. SINGLE PORTFOLIO REFINEMENTS
 * Polishing existing single-portfolio template visual rhythm.
 * ========================================================================= */
.portfolio-single .editorial-hero {
	padding: 6rem 0 3rem;
}
.portfolio-single__cover {
	margin-top: 3rem;
	border-radius: 16px;
	overflow: hidden;
	background: #f1f5f9;
}
.portfolio-single__cover img {
	width: 100%;
	height: auto;
	display: block;
}
.portfolio-single__story {
	padding: 5rem 0;
}
.portfolio-single__story-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 3rem;
}
.portfolio-single__story-block h2 {
	font-family: "Outfit", sans-serif;
	font-size: 1.25rem;
	font-weight: 500;
	color: #828385;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	margin: 0 0 1rem;
}
.portfolio-single__story-block p,
.portfolio-single__story-block li {
	font-family: "Open Sans", sans-serif;
	font-size: 1rem;
	line-height: 1.6;
	color: #181a1c;
}
.portfolio-single__story-block ul {
	padding-left: 1.25rem;
}

/* =========================================================================
 * 6. SINGLE IRANKIS REFINEMENTS
 * ========================================================================= */
.irankis-single .editorial-hero {
	padding: 6rem 0 3rem;
}

/* =========================================================================
 * 7. SCROLL-REVEAL ANIMATION
 * Triggered by JS IntersectionObserver adding .is-visible class.
 * ========================================================================= */
.reveal {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
				transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.is-visible {
	opacity: 1;
	transform: translateY(0);
}
.reveal--delay-1 { transition-delay: 0.08s; }
.reveal--delay-2 { transition-delay: 0.16s; }
.reveal--delay-3 { transition-delay: 0.24s; }
.reveal--delay-4 { transition-delay: 0.32s; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
	.reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}
	.editorial-portfolio__card:hover .editorial-portfolio__cover img {
		transform: none;
	}
}

/* =========================================================================
 * 8. MOBILE RESPONSIVE
 * ========================================================================= */
@media (max-width: 991.98px) {
	.editorial-portfolio__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 2rem 1.5rem;
	}
	.editorial-tools__grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.portfolio-single__story-grid {
		grid-template-columns: 1fr;
		gap: 2rem;
	}
}
@media (max-width: 767.98px) {
	.editorial-hero {
		padding: 4rem 0 2rem;
	}
	.editorial-portfolio,
	.editorial-tools {
		padding: 2rem 0 4rem;
	}
	.editorial-portfolio__grid {
		grid-template-columns: 1fr;
		gap: 2.5rem;
	}
	.editorial-tools__grid {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}
	.editorial-filter {
		padding: 1rem 0 2rem;
	}
	.editorial-filter__bar {
		overflow-x: auto;
		flex-wrap: nowrap;
		-webkit-overflow-scrolling: touch;
		padding-bottom: 0.5rem;
	}
	.editorial-filter__chip {
		flex-shrink: 0;
	}
}

/* =========================================================================
 * 9. ARCHIVE CONVERSION CTA — bottom of /projektai/ (added 2026-05-25)
 * Cold researcher who finished scrolling all portfolio items gets a next step.
 * ========================================================================= */
.editorial-archive-cta {
	padding: 2rem 0 6rem;
}
.editorial-archive-cta__panel {
	display: grid;
	grid-template-columns: 1.5fr 1fr;
	gap: 3rem;
	align-items: center;
	background: linear-gradient(135deg, rgba(255,117,130,0.06) 0%, rgba(47,189,255,0.06) 100%);
	border: 1px solid rgba(24,26,28,0.08);
	border-radius: 16px;
	padding: 3rem 3rem;
}
.editorial-archive-cta__title {
	font-family: "Outfit", sans-serif;
	font-size: clamp(1.75rem, 3vw, 2.5rem);
	font-weight: 500;
	line-height: 1.15;
	color: #181a1c;
	margin: 0.875rem 0 1rem;
	text-wrap: balance;
}
.editorial-archive-cta__title em {
	font-style: italic;
	font-weight: 400;
	color: #ff7582;
}
.editorial-archive-cta__lead {
	font-family: "Open Sans", sans-serif;
	font-size: 1.0625rem;
	color: #4a4b4d;
	line-height: 1.55;
	margin: 0;
	max-width: 480px;
}
.editorial-archive-cta__buttons {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}
.editorial-archive-cta__buttons .button {
	width: 100%;
	text-align: center;
}
@media (max-width: 767.98px) {
	.editorial-archive-cta__panel {
		grid-template-columns: 1fr;
		gap: 1.5rem;
		padding: 2rem 1.5rem;
	}
	.editorial-archive-cta__buttons { flex-direction: column; }
}

/* =========================================================================
 * 10. SINGLE PORTFOLIO PREV/NEXT NAVIGATION (added 2026-05-25)
 * Cold researcher who finished reading case study keeps browsing.
 * Same-category aware (passes 'portfolio_category' to get_previous_post).
 * ========================================================================= */
.portfolio-single__pager {
	padding: 3rem 0 1rem;
	border-top: 1px solid rgba(24,26,28,0.08);
	margin-top: 2rem;
}
.portfolio-single__pager-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.5rem;
}
.portfolio-single__pager-link {
	display: grid;
	grid-template-columns: 80px 1fr;
	grid-template-areas: 'thumb dir' 'thumb title';
	gap: 0.25rem 1rem;
	align-items: center;
	padding: 1rem;
	border: 1px solid rgba(24,26,28,0.08);
	border-radius: 12px;
	text-decoration: none;
	color: inherit;
	transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.portfolio-single__pager-link:hover {
	border-color: #ff7582;
	background: rgba(255,117,130,0.04);
	color: inherit;
	transform: translateY(-2px);
	text-decoration: none;
}
.portfolio-single__pager-link--next {
	text-align: right;
	grid-template-columns: 1fr 80px;
	grid-template-areas: 'dir thumb' 'title thumb';
}
.portfolio-single__pager-thumb { grid-area: thumb; }
.portfolio-single__pager-thumb img {
	width: 80px; height: 80px; object-fit: cover; border-radius: 8px; display: block;
}
.portfolio-single__pager-dir {
	grid-area: dir;
	font-family: "Open Sans", sans-serif;
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #828385;
}
.portfolio-single__pager-title {
	grid-area: title;
	font-family: "Outfit", sans-serif;
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.3;
	color: #181a1c;
}
@media (max-width: 575.98px) {
	.portfolio-single__pager-grid {
		grid-template-columns: 1fr;
		gap: 0.75rem;
	}
	.portfolio-single__pager-link--next {
		text-align: left;
		grid-template-columns: 80px 1fr;
		grid-template-areas: 'thumb dir' 'thumb title';
	}
}
