/* RDW Project Showcase – frontend */

.rdw-ps {
	--rdw-orange: #ff5722;
	--rdw-orange-soft: #fff1ec;
	--rdw-bg: #fdfdfd;
	--rdw-text-dark: #111111;
	--rdw-text-muted: #888888;
	--rdw-border: #e6e6e6;
	--rdw-card-bg: #ffffff;
	--rdw-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-family: var(--rdw-font);
	box-sizing: border-box;
}
.rdw-ps *,
.rdw-ps *::before,
.rdw-ps *::after { box-sizing: border-box; }

.rdw-showcase-wrapper {
	background-color: var(--rdw-bg);
	padding: 40px 20px;
	border-radius: 24px;
	max-width: 1400px;
	margin: 0 auto;
	--rdw-shot-ratio: 16 / 10;
}

/* Neutralise theme / page-builder button styles inside the showcase. */
.rdw-ps button {
	font-family: var(--rdw-font);
	text-transform: none;
	letter-spacing: normal;
	text-shadow: none;
	min-height: 0;
	min-width: 0;
	margin: 0;
	line-height: 1.2;
	-webkit-appearance: none;
	appearance: none;
	text-decoration: none;
}
.rdw-ps button:focus { outline: none; }
.rdw-ps button:focus-visible { outline: 2px solid var(--rdw-orange); outline-offset: 2px; }
.rdw-ps [hidden] { display: none !important; }

/* ---------- Type buttons ---------- */
.rdw-ps .rdw-types-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 35px; }
.rdw-ps .rdw-type-btn {
	flex: 1; min-width: 160px; background: var(--rdw-card-bg); border: 1.5px solid var(--rdw-border);
	border-radius: 16px; padding: 24px 12px; text-align: center; cursor: pointer; transition: all 0.2s ease;
	display: flex; flex-direction: column; align-items: center; box-shadow: 0 4px 12px rgba(0,0,0,0.015);
	color: var(--rdw-text-dark);
}
.rdw-ps .rdw-type-btn:hover { background: var(--rdw-card-bg); border-color: var(--rdw-orange); color: var(--rdw-text-dark); }
.rdw-ps .rdw-type-icon { margin-bottom: 12px; color: var(--rdw-text-dark); display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; }
.rdw-ps .rdw-type-icon svg { width: 26px; height: 26px; }
.rdw-ps .rdw-type-btn strong { display: block; font-size: 15px; color: var(--rdw-text-dark); margin-bottom: 6px; font-weight: 700; line-height: 1.2; }
.rdw-ps .rdw-type-btn .rdw-type-sub { display: block; font-size: 12px; color: var(--rdw-text-muted); line-height: 1.2; font-weight: 400; }

.rdw-ps .rdw-type-btn.active,
.rdw-ps .rdw-type-btn.active:hover { background: var(--rdw-orange); border-color: var(--rdw-orange); box-shadow: 0 8px 20px rgba(255, 87, 34, 0.25); }
.rdw-ps .rdw-type-btn.active .rdw-type-icon,
.rdw-ps .rdw-type-btn.active strong,
.rdw-ps .rdw-type-btn.active .rdw-type-sub { color: #ffffff; }

/* ---------- Industry pills ---------- */
.rdw-ps .rdw-industries-section { margin-bottom: 40px; }
.rdw-ps .rdw-industries-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; }
.rdw-ps .rdw-industries-header h4 { margin: 0; font-size: 16px; font-weight: 700; color: var(--rdw-text-dark); line-height: 1.3; }
.rdw-ps .rdw-clear-btn { background: none; border: none; color: #d9534f; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 0; box-shadow: none; }
.rdw-ps .rdw-clear-btn:hover { background: none; color: #b52b27; }
.rdw-ps .rdw-industries-list { display: flex; flex-wrap: wrap; gap: 10px; }
.rdw-ps .rdw-pill { background: var(--rdw-card-bg); border: 1.5px solid var(--rdw-border); color: var(--rdw-text-muted); padding: 10px 22px; border-radius: 30px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; box-shadow: none; }
.rdw-ps .rdw-pill:hover { background: var(--rdw-card-bg); border-color: var(--rdw-orange); color: var(--rdw-orange); }
.rdw-ps .rdw-pill.active,
.rdw-ps .rdw-pill.active:hover { background: var(--rdw-orange); border-color: var(--rdw-orange); color: #fff; }

/* ---------- Results ---------- */
.rdw-ps .rdw-results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; gap: 12px; flex-wrap: wrap; }
.rdw-ps .rdw-results-header h2 { margin: 0; font-size: 26px; font-weight: 800; color: var(--rdw-text-dark); line-height: 1.2; }
.rdw-ps .rdw-showing-text { font-size: 15px; color: var(--rdw-text-muted); font-weight: 500; }

.rdw-ps .rdw-projects-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; transition: opacity 0.3s ease; }
.rdw-ps .rdw-projects-grid.rdw-loading { opacity: 0.4; pointer-events: none; }
.rdw-ps .rdw-grid-message { grid-column: 1 / -1; text-align: center; padding: 40px; color: var(--rdw-text-muted); }

/* ---------- Card ---------- */
.rdw-ps .rdw-card { background: var(--rdw-card-bg); border-radius: 20px; overflow: hidden; text-decoration: none; display: flex; flex-direction: column; border: 1px solid var(--rdw-border); box-shadow: 0 10px 30px rgba(0,0,0,0.03); transition: transform 0.3s ease, box-shadow 0.3s ease; color: inherit; }
.rdw-ps .rdw-card:hover,
.rdw-ps .rdw-card:focus-visible { transform: translateY(-6px); box-shadow: 0 15px 40px rgba(0,0,0,0.08); text-decoration: none; }

.rdw-ps .rdw-card-img-wrap { padding: 16px 16px 0 16px; background: #ffffff; }

/* The frame has exactly the shape of the captured screen, so the
   above-the-fold screenshot fills it edge to edge. */
.rdw-ps .rdw-card-media {
	position: relative;
	width: 100%;
	aspect-ratio: var(--rdw-shot-ratio, 16 / 10);
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid rgba(0,0,0,0.06);
	box-shadow: 0 4px 12px rgba(0,0,0,0.03);
	background: #f3f4f6;
	isolation: isolate;
}
@supports not (aspect-ratio: 1 / 1) {
	.rdw-ps .rdw-card-media { height: 0; padding-top: 62.5%; }
}
.rdw-ps .rdw-card-media img,
.rdw-ps .rdw-card-media .rdw-card-img {
	position: absolute;
	inset: 0;
	top: 0; left: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	object-fit: cover;
	object-position: top center;
	transition: transform 0.6s ease;
	display: block;
}
.rdw-ps .rdw-card:hover .rdw-card-media img { transform: scale(1.03); }
.rdw-ps .rdw-card-media.rdw-fade-in > * { animation: rdw-fade-in 0.5s ease both; }
@keyframes rdw-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Placeholder while the screenshot is generating */
.rdw-ps .rdw-ph { position: absolute; inset: 0; display: flex; flex-direction: column; background: linear-gradient(135deg, #fff 0%, var(--rdw-orange-soft) 100%); }
.rdw-ps .rdw-ph-bar { display: flex; align-items: center; gap: 5px; padding: 8px 10px; background: #f4f4f5; border-bottom: 1px solid rgba(0,0,0,0.05); }
.rdw-ps .rdw-ph-bar i { width: 8px; height: 8px; border-radius: 50%; background: #d4d4d8; display: block; }
.rdw-ps .rdw-ph-bar em { flex: 1; margin-left: 8px; font-style: normal; font-size: 11px; color: #9ca3af; background: #fff; border-radius: 6px; padding: 2px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rdw-ps .rdw-ph-bar em:empty { visibility: hidden; }
.rdw-ps .rdw-ph-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 12px; text-align: center; }
.rdw-ps .rdw-ph-mark { width: 52px; height: 52px; border-radius: 14px; background: var(--rdw-orange); color: #fff; font-size: 24px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(255, 87, 34, 0.25); }
.rdw-ps .rdw-ph-note { font-size: 13px; color: var(--rdw-text-muted); font-weight: 500; }
.rdw-ps .rdw-ph.is-pending::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,0.65) 50%, transparent 80%);
	transform: translateX(-100%);
	animation: rdw-shimmer 1.6s ease-in-out infinite;
}
@keyframes rdw-shimmer { to { transform: translateX(100%); } }

.rdw-ps .rdw-card-body { padding: 22px; flex-grow: 1; display: flex; flex-direction: column; }
.rdw-ps .rdw-card-category { color: var(--rdw-orange); font-size: 13px; font-weight: 700; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.02em; }
.rdw-ps .rdw-card-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 12px; }
.rdw-ps .rdw-card-title { margin: 0; padding: 0; font-size: 19px; font-weight: 800; color: var(--rdw-text-dark); line-height: 1.25; font-family: var(--rdw-font); text-transform: none; letter-spacing: normal; }
.rdw-ps .rdw-card-arrow { flex: 0 0 auto; background: #111; color: #fff; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.rdw-ps .rdw-card:hover .rdw-card-arrow { background: var(--rdw-orange); }
.rdw-ps .rdw-card-tags { font-size: 14px; color: var(--rdw-text-muted); font-weight: 500; }

/* ---------- Load more ---------- */
.rdw-ps .rdw-load-more-wrap { text-align: center; margin-top: 40px; }
.rdw-ps .rdw-load-more { background: var(--rdw-text-dark); color: #fff; border: none; padding: 15px 36px; border-radius: 12px; font-size: 16px; font-weight: 700; cursor: pointer; transition: background 0.2s; box-shadow: none; }
.rdw-ps .rdw-load-more:hover { background: var(--rdw-orange); color: #fff; }
.rdw-ps .rdw-load-more[disabled] { opacity: 0.6; cursor: wait; }

/* ---------- Mobile drawer ---------- */
.rdw-ps .rdw-mobile-trigger-wrap { display: none; text-align: right; margin-bottom: 20px; }
.rdw-ps .rdw-mobile-btn { background: var(--rdw-orange); color: #fff; border: none; padding: 12px 24px; border-radius: 8px; font-size: 16px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; box-shadow: none; }
.rdw-ps .rdw-mobile-btn:hover { background: #e64a19; color: #fff; }
.rdw-ps .rdw-sidebar-header { display: none; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--rdw-border); margin-bottom: 15px; }
.rdw-ps .rdw-sidebar-header h3 { margin: 0; font-size: 18px; color: var(--rdw-text-dark); }
.rdw-ps .rdw-close-filters { background: none; border: none; font-size: 28px; cursor: pointer; color: var(--rdw-text-dark); padding: 0 4px; line-height: 1; box-shadow: none; }
.rdw-ps .rdw-close-filters:hover { background: none; color: var(--rdw-orange); }
.rdw-overlay[hidden] { display: none !important; }
.rdw-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 999998; opacity: 0; transition: opacity 0.3s; }
.rdw-overlay.open { opacity: 1; }

html.rdw-ps-lock,
html.rdw-ps-lock body { overflow: hidden !important; }

@media (max-width: 992px) {
	.rdw-ps .rdw-projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
	.rdw-ps .rdw-mobile-trigger-wrap { display: block; }

	.rdw-sidebar.rdw-ps {
		position: fixed; top: 0; right: 0; bottom: 0; width: 320px; max-width: 85vw; height: 100vh; height: 100dvh;
		background: #fff; z-index: 999999; padding: 15px; display: flex; flex-direction: column;
		box-shadow: -5px 0 20px rgba(0,0,0,0.1);
		transform: translateX(105%); visibility: hidden;
		transition: transform 0.3s ease, visibility 0s linear 0.3s;
	}
	.rdw-sidebar.rdw-ps.open { transform: translateX(0); visibility: visible; transition: transform 0.3s ease, visibility 0s; }
	.rdw-ps .rdw-sidebar-header { display: flex; }
	.rdw-ps .rdw-sidebar-scroll { overflow-y: auto; flex-grow: 1; padding-right: 5px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

	.rdw-ps .rdw-types-grid { flex-direction: column; gap: 8px; margin-bottom: 20px; }
	.rdw-ps .rdw-type-btn { padding: 10px 12px; border-radius: 12px; display: grid; grid-template-columns: 24px 1fr; column-gap: 12px; text-align: left; min-width: 0; align-items: center; flex: none; width: 100%; }
	.rdw-ps .rdw-type-icon { margin: 0; width: 24px; height: 24px; grid-row: span 2; }
	.rdw-ps .rdw-type-icon svg { width: 18px; height: 18px; }
	.rdw-ps .rdw-type-btn strong { font-size: 14px; margin-bottom: 2px; }
	.rdw-ps .rdw-type-btn .rdw-type-sub { font-size: 11px; }

	.rdw-ps .rdw-industries-header { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
	.rdw-ps .rdw-industries-header h4 { font-size: 14px; }
	.rdw-ps .rdw-pill { padding: 6px 14px; font-size: 12px; }
}

@media (max-width: 600px) {
	.rdw-showcase-wrapper { padding: 28px 14px; border-radius: 18px; }
	.rdw-ps .rdw-projects-grid { grid-template-columns: 1fr; gap: 20px; }
	.rdw-ps .rdw-results-header h2 { font-size: 22px; }
	.rdw-ps .rdw-card-img-wrap { padding: 12px 12px 0; }
	.rdw-ps .rdw-card-body { padding: 18px; }
}

/* While closed on small screens the drawer stays out of the layout; when opened
   it is moved to <body> by the script, where this rule no longer applies. */
@media (max-width: 992px) {
	.rdw-showcase-wrapper .rdw-sidebar.rdw-ps { display: none; }
}

/* Size the grid by the space the showcase actually gets (narrow page-builder
   columns, sidebars), not only by the screen width. */
.rdw-showcase-wrapper { container-type: inline-size; container-name: rdw-showcase; }
@container rdw-showcase (max-width: 920px) {
	.rdw-ps .rdw-projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
	.rdw-ps .rdw-type-btn { min-width: 140px; }
}
@container rdw-showcase (max-width: 540px) {
	.rdw-ps .rdw-projects-grid { grid-template-columns: 1fr; gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
	.rdw-ps *, .rdw-overlay { transition: none !important; animation: none !important; }
}
