/* Sosyal Kart — Instagram profile strip (dark glass) and profile card (light, Instagram-style).
   Loaded only on pages that show it, and on the Sosyal Kart admin screen for the preview.
   Every selector is scoped to .ce-ig. */
.ce-ig {
	--ce-ig-bg: rgba(9, 12, 26, .8);
	--ce-ig-bg-solid: #0b0f20;
	--ce-ig-line: rgba(148, 197, 255, .18);
	--ce-ig-text: #f4f7ff;
	--ce-ig-accent: #2ee6d6;
	--ce-ig-accent-2: #8b5cf6;
	--ce-ig-ink: #0c1014;
	--ce-ig-ink-2: #737373;
	--ce-ig-blue: #0095f6;
	/* Instagram story ring, yellow/orange at the bottom-left to pink/purple at the top-right. */
	--ce-ig-ring: linear-gradient(45deg, #ffd600 0%, #ff7a00 25%, #ff0069 52%, #d300c5 76%, #7638fa 100%);
	--ce-ig-gap: 8px;
	position: fixed;
	z-index: 99970;
	left: max(var(--ce-ig-gap), env(safe-area-inset-left));
	right: max(var(--ce-ig-gap), env(safe-area-inset-right));
	bottom: calc(env(safe-area-inset-bottom) + var(--ce-ig-gap));
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
	box-sizing: border-box;
	font: 400 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--ce-ig-text);
	-webkit-font-smoothing: antialiased;
	pointer-events: none;
}
.ce-ig *,
.ce-ig *::before,
.ce-ig *::after { box-sizing: border-box; }
.ce-ig > * { pointer-events: auto; }
.ce-ig [hidden] { display: none !important; }
.ce-ig p { margin: 0; }
.ce-ig .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}

/* ---------------- Compact strip: translucent glass ---------------- */
.ce-ig .ce-ig-bar {
	position: relative;
	display: flex;
	align-items: center;
	gap: 6px;
	width: 100%;
	min-height: 54px;
	padding: 6px 6px 6px 8px;
	border-radius: 18px;
	background: var(--ce-ig-bg-solid);
	border: 1px solid var(--ce-ig-line);
	box-shadow: 0 10px 30px rgba(3, 6, 18, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
	.ce-ig .ce-ig-bar {
		background: var(--ce-ig-bg);
		-webkit-backdrop-filter: blur(16px) saturate(160%);
		backdrop-filter: blur(16px) saturate(160%);
	}
}
.ce-ig .ce-ig-bar::before {
	content: "";
	position: absolute;
	inset: -1px;
	border-radius: inherit;
	padding: 1px;
	background: linear-gradient(120deg, rgba(46, 230, 214, .55), rgba(139, 92, 246, .45) 55%, rgba(255, 255, 255, .06));
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	pointer-events: none;
}
.ce-ig .ce-ig-profile {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1 1 auto;
	min-width: 0;
	min-height: 44px;
	padding: 2px 8px 2px 2px;
	border-radius: 14px;
	color: var(--ce-ig-text) !important;
	text-decoration: none !important;
}
.ce-ig .ce-ig-profile:hover { background: rgba(255, 255, 255, .06); }
.ce-ig .ce-ig-handle {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	min-width: 0;
	font-weight: 650;
	font-size: 14px;
	letter-spacing: .01em;
}
.ce-ig .ce-ig-handle-text {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.ce-ig .ce-ig-badge { display: inline-flex; flex: 0 0 auto; line-height: 0; }
.ce-ig .ce-ig-badge svg { width: 15px; height: 15px; }
.ce-ig .ce-ig-brand {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	margin-left: auto;
	width: 30px;
	height: 30px;
	border-radius: 9px;
	color: #fff;
	background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}
.ce-ig .ce-ig-brand svg { width: 17px; height: 17px; }
.ce-ig .ce-ig-expand,
.ce-ig .ce-ig-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .14);
	border-radius: 12px;
	background: rgba(255, 255, 255, .07);
	color: var(--ce-ig-text);
	cursor: pointer;
	font: inherit;
	line-height: 1;
	box-shadow: none;
	text-transform: none;
	transition: background .15s ease;
}
.ce-ig .ce-ig-expand:hover { background: rgba(255, 255, 255, .14); }
.ce-ig .ce-ig-expand svg { transition: transform .2s ease; }
.ce-ig .ce-ig-expand[aria-expanded="true"] svg { transform: rotate(180deg); }
.ce-ig .ce-ig-profile:focus-visible,
.ce-ig .ce-ig-expand:focus-visible { outline: 2px solid var(--ce-ig-accent); outline-offset: 2px; }

/* ---------------- Avatar with the story ring ---------------- */
/* Ring (gradient), a thin gap in the surface colour, then the photo. An initial is
   underneath for a missing photo or one that fails to load. */
.ce-ig .ce-ig-photo {
	--ce-ig-ring-w: 2px;
	--ce-ig-ring-gap: 2px;
	--ce-ig-ring-gap-color: var(--ce-ig-bg-solid);
	position: relative;
	display: inline-flex;
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	padding: var(--ce-ig-ring-w);
	background: var(--ce-ig-ring);
}
.ce-ig .ce-ig-photo::after {
	content: "";
	position: absolute;
	inset: var(--ce-ig-ring-w);
	border-radius: 50%;
	border: var(--ce-ig-ring-gap) solid var(--ce-ig-ring-gap-color);
	pointer-events: none;
}
.ce-ig .ce-ig-photo img,
.ce-ig .ce-ig-initial {
	position: absolute;
	inset: var(--ce-ig-ring-w);
	width: calc(100% - 2 * var(--ce-ig-ring-w));
	height: calc(100% - 2 * var(--ce-ig-ring-w));
	border-radius: 50%;
	margin: 0;
	max-width: none;
}
.ce-ig .ce-ig-photo img { object-fit: cover; }
.ce-ig .ce-ig-initial {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #262b3f;
	color: #fff;
	font-weight: 700;
	font-size: 15px;
}
.ce-ig .ce-ig-photo--lg {
	--ce-ig-ring-w: 3px;
	--ce-ig-ring-gap: 3px;
	--ce-ig-ring-gap-color: #fff;
	width: 88px;
	height: 88px;
}
.ce-ig .ce-ig-photo--lg .ce-ig-initial { background: #efefef; color: var(--ce-ig-ink); font-size: 30px; }

/* ---------------- Profile card: light, Instagram profile header ---------------- */
.ce-ig .ce-ig-card {
	position: relative;
	width: 100%;
	padding: 14px 16px 16px;
	border-radius: 20px;
	background: #fff;
	color: var(--ce-ig-ink);
	border: 1px solid rgba(0, 0, 0, .06);
	box-shadow: 0 18px 50px rgba(3, 6, 18, .38), 0 2px 6px rgba(3, 6, 18, .12);
	transform-origin: 50% 100%;
}
.ce-ig.is-open .ce-ig-card { animation: ce-ig-in .2s cubic-bezier(.2, .8, .3, 1) both; }
.ce-ig.is-closing .ce-ig-card { animation: ce-ig-out .14s ease-in both; }
@keyframes ce-ig-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ce-ig-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }

/* Close button: top right, outside the text flow. The bar is sticky and zero-height,
   so the button also stays reachable when a very short screen makes the card scroll. */
.ce-ig .ce-ig-card-closebar { position: sticky; top: 0; z-index: 2; height: 0; }
.ce-ig .ce-ig-close {
	position: absolute;
	top: -2px;
	right: -6px;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: #efefef;
	color: var(--ce-ig-ink);
}
.ce-ig .ce-ig-close:hover { background: #e2e2e2; }
.ce-ig .ce-ig-close:focus-visible,
.ce-ig .ce-ig-card-photo:focus-visible,
.ce-ig .ce-ig-cta:focus-visible { outline: 2px solid var(--ce-ig-blue); outline-offset: 2px; }

/* Photo on the left; on its right the username row and the counts right below it. */
.ce-ig .ce-ig-card-main {
	display: flex;
	align-items: center;
	gap: 16px;
	min-width: 0;
}
.ce-ig .ce-ig-card-photo { display: inline-flex; flex: 0 0 auto; border-radius: 50%; line-height: 0; }
.ce-ig .ce-ig-card-info { flex: 1 1 auto; min-width: 0; }
/* Username and badge stay together: the name shortens, the badge never wraps alone.
   The right padding keeps the row clear of the close button. */
.ce-ig .ce-ig-card-user {
	display: flex;
	align-items: center;
	gap: 5px;
	min-width: 0;
	min-height: 36px;
	padding-right: 40px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -.01em;
	color: var(--ce-ig-ink);
}
.ce-ig .ce-ig-card-user .ce-ig-badge svg { width: 17px; height: 17px; }
.ce-ig .ce-ig-stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
	margin: 6px 0 0;
	padding: 0;
	list-style: none;
}
.ce-ig .ce-ig-stat {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
	margin: 0;
}
.ce-ig .ce-ig-stat-num {
	max-width: 100%;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.25;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	color: var(--ce-ig-ink);
}
.ce-ig .ce-ig-stat-label { font-size: 13px; line-height: 1.3; color: var(--ce-ig-ink); white-space: nowrap; }
.ce-ig .ce-ig-card-name {
	margin-top: 12px;
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--ce-ig-ink);
	overflow-wrap: break-word;
}
.ce-ig .ce-ig-card-bio {
	margin-top: 4px;
	font-size: 14px;
	line-height: 1.45;
	color: var(--ce-ig-ink);
	overflow-wrap: break-word;
}
.ce-ig .ce-ig-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	margin-top: 14px;
	padding: 10px 16px;
	border-radius: 10px;
	background: var(--ce-ig-blue);
	color: #fff !important;
	font-weight: 600;
	font-size: 14.5px;
	text-decoration: none !important;
	transition: background .15s ease;
}
.ce-ig .ce-ig-cta:hover { background: #1877f2; }

/* ---------------- Device visibility and desktop layout ---------------- */
@media (max-width: 767px) {
	.ce-ig[data-mobile="0"] { display: none !important; }
}
@media (min-width: 768px) {
	.ce-ig[data-desktop="0"] { display: none !important; }
	/* The open card is a bit wider than the strip; both stay centred and bounded. */
	.ce-ig {
		--ce-ig-gap: 16px;
		left: 50%;
		right: auto;
		width: min(460px, calc(100vw - 32px));
		translate: -50% 0;
		align-items: center;
	}
	.ce-ig .ce-ig-bar { max-width: 400px; border-radius: 20px; }
	.ce-ig .ce-ig-card { padding: 16px 20px 18px; }
}
/* Narrow phones: a little less padding and a smaller photo and close button, so the
   whole username and its badge fit next to the photo. */
@media (max-width: 389px) {
	.ce-ig .ce-ig-card { padding: 12px 10px 12px 12px; }
	.ce-ig .ce-ig-card-main { gap: 10px; }
	.ce-ig .ce-ig-photo--lg { width: 64px; height: 64px; }
	.ce-ig .ce-ig-close { width: 34px; height: 34px; right: -4px; }
	.ce-ig .ce-ig-card-user { padding-right: 32px; letter-spacing: -.02em; }
}
@media (max-width: 359px) {
	.ce-ig .ce-ig-brand { display: none; }
	.ce-ig .ce-ig-handle { font-size: 13px; }

	.ce-ig .ce-ig-stats { gap: 4px; }
	.ce-ig .ce-ig-stat-num { font-size: 14.5px; }
	.ce-ig .ce-ig-stat-label { font-size: 12px; }
	.ce-ig .ce-ig-card-user { font-size: 15.5px; }
}
/* Very short screens (landscape phones, high zoom): the card scrolls only here,
   and its top row with the close button stays visible while it does. */
@media (max-height: 560px) {
	.ce-ig .ce-ig-bar { min-height: 48px; padding-top: 3px; padding-bottom: 3px; }
	.ce-ig .ce-ig-card {
		max-height: calc(100dvh - 90px - env(safe-area-inset-bottom));
		overflow-y: auto;
		overscroll-behavior: contain;
	}
	.ce-ig .ce-ig-photo--lg { width: 64px; height: 64px; }
	.ce-ig .ce-ig-card-name { margin-top: 8px; }
	.ce-ig .ce-ig-cta { margin-top: 10px; min-height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
	.ce-ig *,
	.ce-ig.is-open .ce-ig-card,
	.ce-ig.is-closing .ce-ig-card { animation: none !important; transition: none !important; }
}

/* Space reserved at the end of the page so the footer is not hidden under the strip */
#ce-ig-spacer { display: block; width: 100%; height: var(--ce-ig-space, 0px); }

/* Reopen control shown while the cookie notice is folded away for the open card */
.ce-ig-cookie-pill {
	position: fixed;
	z-index: 99991;
	top: calc(env(safe-area-inset-top) + 8px);
	left: 50%;
	translate: -50% 0;
	min-height: 40px;
	padding: 8px 16px;
	border: 1px solid rgba(255, 255, 255, .2);
	border-radius: 999px;
	background: #0b0f20;
	color: #fff;
	font: 600 13px/1.3 system-ui, -apple-system, "Segoe UI", sans-serif;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
	cursor: pointer;
}
.ce-ig-cookie-pill[hidden] { display: none; }
.ce-ig-cookie-pill:focus-visible { outline: 2px solid #2ee6d6; outline-offset: 2px; }

/* ---------------- Admin preview: same markup inside the stage ---------------- */
.ce-ig-stage {
	position: relative;
	height: 520px;
	overflow: hidden;
	border-radius: 16px;
	background: radial-gradient(120% 90% at 50% 0%, #1b2347 0%, #0b0f20 60%, #06080f 100%);
	border: 1px solid #1d2440;
}
.ce-ig-stage .ce-ig-stage-page { position: absolute; inset: 28px 24px auto; display: grid; gap: 10px; }
.ce-ig-stage .ce-ig-stage-page span { display: block; height: 12px; border-radius: 6px; background: #ffffff14; }
.ce-ig-stage .ce-ig-stage-page span:first-child { width: 60%; height: 22px; background: #ffffff24; }
.ce-ig-stage .ce-ig-stage-page span:last-child { width: 80%; }
.ce-ig.is-preview {
	position: absolute;
	display: flex !important;
	left: 12px;
	right: 12px;
	bottom: 12px;
	width: auto;
	translate: none;
	align-items: stretch;
}
.ce-ig.is-preview .ce-ig-bar { max-width: none; }
.ce-ig-stage[data-device="desktop"] .ce-ig.is-preview { left: 50%; right: auto; width: min(460px, calc(100% - 24px)); translate: -50% 0; align-items: center; }
.ce-ig-stage[data-device="desktop"] .ce-ig.is-preview .ce-ig-bar { max-width: 400px; }
