/**
 * Monarch shared pieces, used by several blocks. Values measured on the
 * live Divi site (monarchhomestn.com, 1440px): content rows are 80% wide up
 * to 1080px; headings are a serif 36px in navy #263954 (live asks for
 * Calisto, which it never loads — Crimson Pro stands in) over a short grey
 * rule; body text is Nunito 18–19px/1.8 #666; buttons are orange #f3a31a,
 * Nunito 700 14px uppercase with 2px tracking.
 */

.mh-row {
    width: 80%;
    max-width: 1080px;
    margin-inline: auto;
}

/* Section heading (+ optional icon above) and the live site's short rule beneath it. */
.mh-iconheading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    margin: 0;
    text-align: center;
}

.mh-iconheading img {
    display: block;
    width: auto;
    height: 75px;
}

.mh-iconheading__title {
    margin: 0;
    font-family: var(--font-heading, "Crimson Pro", Georgia, "Times New Roman", serif);
    font-weight: 400;
    font-size: 38px;
    line-height: 1.3;
    color: var(--primary, #263954);
}

.mh-iconheading__title::after,
.mh-rule {
    content: "";
    display: block;
    width: 50px;
    height: 1px;
    margin: 24px auto 0;
    background: rgba(0, 0, 0, 0.15);
}

.mh-iconheading--left { align-items: flex-start; text-align: left; }
.mh-iconheading--left .mh-iconheading__title::after { margin-left: 0; }

.mh-iconheading__title--upper { text-transform: uppercase; }

.mh-btn {
    display: inline-block;
    padding: 16px 26px;
    background: var(--mh-accent, #f3a31a);
    color: #ffffff;
    font-family: var(--font-display, "Nunito", ui-sans-serif, system-ui, sans-serif);
    font-weight: 700;
    font-size: 14px;
    line-height: 1.2;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    border-bottom: 0;
    transition: background-color 0.2s ease;
}

.mh-btn:hover,
.mh-btn:focus-visible { background: #d98f0c; color: #ffffff; }

.mh-btn--dark { background: #000000; letter-spacing: 0; text-transform: none; font-family: var(--font-paragraph, "Open Sans", ui-sans-serif, system-ui, sans-serif); font-weight: 400; font-size: 13.6px; padding: 10px 16px; }
.mh-btn--dark:hover,
.mh-btn--dark:focus-visible { background: #333333; }

@media (max-width: 767px) {
    .mh-iconheading img { height: 56px; }
    .mh-iconheading__title { font-size: 30px; }
}

/* Rich content inside blocks (WYSIWYG fields). Live Divi text modules:
   Nunito 18–19px/1.8 #666. */
.mh-prose {
    font-family: var(--font-display, "Nunito", ui-sans-serif, system-ui, sans-serif);
    font-weight: 400;
    font-size: 18px;
    line-height: 1.8;
    color: var(--mh-text, #666666);
}

.mh-prose > :first-child { margin-top: 0; }
.mh-prose > :last-child { margin-bottom: 0; }
.mh-prose p { margin: 0 0 18px; }
.mh-prose strong, .mh-prose b { font-weight: 700; }

.mh-prose h2,
.mh-prose h3,
.mh-prose h4 {
    margin: 0 0 16px;
    font-family: var(--font-heading, "Crimson Pro", Georgia, "Times New Roman", serif);
    font-weight: 400;
    line-height: 1.3;
    color: var(--primary, #263954);
}

.mh-prose h2 { font-size: 38px; }
.mh-prose h3 { font-size: 28px; }
.mh-prose h4 { font-size: 22px; }

.mh-prose ul,
.mh-prose ol { margin: 0 0 18px; padding-left: 1.2em; }
.mh-prose ul { list-style: disc; }
.mh-prose ol { list-style: decimal; }

/* Live's orange ➤ bullets ("Whether you are seeking:"). */
.mh-prose ul.mh-arrows { list-style: none; padding-left: 40px; }
.mh-prose ul.mh-arrows li::before { content: "➤"; margin-right: 8px; color: var(--mh-accent, #f3a31a); }

.mh-prose a { color: #aa6c00; }
.mh-prose a:hover { text-decoration: underline; }

.mh-prose hr { width: 50px; height: 1px; margin: 40px auto; border: 0; background: rgba(0, 0, 0, 0.15); }

.mh-prose img { max-width: 100%; height: auto; }
.mh-prose iframe { max-width: 100%; border: 0; }

/* A button inside formatted text keeps button colours. */
.mh-prose a.mh-btn { color: #ffffff; }
.mh-prose a.mh-btn:hover { text-decoration: none; }

/* Content images floated in the editor. */
.mh-prose img.alignright { float: right; clear: right; max-width: 45%; margin: 6px 0 20px 30px; }
.mh-prose img.alignleft { float: left; clear: left; max-width: 45%; margin: 6px 30px 20px 0; }
.mh-prose::after { content: ""; display: table; clear: both; }

@media (max-width: 767px) {
    .mh-prose { font-size: 17px; }
    .mh-prose h2 { font-size: 30px; }
    .mh-prose ul.mh-arrows { padding-left: 8px; }
}

@media (max-width: 600px) {
    .mh-prose img.alignright, .mh-prose img.alignleft { float: none; max-width: 100%; margin: 0 0 20px; }
}

/* Wide tables scroll inside their block on phones instead of widening the page. */
@media (max-width: 767px) {
    .mh-prose table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: 14px; }
}

/* Section backgrounds offered by the blocks' "Background" select. */
.mh-bg--white { background: var(--background, #ffffff); }
.mh-bg--beige { background: var(--mh-beige, #e3e3db); }
.mh-bg--cream { background: var(--mh-cream, #f8eacc); }
.mh-bg--grey { background: var(--mh-grey, #f7f7f7); }

/* Section rhythm: live sections run ~54–90px top and bottom at 1440. */
.mh-section { padding: 80px 0; }

@media (max-width: 767px) {
    .mh-section { padding: 56px 0; }
}

/* Click-to-load YouTube (foundation_mh_video()). */
.mh-video { position: relative; aspect-ratio: 16 / 9; background: #000000; }
.mh-video__poster { position: absolute; inset: 0; display: block; width: 100%; padding: 0; border: 0; background: #000000; cursor: pointer; }
.mh-video__poster img { width: 100%; height: 100%; object-fit: cover; }
.mh-video__play { position: absolute; top: 50%; left: 50%; width: 68px; height: 48px; margin: -24px 0 0 -34px; border-radius: 12px; background: #ff0000; transition: transform 0.2s ease; }
.mh-video__play::after { content: ""; position: absolute; top: 50%; left: 50%; margin: -9px 0 0 -6px; border-style: solid; border-width: 9px 0 9px 16px; border-color: transparent transparent transparent #ffffff; }
.mh-video__poster:hover .mh-video__play, .mh-video__poster:focus-visible .mh-video__play { transform: scale(1.08); }
.mh-video__poster:focus-visible { outline: 3px solid var(--mh-accent, #f3a31a); outline-offset: 3px; }
.mh-video__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (prefers-reduced-motion: reduce) { .mh-video__play { transition: none; } }

/* Embeds inside formatted text: YouTube and Google Maps iframes. */
.mh-prose iframe.mh-youtube { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.mh-prose iframe[src*="google.com/maps"] { display: block; width: 100%; height: 420px; }

/* Blog list and single posts (home.php, single.php) — unused today, kept styled. */
.mh-blog { padding: 60px 0 80px; }
.mh-blog__inner { max-width: 900px; }
.mh-blog__heading {
    margin: 0 0 32px;
    font-family: var(--font-heading, "Crimson Pro", Georgia, serif);
    font-weight: 400;
    font-size: 40px;
    line-height: 1.15;
    color: var(--primary, #263954);
}
.mh-blog__inner--single .mh-blog__heading { margin-bottom: 8px; }
.mh-blog__item { padding: 0 0 32px; margin: 0 0 32px; border-bottom: 1px solid #e6e6e6; }
.mh-blog__item:last-of-type { border-bottom: 0; }
.mh-blog__title {
    margin: 0 0 4px;
    font-family: var(--font-heading, "Crimson Pro", Georgia, serif);
    font-weight: 400;
    font-size: 28px;
    line-height: 1.25;
    color: var(--primary, #263954);
}
.mh-blog__title a:hover { color: var(--mh-accent, #f3a31a); }
.mh-blog__date { margin: 0 0 12px; font-size: 15px; color: #767676; }
.mh-blog__inner--single .mh-blog__date { margin-bottom: 32px; }
.mh-blog__back { margin: 0 0 16px; font-size: 15px; }
.mh-blog__back a { color: #aa6c00; }
@media (max-width: 767px) {
    .mh-blog { padding: 40px 0 60px; }
    .mh-blog__heading { font-size: 32px; }
}

/* Password-protected pages: WordPress' password form in place of the page content. */
.post-password-form {
    width: 80%;
    max-width: 700px;
    margin: 0 auto;
    padding: 80px 0;
    font-size: 18px;
    line-height: 1.7;
    color: var(--mh-text, #666666);
}
.post-password-form p { margin: 0 0 16px; }
.post-password-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.post-password-form input[type="password"] { max-width: 360px; padding: 10px 12px; border: 1px solid #cfcfcf; font-size: 17px; }
.post-password-form input[type="submit"] {
    padding: 10px 22px;
    border: 0;
    background: var(--mh-accent, #f3a31a);
    color: #ffffff;
    font-family: var(--font-display, "Nunito", ui-sans-serif, system-ui, sans-serif);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
}
.post-password-form input[type="submit"]:hover,
.post-password-form input[type="submit"]:focus-visible { background: #d98f0c; }

/* In-page links (#about, #contact…) land below the sticky header. */
html { scroll-padding-top: 140px; scroll-behavior: smooth; }
@media (max-width: 980px) { html { scroll-padding-top: 90px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Left-aligned section headings (Eric's bio). */
.mediatext-heading .mh-iconheading { align-items: center; text-align: center; }
.mh-left .mh-iconheading { align-items: flex-start; text-align: left; }
.mh-left .mh-iconheading__title::after { margin-left: 0; }

/* About: the butterfly over the hallmark statement (the block's heading),
   then the narrower copy with "Why Monarch Homes" as an h2 inside it. */
.mh-about .richtext-heading .mh-iconheading__title { max-width: 1200px; font-size: 40px; }
.mh-about .richtext-heading .mh-iconheading__title::after { display: none; }
.mh-about .richtext-content { max-width: 900px; margin: 48px auto 0; font-size: 19px; }
.mh-about .richtext-content h2 { margin-top: 0; text-align: center; }
.mh-about .richtext-content h2::after { content: ""; display: block; width: 50px; height: 1px; margin: 24px auto 0; background: rgba(0, 0, 0, 0.15); }
@media (max-width: 767px) {
    .mh-about .richtext-heading .mh-iconheading__title { font-size: 28px; }
    .mh-about .richtext-content { margin-top: 32px; font-size: 17px; }
}

/* Eric's bio: centred two-line heading over the left column. */
.mh-bio .mediatext-text .mh-prose { font-size: 18px; }
.mh-bio .mh-iconheading__title { font-size: 35px; }
.mh-bio .mh-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 0 6%;
    align-items: start;
    max-width: 1200px;
}
.mh-bio .mediatext-heading { grid-column: 1; grid-row: 1; margin: 30px 0 24px; }
.mh-bio .mediatext-grid { display: contents; }
.mh-bio .mediatext-media { grid-column: 2; grid-row: 1 / span 2; }
.mh-bio .mediatext-text { grid-column: 1; grid-row: 2; }
.mh-bio .mediatext-image { display: block; width: 100%; height: auto; }
@media (max-width: 767px) {
    .mh-bio .mh-row { grid-template-columns: 1fr; }
    .mh-bio .mediatext-heading { margin-top: 0; }
    .mh-bio .mediatext-media { grid-column: 1; grid-row: 3; margin-top: 24px; }
    .mh-bio .mh-iconheading__title { font-size: 28px; }
}

/* Loading screen (functions/preloader.php). */
.mh-preloader { position: fixed; inset: 0; z-index: 99999; transition: opacity 0.6s ease; }
.mh-preloader.is-hidden { opacity: 0; pointer-events: none; }
.mh-preloader__bg { position: absolute; inset: 0; background: var(--mh-credit, #424242); }
.mh-preloader__image { position: absolute; inset: 0; background-repeat: no-repeat; background-position: center; background-size: 150px 150px; }
@media (prefers-reduced-motion: reduce) { .mh-preloader { transition: none; } }
