/* ==========================================================================
   SINGLE POST — hero, prose, TOC, author box, related posts
   ========================================================================== */

/* ────────────────────────────────────────
   POST HERO
──────────────────────────────────────── */
.post-hero {
	background: var(--eln-midnight);
	padding: 80px 0 64px;
	position: relative;
	overflow: hidden;
}

.post-hero__glow {
	position: absolute;
	top: -40%;
	right: -5%;
	width: 700px;
	height: 700px;
	border-radius: var(--radius-pill);
	background: var(--eln-rainbow);
	filter: blur(120px);
	opacity: 0.13;
	pointer-events: none;
}

.post-hero__inner {
	max-width: 800px;
	margin: 0 auto;
	padding: 0 40px;
	position: relative;
}

.post-hero__breadcrumb {
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 12px;
	color: rgba(255, 255, 255, 0.4);
	margin-bottom: 28px;
	flex-wrap: wrap;
}

.post-hero__breadcrumb a {
	color: rgba(255, 255, 255, 0.4);
	text-decoration: none;
	transition: color var(--dur) var(--ease-out);
}

.post-hero__breadcrumb a:hover { color: rgba(255, 255, 255, 0.8); }
.post-hero__breadcrumb span { color: rgba(255, 255, 255, 0.2); }

.post-hero__cat {
	display: inline-block;
	background: rgba(27, 154, 163, 0.2);
	border: 1px solid rgba(27, 154, 163, 0.4);
	color: var(--eln-cyan);
	font-family: var(--font-display);
	font-weight: 800;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 5px 14px;
	border-radius: var(--radius-pill);
	margin-bottom: 20px;
	text-decoration: none;
}

.post-hero__title {
	font-family: var(--font-display);
	font-weight: 900;
	font-size: clamp(1.8rem, 3.5vw, 2.8rem);
	color: #fff;
	line-height: 1.1;
	letter-spacing: -0.02em;
	margin: 0 0 24px;
	text-wrap: balance;
}

.post-hero__meta {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	padding-top: 28px;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.post-hero__author { display: flex; align-items: center; gap: 10px; }

.post-hero__avatar {
	width: 40px;
	height: 40px;
	border-radius: var(--radius-pill);
	border: 2px solid rgba(255, 255, 255, 0.2);
	overflow: hidden;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--eln-rainbow);
	font-family: var(--font-display);
	font-weight: 900;
	color: var(--eln-midnight);
	font-size: 14px;
}

.post-hero__avatar img { width: 100%; height: 100%; object-fit: cover; }

.post-hero__author-name { font-family: var(--font-display); font-weight: 800; font-size: 14px; color: #fff; }
.post-hero__author-role { font-size: 12px; color: rgba(255, 255, 255, 0.45); }

.post-hero__meta-sep {
	width: 1px;
	height: 28px;
	background: rgba(255, 255, 255, 0.15);
	flex-shrink: 0;
}

.post-hero__meta-item {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: rgba(255, 255, 255, 0.5);
}

/* ────────────────────────────────────────
   POST COVER
──────────────────────────────────────── */
.post-cover {
	max-width: 1000px;
	margin: 0 auto;
	height: 420px;
	overflow: hidden;
	position: relative;
}

.post-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.post-cover__gradient {
	width: 100%;
	height: 100%;
}

.post-cover__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to bottom, transparent 60%, var(--bg-1) 100%);
}

/* ────────────────────────────────────────
   POST LAYOUT (article + sidebar)
──────────────────────────────────────── */
.post-layout {
	max-width: 1200px;
	margin: 0 auto;
	padding: 64px 40px 96px;
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 72px;
	align-items: start;
}

/* ────────────────────────────────────────
   PROSE (article content)
──────────────────────────────────────── */
.prose { max-width: 720px; }

.prose h2 {
	font-family: var(--font-display);
	font-weight: 900;
	font-size: clamp(1.3rem, 2vw, 1.6rem);
	color: var(--eln-midnight);
	margin: 48px 0 16px;
	padding-top: 8px;
	border-top: 2px solid var(--eln-teal-100);
}

.prose h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }

.prose h3 {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: 1.1rem;
	color: var(--eln-midnight);
	margin: 32px 0 12px;
}

.prose p { color: var(--fg-2); font-size: 1rem; line-height: 1.8; margin: 0 0 20px; }
.prose strong { color: var(--fg-1); font-weight: 700; }

.prose a {
	color: var(--eln-cyan);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.prose a:hover { color: var(--eln-magenta); }

.prose ul,
.prose ol {
	padding-left: 0;
	margin: 0 0 24px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	list-style: none;
}

.prose li {
	display: block;
	position: relative;
	padding-left: 22px;
	font-size: 1rem;
	color: var(--fg-2);
	line-height: 1.65;
}

.prose ul li::before {
	content: '→';
	color: var(--eln-cyan);
	font-weight: 800;
	font-size: 0.9rem;
	position: absolute;
	left: 0;
	top: 0;
}

.prose ol { counter-reset: ol-counter; }
.prose ol li { counter-increment: ol-counter; padding-left: 28px; }

.prose ol li::before {
	content: counter(ol-counter) '.';
	color: var(--eln-cyan);
	font-family: var(--font-display);
	font-weight: 900;
	position: absolute;
	left: 0;
	top: 0;
}

/* Avís de transparència — nota editorial sòbria, inici de post */
.prose .post-disclosure {
	background: var(--bg-paper);
	border: 1px solid var(--border-1);
	border-radius: var(--radius-lg);
	padding: 20px 24px;
	margin: 0 0 40px;
}
.prose .post-disclosure p {
	margin: 0;
	font-size: 0.85rem;
	line-height: 1.6;
	color: var(--fg-3);
}
.prose .post-disclosure strong {
	color: var(--fg-1);
}

/* Bloc d'imatge de Gutenberg */
.prose .wp-block-image {
	margin-bottom: 30px;
}
/* Peu de foto de les imatges */
.prose .wp-block-image figcaption {
	margin-top: 10px;
	font-size: 0.82rem;
	color: var(--fg-3);
	text-align: center;
	font-style: italic;
}
/* Captures de pantalla dins de posts */
.prose .wp-block-image.captura img {
	border: 1px solid var(--border-1);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-md);
}

/* ─── Data tables ─────────────────────────────────────────────────────────── */

/* Gutenberg figure wrapper: clipa els cantons superiors del thead */
.prose .wp-block-table {
	overflow: hidden;
	border-radius: var(--radius-xl) var(--radius-xl) 0 0;
	margin: 32px 0;
}

.prose .wp-block-table table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}

/* .compare-table: taula manual sense figure wrapper */
.compare-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	margin: 32px 0;
	font-size: 0.9rem;
}
.wp-block-table td, .wp-block-table th {
	border: none;
}
.compare-table thead tr th:first-child { border-top-left-radius: var(--radius-xl); }
.compare-table thead tr th:last-child  { border-top-right-radius: var(--radius-xl); }

/* Capçalera (thead th) */
.compare-table th,
.prose .wp-block-table th {
	background: var(--eln-midnight);
	color: #fff;
	font-family: var(--font-display);
	font-weight: 800;
	font-size: 0.78rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 12px 16px;
	text-align: left;
}

/* tbody th: Gutenberg "primera columna com a capçalera" */
.compare-table tbody th,
.prose .wp-block-table tbody th {
	background: transparent;
	color: var(--fg-1);
	font-family: var(--font-body);
	font-weight: 700;
	font-size: 0.9rem;
	letter-spacing: 0;
	text-transform: none;
	padding: 12px 16px;
	border-bottom: 1px solid var(--border-1);
	text-align: left;
}

/* Cel·les */
.compare-table td,
.prose .wp-block-table td {
	padding: 12px 16px;
	border-bottom: 1px solid var(--border-1);
	color: var(--fg-2);
	line-height: 1.4;
	vertical-align: top;
}

.compare-table tr:hover td,
.prose .wp-block-table tr:hover td {
	background: var(--bg-paper);
}

/* Colors de cel·la (classe manual) */
.compare-table .good,
.prose .wp-block-table .good { color: #2fa08a; font-weight: 700; }
.compare-table .bad,
.prose .wp-block-table .bad { color: var(--eln-magenta); font-weight: 700; }
.compare-table .neutral,
.prose .wp-block-table .neutral { color: var(--eln-gold); font-weight: 700; }

/* Native Gutenberg quote (core/quote) with author attribution */
.prose .wp-block-quote {
	background: var(--bg-paper);
	border-left: 4px solid var(--eln-cyan);
	padding: 28px 32px;
	margin: 32px 0;
	font-style: normal;
}
.prose .wp-block-quote p {
	margin: 0 0 16px;
	font-family: var(--font-script);
	font-size: 1.3rem;
	line-height: 1.4;
	color: var(--eln-midnight);
}
.prose .wp-block-quote p:first-of-type::before {
	content: "«";
}
.prose .wp-block-quote p:last-of-type::after {
	content: "»";
}
.prose .wp-block-quote p:last-of-type {
	margin-bottom: 0;
}
.prose .wp-block-quote cite {
	display: block;
	margin-top: 14px;
	font-family: var(--font-display);
	font-weight: 800;
	font-size: 0.9rem;
	color: var(--fg-1);
	font-style: normal;
}

/* Post footer — tags + share */
.post-footer {
	margin-top: 56px;
	padding-top: 32px;
	border-top: 2px solid var(--border-1);
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
}

.post-tags { display: flex; gap: 8px; flex-wrap: wrap; }

.post-tag {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: 12px;
	padding: 6px 14px;
	border-radius: var(--radius-pill);
	background: var(--bg-2);
	color: var(--fg-2);
	border: 1px solid var(--border-1);
	text-decoration: none;
}

.post-share { display: flex; align-items: center; gap: 10px; }

.post-share__label {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: 13px;
	color: var(--fg-3);
}

.share-btn {
	width: 36px;
	height: 36px;
	border-radius: var(--radius-pill);
	background: var(--bg-2);
	border: 1px solid var(--border-1);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all var(--dur) var(--ease-out);
	color: var(--fg-2);
	text-decoration: none;
}

.share-btn:hover { background: var(--eln-midnight); color: #fff; border-color: var(--eln-midnight); }

/* Author box */
.author-box {
	background: var(--bg-paper);
	border: 1px solid var(--border-1);
	border-radius: var(--radius-xl);
	padding: 36px;
	margin-top: 40px;
	display: flex;
	gap: 24px;
	align-items: flex-start;
}

.author-box__avatar {
	width: 72px;
	height: 72px;
	border-radius: var(--radius-pill);
	flex-shrink: 0;
	overflow: hidden;
	background: var(--eln-rainbow);
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-display);
	font-weight: 900;
	font-size: 24px;
	color: var(--eln-midnight);
}

.author-box__avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-box__name { font-family: var(--font-display); font-weight: 900; font-size: 1.05rem; color: var(--eln-midnight); margin: 0 0 4px; }
.author-box__role { font-size: 0.85rem; color: var(--eln-cyan); margin-bottom: 12px; }
.author-box__bio { font-size: 0.9rem; color: var(--fg-2); line-height: 1.65; margin: 0; }

/* Related posts */
.related { margin-top: 64px; }

.related__title {
	font-family: var(--font-display);
	font-weight: 900;
	font-size: 1rem;
	color: var(--eln-midnight);
	margin: 0 0 24px;
	display: flex;
	align-items: center;
	gap: 12px;
}

.related__title::after { content: ''; flex: 1; height: 1px; background: var(--border-1); }

.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.related-card {
	background: #fff;
	border: 1px solid var(--border-1);
	border-radius: var(--radius-xl);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	text-decoration: none;
	transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}

.related-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.related-card__thumb { height: 120px; overflow: hidden; position: relative; }
.related-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-card__thumb-bg { position: absolute; inset: 0; }

.related-card__body { padding: 18px 20px; }

.related-card__cat {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: 11px;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--eln-cyan);
	margin-bottom: 8px;
}

.related-card__title {
	font-family: var(--font-display);
	font-weight: 900;
	font-size: 0.9rem;
	color: var(--eln-midnight);
	line-height: 1.3;
	transition: color var(--dur) var(--ease-out);
}

.related-card:hover .related-card__title { color: var(--eln-magenta); }

/* ────────────────────────────────────────
   POST SIDEBAR
──────────────────────────────────────── */
.post-sidebar {
	position: sticky;
	top: 88px;
	display: flex;
	flex-direction: column;
	gap: 24px;
}

/* TOC */
.toc-card {
	background: var(--bg-paper);
	border: 1px solid var(--border-1);
	border-radius: var(--radius-xl);
	padding: 28px;
	overflow: hidden;
}

.toc-progress {
	height: 3px;
	background: var(--eln-teal-100);
	margin: -28px -28px 24px;
	position: relative;
}

.toc-progress__bar {
	height: 100%;
	background: var(--eln-cyan);
	transition: width 0.15s var(--ease-out);
	width: 0%;
}

.toc-title {
	font-family: var(--font-display);
	font-weight: 900;
	font-size: 0.8rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--fg-3);
	margin: 0 0 14px;
}

.toc-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.toc-card .toc-list {
	max-height: 55vh;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--border-1) transparent;
}

.toc-item a {
	display: block;
	padding: 7px 10px;
	border-radius: var(--radius-sm);
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 0.875rem;
	color: var(--fg-2);
	text-decoration: none;
	transition: all var(--dur) var(--ease-out);
	line-height: 1.35;
}

.toc-item a:hover,
.toc-item.active a {
	background: var(--eln-teal-50);
	color: var(--eln-midnight);
}

.toc-item--sub a {
	padding-left: 24px;
	font-size: 0.82rem;
	font-weight: 600;
}

/* Mobile TOC */
.toc-mobile {
	background: var(--bg-paper);
	border: 1px solid var(--border-1);
	border-radius: var(--radius-xl);
	padding: 24px;
	margin-bottom: 40px;
	display: none;
}

/* CTA sidebar */
.sidebar-cta {
	background: var(--eln-magenta);
	border-radius: var(--radius-xl);
	padding: 28px;
	text-align: center;
}

.sidebar-cta h4 { font-family: var(--font-display); font-weight: 900; font-size: 1rem; color: #fff; margin: 0 0 8px; }
.sidebar-cta p { font-size: 0.85rem; color: rgba(255, 255, 255, 0.75); line-height: 1.55; margin: 0 0 18px; }
.sidebar-cta .btn { width: 100%; justify-content: center; font-size: 14px; background: #fff; color: var(--eln-magenta); }
.sidebar-cta .btn:hover { background: rgba(255, 255, 255, 0.9); }

/* Newsletter sidebar */
.sidebar-nl {
	background: var(--eln-midnight);
	border-radius: var(--radius-xl);
	padding: 28px;
}

.sidebar-nl h4 { font-family: var(--font-script); font-weight: 400; color: var(--eln-gold); font-size: 1.2rem; margin: 0 0 8px; }
.sidebar-nl p { font-size: 0.85rem; color: rgba(255, 255, 255, 0.6); line-height: 1.55; margin: 0 0 16px; }

.sidebar-nl input[type="email"] {
	width: 100%;
	padding: 10px 14px;
	border-radius: var(--radius-md);
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.15);
	color: #fff;
	font-family: var(--font-body);
	font-size: 13px;
	margin-bottom: 10px;
}

.sidebar-nl input[type="email"]::placeholder { color: rgba(255, 255, 255, 0.3); }
.sidebar-nl input[type="email"]:focus { outline: 0; border-color: var(--eln-cyan); }
.sidebar-nl .btn { width: 100%; justify-content: center; font-size: 13px; padding: 11px; }

/* ────────────────────────────────────────
   RESPONSIVE
──────────────────────────────────────── */
@media (max-width: 1000px) {
	.post-layout {
		grid-template-columns: 1fr;
		gap: 48px;
		padding: 48px 20px 72px;
	}

	.post-sidebar { position: static; top: auto; }
	.toc-card { display: none; }
	.toc-mobile { display: block; }
}

@media (max-width: 600px) {
	.post-hero { padding: 56px 0 40px; }
	.post-hero__inner { padding: 0 20px; }
	.post-hero__meta-sep { display: none; }
	.post-cover { height: 240px; }
	.author-box { flex-direction: column; }
	.related-grid { grid-template-columns: 1fr; }
}
