/* ===========================
   Chanzine Archive
=========================== */
.chanzine-page-layout {
	width: 100%;
	padding: 28px 0 48px;
}

.chanzine-page-layout .chanzine-header {
	margin-bottom: 20px;
}

.chanzine-header {
	padding: 28px;
	margin-bottom: 20px;
}

.chanzine-header h1 {
	margin: 0 0 8px;
	font-size: 32px;
	line-height: 1.15;
}

.chanzine-header p {
	margin: 0;
	color: var(--text-muted);
	font-size: 15px;
	line-height: 1.6;
}

/*
 * 3 colonne su desktop.
 * Le card mantengono tutte la stessa altezza.
 */
.chanzine-list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	align-items: stretch;
}

.chanzine-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	height: 100%;
	overflow: hidden;
	padding: 0;
}

.chanzine-card-cover-link {
	display: block;
	overflow: hidden;
	background: var(--surface-muted);
}

.chanzine-card-cover {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	transition: transform 0.25s ease;
}

.chanzine-card-cover-link:hover .chanzine-card-cover {
	transform: scale(1.025);
}

.chanzine-card-content {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 18px;
}

.chanzine-card-meta {
	margin-bottom: 8px;
	color: var(--text-muted);
	font-size: 12px;
	line-height: 1.4;
}

.chanzine-card-title {
	margin: 0 0 10px;
	font-size: 19px;
	line-height: 1.3;
}

.chanzine-card-title a {
	color: inherit;
	text-decoration: none;
}

.chanzine-card-title a:hover {
	color: var(--brand-primary);
}

.chanzine-card-excerpt {
	display: -webkit-box;
	overflow: hidden;
	margin: 0;
	color: var(--text-secondary);
	font-size: 14px;
	line-height: 1.6;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 4;
}

.chanzine-card-actions {
	display: flex;
	justify-content: flex-start;
	margin-top: auto;
	padding-top: 18px;
}

.chanzine-card-actions .button {
	font-size: 13px;
}

.chanzine-sidebar-card {
	padding: 20px;
}

.chanzine-sidebar-card strong {
	display: block;
	margin-bottom: 8px;
	font-size: 17px;
}

.chanzine-sidebar-card p {
	margin: 0;
	color: var(--text-muted);
	font-size: 14px;
	line-height: 1.6;
}

.chanzine-empty {
	grid-column: 1 / -1;
	padding: 28px;
	text-align: center;
	color: var(--text-muted);
}

/* Due colonne su tablet e desktop meno larghi */
@media (max-width: 1100px) {
	.chanzine-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Una colonna su smartphone */
@media (max-width: 680px) {
	.chanzine-header {
		padding: 22px;
	}

	.chanzine-header h1 {
		font-size: 27px;
	}

	.chanzine-list {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}

	.chanzine-card-content {
		padding: 18px;
	}

	.chanzine-card-title {
		font-size: 20px;
	}

	.chanzine-card-excerpt {
		-webkit-line-clamp: 5;
	}

	.chanzine-card-actions .button {
		width: 100%;
		text-align: center;
	}
}

/* ===========================
   Chanzine Article
=========================== */

.chanzine-article {
	overflow: hidden;
	padding: 0;
}

.chanzine-article-cover {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.chanzine-article-body {
	padding: 32px;
}

.chanzine-article-header {
	margin-bottom: 32px;
}

.chanzine-article-meta {
	margin-bottom: 14px;
	color: var(--text-muted);
	font-size: 14px;
}

.chanzine-article-header h1 {
	margin: 0;
	font-size: 42px;
	line-height: 1.15;
}

/* ===========================
   Chanzine Markdown Content
=========================== */

.chanzine-content {
	color: var(--text-primary);
	font-size: 16px;
	line-height: 1.75;
	overflow-wrap: anywhere;
}

.chanzine-content > :first-child {
	margin-top: 0;
}

.chanzine-content > :last-child {
	margin-bottom: 0;
}

/* Titoli */

.chanzine-content h1,
.chanzine-content h2,
.chanzine-content h3,
.chanzine-content h4,
.chanzine-content h5,
.chanzine-content h6 {
	margin: 1.8em 0 0.65em;
	color: var(--text-primary);
	font-weight: 700;
	line-height: 1.25;
}

.chanzine-content h1 {
	padding-bottom: 12px;
	border-bottom: 1px solid var(--border-color);
	font-size: 32px;
}

.chanzine-content h2 {
	padding-bottom: 10px;
	border-bottom: 1px solid var(--border-color);
	font-size: 27px;
}

.chanzine-content h3 {
	font-size: 22px;
}

.chanzine-content h4 {
	font-size: 19px;
}

.chanzine-content h5 {
	font-size: 17px;
}

.chanzine-content h6 {
	color: var(--text-muted);
	font-size: 15px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* Testo */

.chanzine-content p {
	margin: 0 0 1.25em;
}

.chanzine-content strong {
	font-weight: 700;
}

.chanzine-content em {
	font-style: italic;
}

.chanzine-content del {
	color: var(--text-muted);
}

/* Link */

.chanzine-content a {
	color: var(--brand-primary);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.chanzine-content a:hover {
	text-decoration-thickness: 2px;
}

/* Liste */

.chanzine-content ul,
.chanzine-content ol {
	margin: 0 0 1.35em;
	padding-left: 1.6em;
}

.chanzine-content li {
	margin: 0.4em 0;
	padding-left: 0.2em;
}

.chanzine-content li > ul,
.chanzine-content li > ol {
	margin-top: 0.45em;
	margin-bottom: 0.45em;
}

/* Checkbox Markdown */

.chanzine-content input[type="checkbox"] {
	width: 16px;
	height: 16px;
	margin: 0 8px 0 0;
	vertical-align: -2px;
	accent-color: var(--brand-primary);
}

.chanzine-content input[type="checkbox"][disabled] {
	opacity: 1;
}

/* Citazioni */

.chanzine-content blockquote {
	margin: 1.5em 0;
	padding: 16px 20px;
	border-left: 4px solid var(--brand-primary);
	background: var(--surface-muted);
	color: var(--text-secondary);
}

.chanzine-content blockquote > :first-child {
	margin-top: 0;
}

.chanzine-content blockquote > :last-child {
	margin-bottom: 0;
}

/* Codice inline */

.chanzine-content code {
	padding: 0.15em 0.4em;
	border: 1px solid var(--border-color);
	border-radius: 4px;
	background: var(--surface-muted);
	color: var(--text-primary);
	font-family:
		"SFMono-Regular",
		Consolas,
		"Liberation Mono",
		Menlo,
		monospace;
	font-size: 0.9em;
}

/* Blocchi di codice */

.chanzine-content pre {
	max-width: 100%;
	margin: 1.5em 0;
	padding: 18px 20px;
	overflow-x: auto;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	background: #171a1f;
	color: #f1f3f5;
	line-height: 1.6;
	tab-size: 4;
}

.chanzine-content pre code {
	display: block;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font-size: 14px;
	white-space: pre;
}

/* Separatore */

.chanzine-content hr {
	height: 1px;
	margin: 2.2em 0;
	border: 0;
	background: var(--border-color);
}

/* Immagini */

.chanzine-content img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 1.5em auto;
	border-radius: 8px;
}

.chanzine-content a img {
	transition: opacity 0.2s ease;
}

.chanzine-content a:hover img {
	opacity: 0.92;
}

/* Tabelle */

.chanzine-content table {
	width: 100%;
	margin: 1.6em 0;
	border-collapse: collapse;
	border-spacing: 0;
	font-size: 15px;
}

.chanzine-content th,
.chanzine-content td {
	padding: 12px 14px;
	border: 1px solid var(--border-color);
	text-align: left;
	vertical-align: top;
}

.chanzine-content th {
	background: var(--surface-muted);
	color: var(--text-primary);
	font-weight: 700;
}

.chanzine-content tbody tr:nth-child(even) {
	background: var(--surface-muted);
}

/* Elementi vari */

.chanzine-content mark {
	padding: 0.1em 0.25em;
	background: #fff3bf;
	color: #343a40;
}

.chanzine-content sup,
.chanzine-content sub {
	font-size: 0.75em;
	line-height: 0;
}

.chanzine-content kbd {
	padding: 2px 6px;
	border: 1px solid var(--border-color);
	border-bottom-width: 2px;
	border-radius: 4px;
	background: var(--surface-muted);
	font-family:
		"SFMono-Regular",
		Consolas,
		"Liberation Mono",
		Menlo,
		monospace;
	font-size: 0.85em;
}

/* Responsive */

@media (max-width: 680px) {
	.chanzine-content {
		font-size: 15px;
		line-height: 1.7;
	}

	.chanzine-content h1 {
		font-size: 27px;
	}

	.chanzine-content h2 {
		font-size: 23px;
	}

	.chanzine-content h3 {
		font-size: 20px;
	}

	.chanzine-content pre {
		margin-right: -4px;
		margin-left: -4px;
		padding: 16px;
		border-radius: 6px;
	}

	.chanzine-content table {
		display: block;
		overflow-x: auto;
		white-space: nowrap;
	}
}