/**
 * CodelabIT Portfolio Showcase — frontend styles.
 * Shared by the Elementor widget AND the plugin's own archive page
 * ("All Projects"), so both use exactly the same card/grid design.
 * Column counts and most spacing are controlled live via Elementor's
 * responsive controls (inline CSS) when used inside the widget; the
 * rules below provide the archive page's defaults and the core
 * hover-scroll mechanics used everywhere.
 *
 * Brand colors: #E00F7A (pink/magenta) and #2B3990 (navy).
 * Typeface: "Kanit" (enqueued by Codelabit_Elementor_Integration /
 * Codelabit_Portfolio_Template), falling back to the site's own
 * default sans-serif font if it's ever unavailable.
 */

.codelabit-portfolio-widget,
.codelabit-archive-hero,
.codelabit-archive-wrap {
	font-family: 'Kanit', sans-serif;
}

.codelabit-portfolio-widget {
	width: 100%;
}

.codelabit-portfolio-widget.is-loading .codelabit-portfolio-grid,
.codelabit-archive-grid.is-loading {
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.codelabit-portfolio-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	width: 100%;
}

.codelabit-portfolio-empty {
	text-align: center;
	color: #666;
}

.codelabit-portfolio-item {
	display: flex;
	flex-direction: column;
	background-color: #ffffff;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(43, 57, 144, 0.08);
	transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.codelabit-portfolio-item:hover {
	box-shadow: 0 12px 28px rgba(43, 57, 144, 0.16);
	transform: translateY(-4px);
}

.codelabit-portfolio-image-link {
	display: block;
}

/* Fixed-height box with hidden overflow: this is what makes the
   long full-page screenshot appear "cropped" until hovered. */
.codelabit-portfolio-image-wrap {
	position: relative;
	width: 100%;
	height: 350px;
	overflow: hidden;
	background-color: #f2f2f2;
}

/* The image itself keeps its natural (tall) height; JS moves it
   up/down with a CSS transform, this rule only sets the base state
   and transition so movement is smooth in both directions. */
.codelabit-portfolio-image {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	transform: translateY(0);
	transition: transform 0.4s ease;
	will-change: transform;
}

.codelabit-portfolio-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: #999999;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.codelabit-portfolio-content {
	padding: 20px 20px 24px;
	text-align: center;
}

.codelabit-portfolio-title {
	margin: 0 0 16px;
	font-size: 18px;
	line-height: 1.3;
	font-weight: 600;
	color: #2B3990;
}

.codelabit-portfolio-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.codelabit-portfolio-title a:hover,
.codelabit-portfolio-title a:focus {
	color: #E00F7A;
}

/* "View Live Site" card button — matches the single project page
   header button style (pill shape, arrow, brand colors). */
.codelabit-portfolio-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 28px;
	background-color: #E00F7A;
	color: #ffffff !important;
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	border-radius: 30px;
	box-shadow: 0 10px 22px rgba(224, 15, 122, 0.28);
	transition: background-color 0.3s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.codelabit-portfolio-btn:hover,
.codelabit-portfolio-btn:focus {
	background-color: #2B3990;
	color: #ffffff !important;
	transform: translateY(-2px);
	box-shadow: 0 14px 26px rgba(43, 57, 144, 0.32);
}

.codelabit-portfolio-btn-arrow {
	display: inline-block;
	transition: transform 0.25s ease;
}

.codelabit-portfolio-btn:hover .codelabit-portfolio-btn-arrow {
	transform: translateX(4px);
}

/* ---------- Category filter tabs ---------- */
/* Used on the archive page (always shown, plain links) and, when
   enabled, on the Elementor widget (AJAX buttons). Same classes, same
   design either way — see Codelabit_Portfolio_Render_Helper. */

.codelabit-portfolio-filter-tabs {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin: 0 0 32px;
}

.codelabit-portfolio-filter-tab {
	display: inline-flex;
	align-items: center;
	padding: 10px 24px;
	background-color: #ffffff;
	color: #2B3990;
	border: 1px solid rgba(43, 57, 144, 0.2);
	border-radius: 30px;
	font-family: inherit;
	font-weight: 600;
	font-size: 14px;
	line-height: 1.4;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.codelabit-portfolio-filter-tab:hover,
.codelabit-portfolio-filter-tab:focus {
	border-color: #E00F7A;
	color: #fff;
}

.codelabit-portfolio-filter-tab.is-active {
	background-color: #E00F7A;
	border-color: #E00F7A;
	color: #ffffff !important;
	box-shadow: 0 10px 22px rgba(224, 15, 122, 0.28);
}

.codelabit-portfolio-filter-tab.is-active:hover,
.codelabit-portfolio-filter-tab.is-active:focus {
	background-color: #2B3990;
	border-color: #2B3990;
	color: #ffffff !important;
}

/* ---------- Load More (Elementor widget AJAX pagination) ---------- */

.codelabit-portfolio-load-more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 40px;
}

.codelabit-portfolio-load-more-wrap[hidden] {
	display: none;
}

.codelabit-portfolio-load-more {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 13px 34px;
	background-color: #E00F7A;
	color: #ffffff;
	border: 0;
	cursor: pointer;
	font-weight: 600;
	font-size: 14px;
	border-radius: 30px;
	box-shadow: 0 10px 22px rgba(224, 15, 122, 0.28);
	transition: background-color 0.3s ease, transform 0.25s ease, box-shadow 0.25s ease, opacity 0.2s ease;
}

.codelabit-portfolio-load-more:hover:not(:disabled),
.codelabit-portfolio-load-more:focus:not(:disabled) {
	background-color: #2B3990;
	transform: translateY(-2px);
	box-shadow: 0 14px 26px rgba(43, 57, 144, 0.32);
}

.codelabit-portfolio-load-more:disabled,
.codelabit-portfolio-load-more.is-loading {
	opacity: 0.65;
	cursor: default;
	transform: none;
}

.codelabit-portfolio-load-more.is-loading .codelabit-portfolio-load-more-text::after {
	content: "\2026";
}

/* ---------- Archive page ("All Projects") specific ---------- */

.codelabit-archive-hero .codelabit-archive-description {
	max-width: 640px;
	margin: -14px auto 0;
	font-size: 16px;
	line-height: 1.7;
	opacity: 0.85;
}

.codelabit-archive-wrap {
	padding: 64px 0 80px;
	background-color: #f7f8fc;
}

.codelabit-archive-wrap .codelabit-single-container {
	max-width: 1280px;
}

.codelabit-archive-pagination {
	margin-top: 48px;
	display: flex;
	justify-content: center;
}

.codelabit-archive-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	margin: 0 4px;
	padding: 0 12px;
	border-radius: 999px;
	background-color: #ffffff;
	color: #2B3990;
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	box-shadow: 0 2px 10px rgba(43, 57, 144, 0.1);
	transition: background-color 0.2s ease, color 0.2s ease;
}

.codelabit-archive-pagination .page-numbers.current,
.codelabit-archive-pagination .page-numbers:hover,
.codelabit-archive-pagination .page-numbers:focus {
	background-color: #E00F7A;
	color: #ffffff;
}

.codelabit-archive-pagination .page-numbers.dots {
	background: none;
	box-shadow: none;
}

/* Fallback responsive behaviour in case the Elementor-generated
   media queries are ever unavailable (e.g. widget markup reused
   outside of Elementor). Elementor's own inline CSS from the
   "columns" responsive control will normally take precedence on
   widget instances; on the archive page these rules are what apply. */
@media (max-width: 1024px) {
	.codelabit-portfolio-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 767px) {
	.codelabit-portfolio-grid {
		grid-template-columns: repeat(1, 1fr);
	}
}
