/*
Theme Name: Morinkhuur
Template: twentytwentyfive
Description: Child theme of Twenty Twenty-Five. Header with title and tagline, horizontal menu, main 70% + sidebar 30%, max width 1280px.
Version: 1.0.2
Requires at least: 6.7
Text Domain: morinkhuur
*/

/* ---- page frame: max 1280px, centered ---- */
.mk-header,
.mk-layout {
	box-sizing: border-box;
	max-width: 1280px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 20px;
	padding-right: 20px;
}

/* ---- header ---- */
.mk-header {
	padding-top: 24px;
	padding-bottom: 0;
}

/* title + tagline: one line of 1240px at full width (size set by assets/fit.js),
   centered and wrapped on narrower screens */
.mk-header .mk-brand {
	justify-content: center;
	align-items: baseline;
	gap: 0 1em;
	text-align: center;
	font-size: var(--mk-brand-size, 1.5rem);
}
.mk-brand .wp-block-site-title,
.mk-brand .wp-block-site-title a,
.mk-brand .wp-block-site-tagline {
	margin: 0;
	font-family: var(--wp--preset--font-family--manrope, inherit);
	font-size: 1em;
	font-weight: 700;
	font-style: normal;
	letter-spacing: normal;
	line-height: 1.4;
	text-transform: none;
	color: inherit;
}

/* menu: one line of 1240px at full width (size set by assets/fit.js);
   items that do not fit move into the "More" drop-down */
.mk-header .mk-nav {
	margin-top: 16px;
	font-size: var(--mk-nav-size, 1rem);
}
.mk-header .mk-nav .wp-block-navigation__container {
	flex: 1 1 auto;
	flex-wrap: nowrap;
	justify-content: space-between;
	gap: 0 1.2em;
	width: 100%;
	min-width: 0;
}
.mk-header .mk-nav .wp-block-navigation-item {
	white-space: nowrap;
}
.mk-header .mk-nav .is-hidden {
	display: none !important;
}
.mk-more {
	position: relative;
}
.mk-more-btn {
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	color: inherit;
	cursor: pointer;
	white-space: nowrap;
}
.mk-more-btn::after {
	content: " \25BE";
}
.mk-more-list {
	display: none;
	position: absolute;
	top: 100%;
	right: 0;
	z-index: 100;
	flex-direction: column;
	gap: 0.6em;
	margin: 0.4em 0 0;
	padding: 0.8em 1.2em;
	list-style: none;
	background: #fff;
	border: 1px solid #ddd;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.mk-more.is-open .mk-more-list {
	display: flex;
}

/* used by assets/fit.js while measuring the natural one-line width */
.mk-measure {
	display: inline-flex !important;
	flex: none !important;
	flex-wrap: nowrap !important;
	justify-content: flex-start !important;
	width: max-content !important;
}
.mk-measure > * {
	white-space: nowrap !important;
}

/* ---- body: main 70% + sidebar 30%, text slightly smaller ---- */
.mk-layout {
	display: flex;
	align-items: flex-start;
	gap: 40px;
	margin-top: 32px;
	margin-bottom: 48px;
	font-size: 0.75em;
}
.mk-layout > * {
	margin-block-start: 0;
}
.mk-main {
	flex: 7 1 0;
	min-width: 0;
}
.mk-side {
	flex: 3 1 0;
	min-width: 0;
}

/* titles: page / post title and list headings, and post titles inside lists */
.mk-main h1.wp-block-post-title,
.mk-main h1.wp-block-query-title,
.mk-main h1.wp-block-heading {
	font-size: 2.05em;
	line-height: 1.3;
}
.mk-main .wp-block-post-template .wp-block-post-title {
	font-size: 1.4em;
	line-height: 1.4;
}

/* headings inside post / page content: same ratio to the body text as the old
   site (body 14px, h1 26px, h2 20px, h3 16px) */
.mk-main .wp-block-post-content h1 {
	font-size: 1.86em;
	line-height: 1.5;
}
.mk-main .wp-block-post-content h2 {
	font-size: 1.43em;
	line-height: 1.5;
}
.mk-main .wp-block-post-content h3 {
	font-size: 1.14em;
	line-height: 1.6;
}

/* 800px or narrower: sidebar moves below the main content */
@media (max-width: 800px) {
	.mk-layout {
		flex-direction: column;
	}
	.mk-main,
	.mk-side {
		flex: none;
		width: 100%;
	}
}

/* ---- sidebar ---- */
.mk-side > * + * {
	margin-block-start: 2.5em;
}
.mk-side-heading {
	margin: 0 0 0.75em;
	padding-bottom: 0.3em;
	border-bottom: 1px solid #ddd;
	font-size: 1.05em;
}
/* profile (old site layout): bordered box, 70px square image on the left,
   name on one line (cut with "...") and text in the right column */
.mk-side .mk-profile {
	display: grid;
	grid-template-columns: 70px minmax(0, 1fr);
	column-gap: 20px;
	align-items: start;
	padding: 20px;
	border: 1px solid #ddd;
}
.mk-profile > * {
	margin: 0;
	margin-block-start: 0;
}
.mk-profile .mk-profile-img {
	grid-row: 1 / span 2;
	margin: 0;
}
.mk-profile .mk-profile-img img {
	display: block;
	width: 70px;
	height: 70px;
	object-fit: cover;
	border-radius: 4px;
}
.mk-profile .mk-profile-name {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-size: 0.9em;
	font-weight: bold;
	line-height: 1.6;
}
.mk-profile .mk-profile-name > * {
	display: inline;
	white-space: nowrap;
	margin: 0;
	font-size: 1em;
	font-weight: bold;
}
.mk-profile .mk-profile-name .wp-block-site-tagline {
	margin-left: 0.5em;
}
/* text fills the column; same font list as the old site */
.mk-profile .mk-profile-text {
	margin-top: 0.4em;
	font-family: "Helvetica neue", Arial, Roboto, "Droid Sans", "ヒラギノ角ゴ ProN W3", "Hiragino Kaku Gothic ProN", メイリオ, Meiryo, sans-serif;
	font-size: 0.78em;
	font-weight: 400;
	color: rgba(51, 51, 51, 0.7); /* same as the old site */
	letter-spacing: normal;
	line-height: 1.8;
	text-wrap: wrap; /* the theme's "pretty" re-balances the last lines */
}

.mk-side .wp-block-latest-posts,
.mk-side .wp-block-categories {
	padding-left: 0;
	list-style: none;
	font-size: 0.95em;
}
.mk-side .wp-block-latest-posts li,
.mk-side .wp-block-categories li {
	margin-bottom: 0.6em;
}

/* sidebar post list with thumbnails: 80px square image on the left,
   title (2 lines max) and date on the right */
.mk-side .mk-thumb-list li {
	display: grid;
	grid-template-columns: 80px minmax(0, 1fr);
	grid-auto-rows: min-content;
	column-gap: 20px;
	min-height: 80px;
	margin-bottom: 20px;
}
.mk-side .mk-thumb-list .wp-block-latest-posts__featured-image {
	grid-column: 1;
	grid-row: 1 / span 2;
	float: none;
	margin: 0;
	width: 80px;
	height: 80px;
	overflow: hidden;
}
.mk-side .mk-thumb-list .wp-block-latest-posts__featured-image img {
	display: block;
	width: 80px;
	height: 80px;
	max-width: none;
	object-fit: cover;
}
.mk-side .mk-thumb-list .wp-block-latest-posts__post-title {
	grid-column: 2;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 0.85em;
	font-weight: 400;
	line-height: 1.6;
	color: #333; /* same as the old site */
}
.mk-side .mk-thumb-list .wp-block-latest-posts__post-date {
	grid-column: 2;
	margin-top: 0.3em;
	font-size: 0.8em;
	font-weight: 400;
	color: rgba(51, 51, 51, 0.7); /* same as the old site */
}

/* search: compact input and button of the same height */
.mk-side .wp-block-search .wp-block-search__inside-wrapper {
	align-items: stretch;
	gap: 0.4em;
}
.mk-side .wp-block-search .wp-block-search__input,
.mk-side .wp-block-search .wp-block-search__button {
	box-sizing: border-box;
	margin: 0;
	padding: 0.35em 0.7em;
	font-size: 0.95em;
	line-height: 1.4;
	min-height: 0;
}
.mk-side .wp-block-search .wp-block-search__input {
	border: 1px solid #bbb;
	border-radius: 2px;
}
.mk-side .wp-block-search .wp-block-search__button {
	padding-left: 1em;
	padding-right: 1em;
	border-radius: 2px;
	white-space: nowrap;
}

/* ---- footer: one line of text ---- */
.mk-footer {
	box-sizing: border-box;
	max-width: 1280px;
	margin: 0 auto;
	padding: 10px 20px;
	border-top: 1px solid #bbb;
}
/* centered; wraps at any width */
.mk-footer-text {
	margin: 0;
	font-size: 0.75rem;
	line-height: 1.5;
	color: #999;
	text-align: center;
	overflow-wrap: anywhere;
}

/* ---- single post: previous / next ---- */
.mk-postnav {
	margin-top: 3em;
	padding-top: 1em;
	border-top: 1px solid #ddd;
	gap: 1em;
}
