/* Ghiduri: articole și arhivă.
   Container ~1200px; text 720–760px; cuprins lipicios pe desktop.
   Ritm: --section-gap din main.css (64px desktop / 48px mobil). */

.guide__shell {
	width: min(100% - 40px, var(--wrap, 1180px));
	margin-inline: auto;
}

.guide__grid {
	display: grid;
	gap: var(--section-gap);
	grid-template-columns: minmax(0, 1fr);
}
.guide__head,
.guide__leadcol,
.guide__contentcol,
.toc,
.guide__side { min-width: 0; max-width: 100%; }
.guide__head { padding: 0; }
.guide__leadcol { display: grid; gap: var(--section-gap); grid-template-columns: minmax(0, 1fr); }
.guide__contentcol { display: grid; gap: var(--section-gap); grid-template-columns: minmax(0, 1fr); }
.guide .prose { max-width: 100%; min-width: 0; }
.guide__contentcol > .used-calc { margin-top: 0; }
.guide__side { display: none; }
.toc--side { display: none; }

/* Antet: ierarhie clară, aliniat cu coloana de text. */
.guide__head h1 { font-size: clamp(1.9rem, 5vw, 2.75rem); margin: 0 0 .45em; }
.guide__lead { font-size: 1.08rem; color: var(--ink-2); margin: 0 0 1em; max-width: 40em; }
.guide__meta { font-size: .86rem; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.guide__head .share { margin-top: 18px; }
.guide__img { margin: 22px 0 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; box-shadow: var(--shadow); }
.guide__img img { width: 100%; height: 100%; object-fit: cover; }
.guide__head .crumbs { margin-bottom: 12px; }
.guide__head .eyebrow { margin-bottom: 10px; }

/* Cuprins: pe mobil, expander închis; pe desktop, listă statică în bară. */
.toc { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 18px; }
.toc__h { margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.toc__box { margin: 0; }
.toc__box > summary.toc__h {
	cursor: pointer;
	list-style: none;
	padding: 14px 28px 14px 0;
	position: relative;
}
.toc__box > summary.toc__h::-webkit-details-marker { display: none; }
.toc__box > summary.toc__h::after {
	content: "";
	position: absolute;
	right: 2px;
	top: 50%;
	width: 8px;
	height: 8px;
	border-right: 2px solid var(--brand);
	border-bottom: 2px solid var(--brand);
	transform: translateY(-70%) rotate(45deg);
	transition: transform .2s;
}
.toc__box[open] > summary.toc__h::after { transform: translateY(-30%) rotate(225deg); }
.toc ol { margin: 0 0 14px; padding-left: 1.15em; display: grid; gap: 8px; }
.toc li { padding: 0; }
.toc a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; line-height: 1.35; }
.toc a:hover { color: var(--brand); text-decoration: underline; }

/* Text: ritm constant pentru titluri, paragrafe, liste, tabele, note, FAQ. */
.guide .prose { font-size: 1.06rem; }
.guide .prose > * { margin-top: 0; }
.guide .prose h2 { margin: 2.1em 0 .6em; }
.guide .prose h2:first-child { margin-top: 0; }
.guide .prose h3 { margin: 1.5em 0 .45em; }
.guide .prose p { margin: 0 0 1em; }
.guide .prose p:last-child,
.guide .prose ul:last-child,
.guide .prose ol:last-child { margin-bottom: 0; }
.guide .prose ul,
.guide .prose ol { margin: 0 0 1.15em; }
.guide .prose .table-wrap,
.guide .prose .note,
.guide .prose .formula { margin: 0 0 1.25em; }
.guide .prose .table-wrap:last-child,
.guide .prose .note:last-child,
.guide .prose .formula:last-child { margin-bottom: 0; }
.guide .prose > .ad-slot { width: 100%; margin: var(--section-gap) 0; }

.guide .table-wrap {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	max-height: none;
	overflow-x: auto;
	overflow-y: visible;
	-webkit-overflow-scrolling: touch;
}
.guide .prose { overflow-wrap: break-word; }
.guide .table-wrap table { width: 100%; font-size: .95rem; }
.guide .ad-slot { width: 100%; }

.note { border-radius: var(--radius-s); padding: 16px 18px; margin: 0 0 1.25em; background: var(--tint); border-left: 4px solid var(--brand); }
.note p { margin: 0; color: var(--ink-2); }
.note p + p { margin-top: .6em; }
.note--warn { background: var(--amber-soft); border-left-color: var(--amber); }
.note--warn strong { color: var(--ink); }
.note--ok { background: var(--brand-soft); }

.guide .faq h2,
.guide .sources h2 { margin-bottom: .6em; }
.guide .faq details:first-of-type { border-top: 1px solid var(--line); }

/* Card calculator (în articol + compact în bară). */
.used-calc { margin: 0; }
.used-calc__kicker { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); margin: 0 0 12px; }
.used-calc__card {
	display: grid;
	grid-template-columns: 112px 1fr;
	gap: 16px;
	align-items: center;
	padding: 14px;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	color: var(--ink);
	text-decoration: none;
	box-shadow: var(--shadow);
	transition: transform .2s, box-shadow .2s, border-color .2s;
}
.used-calc__card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--brand); color: var(--ink); }
.used-calc__img { border-radius: var(--radius-s); overflow: hidden; aspect-ratio: 1; background: var(--tint); }
.used-calc__img img { width: 100%; height: 100%; object-fit: cover; }
.used-calc__body { display: grid; gap: 4px; }
.used-calc__body strong { font-size: 1.12rem; letter-spacing: -.015em; }
.used-calc__body span { color: var(--ink-2); font-size: .95rem; }
.used-calc__cta { color: var(--brand) !important; font-weight: 700; font-size: .9rem !important; }

.used-calc--compact .used-calc__kicker { margin-bottom: 10px; }
.used-calc--compact .used-calc__card { grid-template-columns: 72px 1fr; gap: 12px; padding: 12px; box-shadow: none; }
.used-calc--compact .used-calc__body strong { font-size: 1rem; }
.used-calc--compact .used-calc__body span:not(.used-calc__cta) { font-size: .88rem; }

/* Ghiduri înrudite, pe toată lățimea containerului. */
.guide__related { margin-top: var(--section-gap); }
.guide__related .section__head { margin-bottom: 22px; }
.guide__related .section__head h2 { margin: 0; }

/* Spațiu sub articol, până la reclama finală. */
.guide > .ad-slot { margin-top: var(--section-gap); }

/* Arhivă /ghiduri/ și categorii: același container ca grila de carduri. */
.guide-archive__head { padding: 0; }
.guide-archive__head .wrap,
.guide-archive__head + .section .wrap { width: min(100% - 40px, var(--wrap, 1180px)); }
.guide-archive__lead { font-size: 1.08rem; color: var(--ink-2); max-width: 40em; }
.guide-cats { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 22px 0 0; }
.guide-cats a { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; font-size: .9rem; font-weight: 600; }
.guide-cats a:hover, .guide-cats a[aria-current="page"] { border-color: var(--brand); color: var(--brand); }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: var(--section-gap); }
.pagination .page-numbers { display: inline-flex; min-width: 42px; height: 42px; align-items: center; justify-content: center; padding: 0 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 650; }
.pagination .page-numbers:hover, .pagination .current { background: var(--tint); color: var(--ink); }

@media (min-width: 1080px) {
	.guide__grid {
		grid-template-columns: minmax(0, 760px) 300px;
		column-gap: 64px;
		row-gap: var(--section-gap);
		justify-content: space-between;
		align-items: start;
		grid-template-areas:
			"head side"
			"lead side"
			"toc side"
			"content side";
	}
	.guide__head { grid-area: head; }
	.guide__leadcol { grid-area: lead; }
	.toc--mobile { grid-area: toc; display: none; }
	.guide__contentcol { grid-area: content; }
	.guide__side {
		grid-area: side;
		display: flex;
		flex-direction: column;
		gap: 24px;
		position: sticky;
		top: 84px;
		z-index: 1;
		max-height: calc(100vh - 100px);
		overflow: auto;
		align-self: start;
	}
	.toc--side { display: block; }
	.guide__img { aspect-ratio: 16 / 9; }
	.toc--side { padding: 18px 20px; }
	.toc--side .toc__h { margin: 0 0 10px; }
	.toc--side ol { margin: 0; }
}

@media (max-width: 639px) {
	.used-calc:not(.used-calc--compact) .used-calc__card { grid-template-columns: 1fr; }
	.used-calc:not(.used-calc--compact) .used-calc__img { aspect-ratio: 16 / 9; }
}
