/*
Theme Name: Mehrusuits Magazine
Theme URI: https://mehrusuits.com/
Author: Mehrusuits
Author URI: https://mehrusuits.com/
Description: A fast, lightweight block theme for Mehrusuits — an editorial magazine for textiles, embroidery and fashion. Combines a magazine homepage (featured hero story, category sections, article card grid) with a clean, fast, system-font design. No jQuery, no page builder, no heavy libraries.
Requires at least: 6.5
Tested up to: 6.9
Requires PHP: 7.4
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mehrusuits-magazine
Tags: blog, magazine, fashion, textile, block-patterns, block-styles, custom-logo, featured-images, full-site-editing, wide-blocks
*/

/* ---------- Base ---------- */
body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

a {
	text-underline-offset: 3px;
}

/* ---------- Header ---------- */
header.wp-block-template-part:has(> .site-header) {
	position: sticky;
	top: 0;
	z-index: 100;
}

body.admin-bar header.wp-block-template-part:has(> .site-header) {
	top: 32px;
}

.site-header {
	background: var(--wp--preset--color--white);
	border-bottom: 1px solid #e5e7eb;
	padding-top: 0.75rem;
	padding-bottom: 0.75rem;
}

.site-header .wp-block-site-title a {
	text-decoration: none;
	font-family: Georgia, "Times New Roman", Times, serif;
	font-weight: 700;
	color: var(--wp--preset--color--ink);
}

.site-header .wp-block-navigation a {
	text-decoration: none;
}

.site-header .wp-block-navigation a:hover {
	color: var(--wp--preset--color--brand);
}

/* ---------- Homepage eyebrow + pills ---------- */
.mm-eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-weight: 700;
	font-size: 0.85rem;
	color: var(--wp--preset--color--brand);
}

.mm-pill .wp-block-button__link {
	border-radius: 999px;
	padding: 0.45em 1.1em;
	font-size: 0.95rem;
}

/* ---------- Hero ---------- */
.mm-hero .wp-block-post-featured-image img {
	border-radius: 16px;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	width: 100%;
}

.mm-hero .wp-block-post-title {
	margin-top: 1.25rem;
}


/* ---------- Wide layout (v1.0.4) ---------- */
/* Force the 1340px width on the home/archive mains and their direct children,
   whatever the alignment classes do — the constrained layout otherwise caps
   nested blocks at the 720px content width. */
main.mm-home,
main.mm-archive {
	max-width: 1340px;
}

main.mm-home > .alignwide,
main.mm-home > .wp-block-query,
main.mm-home > .mm-hero,
main.mm-archive > .alignwide,
main.mm-archive > .wp-block-query {
	max-width: 1340px;
}


/* ---------- Wide layout fix (v1.0.5) ---------- */
/* The 720px content-width rule was still winning on the homepage main element,
   and a child's max-width can never exceed its parent — so the main itself
   must be widened first, then its direct children. */
main.mm-home,
main.mm-archive {
	max-width: 1340px !important;
}

body main.mm-home > *,
body main.mm-archive > * {
	max-width: 1340px !important;
}


/* ---------- Width fix (v1.0.7) ---------- */
/* Widen the main element without depending on any class on it, and make
   sure no ancestor caps it either. */
main:not(.mm-single):not(.mm-page) {
	max-width: 1340px !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

.wp-site-blocks {
	max-width: none !important;
}

/* Widen main's direct children on home/archive pages too. The earlier
   class-based rules never matched, so this uses :not() to exclude only the
   single-post and page mains, which must stay narrow for readability. */
main:not(.mm-single):not(.mm-page) > .wp-block-query,
main:not(.mm-single):not(.mm-page) > .wp-block-group {
	max-width: 1340px !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

/* ---------- Article cards ---------- */
.mm-card-grid .wp-block-post-template {
	display: grid;
	gap: 2rem;
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1023px) {
	.mm-card-grid .wp-block-post-template {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 599px) {
	.mm-card-grid .wp-block-post-template {
		grid-template-columns: 1fr;
	}
}

.mm-card .wp-block-post-featured-image img {
	aspect-ratio: 16 / 9;
	object-fit: cover;
	width: 100%;
	border-radius: 12px;
}


.mm-card {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.mm-card .wp-block-post-excerpt {
	flex: 1 1 auto;
}

.mm-card-meta {
	flex-wrap: nowrap;
}

.mm-card-meta .wp-block-post-date {
	white-space: nowrap;
}

.mm-card-meta {
	font-size: 0.875rem;
	color: var(--wp--preset--color--muted);
	gap: 0.75rem;
	align-items: baseline;
	flex-wrap: wrap;
}

.mm-card-meta a {
	color: var(--wp--preset--color--brand);
	font-weight: 600;
	text-decoration: none;
}

.mm-card-meta a:hover {
	text-decoration: underline;
}

.mm-card .wp-block-post-title a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.mm-card .wp-block-post-title a:hover {
	color: var(--wp--preset--color--brand);
}

.mm-card .wp-block-post-excerpt__more-link,
.mm-hero .wp-block-post-excerpt__more-link {
	color: var(--wp--preset--color--brand);
	font-weight: 600;
	text-decoration: none;
}

.mm-card .wp-block-post-excerpt__more-link:hover,
.mm-hero .wp-block-post-excerpt__more-link:hover {
	text-decoration: underline;
}

/* ---------- Category sections (compact lists) ---------- */
.mm-compact-list .wp-block-post-template {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.mm-compact-list .wp-block-post-featured-image img {
	border-radius: 8px;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.mm-compact-list .wp-block-post-title a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.mm-compact-list .wp-block-post-title a:hover {
	color: var(--wp--preset--color--brand);
}

/* ---------- Instagram strip ---------- */
.mm-insta-tile {
	min-height: 140px;
	border-radius: 12px;
}

.mm-insta-tiles > * {
	min-width: 0;
}

/* ---------- Single post ---------- */
.mm-single .wp-block-post-featured-image img {
	border-radius: 16px;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	width: 100%;
}

.mm-single .wp-block-post-terms a,
.mm-single .wp-block-post-date a {
	color: var(--wp--preset--color--brand);
	text-decoration: none;
	font-weight: 600;
}

.mm-single .wp-block-post-navigation-link a {
	color: var(--wp--preset--color--brand);
	text-decoration: none;
	font-weight: 600;
}

/* ---------- Pagination ---------- */
.wp-block-query-pagination a {
	color: var(--wp--preset--color--brand);
	text-decoration: none;
	font-weight: 600;
}

/* ---------- Footer ---------- */
.site-footer {
	background: var(--wp--preset--color--ink);
	color: #e5e7eb;
	margin-top: 4rem;
	padding-top: 2.5rem;
	padding-bottom: 2rem;
}

.site-footer .wp-block-site-title a {
	color: #ffffff;
	text-decoration: none;
	font-family: Georgia, "Times New Roman", Times, serif;
	font-weight: 700;
}

.site-footer .wp-block-navigation a {
	color: #e5e7eb;
	text-decoration: none;
}

.site-footer .wp-block-navigation a:hover {
	color: #ffffff;
	text-decoration: underline;
}

.site-footer .wp-block-social-links .wp-block-social-link {
	background: rgba(255, 255, 255, 0.12);
}
