/* ==========================================================================
   Manthan Invest — site styles
   One stylesheet for every page. Brand values live in :root below, so a
   colour or font change here changes the whole site.
   ========================================================================== */

:root {
	--ink:        #0e1b2c;   /* headings, nav, dark sections */
	--ink-soft:   #4a5565;   /* body text */
	--ink-faint:  #6b7684;   /* captions, meta */
	--gold:       #f2a93b;   /* brand accent: buttons, marks */
	--gold-deep:  #8a5a00;   /* accent on white, readable as link text */
	--paper:      #ffffff;
	--paper-cool: #f4f6f9;   /* alternating section background */
	--line:       #e3e6eb;
	--line-dark:  #2a3a52;   /* hairlines on navy */
	--on-dark:    #c8d0dc;

	--rail: 1180px;
	--radius: 12px;
	--radius-lg: 20px;

	--display: 'Bricolage Grotesque', 'Trebuchet MS', sans-serif;
	--body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--body);
	font-size: 1.0625rem;
	line-height: 1.65;
	color: var(--ink-soft);
	background: var(--paper);
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
	font-family: var(--display);
	color: var(--ink);
	letter-spacing: -0.025em;
	line-height: 1.1;
	margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.5rem, 5.5vw, 3.9rem); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.85rem, 3.4vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.015em; }

p { margin: 0 0 1.1em; max-width: 68ch; }

a { color: var(--gold-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

button, input, select { font: inherit; }
button { cursor: pointer; }

:focus-visible {
	outline: 3px solid var(--gold);
	outline-offset: 2px;
	border-radius: 4px;
}

.rail { width: 100%; max-width: var(--rail); margin-inline: auto; padding-inline: 24px; }
.section { padding-block: clamp(56px, 8vw, 96px); }
.cool { background: var(--paper-cool); }

/* Visually hidden but read by screen readers */
.sr-only {
	position: absolute; width: 1px; height: 1px; padding: 0;
	margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* --- Brand tagline ------------------------------------------------------ */
.tagline {
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--gold-deep);
	margin-bottom: 1.2em;
}
.hero .tagline { color: var(--gold); }

/* --- Buttons ------------------------------------------------------------ */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 14px 24px;
	border-radius: var(--radius);
	border: 1px solid transparent;
	background: var(--gold);
	color: var(--ink);
	font-weight: 600;
	text-decoration: none;
	transition: background 0.18s ease;
}
.btn:hover { background: #e39a24; text-decoration: none; }

.btn-quiet {
	background: transparent;
	color: inherit;
	border-color: currentColor;
	opacity: 0.92;
}
.btn-quiet:hover { background: rgba(255, 255, 255, 0.08); }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* --- Header ------------------------------------------------------------- */
.masthead { border-bottom: 1px solid var(--line); background: var(--paper); }

.masthead-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding-block: 16px;
	flex-wrap: wrap;
}

.wordmark {
	display: inline-flex;
	align-items: center;
	gap: 11px;
	font-family: var(--display);
	font-weight: 800;
	font-size: 1.3rem;
	letter-spacing: -0.03em;
	color: var(--ink);
	text-decoration: none;
	white-space: nowrap;
}
.wordmark:hover { text-decoration: none; }
.wordmark svg { flex-shrink: 0; }

.masthead nav { display: flex; gap: 26px; flex-wrap: wrap; }
.masthead nav a {
	color: var(--ink);
	font-weight: 500;
	font-size: 0.97rem;
	padding-block: 6px;
	border-bottom: 2px solid transparent;
}
.masthead nav a:hover { color: var(--gold-deep); text-decoration: none; }
.masthead nav a[aria-current='page'] { border-bottom-color: var(--gold); }

/* --- Hero --------------------------------------------------------------- */
.hero { background: var(--ink); color: #fff; }
.hero h1 { color: #fff; }
.hero .lead { color: var(--on-dark); font-size: 1.18rem; max-width: 44ch; }

.hero-grid {
	display: grid;
	grid-template-columns: 1.05fr 0.95fr;
	gap: 64px;
	align-items: center;
	padding-block: clamp(60px, 8vw, 104px);
}

/* The weekly-report preview that sits beside the headline */
.preview {
	background: var(--paper);
	border-radius: var(--radius-lg);
	padding: 30px;
	box-shadow: 0 20px 60px rgba(8, 18, 31, 0.28);
}
.preview h2 { font-size: 1.65rem; margin-bottom: 0.4em; }
.preview p { font-size: 0.97rem; }
.preview-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 18px;
}
.preview-kicker { font-size: 0.8125rem; font-weight: 600; color: var(--ink-faint); }
.pill {
	background: var(--paper-cool);
	color: var(--ink);
	font-size: 0.75rem;
	font-weight: 600;
	padding: 5px 11px;
	border-radius: 999px;
}

.lenses-mini {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	margin: 20px 0 22px;
}
.lenses-mini div {
	background: var(--paper-cool);
	border-radius: 10px;
	padding: 13px 12px;
}
.lenses-mini span { display: block; font-size: 0.75rem; color: var(--ink-faint); }
.lenses-mini strong { font-size: 0.9rem; color: var(--ink); }

/* --- Three lenses ------------------------------------------------------- */
.intro { font-size: 1.15rem; max-width: 60ch; }

.lens-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
	gap: 24px;
	margin-top: 44px;
}
.lens {
	border-top: 2px solid var(--ink);
	padding-top: 22px;
}
.lens h3 { margin-bottom: 0.45em; }
.lens p { font-size: 0.98rem; }

/* --- Membership --------------------------------------------------------- */
.split {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 56px;
	align-items: center;
}
.benefits { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.benefit {
	background: var(--paper);
	border-radius: var(--radius);
	padding: 20px;
}
.benefit h3 { font-size: 1.02rem; margin-bottom: 0.3em; }
.benefit p { font-size: 0.9rem; margin: 0; color: var(--ink-faint); }

/* --- Library and Learn -------------------------------------------------- */
.page-head { border-bottom: 1px solid var(--line); background: var(--paper-cool); }
.page-head .rail { padding-block: clamp(44px, 6vw, 68px); }
.page-head h1 { font-size: clamp(2.1rem, 4.4vw, 3.1rem); }

.toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
	align-items: flex-end;
	justify-content: space-between;
	padding-block: 28px;
	border-bottom: 1px solid var(--line);
}

.search-field { display: flex; flex-direction: column; gap: 6px; min-width: 260px; flex: 1 1 260px; }
.search-field label { font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.search-field input {
	border: 1px solid #c9cfd8;
	border-radius: 10px;
	padding: 12px 14px;
	background: var(--paper);
	width: 100%;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
	background: var(--paper);
	border: 1px solid #c9cfd8;
	color: var(--ink);
	border-radius: 999px;
	padding: 9px 16px;
	font-size: 0.9rem;
	font-weight: 600;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed='true'] { background: var(--ink); color: #fff; border-color: var(--ink); }

.shelf { padding-block: 44px 8px; }
.shelf-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 8px;
}
.shelf-head h2 { font-size: 1.5rem; margin: 0; }
.shelf-count { font-size: 0.875rem; color: var(--ink-faint); }

/* Documents read as a catalogue index, not a grid of cards */
.index { border-top: 1px solid var(--ink); }

.entry {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 12px 40px;
	align-items: center;
	padding-block: 26px;
	border-bottom: 1px solid var(--line);
}
.entry h3 { margin-bottom: 0.3em; font-size: 1.18rem; }
.entry p { margin: 0 0 12px; font-size: 0.97rem; max-width: 62ch; }

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 22px;
	font-size: 0.84rem;
	color: var(--ink-faint);
}
.entry-tag { font-weight: 600; color: var(--ink); }
.lock { display: inline-flex; align-items: center; gap: 6px; color: var(--gold-deep); font-weight: 600; }

.get {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 11px 18px;
	border: 1px solid #c9cfd8;
	border-radius: var(--radius);
	font-weight: 600;
	font-size: 0.93rem;
	color: var(--ink);
	white-space: nowrap;
	transition: border-color 0.15s ease, background 0.15s ease;
}
.get:hover { background: var(--paper-cool); border-color: var(--ink); text-decoration: none; }
.get svg { flex-shrink: 0; color: var(--gold-deep); }

/* Videos: thumbnails earn their place, so these are a strip, not an index */
.reel {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 28px;
	padding-top: 26px;
}
.clip { margin: 0; }
.frame {
	position: relative;
	aspect-ratio: 16 / 9;
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--ink);
	border: 0;
	padding: 0;
	width: 100%;
	display: block;
}
.frame img { width: 100%; height: 100%; object-fit: cover; }
.frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.frame-play {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	background: rgba(14, 27, 44, 0.3);
	transition: background 0.18s ease;
}
.frame:hover .frame-play { background: rgba(14, 27, 44, 0.15); }
.frame-play span {
	width: 58px; height: 58px;
	border-radius: 999px;
	background: var(--gold);
	display: grid;
	place-items: center;
}
.clip figcaption { padding-top: 14px; }
.clip h3 { font-size: 1.08rem; margin-bottom: 0.25em; }
.clip p { font-size: 0.92rem; margin: 0 0 6px; }
.clip .entry-meta { flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; gap: 10px; }

.empty {
	padding: 40px 0;
	color: var(--ink-faint);
}

/* Access note on the library page */
.access {
	display: flex;
	gap: 20px;
	align-items: flex-start;
	background: var(--paper-cool);
	border-left: 3px solid var(--gold);
	border-radius: 0 var(--radius) var(--radius) 0;
	padding: 22px 24px;
	margin-top: 28px;
}
.access h2 { font-size: 1.15rem; margin-bottom: 0.3em; }
.access p { font-size: 0.95rem; margin: 0; }
.access svg { flex-shrink: 0; color: var(--gold-deep); margin-top: 3px; }

/* --- Articles (Learn) --------------------------------------------------- */
.prose { max-width: 70ch; }
.prose h2 { font-size: 1.6rem; margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-block: 7px; }
.prose blockquote {
	margin: 24px 0;
	padding-left: 20px;
	border-left: 3px solid var(--gold);
	font-size: 1.05rem;
}

details.guide {
	border-bottom: 1px solid var(--line);
	padding-block: 22px;
}
details.guide:first-of-type { border-top: 1px solid var(--ink); }
details.guide summary {
	cursor: pointer;
	list-style: none;
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 20px;
	align-items: baseline;
}
details.guide summary::-webkit-details-marker { display: none; }
details.guide summary h3 { margin: 0; }
details.guide summary .entry-meta { flex-direction: row; gap: 12px; }
details.guide[open] summary { margin-bottom: 16px; }
details.guide .prose { padding-top: 4px; }

/* --- Footer ------------------------------------------------------------- */
.foot { background: var(--ink); color: var(--on-dark); padding-block: 56px 40px; }
.foot h2 { color: #fff; font-size: 1.2rem; }
.foot a { color: #fff; }
.foot .wordmark { color: #fff; }
.foot-top {
	display: flex;
	justify-content: space-between;
	gap: 32px;
	flex-wrap: wrap;
	padding-bottom: 32px;
}
.foot nav { display: flex; gap: 24px; flex-wrap: wrap; }
.foot-mail { color: var(--gold); font-weight: 600; }
.disclaimer {
	border-top: 1px solid var(--line-dark);
	padding-top: 26px;
	font-size: 0.875rem;
	color: var(--on-dark);
	max-width: 90ch;
}
.foot small { display: block; margin-top: 22px; font-size: 0.8125rem; color: #8d9bb0; }

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 900px) {
	.hero-grid, .split { grid-template-columns: 1fr; gap: 40px; }
	.hero .lead { max-width: 60ch; }
	.masthead-inner { gap: 14px; }
	.masthead nav { order: 3; width: 100%; gap: 20px; }
}

@media (max-width: 620px) {
	.rail { padding-inline: 18px; }
	.benefits { grid-template-columns: 1fr; }
	.lenses-mini { grid-template-columns: 1fr; }
	.lenses-mini div { display: flex; justify-content: space-between; align-items: baseline; }
	.entry { grid-template-columns: 1fr; align-items: start; }
	.get { justify-self: start; }
	.preview { padding: 22px; }
	details.guide summary { grid-template-columns: 1fr; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   Accounts, forms and the admin pages
   ========================================================================== */

.account-bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.account-bar a { color: var(--ink); font-weight: 500; font-size: 0.95rem; }
.account-bar a:hover { color: var(--gold-deep); text-decoration: none; }
.account-bar .btn { color: var(--ink); }

.btn-small {
	border: 1px solid #c9cfd8;
	border-radius: 10px;
	padding: 9px 15px;
	font-weight: 600;
	font-size: 0.9rem;
}
.btn-small:hover { background: var(--paper-cool); text-decoration: none; }

.narrow { max-width: 560px; }

.panel {
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	padding: clamp(24px, 4vw, 38px);
}
.panel h1 { font-size: clamp(1.9rem, 4vw, 2.5rem); }
.panel h2 { font-size: 1.3rem; }

.form { display: flex; flex-direction: column; gap: 18px; margin-top: 26px; }
.form label { display: flex; flex-direction: column; gap: 7px; font-weight: 600; color: var(--ink); font-size: 0.95rem; }
.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form input[type="file"],
.form select,
.form textarea {
	font: inherit;
	font-weight: 400;
	color: var(--ink-soft);
	border: 1px solid #c9cfd8;
	border-radius: 10px;
	padding: 12px 14px;
	background: var(--paper);
	width: 100%;
}
.form textarea { resize: vertical; }
.form .btn { align-self: flex-start; border: 0; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.hint { font-size: 0.84rem; color: var(--ink-faint); margin-top: -8px; }

.check { flex-direction: row !important; align-items: flex-start; gap: 11px !important; font-weight: 400 !important; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; }
.check span { font-size: 0.92rem; line-height: 1.5; color: var(--ink-soft); }

.switch { margin-top: 20px; font-size: 0.93rem; }

.errors {
	background: #fdf2f2;
	border-left: 3px solid #b3261e;
	border-radius: 0 var(--radius) var(--radius) 0;
	padding: 14px 18px;
	margin-top: 22px;
}
.errors p { margin: 4px 0; color: #8c1d18; font-size: 0.93rem; }

.notice {
	background: var(--paper-cool);
	border-left: 3px solid var(--gold);
	border-radius: 0 var(--radius) var(--radius) 0;
	padding: 14px 18px;
	margin: 20px 0 0;
	color: var(--ink);
	font-weight: 500;
}

.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }

.get.danger { border: 0; background: none; color: #8c1d18; padding: 11px 4px; }
.get.danger:hover { background: none; text-decoration: underline; }

.frame-lock { width: 58px; height: 58px; border-radius: 999px; background: var(--gold); display: grid; place-items: center; }

.entry form { margin: 0; }

@media (max-width: 760px) {
	.admin-grid, .form-row { grid-template-columns: 1fr; }
	.account-bar { gap: 12px; }
}

/* ==========================================================================
   Brand mark and social links
   ========================================================================== */


.foot-contact { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin: 12px 0 0; }
.foot-social { display: inline-flex; align-items: center; gap: 8px; color: var(--on-dark); font-weight: 500; }
.foot-social:hover { color: #fff; text-decoration: none; }
.foot-social svg { flex-shrink: 0; }




/* Records whose file has gone missing from the storage folder */
.entry-broken { background: #fdf7f6; }
.flag { color: #8c1d18; font-weight: 600; }
.restore { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.restore input[type="file"] { font-size: 0.88rem; max-width: 100%; }
.restore .get { border: 1px solid #c9cfd8; }

/* --- Brand mark: the logo shown whole, never cut out --------------------- */

.brandmark { display: inline-flex; align-items: center; line-height: 0; }
.brandmark img {
	height: 72px;
	width: auto;
	display: block;
	border-radius: 10px;
}
.masthead-inner { padding-block: 12px; }

.foot .brandmark img { height: 80px; border-radius: 12px; }

.panel-logo {
	width: 200px;
	height: auto;
	max-width: 62%;
	border-radius: 14px;
	margin: 0 0 24px;
}

@media (max-width: 900px) {
	.brandmark img { height: 60px; }
}

@media (max-width: 620px) {
	.brandmark img { height: 54px; }
	.foot .brandmark img { height: 64px; }
}

/* The site name set beside the logo, so it reads at a glance.
   To show the logo on its own, delete the two <span class="brandname">
   lines in includes/header.php and includes/footer.php. */
.brandmark { gap: 14px; }
.brandname {
	font-family: var(--display);
	font-weight: 800;
	font-size: 1.32rem;
	letter-spacing: -0.03em;
	color: var(--ink);
	line-height: 1.1;
}
.foot .brandname { color: #fff; }

@media (max-width: 620px) { .brandname { font-size: 1.1rem; } }

/* --- Self-hosted clips: watch here, no download ------------------------- */

.frame.player { background: #000; cursor: default; }
.frame.player video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }

/* The viewer's own email, laid over the picture. It cannot be clicked
   through and does not cover the controls. */
.stamp {
	position: absolute;
	top: 10px;
	right: 12px;
	max-width: 70%;
	padding: 4px 9px;
	border-radius: 6px;
	background: rgba(14, 27, 44, 0.42);
	color: rgba(255, 255, 255, 0.78);
	font-size: 11px;
	letter-spacing: 0.01em;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	pointer-events: none;
	user-select: none;
}
