/*
Theme Name: VSCode Minimal
Version: 3.5.1
*/

/* ==========================================================================
   1. Token — palette Visual Studio Code
   Dark  = Dark+ (default dark)
   Light = Light+ (default light)
   ========================================================================== */

:root,
[data-theme="dark"] {
	--bg:            #1e1e1e;
	--bg-elev:       #252526;
	--bg-bar:        #333333;
	--border:        #3c3c3c;
	--border-strong: #565656;
	--fg:            #d4d4d4;
	--fg-strong:     #ffffff;
	--fg-muted:      #8b949e;
	--accent:        #007acc;
	--accent-fg:     #ffffff;
	--tok-keyword:   #569cd6;
	--tok-type:      #4ec9b0;
	--tok-function:  #dcdcaa;
	--tok-string:    #ce9178;
	--tok-comment:   #6a9955;
	--tok-tag:       #808080;
	--selection:     #264f78;
	--shadow:        0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
	color-scheme: dark;
}
[data-theme="light"] {
	--bg:            #ffffff;
	--bg-elev:       #f3f3f3;
	--bg-bar:        #f8f8f8;
	--border:        #e5e5e5;
	--border-strong: #cecece;
	--fg:            #3b3b3b;
	--fg-strong:     #1f1f1f;
	--fg-muted:      #6a737d;
	--accent:        #005fb8;
	--accent-fg:     #ffffff;
	--tok-keyword:   #0000ff;
	--tok-type:      #267f99;
	--tok-function:  #795e26;
	--tok-string:    #a31515;
	--tok-comment:   #008000;
	--tok-tag:       #800000;
	--selection:     #add6ff;
	--shadow:        0 1px 2px rgba(0, 0, 0, .06), 0 6px 18px rgba(0, 0, 0, .05);
	color-scheme: light;
}


:root {
	--font-ui:   "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
	--font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;

	--wrap:   720px;
	--gutter: 24px;
	--radius: 4px;

	--step-0: 1rem;
	--step-1: 1.125rem;
	--step-2: 1.375rem;
	--step-3: clamp(1.6rem, 1.2rem + 2vw, 2.25rem);
	--step-4: clamp(2.2rem, 1.4rem + 4.2vw, 4rem);
}

/* ==========================================================================
   2. Reset e base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--font-ui);
	font-size: var(--step-1);
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	transition: background-color .18s ease, color .18s ease;
}

::selection { background: var(--selection); }

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--tok-keyword); }

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	border-radius: 2px;
}

code, pre, kbd { font-family: var(--font-mono); font-size: .9em; }

.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--accent);
	color: var(--accent-fg);
	padding: 10px 16px;
	z-index: 100;
	font-family: var(--font-mono);
	font-size: .85rem;
}
.skip-link:focus { left: 0; }

.screen-reader-text {
	position: absolute;
	width: 1px; height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ==========================================================================
   3. Barra superiore (title bar dell'editor)
   ========================================================================== */

.topbar {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--bg-bar);
	border-bottom: 1px solid var(--border);
	backdrop-filter: saturate(180%) blur(6px);
}

.topbar__inner {
	display: flex;
	align-items: center;
	gap: 0;
	min-height: 40px;
}

/* Marchio in barra: solo il nome, ancora di ritorno su ogni pagina */
.topbar__brand {
	display: block;
	min-width: 0;
	text-decoration: none;
	color: var(--fg);
}
.topbar__name {
	font-family: var(--font-mono);
	font-size: .82rem;
	font-weight: 600;
	letter-spacing: -.01em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.topbar__brand:hover .topbar__name { color: var(--accent); }

/* Ricerca a scomparsa, senza JavaScript: <details> + <summary> */
.topbar__search > summary {
	list-style: none;
	cursor: pointer;
}
.topbar__search > summary::-webkit-details-marker { display: none; }
.topbar__search[open] > summary {
	color: var(--fg-strong);
	background: var(--bg-elev);
	border-color: var(--border);
}
.topbar__search-panel {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	background: var(--bg-bar);
	border-bottom: 1px solid var(--border);
	padding-block: 12px;
}
.topbar__search-panel .search-form { max-width: none; }

/* Pulsanti azione a destra della strip */
.topbar__actions {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 4px;
	padding-left: 10px;
	flex: 0 0 auto;
}
.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	flex: 0 0 auto;
	padding: 0;
	background: transparent;
	border: 1px solid transparent;
	border-radius: var(--radius);
	color: var(--fg-muted);
	cursor: pointer;
	transition: color .15s ease, background-color .15s ease;
}
.icon-btn:hover { color: var(--fg-strong); background: var(--bg-elev); border-color: var(--border); }
.icon-btn svg { width: 17px; height: 17px; }
.search-toggle[aria-expanded="true"] { color: var(--fg-strong); background: var(--bg-elev); border-color: var(--border); }
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun  { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }

/* ==========================================================================
   4. Header principale
   ========================================================================== */

.masthead {
	padding-block: clamp(64px, 12vw, 128px) clamp(48px, 8vw, 88px);
	border-bottom: 1px solid var(--border);
	background:
		radial-gradient(120% 80% at 50% -20%, var(--bg-elev) 0%, transparent 70%);
}

.masthead__eyebrow {
	font-family: var(--font-mono);
	font-size: .8rem;
	color: var(--tok-comment);
	margin: 0 0 14px;
}

.masthead__title {
	font-family: var(--font-mono);
	font-size: var(--step-4);
	line-height: 1.05;
	font-weight: 600;
	letter-spacing: -.03em;
	margin: 0;
	color: var(--fg-strong);
	overflow-wrap: break-word;
}
.masthead__title a { color: inherit; text-decoration: none; }
.punct { color: var(--tok-tag); font-weight: 400; }
.masthead__title .accent { color: var(--tok-function); }

/* Riga di presentazione con i link alle categorie */
.masthead__intro {
	font-family: var(--font-ui);
	font-size: clamp(1rem, .95rem + .3vw, 1.125rem);
	line-height: 1.65;
	color: var(--fg);
	max-width: 56ch;
	margin: 24px 0 0;
	text-wrap: pretty;
}
.masthead__intro a {
	color: var(--tok-type);
	text-decoration: underline;
	text-decoration-color: var(--border-strong);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	transition: color .15s ease, text-decoration-color .15s ease;
}
.masthead__intro a:hover,
.masthead__intro a:focus-visible {
	color: var(--tok-keyword);
	text-decoration-color: currentColor;
}

/* Cursore lampeggiante */
.caret {
	display: inline-block;
	width: .5ch;
	height: .82em;
	margin-left: .1em;
	background: var(--accent);
	vertical-align: -.12em;
	animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ==========================================================================
   5. Home — lista card
   ========================================================================== */

.section-label {
	display: flex;
	align-items: center;
	gap: 12px;
	font-family: var(--font-mono);
	font-size: .78rem;
	text-transform: uppercase;
	letter-spacing: .12em;
	color: var(--fg-muted);
	margin: clamp(40px, 7vw, 72px) 0 24px;
}
.section-label::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--border);
}

.section-label--page { margin-top: clamp(32px, 6vw, 56px); }

.cards {
	display: grid;
	gap: 16px;
	margin: 0 0 56px;
	padding: 0;
	list-style: none;
}

.card {
	position: relative;
	background: var(--bg-elev);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 22px 24px;
	transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.card::before {
	content: "";
	position: absolute;
	inset: -1px auto -1px -1px;
	width: 2px;
	background: var(--accent);
	border-radius: var(--radius) 0 0 var(--radius);
	opacity: 0;
	transition: opacity .15s ease;
}
.card:hover,
.card:focus-within {
	border-color: var(--border-strong);
	transform: translateY(-2px);
	box-shadow: var(--shadow);
}
.card:hover::before,
.card:focus-within::before { opacity: 1; }

/* Meta su tre righe: data e autore, categorie, badge del gioco. */
.card__meta {
	font-family: var(--font-mono);
	font-size: .75rem;
	color: var(--fg-muted);
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	margin-bottom: 10px;
}
.card__meta--tail { margin: 0 0 12px; }
.card__meta-row,
.entry__meta-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	max-width: 100%;
}
.card__author { color: var(--tok-function); }
.card__cat { color: var(--tok-type); }
.card__dot { opacity: .45; }
.card__read { color: var(--tok-string); }

.card__cats { display: block; min-width: 0; }
a.card__cat { text-decoration: none; }
a.card__cat:hover,
a.card__cat:focus-visible {
	color: var(--tok-keyword);
	text-decoration: underline;
	text-underline-offset: 2px;
}
.card__comma { color: var(--fg-muted); opacity: .7; }

/* Badge del gioco (tag del post). Volutamente diverso dalle categorie:
   ha una forma propria, un'icona e il colore «string» della palette. */
.card__game {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	max-width: 100%;
	padding: 3px 9px;
	background: var(--bg);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	color: var(--tok-string);
	font-size: .72rem;
	line-height: 1.6;
	text-decoration: none;
	white-space: nowrap;
	transition: border-color .15s ease, background-color .15s ease;
}
.card__game svg { width: 13px; height: 13px; flex: 0 0 auto; opacity: .85; }
.card__game span { overflow: hidden; text-overflow: ellipsis; }
.card__game:hover,
.card__game:focus-visible {
	color: var(--tok-string);
	border-color: var(--tok-string);
	background: var(--bg-elev);
}

.card__title {
	font-family: var(--font-mono);
	font-size: var(--step-2);
	line-height: 1.3;
	font-weight: 600;
	letter-spacing: -.015em;
	margin: 0 0 10px;
}
.card__title a {
	color: var(--tok-keyword);
	text-decoration: none;
}
.card:hover .card__title a { text-decoration: underline; text-decoration-thickness: 1px; }

.card__excerpt {
	margin: 0;
	font-size: 1rem;
	line-height: 1.65;
	color: var(--fg);
}

.card__thumb {
	display: block;
	margin: 0 0 16px;
	border-radius: var(--radius);
	overflow: hidden;
	border: 1px solid var(--border);
}
.card__thumb img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; }

/* ==========================================================================
   6. Articolo singolo
   ========================================================================== */

.entry { padding-block: clamp(40px, 7vw, 72px) 24px; }

.entry__meta {
	font-family: var(--font-mono);
	font-size: .8rem;
	color: var(--fg-muted);
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 7px;
	margin: 0 0 36px;
}

.entry__title {
	font-family: var(--font-mono);
	font-size: var(--step-3);
	line-height: 1.2;
	font-weight: 600;
	letter-spacing: -.025em;
	color: var(--fg-strong);
	margin: 0 0 18px;
	overflow-wrap: break-word;
}

.entry__thumb { margin: 0 0 36px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

.prose > * + * { margin-top: 1.3em; }
.prose h2, .prose h3, .prose h4 {
	font-family: var(--font-mono);
	color: var(--fg-strong);
	letter-spacing: -.02em;
	line-height: 1.3;
	margin-top: 2em;
	scroll-margin-top: 72px;
}
.prose h2 { font-size: var(--step-2); }
.prose h3 { font-size: var(--step-1); }
.prose h4 { font-size: var(--step-0); }
.prose p, .prose li { overflow-wrap: break-word; }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--tok-keyword); }

.prose blockquote {
	margin-inline: 0;
	padding: 4px 0 4px 20px;
	border-left: 2px solid var(--accent);
	color: var(--fg-muted);
	font-style: normal;
}

.prose :not(pre) > code {
	background: var(--bg-elev);
	border: 1px solid var(--border);
	border-radius: 3px;
	padding: .12em .4em;
	color: var(--tok-string);
}

.prose pre {
	background: var(--bg-elev);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 18px 20px;
	overflow-x: auto;
	line-height: 1.55;
	tab-size: 2;
}
.prose pre code { color: var(--fg); background: none; border: 0; padding: 0; }

.prose hr { border: 0; border-top: 1px solid var(--border); margin-block: 2.5em; }

.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.prose th { background: var(--bg-elev); font-family: var(--font-mono); font-size: .85rem; }

.prose figure { margin: 0; }
.prose figcaption {
	font-family: var(--font-mono);
	font-size: .78rem;
	color: var(--fg-muted);
	margin-top: 8px;
}

.prose img {
	max-width: 100%;
	height: auto;
	border-radius: var(--radius);
}
.prose figure { text-align: center; }
.prose figure img { margin-inline: auto; }
.alignwide, .alignfull { margin-inline: 0; }
.aligncenter { margin-inline: auto; }

/* Lista link (social, itch, shop) fra i meta e il testo del post */
.postlinks {
	margin: 0 0 34px;
	padding-top: 16px;
	border-top: 1px solid var(--border);
}
.postlinks ul {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.postlinks a {
	font-family: var(--font-mono);
	font-size: .8rem;
	color: var(--fg-muted);
	text-decoration: none;
}
.postlinks a:hover,
.postlinks a:focus-visible { color: var(--accent); text-decoration: underline; }

/* ==========================================================================
   7. Navigazione tra post e paginazione
   ========================================================================== */

.post-nav {
	display: grid;
	gap: 12px;
	margin: clamp(48px, 8vw, 80px) 0 0;
	padding-top: 28px;
	border-top: 1px solid var(--border);
	font-family: var(--font-mono);
	font-size: .85rem;
}
.post-nav a {
	display: block;
	padding: 14px 16px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	text-decoration: none;
	color: var(--fg);
	background: var(--bg-elev);
	transition: border-color .15s ease, color .15s ease;
}
.post-nav a:hover { border-color: var(--border-strong); color: var(--tok-keyword); }
.post-nav small { display: block; color: var(--fg-muted); font-size: .72rem; margin-bottom: 4px; }

.pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 64px;
	font-family: var(--font-mono);
	font-size: .85rem;
}
.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 34px;
	padding-inline: 10px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	color: var(--fg-muted);
	text-decoration: none;
}
.pagination .page-numbers:hover { color: var(--fg-strong); border-color: var(--border-strong); }
.pagination .page-numbers.current {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--accent-fg);
}

/* ==========================================================================
   8. Stati vuoti e 404
   ========================================================================== */

.notice {
	padding: 32px 0 64px;
	font-family: var(--font-mono);
}
.notice__code {
	font-size: var(--step-4);
	color: var(--tok-comment);
	line-height: 1;
	margin: 0 0 16px;
	letter-spacing: -.03em;
}
.notice p { color: var(--fg-muted); margin: 0 0 20px; font-size: 1rem; }

.search-form { display: flex; gap: 8px; max-width: 420px; }
.search-form input[type="search"] {
	flex: 1;
	min-width: 0;
	padding: 9px 12px;
	background: var(--bg-elev);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	color: var(--fg);
	font-family: var(--font-mono);
	font-size: .9rem;
}
.search-form input[type="search"]:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.search-form button {
	padding: 9px 16px;
	background: var(--accent);
	color: var(--accent-fg);
	border: 0;
	border-radius: var(--radius);
	font-family: var(--font-mono);
	font-size: .9rem;
	cursor: pointer;
}

/* ==========================================================================
   8b. Elenco giochi e logo di chiusura
   ========================================================================== */

.games {
	border-top: 1px solid var(--border);
	margin-top: clamp(48px, 8vw, 80px);
	padding-block: clamp(32px, 5vw, 48px) 0;
}
.games__label {
	font-family: var(--font-mono);
	font-size: .75rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: .14em;
	color: var(--fg-muted);
	margin: 0 0 18px;
}
.games__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.games__list a {
	display: inline-block;
	padding: 4px 10px;
	background: var(--bg-elev);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	font-family: var(--font-mono);
	font-size: .78rem;
	color: var(--tok-string);
	text-decoration: none;
	transition: border-color .15s ease;
}
.games__list a:hover,
.games__list a:focus-visible {
	color: var(--tok-string);
	border-color: var(--tok-string);
}
.colophon {
	display: flex;
	justify-content: center;
	padding-block: clamp(40px, 7vw, 72px);
}
.colophon__logo {
	width: clamp(96px, 13vw, 140px);
	height: auto;
	border-radius: 50%;
	transition: opacity .15s ease;
}
.colophon a:hover .colophon__logo { opacity: .85; }

/* ==========================================================================
   9. Status bar (footer)
   ========================================================================== */

.statusbar {
	background: var(--accent);
	color: var(--accent-fg);
	font-family: var(--font-mono);
	font-size: .74rem;
	margin-top: auto;
}
.statusbar__inner {
	display: flex;
	align-items: center;
	gap: 18px;
	min-height: 26px;
	flex-wrap: wrap;
}
.statusbar a { color: inherit; text-decoration: none; opacity: .95; }
.statusbar a:hover { text-decoration: underline; color: inherit; }
.statusbar__right { margin-left: auto; opacity: .85; }


body { display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1; }

/* ==========================================================================
   10. Responsive e preferenze
   ========================================================================== */

@media (max-width: 640px) {
	:root { --gutter: 18px; }
	body { font-size: 1.0625rem; }
	.card { padding: 18px; }
	.masthead { padding-block: 48px 40px; }
	.masthead__intro { font-size: 1rem; }
	.topbar__name { font-size: .78rem; max-width: 38vw; }
	.topbar__brand { padding-right: 10px; }
	.nav a { padding: 0 11px; }
}

@media (min-width: 960px) {
	:root { --wrap: 860px; }
}

@media (min-width: 1280px) {
	:root { --wrap: 900px; }
	.cards { gap: 22px; }
	.card { padding: 26px 28px; }
	.card__title { font-size: 1.25rem; }
}

/* Articolo e card condividono lo stesso contenitore: titolo, testo,
   codice e immagini sono allineati sulla stessa larghezza. */
.notice { max-width: 760px; }

@media (min-width: 760px) {
	.cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 18px;
	}
	.card__title { font-size: var(--step-1); }
}

@media (min-width: 720px) {
	.post-nav { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
	.card:hover { transform: none; }
}

@media print {
	.topbar, .statusbar, .post-nav, .theme-toggle { display: none; }
	body { background: #fff; color: #000; }
}