/* =========================================================================
   MundiBook Pro — Core Stylesheet
   Design tokens are drawn from the firm's own printed documents (Watak,
   Buyer Bill): maroon ledger binding, gold wax-seal accent, cream paper.
   ========================================================================= */

:root {
	/* Color */
	--mb-maroon:        #6B1F2A;
	--mb-maroon-dark:    #4E1620;
	--mb-gold:           #B8862E;
	--mb-gold-light:     #D9AE5C;
	--mb-cream:          #F6F0E2;
	--mb-cream-dark:     #EDE3CC;
	--mb-ink:            #2B241D;
	--mb-ink-soft:       #5B5347;
	--mb-orchard:        #4B5A38;
	--mb-apple:          #A63A2C;
	--mb-white:          #FFFDF9;
	--mb-border:         rgba(43, 36, 29, 0.14);

	/* Type */
	--mb-font-head: 'Newsreader', Georgia, serif;
	--mb-font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
	--mb-font-mono: 'IBM Plex Mono', monospace;

	/* Layout */
	--mb-container: 1180px;
	--mb-radius-sm: 3px;
	--mb-radius: 6px;
	--mb-space-1: 8px;
	--mb-space-2: 16px;
	--mb-space-3: 24px;
	--mb-space-4: 40px;
	--mb-space-5: 64px;
	--mb-space-6: 96px;
}

/* ---------- Reset-ish base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
	margin: 0;
	background: var(--mb-cream);
	color: var(--mb-ink);
	font-family: var(--mb-font-body);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--mb-maroon); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
	font-family: var(--mb-font-head);
	color: var(--mb-maroon-dark);
	line-height: 1.15;
	margin: 0 0 var(--mb-space-2);
	font-weight: 600;
}

p { margin: 0 0 var(--mb-space-2); max-width: 68ch; }

.mb-container {
	max-width: var(--mb-container);
	margin: 0 auto;
	padding: 0 var(--mb-space-3);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.skip-link {
	position: absolute;
	top: -60px; left: 0;
	background: var(--mb-maroon);
	color: var(--mb-white);
	padding: 10px 18px;
	z-index: 1000;
	border-radius: 0 0 var(--mb-radius) 0;
}
.skip-link:focus { top: 0; }

:focus-visible {
	outline: 2px solid var(--mb-gold);
	outline-offset: 2px;
}

/* ---------- Buttons ---------- */
.mb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 22px;
	border-radius: var(--mb-radius-sm);
	font-family: var(--mb-font-body);
	font-weight: 600;
	font-size: 0.95rem;
	border: 1.5px solid transparent;
	cursor: pointer;
	transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
	text-decoration: none !important;
}
.mb-btn-primary {
	background: var(--mb-maroon);
	color: var(--mb-white);
	border-color: var(--mb-maroon);
}
.mb-btn-primary:hover { background: var(--mb-maroon-dark); border-color: var(--mb-maroon-dark); }
.mb-btn-ghost {
	background: transparent;
	color: var(--mb-maroon);
	border-color: var(--mb-border);
}
.mb-btn-ghost:hover { border-color: var(--mb-maroon); background: rgba(107,31,42,0.05); }
.mb-btn-lg { padding: 14px 28px; font-size: 1.02rem; }

/* ---------- Header ---------- */
.mb-site-header {
	background: var(--mb-cream);
	border-bottom: 1px solid var(--mb-gold);
	position: sticky;
	top: 0;
	z-index: 100;
}
.mb-site-header__inner {
	display: flex;
	align-items: center;
	gap: var(--mb-space-3);
	padding-top: 14px;
	padding-bottom: 14px;
}
.mb-wordmark {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--mb-maroon-dark);
}
.mb-wordmark__mark { color: var(--mb-gold); display: inline-flex; }
.mb-wordmark__text {
	font-family: var(--mb-font-head);
	font-size: 1.3rem;
	font-weight: 600;
	letter-spacing: 0.01em;
}
.mb-wordmark__text em { font-style: normal; color: var(--mb-gold); }
.custom-logo-link img { max-height: 44px; width: auto; }

.mb-nav { flex: 1; }
.mb-nav__list {
	list-style: none;
	display: flex;
	gap: var(--mb-space-4);
	margin: 0; padding: 0;
	justify-content: center;
}
.mb-nav__list a {
	color: var(--mb-ink);
	font-weight: 500;
	font-size: 0.96rem;
}
.mb-nav__list a:hover { color: var(--mb-maroon); text-decoration: none; }

.mb-header-actions { display: flex; gap: 10px; align-items: center; }

.mb-nav-toggle {
	display: none;
	flex-direction: column;
	gap: 5px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 6px;
}
.mb-nav-toggle span {
	width: 22px; height: 2px;
	background: var(--mb-maroon-dark);
	display: block;
}

.mb-mobile-nav { display: none; }

@media (max-width: 900px) {
	.mb-nav, .mb-header-actions { display: none; }
	.mb-nav-toggle { display: flex; }
	.mb-mobile-nav {
		display: none;
		flex-direction: column;
		background: var(--mb-white);
		border-top: 1px solid var(--mb-border);
		padding: var(--mb-space-2) var(--mb-space-3) var(--mb-space-3);
	}
	.mb-mobile-nav.is-open { display: flex; }
	.mb-mobile-nav__list { list-style: none; margin: 0 0 var(--mb-space-2); padding: 0; display: flex; flex-direction: column; gap: 14px; }
	.mb-mobile-nav__list a { color: var(--mb-ink); font-weight: 500; }
	.mb-mobile-nav__actions { display: flex; flex-direction: column; gap: 10px; }
}

/* ---------- Footer ---------- */
.mb-site-footer {
	background: var(--mb-maroon-dark);
	color: var(--mb-cream);
	margin-top: var(--mb-space-6);
}
.mb-site-footer a { color: var(--mb-cream); }
.mb-site-footer__top {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr 1fr;
	gap: var(--mb-space-4);
	padding: var(--mb-space-5) var(--mb-space-3) var(--mb-space-4);
}
.mb-footer-brand p { color: rgba(246,240,226,0.7); max-width: 32ch; }
.mb-footer-col h3, .footer-widget-title {
	font-family: var(--mb-font-body);
	font-size: 0.8rem;
	letter-spacing: 0.05em;
	color: var(--mb-gold-light);
	margin-bottom: var(--mb-space-2);
}
.mb-footer-col ul, .mb-footer-legal { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mb-footer-col ul a, .mb-footer-legal a { color: rgba(246,240,226,0.85); font-size: 0.94rem; }
.mb-site-footer__bottom {
	border-top: 1px solid rgba(246,240,226,0.15);
	padding: var(--mb-space-2) var(--mb-space-3);
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 0.85rem;
	color: rgba(246,240,226,0.6);
}
.mb-footer-seal { font-family: var(--mb-font-head); font-style: italic; }

@media (max-width: 800px) {
	.mb-site-footer__top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
	.mb-site-footer__top { grid-template-columns: 1fr; }
}

/* ---------- Generic page / post ---------- */
.mb-page { padding: var(--mb-space-5) 0; }
.mb-post__title { font-size: 2.2rem; }
.mb-post__thumb { margin-bottom: var(--mb-space-3); border-radius: var(--mb-radius); overflow: hidden; }
.mb-post__content { max-width: 74ch; }
.mb-post__content p { max-width: none; }

/* ---------- Auth pages (login/register/dashboard shell) ---------- */
.mb-auth-page { padding: var(--mb-space-5) 0; display: flex; justify-content: center; }
.mb-auth-card {
	background: var(--mb-white);
	border: 1px solid var(--mb-border);
	border-top: 4px solid var(--mb-gold);
	border-radius: var(--mb-radius);
	padding: var(--mb-space-4);
	max-width: 480px;
	width: 100%;
}
.mb-auth-card--wide { max-width: 640px; }
.mb-auth-card__lede { color: var(--mb-ink-soft); }
.mb-auth-card__switch { margin-top: var(--mb-space-3); font-size: 0.94rem; color: var(--mb-ink-soft); }
.mb-plugin-placeholder {
	background: var(--mb-cream-dark);
	border: 1px dashed var(--mb-border);
	border-radius: var(--mb-radius);
	padding: var(--mb-space-3);
	text-align: center;
	color: var(--mb-ink-soft);
}
.mb-dashboard-page { padding: var(--mb-space-4) 0; }

/* ---------- Section building blocks (shared by landing + inner pages) ---------- */
.mb-section-title { font-size: 2rem; text-align: center; }
.mb-section-lede {
	text-align: center;
	color: var(--mb-ink-soft);
	max-width: 60ch;
	margin: 0 auto var(--mb-space-4);
}

/* =========================================================================
   Mobile responsiveness — global rules that apply site-wide, on top of
   the component-level breakpoints already in landing.css and dashboard.css.
   ========================================================================= */

/* Tighten the space scale on small screens so sections don't feel like
   mostly empty space on a phone. */
@media (max-width: 640px) {
	:root {
		--mb-space-5: 44px;
		--mb-space-6: 56px;
	}
	.mb-container { padding: 0 var(--mb-space-2); }
	h1 { font-size: 1.7rem; }
	h2.mb-section-title { font-size: 1.5rem; }
	.mb-post__title { font-size: 1.6rem; }
}

/* Every tappable control gets a comfortable touch target on touch
   devices, without changing desktop sizing. */
@media (max-width: 640px) {
	.mb-btn { min-height: 44px; }
	.mb-nav-toggle { min-height: 44px; min-width: 44px; justify-content: center; }
}

/* Auth cards go edge-to-edge with breathing room instead of a
   fixed max-width that leaves it floating oddly on a phone. */
@media (max-width: 560px) {
	.mb-auth-page { padding: var(--mb-space-3) 0; }
	.mb-auth-card, .mb-auth-card--wide { max-width: 100%; padding: var(--mb-space-3); }
}

/* Any wide table (used by the dashboard, and any future printable
   summary embedded in a page) scrolls horizontally instead of
   overflowing or forcing the whole page wider than the viewport. */
@media (max-width: 640px) {
	.mb-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Prevent iOS Safari's automatic zoom-on-focus, which happens on any
   input with a computed font-size under 16px. */
@media (max-width: 640px) {
	input, select, textarea, button { font-size: 16px; }
}


/* ========================================================================
   MundiBook App Shell — clean, image-free workspace
   ======================================================================== */
.mb-dashboard-app .mb-site-header,
.mb-dashboard-app .mb-site-footer { display:none; }
.mb-dashboard-app .mb-main { min-height:100vh; }
.mb-dashboard-app--logged-in #wpadminbar { display:none !important; }
.mb-dashboard-app--logged-in { margin-top:0 !important; }
.mb-dashboard-app .mb-dashboard-page { max-width:none; width:100%; padding:0; }
.mb-dashboard-app .mb-dashboard-page > .mb-dash { width:100%; }
