/*
Theme Name: Meldon House & Home
Theme URI: https://www.meldonhouseandhome.com
Author: My Tech Team
Author URI: https://mytechteam.uk
Description: Minimal boxed theme recreating the Meldon House & Home Squarespace design. Built for Elementor. Includes a one-click setup (Appearance > Meldon Setup) that imports all pages, images, posts and the menu.
Version: 1.0.2
Requires at least: 6.2
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: meldon
*/

/* ---------- Design tokens (taken from the live Squarespace site) ---------- */
:root {
	--mh-font: "proxima-nova", "Figtree", "Helvetica Neue", Arial, sans-serif;
	--mh-text: #5c5c5c;        /* body copy */
	--mh-heading: #222222;     /* h3 */
	--mh-heading-light: #262626; /* h2 */
	--mh-link: #111111;
	--mh-nav: rgba(0, 0, 0, 0.5);
	--mh-nav-active: #111111;
	--mh-rule: rgba(0, 0, 0, 0.1);
	--mh-meta: rgba(0, 0, 0, 0.4);
	--mh-canvas-width: 1100px;
	--mh-canvas-pad: 100px;
	--mh-canvas-margin: 80px;
	--mh-body-size: 24px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: #fff;
	color: var(--mh-text);
	font-family: var(--mh-font);
	font-weight: 300;
	font-size: var(--mh-body-size);
	line-height: 1.8;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--mh-link); text-decoration: none; transition: opacity .15s; }
a:hover { opacity: .6; }
p { margin: 0 0 1.8em; }
p:last-child { margin-bottom: 0; }
strong, b { font-weight: 600; }
h1, h2, h3, h4 { font-family: var(--mh-font); letter-spacing: 1px; margin: 0; }
h1 { font-size: 2.6em; font-weight: 300; line-height: 1.2; color: var(--mh-heading-light); }
h2 { font-size: 2em; font-weight: 300; line-height: 1.4; color: var(--mh-heading-light); }
h3 { font-size: 1.3em; font-weight: 400; line-height: 1.4; color: var(--mh-heading); margin: 1em 0 .3em; }
h3:first-child { margin-top: 0; }
hr { border: 0; border-top: 1px solid var(--mh-rule); margin: 1em 0; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }

/* ---------- Boxed canvas ---------- */
.mh-canvas {
	max-width: calc(var(--mh-canvas-width) + (var(--mh-canvas-pad) * 2) + 4px);
	margin: var(--mh-canvas-margin) auto;
	padding: var(--mh-canvas-pad) var(--mh-canvas-pad) 0;
	background: #fff;
	border: 2px solid var(--mh-rule);
}

/* ---------- Header ---------- */
.mh-header { text-align: center; }
.mh-logo { margin: 0; line-height: 0; }
.mh-logo a { display: inline-block; }
.mh-logo img { width: 478px; max-width: 100%; height: auto; margin: 0 auto; }
.mh-logo .mh-logo-text { font-size: 48px; line-height: 1.2; letter-spacing: 4px; color: var(--mh-link); font-weight: 300; text-transform: uppercase; }

.mh-nav { margin-top: 50px; position: relative; }
.mh-nav::before { /* the thin rule running either side of the menu */
	content: ""; position: absolute; left: 0; right: 0; top: 50%;
	border-top: 2px solid var(--mh-rule);
}
.mh-nav ul {
	position: relative; display: inline-flex; flex-wrap: wrap; justify-content: center;
	list-style: none; margin: 0; padding: 0 30px; background: #fff;
}
.mh-nav li { margin: 0 0 0 30px; }
.mh-nav li:first-child { margin-left: 0; }
.mh-nav a {
	display: block; font-size: 14px; font-weight: 400; letter-spacing: 1px; line-height: 1.6;
	text-transform: uppercase; color: var(--mh-nav);
}
.mh-nav a:hover { opacity: 1; color: var(--mh-nav-active); }
.mh-nav .current-menu-item > a,
.mh-nav .current_page_item > a,
.mh-nav .current-menu-ancestor > a,
.mh-nav .current_page_parent > a { color: var(--mh-nav-active); }

.mh-nav-toggle { display: none; }

/* ---------- Page banner (featured image) ---------- */
.mh-hero { margin-top: 95px; }
.mh-hero img { width: 100%; height: auto; }

/* ---------- Main content area ---------- */
.mh-main { margin: 95px 0; }
.mh-main.mh-no-hero { margin-top: 95px; }
/* Classic (non-Elementor) content column */
.mh-entry { max-width: 770px; margin: 0 auto; }
.mh-entry img { margin: 0 auto 1.8em; }

/* Elementor: keep its own spacing neutral so the theme's rhythm applies */
.mh-main .elementor-section.elementor-section-boxed > .elementor-container { max-width: var(--mh-canvas-width); }
.mh-main .elementor-widget-text-editor { color: var(--mh-text); font-family: var(--mh-font); font-size: var(--mh-body-size); font-weight: 300; line-height: 1.8; }
.mh-main .elementor-widget-text-editor p:last-child { margin-bottom: 0; }
/* Squarespace blocks sit ~34px apart (17px padding each side) */
.mh-main .elementor-element.elementor-widget:not(:last-child) { margin-block-end: 34px; }
.mh-main .elementor-section + .elementor-section { margin-top: 0; }
.mh-main .elementor-heading-title { line-height: 1.4; letter-spacing: 1px; font-weight: 300; color: var(--mh-heading-light); }
.mh-main .elementor-widget-spacer { margin-block-end: 0 !important; }
.mh-main .elementor-divider { padding-block: 9px; }
.mh-main .elementor-widget-image img { width: 100%; }
.mh-page img.aligncenter { margin: 0 auto 1.8em; }

/* Square-cropped gallery grid like Squarespace's "grid / square" gallery */
.mh-grid { --mh-gap: 20px; }
.mh-grid.mh-gap-15 { --mh-gap: 15px; }
.mh-grid .gallery { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: var(--mh-gap); margin: 0 !important; }
.mh-grid .gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.mh-grid .gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }
.mh-grid .gallery-item { width: auto !important; max-width: none !important; float: none !important; margin: 0 !important; padding: 0 !important; }
.mh-grid .gallery-icon { aspect-ratio: 1 / 1; overflow: hidden; margin: 0; }
.mh-grid .gallery-icon a { display: block; height: 100%; }
.mh-grid .gallery-item img { width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; border: 0 !important; margin: 0 !important; }
.mh-grid .gallery-caption { display: none; }
.mh-grid .gallery br { display: none; }

/* Image floated right inside text (Picture Framing page) */
.alignright { float: right; width: 50%; margin: 0 0 1em 34px; }
.alignleft { float: left; width: 50%; margin: 0 34px 1em 0; }
.aligncenter { margin-left: auto; margin-right: auto; }
.mh-clear::after { content: ""; display: table; clear: both; }

/* Front-page sign-off line sits right on the footer rule, as on Squarespace */
.home .mh-main { margin-bottom: 12px; }
.mh-fallback-section:last-child { margin-bottom: 0 !important; }

/* ---------- Blog ---------- */
.mh-posts { max-width: 770px; margin: 0 auto; }
.mh-post { text-align: center; padding-bottom: 95px; }
.mh-post + .mh-post { padding-top: 0; }
.mh-post-title { font-size: 30px; font-weight: 300; letter-spacing: 1px; line-height: 1.4; color: var(--mh-heading); max-width: 560px; margin: 0 auto; }
.mh-post-title a { color: inherit; }
.mh-post-date { display: block; margin-top: 12px; font-size: 20.4px; font-style: italic; letter-spacing: 2px; color: var(--mh-meta); }
.mh-post-date a { color: inherit; }
.mh-post-thumb { display: block; margin: 40px auto; max-width: 507px; }
.mh-post-excerpt, .mh-post-content { text-align: left; }
.mh-post-content img { margin: 0 auto 1.8em; }
.mh-read-more { display: inline-block; margin-top: 1.2em; }
.mh-post-meta { margin-top: 1.8em; font-size: 16px; letter-spacing: 1px; color: var(--mh-meta); text-align: left; }
.mh-post-meta a { color: var(--mh-meta); }
.mh-pagination { text-align: center; font-size: 16px; letter-spacing: 1px; text-transform: uppercase; }
.mh-pagination a { margin: 0 12px; }

/* ---------- Footer ---------- */
.mh-footer { padding: 50px 0; border-top: 1px solid var(--mh-rule); text-align: center; }
.mh-social { display: flex; justify-content: center; gap: 12px; list-style: none; margin: 0; padding: 0; }
.mh-social a {
	display: flex; align-items: center; justify-content: center;
	width: 48px; height: 48px; border-radius: 50%; background: #000; color: #fff; font-size: 20px;
}
.mh-social a:hover { opacity: .7; }
.mh-social svg { width: 22px; height: 22px; fill: currentColor; }

/* ---------- Responsive ---------- */
@media (max-width: 1340px) {
	:root { --mh-canvas-pad: 60px; --mh-canvas-margin: 50px; }
}
@media (max-width: 1024px) {
	:root { --mh-body-size: 20px; --mh-canvas-pad: 40px; --mh-canvas-margin: 30px; }
	.mh-hero, .mh-main { margin-top: 60px; }
	.mh-main { margin-bottom: 60px; }
}
@media (max-width: 767px) {
	:root { --mh-body-size: 17px; --mh-canvas-pad: 20px; --mh-canvas-margin: 0; }
	.mh-canvas { border: 0; }
	.mh-logo img { width: 300px; }
	.mh-nav { margin-top: 30px; }
	.mh-nav::before { display: none; }
	.mh-nav-toggle {
		display: inline-block; background: none; border: 1px solid var(--mh-rule); padding: 8px 18px;
		font: 400 14px/1.6 var(--mh-font); letter-spacing: 1px; text-transform: uppercase; color: var(--mh-link); cursor: pointer;
	}
	.mh-nav ul { display: none; flex-direction: column; padding: 16px 0 0; width: 100%; }
	.mh-nav.is-open ul { display: flex; }
	.mh-nav li { margin: 0 0 10px; }
	.mh-hero, .mh-main { margin-top: 40px; }
	.mh-main { margin-bottom: 40px; }
	.alignright, .alignleft { float: none; width: 100%; margin: 0 0 1.8em; }
	.mh-grid .gallery, .mh-grid .gallery-columns-4 { grid-template-columns: repeat(2, 1fr); }
	.mh-post-title { font-size: 24px; }
	.mh-post-date { font-size: 16px; }
	.mh-post { padding-bottom: 60px; }
}
