/* No Smoke No Fire — Case Study Cards widget.
   Card grid → full-screen viewer: live client site in an iframe (left,
   scrollable) + writeup sidebar (right). Stacks on mobile. */

/* ── grid ── */
.sg-cs__grid {
	display: grid;
	grid-template-columns: repeat(var(--sgcs-cols, 3), minmax(0, 1fr));
	gap: var(--sgcs-gap, 24px);
}

/* ── card ── */
.sg-cs__card {
	background: #ffffff;
	border-radius: 12px;
	overflow: hidden;
	cursor: pointer;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.sg-cs__card:hover,
.sg-cs__card:focus-visible {
	transform: translateY(-4px);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}
.sg-cs__card:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.sg-cs__img {
	width: 100%;
	height: var(--sgcs-imgh, 220px);
	object-fit: cover;
	display: block;
}
.sg-cs__body { padding: 20px 22px 22px; }
.sg-cs__title {
	margin: 0 0 8px;
	font-size: 20px;
	font-weight: 700;
	color: #16232e;
	line-height: 1.25;
}
.sg-cs__desc {
	margin: 0;
	font-size: 14px;
	line-height: 1.55;
	color: #5a646d;
}
.sg-cs__tpl { display: none; }

/* ── viewer ── */
.sg-cs__modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
}
.sg-cs__modal.is-open { display: block; }
.sg-cs__scrim {
	position: absolute;
	inset: 0;
	background: rgba(10, 12, 14, 0.85);
}
.sg-cs__panel {
	position: absolute;
	inset: var(--sgcs-panel-inset, 3%);
	background: #101214;
	border-radius: 14px;
	overflow: hidden;
	display: flex;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.sg-cs__frame-wrap {
	flex: 1 1 auto;
	min-width: 0;
	background: #ffffff;
	position: relative;
}
.sg-cs__frame-wrap iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}
.sg-cs__noframe {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 14px;
	text-align: center;
	padding: 24px;
	color: #5a646d;
	font-size: 15px;
	background: #f5f6f8;
}
.sg-cs__modal.is-noframe .sg-cs__noframe { display: flex; }
.sg-cs__modal.is-noframe .sg-cs__frame-wrap iframe { display: none; }

/* ── sidebar ── */
.sg-cs__side {
	flex: 0 0 var(--sgcs-sidew, 360px);
	max-width: 46%;
	background: #16181b;
	color: #d7dce0;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
}
.sg-cs__side-inner { padding: 34px 30px 30px; display: flex; flex-direction: column; flex: 1; }
.sg-cs__side-title {
	margin: 0 0 14px;
	font-size: 24px;
	font-weight: 800;
	line-height: 1.2;
	color: #ffffff;
}
.sg-cs__side-content { font-size: 15px; line-height: 1.65; }
.sg-cs__side-content p { margin: 0 0 1em; }
.sg-cs__side-content > :last-child { margin-bottom: 0; }
.sg-cs__visit {
	appearance: none !important;
	-webkit-appearance: none !important;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 24px;
	align-self: flex-start;
	padding: 11px 22px;
	border-radius: 999px;
	background: #ffffff;
	color: #16232e;
	border: 0 !important;
	font-weight: 700;
	font-size: 14px;
	text-decoration: none;
	box-shadow: none !important;
	transition: transform 0.15s ease, background 0.15s ease;
}
.sg-cs__visit:hover { transform: translateY(-1px); }

/* ── close ── */
.sg-cs__close {
	appearance: none !important;
	-webkit-appearance: none !important;
	position: absolute;
	top: 14px;
	right: 14px;
	width: 40px;
	height: 40px;
	min-width: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: rgba(0, 0, 0, 0.55);
	color: #ffffff;
	font-size: 0;
	cursor: pointer;
	z-index: 5;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: none !important;
	transition: background 0.15s ease;
}
.sg-cs__close:hover { background: rgba(0, 0, 0, 0.85); }
.sg-cs__close svg { width: 18px; height: 18px; display: block; }
.sg-cs__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

body.sg-cs-lock { overflow: hidden; }

/* ── mobile: writeup hides in a bottom sheet (v1.16.1) ── */
.sg-cs__sheet-btn { display: none; }
@media (max-width: 880px) {
	.sg-cs__panel { inset: 0; border-radius: 0; }
	.sg-cs__side {
		position: absolute;
		left: 0;
		right: 0;
		bottom: 0;
		flex: none;
		max-width: none;
		max-height: 74vh;
		z-index: 6;
		border-radius: 18px 18px 0 0;
		transform: translateY(100%);
		transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
		box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
	}
	.sg-cs__panel.is-sheet-open .sg-cs__side { transform: translateY(0); }
	.sg-cs__side-inner { padding: 26px 20px 84px; }
	.sg-cs__side-title { font-size: 20px; }

	.sg-cs__sheet-btn {
		appearance: none !important;
		-webkit-appearance: none !important;
		position: absolute;
		bottom: 16px;
		left: 50%;
		transform: translateX(-50%);
		z-index: 7;
		display: inline-flex;
		align-items: center;
		gap: 8px;
		padding: 12px 24px;
		min-width: 0 !important;
		border: 0 !important;
		border-radius: 999px !important;
		background: #ffffff !important;
		color: #16232e !important;
		font-size: 14px;
		font-weight: 700;
		cursor: pointer;
		box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4) !important;
		text-shadow: none !important;
		white-space: nowrap;
	}
	.sg-cs__panel.is-sheet-open .sg-cs__sheet-btn { background: #16181b !important; color: #ffffff !important; }
}
@media (prefers-reduced-motion: reduce) {
	.sg-cs__side { transition: none; }
}

/* ── intro overlay (v1.9.0): shown over the iframe before browsing ── */
.sg-cs__intro {
	position: absolute;
	inset: 0;
	z-index: 4;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 6px;
	padding: 32px;
	background: rgba(13, 15, 17, 0.94);
	color: #d7dce0;
	opacity: 1;
	transition: opacity 0.35s ease;
}
.sg-cs__intro.is-dismissed { opacity: 0; pointer-events: none; }
.sg-cs__intro-icon { height: 72px; width: auto; margin-bottom: 18px; }
.sg-cs__intro-eyebrow {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: #8a939b;
}
.sg-cs__intro-title {
	margin: 4px 0 10px;
	font-size: 30px;
	font-weight: 800;
	line-height: 1.15;
	color: #ffffff;
}
.sg-cs__intro-text {
	margin: 0;
	max-width: 520px;
	font-size: 15px;
	line-height: 1.65;
}
.sg-cs__intro-btn {
	appearance: none !important;
	-webkit-appearance: none !important;
	margin-top: 26px;
	padding: 12px 28px;
	border: 0 !important;
	border-radius: 999px;
	background: #ffffff;
	color: #16232e;
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
	box-shadow: none !important;
	transition: transform 0.15s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 43px; /* identical height loading vs ready, so the CTA never jumps */
}
.sg-cs__intro-btn:hover { transform: translateY(-1px); }
/* Spinner shape only. The .is-loading state rules + keyframes live INLINE in
   wp_head — NitroPack's unused-CSS pass can't see classes JS adds at runtime
   and strips them from the stylesheet. */
.sg-cs__intro-spin {
	display: none;
	width: 16px;
	height: 16px;
	flex: none;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
}
@media (max-width: 880px) {
	.sg-cs__intro-title { font-size: 22px; }
	.sg-cs__intro-icon { height: 52px; }
}

/* ── persistent "Live Preview" chrome (v1.10.0) ── */
.sg-cs__chrome {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 3; /* under the intro (4) and close button (5) */
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 7px 14px 7px 10px;
	border-radius: 999px;
	background: rgba(13, 15, 17, 0.82);
	color: #ffffff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	pointer-events: none;
}
.sg-cs__chrome img { height: 20px; width: auto; display: block; }
