/*
 * Platform design tokens and chrome (issue #265). Scoped to the
 * platform wrappers and element types, never to host classes: the
 * same file serves the WordPress compatibility layer and the
 * standalone runtime. The user symbol styles live with talim-auth
 * (assets/auth.css), which loads on the whole front end.
 *
 * Slice 5: the platform typography serves from the platform itself
 * (owner decision, 4 November 2026). Fira Code — the defined brand
 * monospace of the talim.ch visual identity — carries the body text
 * and every title; Manrope carries the navigation, the wordmark and
 * the buttons. The Latin-subset woff2 files live in assets/fonts —
 * no external font service, the same appearance on every device and
 * offline. Because the platform itself declares Fira Code, host
 * references to the family (the theme's typography presets) resolve
 * to the platform webfont instead of falling back to Consolas.
 * Every family keeps a fallback stack, so the surfaces stay
 * readable before the fonts arrive. The one platform-wide
 * typography rules: headings take the body family whatever a module
 * stylesheet or the host theme declares, the heading scale carries
 * one hierarchy on every platform surface — page name above,
 * in-page headings clearly below — every button under the chrome
 * takes Manrope, and form fields inherit the body text.
 */

@font-face {
	font-family: "Fira Code";
	src: url("fonts/FiraCode-latin-400.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Fira Code";
	src: url("fonts/FiraCode-latin-500.woff2") format("woff2");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Fira Code";
	src: url("fonts/FiraCode-latin-700.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Manrope";
	src: url("fonts/Manrope-latin-600.woff2") format("woff2");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Manrope";
	src: url("fonts/Manrope-latin-700.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

:root {
	--talim-ink: #2a2a2a;
	--talim-deep: #442e66;
	--talim-plum: #7d2c6e;
	--talim-sun: #ffd500;
	--talim-sun-hover: #e6c000;
	--talim-paper: #ffffff;
	--talim-mist: #f7f2f6;
	--talim-line: #e6dfd9;
	--talim-soft: #e8e8e8;
	--talim-font-head: "Manrope", "Segoe UI", system-ui, sans-serif;
	--talim-font-body: "Fira Code", "JetBrains Mono", Consolas, "Menlo", monospace;
	--talim-title-size: 1.6rem;
	--talim-section-size: 1.25rem;
	--talim-subsection-size: 1.125rem;
}

/* The platform page is one full-height column: the header opens it,
   the main area grows, the footer closes it at the viewport bottom —
   short pages keep the full-height design (issue #265, slice 3).
   The wrapper owns the body text: one size (1.125rem, the owner's
   preferred measure) and one family for every platform surface —
   blog, workroom and shortcode pages alike (slice 5). */
body.talim-platform {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	color: var(--talim-ink);
	background: var(--talim-paper);
	font-family: var(--talim-font-body);
	font-size: 1.125rem;
	line-height: 1.5;
}

/* One platform-wide typography decision: every title under the
   chrome renders in the body family (owner decision, slice 5),
   whatever a module stylesheet or the host theme declares. The
   heading scale carries one hierarchy on every platform surface
   (owner decision, 4 November 2026): the page name (h1) sits
   above, the in-page section headings (h2, h3) sit clearly below —
   a module's bare headings join the platform measure instead of
   the browser defaults (the planner's Calendar title was the
   default 2em, the account section headings the default 1.5em). */
body.talim-platform h1,
body.talim-platform h2,
body.talim-platform h3,
body.talim-platform h4,
body.talim-platform h5,
body.talim-platform h6 {
	font-family: var(--talim-font-body);
}

body.talim-platform h1 {
	font-size: var(--talim-title-size);
	font-weight: 700;
}

body.talim-platform h2 {
	font-size: var(--talim-section-size);
}

body.talim-platform h3 {
	font-size: var(--talim-subsection-size);
}

/* Every button under the chrome renders in Manrope (owner
   decision, slice 5) — the browser default never decides a font
   on a platform surface again. */
/* Platform hardening (issue #272): the important flag on the
   form-control rules below means a host-side rule (the customized
   theme, the Additional CSS, or any future font-family:
   monospace) can never decide a font on a platform surface again.
   The button rule carries it too, so the generic hardened input
   rule cannot overrule Manrope on input buttons. */
body.talim-platform button,
body.talim-platform input[type="button"],
body.talim-platform input[type="submit"] {
	font-family: var(--talim-font-head) !important;
}

/* Form content follows the platform body text (owner review,
   slice 5): every input, select and textarea under the chrome
   inherits the wrapper's family and size, so typed content,
   labels and prose read as one text — the browser default never
   decides a font on a platform surface (the account page showed
   exactly that defect). */
body.talim-platform input,
body.talim-platform select,
body.talim-platform textarea {
	font-family: var(--talim-font-body) !important;
	font-size: inherit;
}

.talim-chrome-main {
	flex: 1 0 auto;
	max-width: 72rem;
	margin: 0 auto;
	padding: 1rem 1rem 3rem;
	box-sizing: border-box;
	width: 100%;
}

.talim-chrome-header {
	background: var(--talim-deep);
}

.talim-chrome-bar {
	max-width: 72rem;
	margin: 0 auto;
	padding: 0.6rem 1rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.talim-chrome-wordmark {
	color: var(--talim-soft);
	font-family: var(--talim-font-head);
	font-weight: 700;
	letter-spacing: 0.05em;
	text-decoration: none;
	font-size: 1.1rem;
}

.talim-chrome-wordmark:hover {
	color: var(--talim-sun);
}

/* talim.ch deployment, 25 November 2026: when a logo is set, it replaces
   the wordmark text (owner ruling); the anchor keeps the same place in
   the flex bar, the image is sized to the header's rhythm. */
.talim-chrome-wordmark .talim-chrome-logo {
	display: block;
	height: 2.2rem;
	width: auto;
}

.talim-chrome-wordmark:hover .talim-chrome-logo {
	opacity: 0.85;
}

/* Slice 7, owner review (16 November 2026): the navigation (Start)
   sits beside the wordmark on the left; the round user symbol
   stands alone on the bar's right side. */
.talim-chrome-bar-left {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	flex-wrap: wrap;
}

.talim-chrome-user {
	list-style: none;
	display: flex;
	align-items: center;
	margin: 0;
	padding: 0;
}

.talim-chrome-nav-list {
	list-style: none;
	display: flex;
	align-items: center;
	gap: 1rem;
	margin: 0;
	padding: 0;
	flex-wrap: wrap;
}

.talim-chrome-nav-link {
	color: var(--talim-soft);
	text-decoration: none;
	font-family: var(--talim-font-head);
	font-size: 1.05rem;
	font-weight: 700;
}

.talim-chrome-nav-link:hover {
	color: var(--talim-sun);
}

/* The bottom hover strip (issue #317, owner review, sixth
   round, 16 November 2026): no visible footer bar — Duolingo
   restraint, one chrome bar (the header) per screen. The bottom
   edge of every surface is a slim, invisible hover strip pinned
   to the viewport; the white handle drawer slides up from it on
   mouse-over or keyboard focus. */
.talim-chrome-footer {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	height: 1.25rem;
	z-index: 10;
}

/* Footer hover drawer (issue #317, owner review, second and
   third round, 16 November 2026): the violet wordmark bar stays
   quiet and keeps its place; on mouse-over or keyboard focus the
   four platform tabs (Bio, Peers, Skills, Jobs) appear as white
   chip buttons in a panel that overlays the page ABOVE the bar —
   the page never shifts — and the chips speak the button language
   of the party surfaces (bio.css). */
.talim-chrome-footer-items {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 100%;
	background: #ffffff;
	border-top: 1px solid #d0d4f0;
	box-shadow: 0 -4px 12px rgba( 0, 0, 0, 0.08 );
	opacity: 0;
	visibility: hidden;
	transform: translateY( 4px );
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.talim-chrome-footer:hover .talim-chrome-footer-items,
.talim-chrome-footer:focus-within .talim-chrome-footer-items {
	opacity: 1;
	visibility: visible;
	transform: translateY( 0 );
}

.talim-chrome-footer-list {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-around;
	margin: 0;
	padding: 10px 0 12px;
}

.talim-chrome-footer-link {
	font-size: 0.85rem;
	font-family: var(--talim-font-head);
	color: #7d2c6e;
	text-decoration: none;
	padding: 4px 10px;
}

.talim-chrome-footer-link:hover,
.talim-chrome-footer-link:focus {
	font-weight: 700;
	border-bottom: 2px solid #7d2c6e;
}

.talim-chrome-footer-link--current {
	font-weight: 700;
	border-bottom: 2px solid #7d2c6e;
}

/* The user symbol stands in its own list on the bar's right
   side; the details dropdown styles are auth.css. The module
   entries (talim_design_user_menu_items) render inside the
   dropdown panel, never as flat header links (slice 7). */

/* Platform page template (slice 2): the shortcode-surface page
   keeps the platform measure — the owning module styles carry the
   content itself. */
.talim-chrome-page {
	max-width: 60rem;
	margin: 0 auto;
}

.talim-chrome-page-title {
	font-family: var(--talim-font-body);
	font-size: var(--talim-title-size);
	margin: 1.2rem 0 1rem;
	color: var(--talim-deep);
}

.talim-chrome-page-content > *:first-child {
	margin-top: 0;
}

/* Blog surfaces (slice 3): the posts index and the single post keep
   the platform measure and a quiet, content-first rhythm. The body
   text inherits the wrapper's one shared size and family. */
.talim-post {
	max-width: 42rem;
	margin: 0 auto 2.5rem;
}

.talim-post-title {
	font-family: var(--talim-font-body);
	font-size: 1.35rem;
	margin: 0 0 0.2rem;
	color: var(--talim-deep);
}

.talim-post-link {
	color: inherit;
	text-decoration: none;
}

.talim-post-link:hover {
	color: var(--talim-plum);
	text-decoration: underline;
}

.talim-post-meta {
	color: var(--talim-plum);
	font-size: 0.85rem;
	margin: 0 0 0.6rem;
}

.talim-post-content > *:first-child {
	margin-top: 0;
}
/* Scrollbar stability (issue #317 verification, 16 November
   2026): on Windows the classic scrollbar reserves its width only
   on pages long enough to scroll, so a short surface (the Account
   page) shifts and its centered header bar looks slightly smaller
   and offset compared with long surfaces. The platform body always
   reserves the gutter, so every surface aligns pixel-identically. */
body.talim-platform {
	overflow-y: scroll;
	scrollbar-gutter: stable;
}
/* Legal links (issue #317 follow-up, owner ruling, 16 November
   2026, Duolingo pattern): quiet legal links on the HOME surface
   only, never on the internal sites. They sit above the invisible
   hover strip, quiet and small, like Duolingo's home footer. */
.talim-chrome-footer-legal {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 100%;
	text-align: center;
	padding: 0 1rem 0.75rem;
}

.talim-chrome-footer-legal-list {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1.5rem;
	margin: 0;
	padding: 0;
}

.talim-chrome-footer-legal-link {
	font-size: 0.8rem;
	font-family: var(--talim-font-head);
	color: #999999;
	text-decoration: none;
}

.talim-chrome-footer-legal-link:hover,
.talim-chrome-footer-legal-link:focus {
	color: #7d2c6e;
	text-decoration: underline;
}

/* Mobile (owner ruling, Duolingo pattern): the legal links are a
   desktop-site element; on small screens nothing shows, like
   Duolingo's mobile site. */
@media ( max-width: 600px ) {
	.talim-chrome-footer-legal {
		display: none;
	}
}

/* Issue #379, owner ruling 25 November 2026: the mobile bottom tab
   bar of issue #317 (always-visible on touch devices) is removed -
   the four platform tabs are never permanently visible; touch
   devices open them through the side menu (see below). */

@media ( max-width: 600px ), ( hover: none ) {

	/* Issue #379, owner ruling 25 November 2026: the hover strip is
	   a pointer-device affordance; the four platform tabs are never
	   permanently visible, so the footer carries nothing on touch
	   devices and small screens. */
	.talim-chrome-footer {
		display: none;
	}

	.talim-chrome-main {
		padding-bottom: 0;
	}
}

/* Side menu (issue #379, owner ruling 25 November 2026): the four
   platform links open independently of the face icon from a slim
   handle on the right edge of the screen; the panel slides in from
   the right side. Details/summary chrome convention, no JavaScript.
   Pointer devices and large screens keep the bottom hover strip,
   so the handle renders there never. */
.talim-chrome-side-menu {
	display: none;
}

.talim-chrome-side-handle {
	list-style: none;
}

.talim-chrome-side-handle::-webkit-details-marker {
	display: none;
}

@media ( max-width: 600px ), ( hover: none ) {

	.talim-chrome-side-menu {
		display: flex;
		flex-direction: column;
		align-items: center;
		position: fixed;
		top: 50%;
		right: 0;
		transform: translateY( -50% );
		z-index: 40;
	}

	.talim-chrome-side-handle {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 26px;
		height: 64px;
		background: #7d2c6e;
		border-radius: 10px 0 0 10px;
		color: #ffffff;
		cursor: pointer;
		box-shadow: -2px 2px 8px rgba( 0, 0, 0, 0.18 );
	}

	.talim-chrome-side-glyph {
		font-size: 1.2rem;
		line-height: 1;
		transition: transform 0.15s ease;
	}

	.talim-chrome-side-menu[open] .talim-chrome-side-glyph {
		transform: scaleX( -1 );
	}

	.talim-chrome-side-list {
		display: none;
		list-style: none;
		margin: 0;
		padding: 10px 0;
		flex-direction: column;
		align-items: center;
	}

	/* Owner second review 25 November 2026: not a text panel but a
	   single vertical bar of four round icon buttons (the label
	   travels as title/aria-label, the face symbol supplies the
	   button language). */
	.talim-chrome-side-menu[open] .talim-chrome-side-list {
		display: flex;
	}

	.talim-chrome-side-link {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 42px;
		height: 42px;
		margin-top: 8px;
		background: #442e66;
		border: 2px solid #ffd500;
		border-radius: 50%;
		text-decoration: none;
	}

	.talim-chrome-side-link--current {
		background: #7d2c6e;
	}

	.talim-chrome-side-initial {
		color: #ffffff;
		font-family: var(--talim-font-head);
		font-size: 1rem;
	}
}
