/**
 * Migrawise — Legal Pages (Terms of Service, Privacy Policy)
 *
 * Clean, readable typography for long-form legal content.
 * Used by page-terms.php and page-privacy.php templates.
 *
 * @package Migrawise Theme
 */

/* ---------------------------------------------------------------------------
   CSS Custom Properties
   --------------------------------------------------------------------------- */

:root {
	--mw-legal-font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--mw-legal-heading-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--mw-legal-max-width:   800px;
	--mw-legal-text:        #3D2E2A;
	--mw-legal-heading:     #2A1F1B;
	--mw-legal-muted:       #8B7355;
	--mw-legal-border:      #E8DDD4;
	--mw-legal-link:        #DA7756;
	--mw-legal-link-hover:  #C4654A;
	--mw-legal-bg:          #FFFAF7;
	--mw-legal-toc-bg:      #FDF2EE;
}

/* ---------------------------------------------------------------------------
   Page reset & base
   --------------------------------------------------------------------------- */

.mw-legal-page,
.mw-legal-page * {
	box-sizing: border-box;
}

.mw-legal-page {
	margin: 0 !important;
	padding: 0 !important;
	background: var(--mw-legal-bg) !important;
	color: var(--mw-legal-text) !important;
	font-family: var(--mw-legal-font) !important;
	font-size: 17px !important;
	line-height: 1.75 !important;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Override any WP block/theme defaults */
.mw-legal-page .wp-site-blocks,
.mw-legal-page .entry-content {
	max-width: none !important;
	padding: 0 !important;
	margin: 0 !important;
}

/* ---------------------------------------------------------------------------
   Header
   --------------------------------------------------------------------------- */

.mw-legal-header {
	border-bottom: 1px solid var(--mw-legal-border);
	padding: 16px 24px;
	position: sticky;
	top: 0;
	background: var(--mw-legal-bg);
	z-index: 100;
}

.mw-legal-header__inner {
	max-width: var(--mw-legal-max-width);
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.mw-legal-logo {
	display: flex;
	align-items: center;
	gap: 0;
	text-decoration: none !important;
	color: var(--mw-legal-heading);
	font-family: var(--mw-legal-heading-font);
	font-weight: 800;
	font-size: 20px;
	letter-spacing: -.4px;
	transition: opacity 0.25s ease;
}
.mw-legal-logo:hover {
	text-decoration: none !important;
	opacity: 0.75;
}
.mw-legal-logo:active {
	opacity: 0.6;
}

/* Logo text — single terracotta color */
.mw-legal-logo__text {
	color: #DA7756;
}

.mw-legal-logo__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: linear-gradient(135deg, #DA7756, #C4654A);
	color: #fff;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 800;
}

.mw-legal-header__nav {
	display: flex;
	gap: 24px;
}

.mw-legal-header__nav a {
	color: var(--mw-legal-muted);
	text-decoration: none;
	font-family: var(--mw-legal-heading-font);
	font-size: 14px;
	font-weight: 500;
	transition: color 0.2s;
}

.mw-legal-header__nav a:hover {
	color: var(--mw-legal-link);
}

.mw-legal-header__nav a.is-active {
	color: var(--mw-legal-link);
}

/* ---------------------------------------------------------------------------
   Content area
   --------------------------------------------------------------------------- */

.mw-legal-content {
	max-width: var(--mw-legal-max-width);
	margin: 0 auto;
	padding: 48px 24px 80px;
}

/* Title block */
.mw-legal-title {
	margin: 0 0 8px;
	font-family: var(--mw-legal-heading-font);
	font-size: 36px;
	font-weight: 800;
	color: var(--mw-legal-heading);
	line-height: 1.2;
}

.mw-legal-meta {
	color: var(--mw-legal-muted);
	font-size: 14px;
	font-family: var(--mw-legal-heading-font);
	margin-bottom: 40px;
}

/* ---------------------------------------------------------------------------
   Table of Contents
   --------------------------------------------------------------------------- */

.mw-legal-toc {
	background: var(--mw-legal-toc-bg);
	border: 1px solid var(--mw-legal-border);
	border-radius: 8px;
	padding: 24px 28px;
	margin-bottom: 48px;
}

.mw-legal-toc__title {
	font-family: var(--mw-legal-heading-font);
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--mw-legal-muted);
	margin: 0 0 12px;
}

.mw-legal-toc ol {
	margin: 0;
	padding: 0 0 0 20px;
	list-style: decimal;
}

.mw-legal-toc li {
	margin-bottom: 6px;
	font-family: var(--mw-legal-heading-font);
	font-size: 15px;
	line-height: 1.5;
}

.mw-legal-toc a {
	color: var(--mw-legal-link);
	text-decoration: none;
	transition: color 0.2s;
}

.mw-legal-toc a:hover {
	color: var(--mw-legal-link-hover);
	text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   Sections
   --------------------------------------------------------------------------- */

.mw-legal-section {
	margin-bottom: 40px;
	scroll-margin-top: 80px;
}

.mw-legal-section h2 {
	font-family: var(--mw-legal-heading-font);
	font-size: 22px;
	font-weight: 700;
	color: var(--mw-legal-heading);
	margin: 0 0 12px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--mw-legal-border);
	line-height: 1.3;
}

.mw-legal-section h3 {
	font-family: var(--mw-legal-heading-font);
	font-size: 18px;
	font-weight: 600;
	color: var(--mw-legal-heading);
	margin: 24px 0 8px;
}

.mw-legal-section p {
	margin: 0 0 16px;
}

.mw-legal-section ul,
.mw-legal-section ol {
	margin: 0 0 16px;
	padding-left: 24px;
}

.mw-legal-section li {
	margin-bottom: 6px;
}

.mw-legal-section a {
	color: var(--mw-legal-link);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.mw-legal-section a:hover {
	color: var(--mw-legal-link-hover);
}

.mw-legal-section strong {
	color: var(--mw-legal-heading);
	font-weight: 600;
}

/* Numbered section prefix */
.mw-legal-section__number {
	display: inline-block;
	font-family: var(--mw-legal-heading-font);
	font-weight: 800;
	color: var(--mw-legal-link);
	margin-right: 8px;
}

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */

.mw-legal-footer {
	border-top: 1px solid var(--mw-legal-border);
	padding: 24px;
	text-align: center;
	color: var(--mw-legal-muted);
	font-family: var(--mw-legal-heading-font);
	font-size: 13px;
}

.mw-legal-footer a {
	color: var(--mw-legal-muted);
	text-decoration: none;
}

.mw-legal-footer a:hover {
	color: var(--mw-legal-link);
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */

@media (max-width: 640px) {
	.mw-legal-title {
		font-size: 28px;
	}

	.mw-legal-content {
		padding: 32px 16px 60px;
	}

	.mw-legal-toc {
		padding: 18px 20px;
	}

	.mw-legal-section h2 {
		font-size: 19px;
	}

	.mw-legal-page {
		font-size: 16px;
	}

	.mw-legal-header__nav {
		gap: 16px;
	}

	.mw-legal-header__nav a {
		font-size: 13px;
	}
}

/* ---------------------------------------------------------------------------
   Print styles
   --------------------------------------------------------------------------- */

@media print {
	.mw-legal-header {
		position: static;
		border-bottom: 2px solid #000;
	}

	.mw-legal-header__nav {
		display: none;
	}

	.mw-legal-page {
		font-size: 12pt;
		line-height: 1.6;
		color: #000;
	}

	.mw-legal-content {
		max-width: 100%;
		padding: 0;
	}

	.mw-legal-toc {
		border: 1px solid #ccc;
		page-break-after: always;
	}

	.mw-legal-section {
		page-break-inside: avoid;
	}

	.mw-legal-section h2 {
		border-bottom-color: #000;
	}

	.mw-legal-section a {
		color: #000;
		text-decoration: none;
	}

	.mw-legal-section a::after {
		content: ' (' attr(href) ')';
		font-size: 0.85em;
		color: #555;
	}

	.mw-legal-footer {
		border-top: 1px solid #000;
	}
}
