/* ============================================================
   Spreadsheet Coding — "green" brand design system.
   Ported from the twentytwentythree-child Prism preview
   (code-block-green-preview.png). Loads after Tailwind so it
   wins on the elements it targets.
   ============================================================ */

:root {
	--brand:      #00ac47;  /* rail / brand green            */
	--brand-dark: #00913c;  /* hover                         */
	--ink:        #10231a;  /* near-black green heading ink  */
	--body:       #4a6357;  /* muted green-gray body text    */
	--muted:      #6b8478;  /* fainter labels                */
	--bg:         #f4f8f5;  /* soft green-white page ground  */
	--line:       #e0ebe4;  /* hairline borders on light bg  */

	/* Code block (dark) + token palette */
	--code-bg:    #0b1a12;
	--code-base:  #aec6b7;
	--tok-comment:#587e6c;
	--tok-punc:   #7ba38c;
	--tok-number: #d8b47c;
	--tok-string: #8fc39b;
	--tok-keyword:#57b877;
	--tok-func:   #5cb695;
	--tok-var:    #d18f5e;
}

body {
	background-color: var(--bg);
	color: var(--body);
	font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---- Type scale (from the preview) ---- */
h1, h2, h3, h4 { color: var(--ink); text-wrap: balance; }

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.7rem;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--brand);
}
.eyebrow::before {
	content: "";
	width: 2.2rem;
	height: 2px;
	background: var(--brand);
}

.display {
	font-size: clamp(1.9rem, 5vw, 3rem);
	line-height: 1.05;
	letter-spacing: -0.02em;
	font-weight: 700;
	color: var(--ink);
	margin: 0.5em 0 0.4em;
}
.display .accent { color: var(--brand); }

.lede {
	font-size: 1.05rem;
	line-height: 1.6;
	color: var(--body);
	max-width: 46ch;
}

.section-label {
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--muted);
}

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

/* ---- Post content typography ---- */
.prose p { font-size: 1.05rem; line-height: 1.6; color: var(--body); margin: 0 0 1.15em; }
.prose h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); line-height: 1.15; letter-spacing: -0.015em; font-weight: 700; margin: 1.8em 0 0.5em; }
.prose h3 { font-size: 1.4rem; line-height: 1.25; letter-spacing: -0.01em; font-weight: 600; margin: 1.5em 0 0.4em; }
.prose a  { text-decoration: underline; text-underline-offset: 2px; }

/* Content lists — Tailwind's reset strips markers, so restore them */
.prose ul, .prose ol { margin: 0 0 1.15em; padding-left: 1.5em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin: 0.35em 0; font-size: 1.05rem; line-height: 1.6; color: var(--body); }
.prose li::marker { color: var(--brand); }
.prose li > ul, .prose li > ol { margin: 0.35em 0; }

/* ---- Inline code ---- */
:not(pre) > code,
.prose :not(pre) > code {
	font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	background: rgba(0, 172, 71, 0.10);
	color: #0a7c37;
	padding: 0.14em 0.45em;
	border-radius: 6px;
	border: 1px solid rgba(0, 172, 71, 0.24);
	font-size: 0.9em;
}

/* ============================================================
   Code window — the signature dark green block with chrome.
   Hand-built (no Prism needed) so the demo matches pixel-close.
   ============================================================ */
.code-window {
	position: relative;
	background: var(--code-bg);
	border: 1px solid rgba(0, 172, 71, 0.35);
	border-left: 4px solid var(--brand);
	border-radius: 10px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
	overflow: hidden;
}
.code-window__bar {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	height: 2.6rem;
	padding: 0 0.9rem 0 1.1rem;
	background: rgba(0, 0, 0, 0.22);
	border-bottom: 1px solid rgba(0, 172, 71, 0.20);
}
.code-window__dots { display: flex; gap: 0.5rem; }
.code-window__dots i {
	width: 0.62rem; height: 0.62rem; border-radius: 50%;
	background: var(--brand);
	display: block;
}
.code-window__dots i:nth-child(2) { background: rgba(0, 172, 71, 0.55); }
.code-window__dots i:nth-child(3) { background: rgba(0, 172, 71, 0.30); }
.code-window__file {
	margin-left: auto;
	font-family: "JetBrains Mono", ui-monospace, monospace;
	font-size: 0.8rem;
	color: var(--tok-comment);
}
.code-window__link {
	font-family: "JetBrains Mono", ui-monospace, monospace;
	font-size: 0.72rem;
	color: var(--tok-string);
	text-decoration: none;
	padding: 0.2rem 0.5rem;
	border-radius: 6px;
	transition: color .15s, background .15s;
}
.code-window__link:hover { color: #b7f3cf; background: rgba(0, 172, 71, 0.12); }
.code-window__copy {
	font-family: "JetBrains Mono", ui-monospace, monospace;
	font-size: 0.72rem;
	color: #b7f3cf;
	background: rgba(0, 172, 71, 0.18);
	border: 1px solid rgba(0, 172, 71, 0.35);
	border-radius: 6px;
	padding: 0.2rem 0.6rem;
	cursor: pointer;
	transition: background .15s, color .15s;
}
.code-window__copy:hover { background: var(--brand); color: #fff; }
.prose .code-window { margin: 1.6em 0; }
.code-window pre {
	margin: 0;
	padding: 1.15rem 1.35rem;
	overflow: auto;
	font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.9rem;
	line-height: 1.65;
	color: var(--code-base);
	tab-size: 4;
}

/* token colors for hand-authored spans (no Prism — plain span classes) */
.tok-comment { color: var(--tok-comment); font-style: italic; }
.tok-punc    { color: var(--tok-punc); }
.tok-number  { color: var(--tok-number); }
.tok-string  { color: var(--tok-string); }
.tok-keyword { color: var(--tok-keyword); font-weight: 600; }
.tok-func    { color: var(--tok-func); }
.tok-var     { color: var(--tok-var); }

/* ---- Token palette swatch grid (preview's legend) ---- */
.swatch {
	display: flex; align-items: center; gap: 0.75rem;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 0.85rem 1rem;
}
.swatch b { display: block; font-size: 0.9rem; font-weight: 600; color: var(--ink); }
.swatch span { font-family: "JetBrains Mono", monospace; font-size: 0.78rem; color: var(--muted); }
.swatch i { width: 1.4rem; height: 1.4rem; border-radius: 5px; flex: none; border: 1px solid rgba(0,0,0,0.06); }

/* Method palette: mono method chip + origin tag, over a sans description */
.swatch--method { flex-direction: column; align-items: stretch; gap: 0.5rem; }
.method-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.swatch--method .method-desc { font-family: inherit; font-size: 0.85rem; color: var(--body); }

/* Origin tag: green = PhpSpreadsheet, teal-green = Google Sheets, amber = PHP */
.swatch .tag {
	font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
	font-size: 0.55rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	padding: 0.1rem 0.4rem;
	border-radius: 999px;
	white-space: nowrap;
}
.tag--pss { color: #0a7c37; background: rgba(0, 172, 71, 0.12);  border: 1px solid rgba(0, 172, 71, 0.24); }
.tag--gs  { color: #3f7d63; background: rgba(92, 182, 149, 0.16); border: 1px solid rgba(92, 182, 149, 0.32); }
.tag--php { color: #a8672e; background: rgba(209, 143, 94, 0.14); border: 1px solid rgba(209, 143, 94, 0.32); }

/* Browse by technique: whole card is a link with a brand-green chip */
.swatch--link { text-decoration: none; }
.swatch--link i { background: var(--brand); }
.swatch--link span { font-family: inherit; font-size: 0.82rem; color: var(--muted); }
.swatch--link:hover { border-color: rgba(0,172,71,0.5); box-shadow: 0 6px 18px rgba(0,0,0,0.06); }
.swatch--link:hover b { color: var(--brand); }
/* keep reference cards link-clean inside .prose (which underlines <a>) */
.prose a.swatch--link { text-decoration: none; }

/* Reference cards: inline-SVG icon in a rounded green chip instead of the box */
.ref-ico {
	width: 2rem; height: 2rem;
	flex: none;
	display: flex; align-items: center; justify-content: center;
	border-radius: 8px;
	color: var(--brand);
	background: rgba(0, 172, 71, 0.10);
	border: 1px solid rgba(0, 172, 71, 0.20);
}
.ref-ico svg { width: 1.05rem; height: 1.05rem; }
.swatch--ref:hover .ref-ico { background: rgba(0, 172, 71, 0.16); }

/* ---- Search box (shared: header + hero + default form) ---- */
.sc-search { position: relative; display: block; }
.sc-search__icon {
	position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%);
	display: flex; color: var(--muted); pointer-events: none;
}
.sc-search__icon svg { width: 1.1rem; height: 1.1rem; }
.sc-search input[type="search"] {
	width: 100%; box-sizing: border-box;
	font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
	font-size: 1rem; color: var(--ink);
	background: #fff; border: 1px solid var(--line);
	border-radius: 10px; padding: 0.7rem 1rem 0.7rem 2.6rem;
	transition: border-color .15s, box-shadow .15s;
}
.sc-search input[type="search"]:focus {
	outline: none; border-color: var(--brand);
	box-shadow: 0 0 0 3px rgba(0, 172, 71, 0.15);
}
.sc-search input[type="search"]::placeholder { color: var(--muted); }

/* ---- Pagination (archive/search) ---- */
.sc-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.sc-pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 2.3rem; height: 2.3rem; padding: 0 0.75rem;
	border-radius: 8px; border: 1px solid var(--line);
	background: #fff; color: var(--body);
	font-size: 0.9rem; text-decoration: none;
	transition: border-color .15s, color .15s, background .15s;
}
.sc-pagination a.page-numbers:hover { border-color: rgba(0,172,71,0.5); color: var(--brand); }
.sc-pagination .page-numbers.current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.sc-pagination .page-numbers.dots { border: none; background: none; padding: 0 0.25rem; min-width: auto; }

/* ---- Cards (latest posts) ---- */
.card {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 1rem 1.15rem;
	transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: rgba(0,172,71,0.5); box-shadow: 0 6px 18px rgba(0,0,0,0.06); }
