/*
 * Legal pages (page-templates/legal.php): KVKK, Gizlilik, Çerez, İade Politikası.
 * Loaded only with that template. One calm reading column, no motion.
 * All values come from tokens.css.
 */

.legal-main {
	padding-block: var(--space-xl) var(--space-2xl);
}

/* Reading column: about 70 characters per line (46ch, measured: "ch" is the
   width of "0", wider than an average letter in Instrument Sans).
   The article is a wider, centred block; the text keeps to the left of it,
   so on large screens the column sits left of centre and only the wide
   cookie table uses the full width. */
.legal {
	--legal-measure: 46ch;
	--legal-wide: 56rem;
	inline-size: min(100%, var(--legal-wide));
	margin-inline: auto;
}

.legal__header,
.legal__body > * {
	max-inline-size: var(--legal-measure);
}

.legal__body > .legal-table--stack {
	max-inline-size: none;
}

/* ---- Title ------------------------------------------------------------- */

.legal__header {
	margin-block-end: var(--space-s);
}

/* The thread is shown still here: no scroll motion on these pages. */
.legal__header .nortia-thread {
	margin-block-end: var(--space-m);
}

.legal__title {
	font-size: var(--text-2xl);
	line-height: var(--leading-tight);
	overflow-wrap: break-word;
	hyphens: auto;
}

/* "Son güncelleme" line. */
.legal-updated {
	font-size: var(--text-sm);
	color: var(--color-text-muted);
}

.legal-updated + * {
	margin-block-start: var(--space-l);
}

/* ---- Running text ------------------------------------------------------ */

.legal__body {
	font-size: var(--text-base);
	line-height: 1.7;
	overflow-wrap: break-word;
}

.legal__body > * + * {
	margin-block-start: var(--space-s);
}

.legal__body h2 {
	margin-block-start: var(--space-xl);
	font-size: var(--text-xl);
	line-height: var(--leading-snug);
	scroll-margin-block-start: var(--space-l);
}

.legal__body h2 + * {
	margin-block-start: var(--space-s);
}

.legal__body ul {
	padding-inline-start: 1.25em;
}

/* Numbered steps (İade Politikası, section 2): room for "1." outside. */
.legal__body ol {
	padding-inline-start: 1.5em;
}

.legal__body ol > li::marker {
	font-variant-numeric: tabular-nums;
}

.legal__body li + li {
	margin-block-start: var(--space-2xs);
}

.legal__body li::marker {
	color: var(--color-text-muted);
}

.legal__body strong {
	font-weight: 600;
}

/* Links are always underlined in running text, never colour alone. */
.legal__body a {
	text-decoration-line: underline;
	text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
}

.legal__body a:hover {
	text-decoration-color: currentColor;
}

/* ---- Placeholders still to fill: [ödeme kuruluşu adı] etc. ------------- */
/* Plain text for visitors; highlighted for a logged-in owner, so they are
   easy to find before launch. */
.logged-in .nortia-todo {
	background: color-mix(in srgb, var(--color-accent) 14%, transparent);
	box-shadow: inset 0 -1px 0 var(--color-accent);
}

/* ---- Tables ------------------------------------------------------------ */
/* Real tables with header cells. The wrapper may scroll on its own if a
   table ever gets wider than the screen; the page itself never does. */

.legal-table {
	overflow-x: auto;
	margin-block: var(--space-m);
}

.legal-table table {
	inline-size: 100%;
	border-collapse: collapse;
	font-size: var(--text-sm);
	line-height: var(--leading-body);
}

.legal-table th,
.legal-table td {
	padding: var(--space-xs) var(--space-s) var(--space-xs) 0;
	border-block-end: var(--border-hairline);
	text-align: start;
	vertical-align: top;
	overflow-wrap: anywhere;
}

.legal-table thead th {
	padding-block-start: 0;
	border-block-end-color: var(--color-text-muted);
	font-size: var(--text-xs);
	font-weight: 600;
	letter-spacing: var(--tracking-label);
	color: var(--color-text-muted);
}

.legal-table tbody th {
	font-weight: 600;
}

/* Two-column tables: the label column stays narrow. */
.legal-table--pairs tbody th {
	inline-size: 38%;
}

/* Narrow space (phones, small tablets): the four-column cookie table becomes
   one block per row, each value with its column name, so nothing is
   squeezed or scrolled. Decided by the table's own width. */
.legal-table--stack {
	container-type: inline-size;
}

@container (max-width: 39.99rem) {
	.legal-table--stack thead {
		position: absolute;
		inline-size: 1px;
		block-size: 1px;
		overflow: hidden;
		clip-path: inset(50%);
	}

	.legal-table--stack tr,
	.legal-table--stack th,
	.legal-table--stack td {
		display: block;
	}

	.legal-table--stack tr {
		padding-block: var(--space-s);
		border-block-end: var(--border-hairline);
	}

	.legal-table--stack tbody th,
	.legal-table--stack td {
		padding: 0;
		border: 0;
	}

	.legal-table--stack tbody th {
		font-family: var(--font-display);
		font-size: var(--text-lg);
		font-weight: 400;
	}

	.legal-table--stack td {
		margin-block-start: var(--space-2xs);
	}

	.legal-table--stack td::before {
		content: attr(data-label);
		display: block;
		font-size: var(--text-xs);
		font-weight: 600;
		letter-spacing: var(--tracking-label);
		color: var(--color-text-muted);
	}
}
