/* =============================================================
   PureFields Help Page — all rules scoped under .pf-help
   ============================================================= */

/* ── WP admin structural resets (mirrors welcome.css approach) ──────────────
   Remove WP's default padding so the page fills the full content area, then
   ensure overflow is visible on all wrapper elements so position:sticky works.
   Scoped to this page's body class to avoid polluting other admin screens.   */
.pure-fields_page_pure-fields-help #wpcontent      { padding-left: 0 !important; }
.pure-fields_page_pure-fields-help #wpbody-content { padding: 0 !important; background: #f1f5f9; }
.pure-fields_page_pure-fields-help #wpwrap          { overflow: visible !important; }
.pure-fields_page_pure-fields-help #wpcontent       { overflow: visible !important; }
.pure-fields_page_pure-fields-help #wpbody          { overflow: visible !important; }
.pure-fields_page_pure-fields-help #wpbody-content  { overflow: visible !important; }

.pf-help *, .pf-help *::before, .pf-help *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

/* ── Page shell ─────────────────────────────────────────────── */
.pf-help {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 14px;
	line-height: 1.6;
	color: #1e293b;
	background: #f1f5f9;
	min-height: 100vh;
}

/* ── Neutralise global WP admin a:focus rule ────────────────── */
.pf-help a:focus,
.pf-help a:focus img,
.pf-help button:focus {
	background: transparent !important;
	color: inherit !important;
	box-shadow: none !important;
	outline: 2px solid rgba(99,102,241,.45) !important;
	outline-offset: 2px !important;
}

/* Tab pills: focus = active styling (white bg, indigo text, no outline) */
.pf-help .pf-tab-pill:focus,
.pf-help .pf-tab-pill.active,
.pf-help .pf-tab-pill.active:focus {
	background: #fff !important;
	color: #4338ca !important;
	border-color: #fff !important;
	box-shadow: 0 4px 12px rgba(0,0,0,.18) !important;
	outline: none !important;
}

/* Nav links have their own focus style */
.pf-help .pf-nav a:focus {
	background: #eef2ff !important;
	color: #4338ca !important;
	outline: none !important;
}

/* ── Hero ───────────────────────────────────────────────────── */
.pf-hero {
	background: linear-gradient(135deg, #4338ca 0%, #6d28d9 50%, #1d4ed8 100%);
	padding: 44px 48px 56px;
	position: relative;
	overflow: hidden; /* clips ::before pseudo and grid overlay only */
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 32px;
	/* ensure hero itself never pushes past its own box */
	width: 100%;
	box-sizing: border-box;
}

.pf-hero::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image: radial-gradient(circle at 25% 25%, rgba(255,255,255,.08) 0%, transparent 50%),
	                  radial-gradient(circle at 75% 75%, rgba(255,255,255,.05) 0%, transparent 50%);
}

.pf-hero-grid {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
	background-size: 40px 40px;
	pointer-events: none;
}

.pf-hero-inner {
	position: relative;
	flex: 1;
	min-width: 0; /* allow text to wrap rather than push layout */
	max-width: 540px;
}

.pf-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(255,255,255,.15);
	color: rgba(255,255,255,.95);
	border: 1px solid rgba(255,255,255,.25);
	border-radius: 20px;
	padding: 4px 14px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .8px;
	text-transform: uppercase;
	margin-bottom: 18px;
}

.pf-badge span { font-size: 14px; }

.pf-hero h1 {
	font-size: 34px;
	font-weight: 800;
	color: #fff;
	line-height: 1.15;
	margin-bottom: 14px;
	letter-spacing: -.5px;
}

.pf-hero h1 em {
	font-style: normal;
	background: linear-gradient(90deg, #a5f3fc, #c4b5fd);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.pf-hero-desc {
	color: rgba(255,255,255,.8);
	font-size: 15px;
	line-height: 1.65;
	margin-bottom: 28px;
}

.pf-hero-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.pf-tab-pill {
	background: rgba(255,255,255,.12);
	color: rgba(255,255,255,.9);
	border: 1px solid rgba(255,255,255,.22);
	border-radius: 10px;
	padding: 9px 22px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background .18s, border-color .18s, color .18s, transform .1s;
	letter-spacing: .2px;
	outline: none;
}

.pf-tab-pill:hover {
	background: rgba(255,255,255,.22);
	border-color: rgba(255,255,255,.45);
	transform: translateY(-1px);
}

.pf-tab-pill.active {
	background: #fff;
	color: #4338ca;
	border-color: #fff;
	box-shadow: 0 4px 12px rgba(0,0,0,.18);
}

/* Hero decoration — hidden below 900px so it can't force horizontal overflow */
.pf-hero-deco {
	position: relative;
	flex-shrink: 1;
	width: 240px;
	min-width: 0;
}

@media (max-width: 900px) {
	.pf-hero-deco { display: none; }
	.pf-hero { padding: 36px 28px 44px; }
}

.pf-hero-window {
	background: rgba(0,0,0,.4);
	border: 1px solid rgba(255,255,255,.15);
	border-radius: 14px;
	overflow: hidden;
	backdrop-filter: blur(12px);
	box-shadow: 0 20px 60px rgba(0,0,0,.3);
	max-width: 100%;
}

.pf-hero-window-bar {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 10px 14px;
	background: rgba(255,255,255,.07);
	border-bottom: 1px solid rgba(255,255,255,.1);
}

.pf-hero-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
}

.pf-hero-dot:nth-child(1) { background: #ff5f57; }
.pf-hero-dot:nth-child(2) { background: #ffbd2e; }
.pf-hero-dot:nth-child(3) { background: #28c840; }

.pf-hero-code-block {
	padding: 16px 18px;
	font-family: 'Consolas', 'Monaco', 'Fira Code', monospace;
	font-size: 11.5px;
	line-height: 1.8;
	color: #e2e8f0;
	white-space: pre;
	overflow-x: auto; /* scroll internally, never push hero wider */
	max-width: 100%;
}

.pf-hero-code-block .hkw  { color: #ff79c6; }
.pf-hero-code-block .hfn  { color: #50fa7b; }
.pf-hero-code-block .hst  { color: #f1fa8c; }
.pf-hero-code-block .hvar { color: #bd93f9; }
.pf-hero-code-block .hcm  { color: #6272a4; font-style: italic; }

/* ── Body layout ────────────────────────────────────────────── */
.pf-body {
    display: flex;
    align-items: flex-start;
    min-width: 0;
    width: 70%;
    margin: 0 auto;
}

@media (max-width: 800px) {
	.pf-body { flex-direction: column; }
	.pf-sidebar {
		position: static;
		width: 100%;
		max-height: none;
		overflow: visible;
		padding: 16px 20px 0;
	}
}

/* ── Sidebar ────────────────────────────────────────────────── */
.pf-sidebar {
	width: 210px;
	flex-shrink: 0;
	position: sticky;
	top: 52px; /* 32px WP toolbar + 20px breathing room */
	padding: 20px 0 20px 2px;
	align-self: flex-start;
	max-height: calc(100vh - 72px);
	overflow-y: auto;
	overflow-x: hidden;
}

.pf-nav-group { display: none; }
.pf-nav-group.active { display: block; }

.pf-nav-label {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1.2px;
	color: #94a3b8;
	padding: 0 10px;
	margin-bottom: 6px;
	margin-top: 16px;
}

.pf-nav-label:first-child { margin-top: 0; }

.pf-nav a {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 10px;
	color: #64748b;
	text-decoration: none;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 500;
	transition: color .15s, background .15s;
	border-left: 2px solid transparent;
	margin-bottom: 1px;
}

.pf-nav a:hover { color: #4338ca; background: #eef2ff; }
.pf-nav a.active {
	color: #4338ca;
	background: #eef2ff;
	border-left-color: #4338ca;
	font-weight: 600;
}

/* ── Main ───────────────────────────────────────────────────── */
.pf-main {
	flex: 1;
	min-width: 0;
	padding: 28px 28px 64px;
}

/* ── Tab panels ─────────────────────────────────────────────── */
.pf-panel { display: block; }
.pf-panel.hidden { display: none; }

/* ── Flow diagram ───────────────────────────────────────────── */
.pf-flow {
	display: flex;
	align-items: center;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	padding: 24px 28px;
	margin-bottom: 28px;
	overflow-x: auto;
	box-shadow: 0 1px 4px rgba(0,0,0,.05);
	gap: 0;
}

.pf-flow-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	flex-shrink: 0;
	width: 110px;
	opacity: 0;
	transform: translateY(10px);
	transition: opacity .4s ease, transform .4s ease;
}

.pf-flow-step.vis { opacity: 1; transform: translateY(0); }

.pf-flow-icon {
	width: 52px;
	height: 52px;
	border-radius: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	margin-bottom: 10px;
	position: relative;
}

.pf-flow-icon::after {
	content: '';
	position: absolute;
	inset: -4px;
	border-radius: 17px;
	border: 2px solid currentColor;
	opacity: .15;
}

.pf-flow-step-lbl {
	font-size: 12px;
	font-weight: 700;
	color: #1e293b;
	margin-bottom: 3px;
	line-height: 1.3;
}

.pf-flow-step-sub {
	font-size: 10.5px;
	color: #94a3b8;
	max-width: 88px;
	line-height: 1.4;
	font-family: 'Consolas', 'Monaco', monospace;
}

/* Icon colour bands */
.pf-fi-indigo { background: #eef2ff; color: #4338ca; }
.pf-fi-green  { background: #f0fdf4; color: #15803d; }
.pf-fi-amber  { background: #fffbeb; color: #b45309; }
.pf-fi-violet { background: #faf5ff; color: #7c3aed; }
.pf-fi-cyan   { background: #ecfeff; color: #0e7490; }

/* Connector arrows */
.pf-flow-conn {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	padding: 0 6px;
	opacity: 0;
	transition: opacity .35s ease;
}

.pf-flow-conn.vis { opacity: 1; }

.pf-conn-line {
	width: 32px;
	height: 2px;
	background: linear-gradient(90deg, #6366f1, #8b5cf6);
	border-radius: 1px;
	position: relative;
	overflow: hidden;
}

.pf-conn-line::after {
	content: '';
	position: absolute;
	left: 0; top: 0;
	width: 100%; height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
	animation: pf-shimmer 1.8s linear infinite;
}

.pf-conn-head {
	border: solid transparent;
	border-left-color: #8b5cf6;
	border-width: 5px 0 5px 7px;
	margin-left: -1px;
	flex-shrink: 0;
}

@keyframes pf-shimmer {
	from { transform: translateX(-120%); }
	to   { transform: translateX(120%); }
}

/* ── Sections ───────────────────────────────────────────────── */
.pf-section {
	margin-bottom: 36px;
	scroll-margin-top: 80px;
}

.pf-section-hd {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 14px;
	padding-bottom: 12px;
	border-bottom: 2px solid #e2e8f0;
}

.pf-section-ico {
	width: 34px;
	height: 34px;
	border-radius: 9px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	background: #eef2ff;
	flex-shrink: 0;
}

.pf-section-hd h2 {
	font-size: 17px;
	font-weight: 700;
	color: #1e293b;
}

.pf-section-desc {
	font-size: 13.5px;
	color: #64748b;
	margin-bottom: 14px;
	line-height: 1.65;
}

/* ── Code card ──────────────────────────────────────────────── */
.pf-code-card {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	overflow: hidden;
	margin-bottom: 14px;
	box-shadow: 0 1px 3px rgba(0,0,0,.04);
	transition: box-shadow .2s;
}

.pf-code-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.09); }

.pf-cc-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 11px 16px;
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
	gap: 12px;
}

.pf-cc-title {
	font-size: 13px;
	font-weight: 700;
	color: #1e293b;
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.pf-cc-tag {
	font-size: 10px;
	font-weight: 600;
	background: #eef2ff;
	color: #4338ca;
	border-radius: 5px;
	padding: 2px 8px;
	white-space: nowrap;
	letter-spacing: .3px;
}

.pf-cc-tag.green { background: #f0fdf4; color: #15803d; }
.pf-cc-tag.amber { background: #fffbeb; color: #b45309; }
.pf-cc-tag.violet { background: #faf5ff; color: #7c3aed; }

.pf-copy-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: transparent;
	color: #64748b;
	border: 1px solid #cbd5e1;
	border-radius: 7px;
	padding: 4px 11px;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	transition: all .15s;
	white-space: nowrap;
	flex-shrink: 0;
	line-height: 1.6;
}

.pf-copy-btn:hover { background: #f1f5f9; color: #4338ca; border-color: #4338ca; }
.pf-copy-btn.ok    { background: #f0fdf4; color: #15803d; border-color: #86efac; }

.pf-cc-desc {
	font-size: 12.5px;
	color: #64748b;
	padding: 10px 16px 0;
	line-height: 1.55;
}

.pf-pre {
	margin: 0;
	padding: 18px 20px;
	overflow-x: auto;
	background: #0f172a;
	font-family: 'Consolas', 'Fira Code', 'Monaco', monospace;
	font-size: 12.5px;
	line-height: 1.75;
	color: #cbd5e1;
	tab-size: 4;
	border: 0;
}

.pf-pre::-webkit-scrollbar { height: 4px; }
.pf-pre::-webkit-scrollbar-track { background: #1e293b; }
.pf-pre::-webkit-scrollbar-thumb { background: #475569; border-radius: 2px; }

/* ── Syntax tokens ──────────────────────────────────────────── */
.syn-kw  { color: #ff79c6; }
.syn-fn  { color: #50fa7b; }
.syn-st  { color: #f1fa8c; }
.syn-var { color: #bd93f9; }
.syn-cm  { color: #6272a4; font-style: italic; }
.syn-nb  { color: #ffb86c; }
.syn-tag { color: #8be9fd; }

/* ── Code grid (two columns) ────────────────────────────────── */
.pf-code-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
	gap: 14px;
	margin-bottom: 14px;
}

/* ── Field type chips ───────────────────────────────────────── */
.pf-chip-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin-bottom: 16px;
}

.pf-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #f8fafc;
	color: #334155;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 5px 12px;
	font-size: 12px;
	font-weight: 600;
	font-family: 'Consolas', 'Monaco', monospace;
	cursor: default;
	transition: all .15s;
}

.pf-chip:hover { background: #eef2ff; border-color: #6366f1; color: #4338ca; }

.pf-chip-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	flex-shrink: 0;
}

/* Dashicon variant of the chip indicator (replaces the colored dot for a more
   visual look). Color is set inline per type. */
.pf-chip-icon {
	font-size: 14px;
	width: 14px;
	height: 14px;
	line-height: 14px;
	flex-shrink: 0;
}
.pf-chip:hover .pf-chip-icon { color: #4338ca !important; }

/* ── Step guide ─────────────────────────────────────────────── */
.pf-steps {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.pf-steps::before {
	content: '';
	position: absolute;
	left: 19px;
	top: 44px;
	bottom: 44px;
	width: 2px;
	background: linear-gradient(to bottom, #6366f1, #8b5cf6, #a855f7);
	border-radius: 2px;
	z-index: 0;
}

.pf-step {
	display: flex;
	gap: 18px;
	align-items: flex-start;
	position: relative;
	z-index: 1;
	padding-bottom: 16px;
}

.pf-step-num {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: linear-gradient(135deg, #6366f1, #8b5cf6);
	color: #fff;
	font-size: 15px;
	font-weight: 800;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	box-shadow: 0 2px 10px rgba(99,102,241,.4);
}

.pf-step-body {
	flex: 1;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 14px 18px;
	box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.pf-step-title {
	font-size: 14px;
	font-weight: 700;
	color: #1e293b;
	margin-bottom: 5px;
}

.pf-step-text {
	font-size: 13px;
	color: #64748b;
	line-height: 1.6;
}

.pf-step-text code {
	background: #f1f5f9;
	color: #4338ca;
	font-family: 'Consolas', 'Monaco', monospace;
	font-size: 12px;
	padding: 1px 6px;
	border-radius: 4px;
}

/* ── Tip / callout ──────────────────────────────────────────── */
.pf-tip {
	display: flex;
	gap: 12px;
	background: #fefce8;
	border: 1px solid #fde047;
	border-left: 4px solid #eab308;
	border-radius: 10px;
	padding: 13px 16px;
	margin-bottom: 16px;
	font-size: 13px;
	color: #713f12;
	line-height: 1.6;
}

.pf-tip-icon { font-size: 17px; flex-shrink: 0; line-height: 1.4; }

.pf-note {
	display: flex;
	gap: 12px;
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-left: 4px solid #3b82f6;
	border-radius: 10px;
	padding: 13px 16px;
	margin-bottom: 16px;
	font-size: 13px;
	color: #1e40af;
	line-height: 1.6;
}

/* ── Info tile grid ─────────────────────────────────────────── */
.pf-tile-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 10px;
	margin-bottom: 18px;
}

.pf-tile {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 14px 16px;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	box-shadow: 0 1px 3px rgba(0,0,0,.04);
	transition: box-shadow .18s;
}

.pf-tile:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }

.pf-tile-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }

.pf-tile-lbl {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .6px;
	color: #94a3b8;
	margin-bottom: 3px;
}

.pf-tile-val {
	font-size: 13px;
	font-weight: 600;
	color: #1e293b;
	font-family: 'Consolas', 'Monaco', monospace;
	word-break: break-all;
}
