/* ============ SonCV Theme v1.0.0 ============ */
:root {
	--scv-accent: #2563eb;
	--scv-ink: #0f172a;
	--scv-body: #334155;
	--scv-muted: #64748b;
	--scv-line: #e2e8f0;
	--scv-bg: #f8fafc;
	--scv-card: #ffffff;
	--scv-radius: 12px;
	--scv-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--scv-font); color: var(--scv-body); line-height: 1.6; background: #fff; font-size: 16px; }
h1, h2, h3, h4 { color: var(--scv-ink); line-height: 1.25; }
a { color: var(--scv-accent); }
a:hover { color: var(--scv-ink); }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--scv-accent); outline-offset: 2px; }

.screen-reader-text { border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--scv-ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 200; transition: top .2s; text-decoration: none; }
.skip-link:focus { top: 12px; color: #fff; }

.scv-container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.scv-container-wide { max-width: 1400px; }
.scv-section { padding: 48px 0; }
.scv-narrow { max-width: 820px; }
.scv-main { min-height: 60vh; }

/* buttons */
.scv-btn { display: inline-block; border: 1px solid transparent; border-radius: 8px; padding: 10px 20px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; text-decoration: none; line-height: 1.4; }
.scv-btn-primary { background: var(--scv-accent); color: #fff; }
.scv-btn-primary:hover { color: #fff; filter: brightness(.92); }
.scv-btn-secondary { background: #f1f5f9; color: var(--scv-ink); border-color: var(--scv-line); }
.scv-btn-secondary:hover { background: var(--scv-line); color: var(--scv-ink); }

/* header */
.scv-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--scv-line); }
.scv-header-inner { display: flex; align-items: center; gap: 28px; height: 68px; }
.scv-brand { flex-shrink: 0; }
.scv-brand .custom-logo { max-height: 40px; width: auto; }
.scv-logo-text { font-size: 24px; font-weight: 800; letter-spacing: -.5px; color: var(--scv-ink); text-decoration: none; }
.scv-logo-text span { color: var(--scv-accent); }
.scv-nav { margin-left: auto; }
.scv-menu { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.scv-menu a { display: block; padding: 9px 14px; border-radius: 8px; color: var(--scv-body); text-decoration: none; font-weight: 600; font-size: 15px; }
.scv-menu a:hover { background: var(--scv-bg); color: var(--scv-ink); }
.scv-menu .current-menu-item > a { color: var(--scv-accent); }
.scv-header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.scv-nav + .scv-header-actions { margin-left: 0; }
.scv-menu-toggle { display: none; background: none; border: 1px solid var(--scv-line); border-radius: 8px; width: 44px; height: 44px; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.scv-menu-toggle span { display: block; width: 20px; height: 2px; background: var(--scv-ink); border-radius: 2px; transition: transform .2s, opacity .2s; }

/* page head */
.scv-page-head { max-width: 760px; margin: 0 0 32px; }
.scv-page-head h1 { font-size: clamp(30px, 4vw, 42px); letter-spacing: -.5px; margin: 0 0 10px; }
.scv-page-head p { font-size: 18px; color: var(--scv-muted); margin: 0; }
.scv-kicker { margin: 0 0 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; }
.scv-kicker a { text-decoration: none; }

/* cards */
.scv-grid { display: grid; gap: 22px; }
.scv-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .scv-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .scv-grid-3 { grid-template-columns: 1fr; } }
.scv-card-post { background: var(--scv-card); border: 1px solid var(--scv-line); border-radius: var(--scv-radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.scv-card-post:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(15,23,42,.1); }
.scv-card-media img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.scv-card-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.scv-card-title { font-size: 19px; margin: 0; }
.scv-card-title a { color: var(--scv-ink); text-decoration: none; }
.scv-card-title a:hover { color: var(--scv-accent); }
.scv-card-excerpt { margin: 0; color: var(--scv-muted); font-size: 15px; flex: 1; }

/* meta */
.scv-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13.5px; color: var(--scv-muted); }
.scv-meta a { color: var(--scv-body); text-decoration: none; font-weight: 600; }
.scv-meta-author { display: inline-flex; align-items: center; gap: 8px; }
.scv-meta .avatar { border-radius: 50%; }
.scv-meta-sep { color: var(--scv-line); }

/* article */
.scv-article { max-width: 780px; margin: 0 auto; }
.scv-article-head { margin-bottom: 24px; }
.scv-article-head h1 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -.5px; margin: 0 0 14px; }
.scv-featured { margin: 0 0 28px; }
.scv-featured img { border-radius: var(--scv-radius); width: 100%; }

/* rich entry typography (guides) */
.scv-entry { font-size: 17px; }
.scv-entry > *:first-child { margin-top: 0; }
.scv-entry h2 { font-size: 26px; margin: 38px 0 14px; letter-spacing: -.3px; }
.scv-entry h3 { font-size: 20px; margin: 30px 0 10px; }
.scv-entry h4 { font-size: 17px; margin: 24px 0 8px; }
.scv-entry p { margin: 0 0 18px; }
.scv-entry ul, .scv-entry ol { margin: 0 0 18px; padding-left: 24px; }
.scv-entry li { margin-bottom: 8px; }
.scv-entry li::marker { color: var(--scv-accent); font-weight: 700; }
.scv-entry blockquote { margin: 0 0 20px; padding: 16px 20px; border-left: 4px solid var(--scv-accent); background: var(--scv-bg); border-radius: 0 8px 8px 0; color: var(--scv-ink); }
.scv-entry blockquote p:last-child { margin-bottom: 0; }
.scv-entry table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 15px; }
.scv-entry th, .scv-entry td { border: 1px solid var(--scv-line); padding: 10px 14px; text-align: left; }
.scv-entry th { background: var(--scv-bg); color: var(--scv-ink); }
.scv-entry code { background: var(--scv-bg); border: 1px solid var(--scv-line); border-radius: 4px; padding: 1px 6px; font-size: .9em; }
.scv-entry pre { background: var(--scv-ink); color: #e2e8f0; padding: 18px; border-radius: 10px; overflow-x: auto; font-size: 14px; }
.scv-entry pre code { background: none; border: none; padding: 0; }
.scv-entry img { border-radius: 8px; }
.scv-entry figure { margin: 0 0 20px; }
.scv-entry figcaption { font-size: 13px; color: var(--scv-muted); text-align: center; margin-top: 8px; }
.scv-entry hr { border: none; border-top: 1px solid var(--scv-line); margin: 32px 0; }
.scv-tags-row { font-size: 14px; color: var(--scv-muted); }
.scv-embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; margin: 0 0 20px; border-radius: 10px; }
.scv-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* author box + related */
.scv-author-box { display: flex; gap: 18px; align-items: flex-start; background: var(--scv-bg); border: 1px solid var(--scv-line); border-radius: var(--scv-radius); padding: 22px; margin: 36px 0; }
.scv-author-box .avatar { border-radius: 50%; flex-shrink: 0; width: 72px; height: 72px; object-fit: cover; }
@media (max-width: 560px) {
	.scv-author-box .avatar { width: 56px; height: 56px; }
}
.scv-author-box h4 { margin: 0 0 6px; font-size: 17px; }
.scv-author-box p { margin: 0; font-size: 15px; color: var(--scv-muted); }
.scv-related { margin: 48px 0 0; }
.scv-related h3 { font-size: 22px; margin: 0 0 18px; }

/* ads */
.scv-ad-slot { margin: 28px auto; text-align: center; max-width: 1140px; padding: 0 20px; }
.scv-ad-slot:empty { display: none; }

/* blank canvas (tool pages) */
.scv-blank { max-width: none; }

/* search */
.scv-search { display: flex; gap: 10px; max-width: 520px; margin-top: 18px; }
.scv-search-input { flex: 1; padding: 11px 14px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 15px; font-family: inherit; }
.scv-search-input:focus { outline: 2px solid var(--scv-accent); border-color: var(--scv-accent); }

/* pagination */
.scv-pagination { margin: 36px 0 0; text-align: center; }
.scv-pagination .nav-links { display: inline-flex; gap: 8px; }
.scv-pagination .page-numbers { display: inline-block; padding: 9px 16px; border: 1px solid var(--scv-line); border-radius: 8px; text-decoration: none; color: var(--scv-body); font-weight: 600; font-size: 14px; }
.scv-pagination .page-numbers.current { background: var(--scv-ink); color: #fff; border-color: var(--scv-ink); }
.scv-pagination a.page-numbers:hover { background: var(--scv-bg); }

/* 404 / none */
.scv-404, .scv-none { text-align: center; }
.scv-404 h1, .scv-none h2 { margin-top: 0; }
.scv-404-links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 24px 0; }
.scv-404 .scv-search { margin-left: auto; margin-right: auto; }

/* footer */
.scv-footer { background: var(--scv-ink); color: #94a3b8; margin-top: 64px; }
.scv-footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; padding: 56px 0 40px; }
@media (max-width: 900px) { .scv-footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .scv-footer-grid { grid-template-columns: 1fr; } }
.scv-footer .scv-logo-text { color: #fff; }
.scv-footer-brand p { font-size: 14.5px; max-width: 300px; }
.scv-footer-title { color: #fff; font-size: 15px; margin: 0 0 14px; }
.scv-footer-widget ul { list-style: none; margin: 0; padding: 0; }
.scv-footer-widget li { margin-bottom: 10px; }
.scv-footer-widget a { color: #94a3b8; text-decoration: none; font-size: 14.5px; }
.scv-footer-widget a:hover { color: #fff; }
.scv-footer-bottom { border-top: 1px solid #1e293b; padding: 20px 0; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13.5px; }
.scv-footer-bottom p { margin: 0; }
.scv-footer-legal a { color: #94a3b8; text-decoration: none; margin: 0 4px; }
.scv-footer-legal a:hover { color: #fff; }

/* responsive header */
@media (max-width: 900px) {
	.scv-menu-toggle { display: inline-flex; }
	.scv-nav { position: absolute; top: 68px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--scv-line); margin: 0; display: none; box-shadow: 0 18px 30px rgba(15,23,42,.08); }
	.scv-header.scv-nav-open .scv-nav { display: block; }
	.scv-menu { flex-direction: column; padding: 12px 20px 20px; }
	.scv-menu a { padding: 12px 8px; font-size: 16px; }
	.scv-header.scv-nav-open .scv-menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
	.scv-header.scv-nav-open .scv-menu-toggle span:nth-child(2) { opacity: 0; }
	.scv-header.scv-nav-open .scv-menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
	.scv-header .scv-cta { padding: 8px 14px; font-size: 14px; white-space: nowrap; }
}

/* ============ App-like mobile UX ============ */
.scv-tabbar { display: none; }

@media (max-width: 900px) {
	/* room for the fixed bottom tab bar + iPhone home indicator */
	body { padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); -webkit-tap-highlight-color: transparent; }

	.scv-tabbar {
		display: flex;
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
		background: rgba(255, 255, 255, .94);
		-webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
		border-top: 1px solid var(--scv-line);
		padding-bottom: env(safe-area-inset-bottom, 0px);
	}
	.scv-tab {
		flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
		gap: 3px; min-height: 62px; padding: 8px 4px 6px;
		color: var(--scv-muted); text-decoration: none;
		font-size: 11px; font-weight: 600; letter-spacing: .2px;
	}
	.scv-tab-icon svg { width: 24px; height: 24px; display: block; }
	.scv-tab.active { color: var(--scv-accent); }
	.scv-tab:active { background: var(--scv-bg); }

	/* comfortable reading width on phones: never let text touch the edges */
	.scv-container { padding-left: 20px; padding-right: 20px; }
}

@media print {
	.scv-tabbar { display: none !important; }
	body { padding-bottom: 0; }
}

/* v1.1.1 fixes: footer logo size + header overflow guard on small screens */
.scv-footer-brand .custom-logo { max-height: 52px; width: auto; max-width: 220px; }

@media (max-width: 900px) {
	.scv-header-inner { gap: 12px; }
	.scv-header-actions { min-width: 0; }
	.scv-header .scv-cta { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}

/* v1.1.2 — article media overflow guards: no image/figure/embed may ever
   break out of the content column, on desktop or mobile */
.scv-entry { overflow-wrap: break-word; }
.scv-entry img { max-width: 100%; height: auto; }
.scv-entry figure { margin: 0 auto 24px; padding: 0; max-width: 100%; min-width: 0; }
.scv-entry figure img { max-width: 100%; }
.scv-entry .alignwide, .scv-entry .alignfull { max-width: 100%; margin-left: auto; margin-right: auto; float: none; }
.scv-entry iframe, .scv-entry embed, .scv-entry object, .scv-entry video { max-width: 100%; }
@media (max-width: 640px) {
	.scv-entry table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
	.scv-entry pre { font-size: 12.5px; }
}
