/**
 * Milestone shared pieces, used by several blocks. Values measured on the live
 * Divi site (milestonetn.com, 1440px): content rows are 80% wide up to
 * 1080px; section headings are Actor 700 42px #333 over a 50x5px red rule;
 * body text is Open Sans 500 15px/1.8 #666; buttons are Rubik 700 14px
 * uppercase with 4px letter spacing, red, turning grey (#b7b7b7) on hover.
 */

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

/* Section heading + the short red rule under it. */
.ms-heading {
    margin: 0;
    font-family: var(--font-heading, "Actor", ui-sans-serif, system-ui, sans-serif);
    font-weight: 700;
    font-size: 42px;
    line-height: 1.2;
    color: var(--ms-heading, #333333);
}

.ms-heading--light { color: #ffffff; }

.ms-rule {
    display: block;
    width: 50px;
    height: 5px;
    margin: 26px 0 0;
    border: 0;
    background: var(--ms-accent, #de3a27);
}

.ms-rule--center { margin-inline: auto; }
.ms-rule--grey { background: #b7b7b7; }

@media (max-width: 767px) {
    .ms-heading { font-size: 34px; }
}

.ms-btn {
    display: inline-block;
    padding: 14px 24px;
    border: 0;
    background: var(--ms-accent, #de3a27);
    color: #ffffff;
    font-family: var(--font-label, "Rubik", ui-sans-serif, system-ui, sans-serif);
    font-weight: 700;
    font-size: 14px;
    line-height: 1.7;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ms-btn:hover,
.ms-btn:focus-visible { background: var(--ms-accent-hover, #b7b7b7); color: #ffffff; }

/* Links site-wide get a transparent bottom border (a:not(.btn)); buttons keep their own. */
a.ms-btn, a.ms-btn:hover { border-bottom: 0; }
a.ms-btn--outline, a.ms-btn--outline:hover { border-bottom: 4px solid var(--ms-accent, #de3a27); }

/* Outlined: red border and text; fills red on hover (live "Free Quote"). */
.ms-btn--outline {
    padding: 10px 30px;
    border: 4px solid var(--ms-accent, #de3a27);
    background: transparent;
    color: var(--ms-accent, #de3a27);
}

.ms-btn--outline:hover,
.ms-btn--outline:focus-visible { background: var(--ms-accent, #de3a27); color: #ffffff; }

/* Rich content inside blocks (WYSIWYG fields). Live Divi text modules:
   Open Sans 500 15px/1.8 #666; headings Actor #333. */
.ms-prose {
    font-family: var(--font-paragraph, "Open Sans", ui-sans-serif, system-ui, sans-serif);
    font-weight: 400;
    font-size: 15px;
    line-height: 1.8;
    color: var(--ms-text, #666666);
}

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

.ms-prose h2,
.ms-prose h3,
.ms-prose h4,
.ms-prose h6 {
    margin: 0 0 10px;
    font-family: var(--font-heading, "Actor", ui-sans-serif, system-ui, sans-serif);
    font-weight: 700;
    line-height: 1.3;
    color: var(--ms-heading, #333333);
}

.ms-prose h2 { font-size: 23px; font-weight: 700; }
.ms-prose h3 { font-size: 20px; }
.ms-prose h4 { font-size: 18px; }
.ms-prose h6 { font-size: 15px; }

.ms-prose ul,
.ms-prose ol { margin: 0 0 16px; padding-left: 1.2em; line-height: 1.6; }
.ms-prose ul { list-style: disc; }
.ms-prose ol { list-style: decimal; }

.ms-prose a { color: var(--ms-accent, #de3a27); text-decoration: underline; }
.ms-prose a:hover { color: var(--ms-heading, #333333); }

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

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

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

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

@media (max-width: 767px) {
    .ms-prose table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: 14px; }
}

/* Click-to-load YouTube (foundation_ms_video()). */
.ms-video { position: relative; aspect-ratio: 16 / 9; background: #000000; }
.ms-video__poster { position: absolute; inset: 0; display: block; width: 100%; padding: 0; border: 0; background: #000000; cursor: pointer; }
.ms-video__poster img { width: 100%; height: 100%; object-fit: cover; }
.ms-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; }
.ms-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; }
.ms-video__poster:hover .ms-video__play, .ms-video__poster:focus-visible .ms-video__play { transform: scale(1.08); }
.ms-video__poster:focus-visible { outline: 3px solid var(--ms-accent, #de3a27); outline-offset: 3px; }
.ms-video__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (prefers-reduced-motion: reduce) { .ms-video__play { transition: none; } }

.ms-prose iframe.ms-youtube { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }


/* Blog list and single posts (home.php, single.php) — unused today, kept styled. */
.ms-blog { padding: 60px 0 80px; }
.ms-blog__inner { max-width: 900px; }
.ms-blog__heading { margin: 0 0 32px; font-family: var(--font-heading, "Actor", sans-serif); font-weight: 700; font-size: 42px; line-height: 1.2; color: #333333; }
.ms-blog__inner--single .ms-blog__heading { margin-bottom: 8px; }
.ms-blog__item { padding: 0 0 32px; margin: 0 0 32px; border-bottom: 1px solid #e6e6e6; }
.ms-blog__item:last-of-type { border-bottom: 0; }
.ms-blog__title { margin: 0 0 4px; font-family: var(--font-heading, "Actor", sans-serif); font-weight: 700; font-size: 24px; line-height: 1.3; color: #333333; }
.ms-blog__title a:hover { color: var(--ms-accent, #de3a27); text-decoration: underline; }
.ms-blog__date { margin: 0 0 12px; font-size: 15px; color: #767676; }
.ms-blog__inner--single .ms-blog__date { margin-bottom: 32px; }
.ms-blog__back { margin: 0 0 16px; font-size: 15px; }
.ms-blog__back a { color: var(--ms-accent, #de3a27); text-decoration: underline; }
@media (max-width: 767px) {
    .ms-blog { padding: 40px 0 60px; }
    .ms-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: 17px; line-height: 1.7; color: var(--ms-text, #636363); }
.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: 8px 18px; border: 2px solid var(--ms-accent, #de3a27); background: var(--ms-accent, #de3a27); color: #ffffff; font-weight: 700; font-size: 16px; cursor: pointer; }
.post-password-form input[type="submit"]:hover,
.post-password-form input[type="submit"]:focus-visible { background: #ffffff; color: var(--ms-accent, #de3a27); }

/* 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: 16px; line-height: 1.7; color: var(--ms-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: 16px; }
.post-password-form input[type="submit"] { padding: 10px 20px; border: 0; background: var(--ms-accent, #de3a27); color: #ffffff; font-family: var(--font-label, "Rubik", sans-serif); font-weight: 700; font-size: 14px; letter-spacing: 4px; text-transform: uppercase; cursor: pointer; }
.post-password-form input[type="submit"]:hover,
.post-password-form input[type="submit"]:focus-visible { background: var(--ms-accent-hover, #b7b7b7); }

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

/* Section backgrounds offered by the generic blocks' "Background" select. */
.ms-bg--white { background: var(--background, #ffffff); }
.ms-bg--grey { background: var(--ms-grey, #f7f7f7); }
.ms-section { padding: 80px 0; }
@media (max-width: 767px) { .ms-section { padding: 56px 0; } }
