/* Melbourne House Painter — main stylesheet. Mobile-first. */

:root {
    /* Colors — extracted from Headway compiled CSS (Task 23). */
    --mhp-bg:           #ffffff;
    --mhp-text:         #555555;
    --mhp-link:         #555555;
    --mhp-link-hover:   #222222;
    --mhp-accent:       #c8102e;
    --mhp-sidebar-bg:   #eeeeee;
    --mhp-border:       #dddddd;
    --mhp-page-frame:   #000000;   /* black background framing the page */

    --mhp-content-max:  950px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; padding: 7px 0 0; color: var(--mhp-text); background: var(--mhp-page-frame); font: 16px/1.5 Arial, Helvetica, sans-serif; }

/* Centered white "page" sitting on the black body background — matches the
   original site's black-framed layout. */
.mhp-site {
    /* 1200px logo + 7px white margin each side = 1214px white page on black. */
    max-width: 1214px;
    margin: 0 auto;
    background: var(--mhp-bg);
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.2; }
a { color: var(--mhp-link); }
a:hover, a:focus { color: var(--mhp-link-hover); }
.mhp-emphasis { color: var(--mhp-accent); font-weight: bold; }
.mhp-skiplink { position: absolute; left: -9999px; }
.mhp-skiplink:focus { left: 0; top: 0; background: var(--mhp-accent); color: #fff; padding: 0.5rem 1rem; z-index: 1000; }

/* --- Header --- */
.mhp-site-header {
    text-align: center;
    padding: 7px 7px 0;   /* 7px white margin around the 1200px logo (top/left/right) */
    background: var(--mhp-bg);
    border-bottom: 1px solid var(--mhp-border);
}
.mhp-logo { display: inline-block; }
.mhp-logo img { margin: 0 auto; max-width: 100%; height: auto; }

/* --- Nav --- */
.mhp-nav { padding: 0.5rem 0; }
.mhp-nav__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    list-style: none;
    padding: 0; margin: 0;
    justify-content: center;
}
.mhp-nav__list li { position: relative; }
.mhp-nav__list a {
    text-decoration: none;
    padding: 0.4rem 0.6rem;
    /* Navigation font + uppercase from the original site (#block-2 ul.menu li > a). */
    font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
    font-size: 16px;
    text-transform: uppercase;
    color: var(--mhp-text);
    display: inline-block;
}
/* Nav states — colors taken from the original site (#block-2 ul.menu). */
.mhp-nav__list a:hover,
.mhp-nav__list a:focus { background: #E5D2AF; }                 /* khaki on hover */
.mhp-nav__list .sub-menu a:hover,
.mhp-nav__list .sub-menu a:focus { background: #F7F0CB; }       /* lighter khaki for dropdown items */
.mhp-nav__list .current-menu-item > a,
.mhp-nav__list .current-menu-parent > a,
.mhp-nav__list .current-menu-ancestor > a,
.mhp-nav__list .current_page_item > a,
.mhp-nav__list .current_page_parent > a,
.mhp-nav__list .current_page_ancestor > a { background: #D3F0C2; }   /* light green = current page */

/* Services dropdown (sub-menu) */
.mhp-nav__list .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    min-width: 230px;
    margin: 0;
    padding: 0;
    list-style: none;
    background: var(--mhp-bg);
    border: 1px solid var(--mhp-border);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    text-align: left;
}
.mhp-nav__list .menu-item-has-children:hover > .sub-menu,
.mhp-nav__list .menu-item-has-children:focus-within > .sub-menu { display: block; }
.mhp-nav__list .sub-menu li { display: block; }
.mhp-nav__list .sub-menu a { display: block; padding: 0.5rem 0.9rem; white-space: nowrap; }
.mhp-nav__list .menu-item-has-children > a::after { content: " \25BE"; font-size: 0.8em; }

/* --- Layout --- */
.mhp-layout {
    /* Full wrapper width so the sidebar reaches the left edge (7px margin),
       matching the original. */
    margin: 1rem 0;
    padding: 0 7px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
.mhp-main { min-width: 0; }
.mhp-main--full { max-width: var(--mhp-content-max); margin: 1rem auto; padding: 0 1rem; }
.mhp-article__title { color: var(--mhp-accent); }

/* --- Homepage main column ---
   The original's main content was a Headway custom-code block (#block-9) with
   no font rule of its own, so it inherited the site body: Arial Narrow 14px
   #555555. The narrative sat in align="center" table cells; the phone/license
   block was left-aligned; the services list was a centered 3-column group. */
.home .mhp-article__body {
    font-family: "Arial Narrow", Arial, sans-serif;
    font-size: 16px;
    color: #555555;
    line-height: 1.3;
    text-align: left;
}
.home .mhp-article__body p { margin: 0 0 1em; }
.home .mhp-phone-block { text-align: left; }
.home .mhp-phone-red { color: red; }
.home .mhp-services-columns {
    list-style: none;
    columns: 3;
    max-width: 550px;
    margin: 0 0 1em;
    padding: 0;
}
.home .mhp-services-columns li { padding: 1px 0; }
.home .mhp-delivers {
    list-style: square;
    display: inline-block;
    text-align: left;
    margin: 0 0 1em;
    padding-left: 1.25em;
    font-weight: bold;   /* original wrapped the whole list in <strong> */
}
/* Original main column had the Melbourne High School photo (330x482, border=1)
   in the right cell beside the final narrative block. Float it right. */
.home .mhp-home-photo {
    float: right;
    width: 330px;
    max-width: 100%;
    height: auto;
    margin: 0 0 1em 1.5em;
    border: 1px solid #000;
}
/* Bottom of the right column: paint-cans image full width (block-35), then the
   large blue phone number (block-36: Arial Black 60px #299CB6 bold, centered). */
.home .mhp-home-footer-photo { clear: both; margin-top: 1.5rem; }
.home .mhp-home-footer-photo img { width: 100%; height: auto; }
.home .mhp-home-bigphone {
    font-family: "Arial Black", Gadget, sans-serif;
    font-weight: bold;
    color: #299CB6;
    text-align: center;
    line-height: 1.1;
    font-size: clamp(2rem, 8vw, 60px);
    margin: 0.25rem 0 0;
}

/* --- Sidebar widgets --- */
/* Facebook banner — full-width logo at the top of the sidebar (matches the
   original's like_facebook-logo.png at the top of block-3). */
.mhp-facebook-banner { margin-bottom: 1rem; }
.mhp-facebook-banner a { display: block; }
.mhp-facebook-banner img { width: 100%; height: auto; }

.mhp-widget {
    background: var(--mhp-sidebar-bg);
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--mhp-border);
}
.mhp-widget__title { margin-top: 0; color: var(--mhp-accent); }
.mhp-widget__list { list-style: none; padding: 0; margin: 0; }
.mhp-widget__list li { padding: 0.25rem 0; }
.mhp-widget__list a { text-decoration: none; }
.mhp-widget--contact .mhp-widget__phone { font-size: 1.4rem; font-weight: bold; margin: 0.25rem 0; }
.mhp-widget--contact .mhp-widget__phone a { color: var(--mhp-accent); text-decoration: none; }
.mhp-widget--contact .mhp-widget__facebook img { display: inline-block; vertical-align: middle; height: 24px; width: auto; margin-right: 0.5rem; }
.mhp-widget__cities {
    list-style: none;
    padding: 0; margin: 0;
}

/* Service-area, Services, and Contact widgets share the original's #block-3
   sidebar typography (Cuprum 18px #552626; headings bold uppercase). The
   Services/Contact widgets had only generic default styling on the original,
   so per direction they reuse the service-area treatment for consistency. */
.mhp-widget--service-area,
.mhp-widget--services,
.mhp-widget--contact {
    font-family: "Cuprum", sans-serif;
    font-size: 18px;
    color: #552626;
}
.mhp-widget--service-area .mhp-widget__title,
.mhp-widget--services .mhp-widget__title {
    font-family: "Cuprum", sans-serif;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    color: #552626;
}
.mhp-widget--service-area .mhp-widget__cities li,
.mhp-widget--services .mhp-widget__list li { color: #552626; }
.mhp-widget--services .mhp-widget__list a,
.mhp-widget--contact .mhp-widget__license { color: #552626; }
.mhp-widget__cities li { padding: 0.15rem 0; }

/* --- Carousel --- */
.mhp-carousel-section { margin: 1rem 0; }
.mhp-carousel-wrap {
    /* Matches the original: 1120px-wide strip with a thin dark-gray border. */
    max-width: 1120px;
    margin: 0 auto;
    padding: 6px;
    border: 1px solid #555555;
    overflow: hidden;
}
.mhp-carousel-caption {
    font-family: 'Kaushan Script', cursive;
    color: #555555;
    text-align: center;
    font-size: 1.6rem;
    margin: 0.6rem auto 1rem;
}
/* Homepage slider — 140x140 square thumbnails (matches the original). */
.mhp-carousel__img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

/* --- Services-landing children grid --- */
.mhp-services-children {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax(180px, 1fr) );
    gap: 1rem;
    margin-top: 2rem;
}
.mhp-services-children__item {
    display: block;
    padding: 1rem;
    background: var(--mhp-sidebar-bg);
    border: 1px solid var(--mhp-border);
    text-decoration: none;
    text-align: center;
    color: var(--mhp-text);
}
.mhp-services-children__item:hover {
    background: var(--mhp-accent);
    color: #fff;
    border-color: var(--mhp-accent);
}
.mhp-services-children__thumb { margin: 0 auto 0.5rem; }
.mhp-services-children__label { display: block; font-weight: bold; }

/* --- Gallery page --- */
/* Title — original single-page entry-title (Tahoma 24px #333 bold). */
.mhp-gallery-page .mhp-article__title {
    font-family: Tahoma, sans-serif;
    font-size: 24px;
    font-weight: bold;
    color: #333333;
    line-height: 1.3;
}
/* 150x150 square thumbnails with the original's 2px gray border. Targets both
   the classic [gallery] shortcode output and the Gutenberg gallery block. */
.mhp-gallery-page .wp-block-gallery,
.mhp-gallery-page .blocks-gallery-grid,
.mhp-gallery-page .gallery {
    display: grid;
    grid-template-columns: repeat( auto-fill, 150px );
    gap: 10px;
    justify-content: center;
    list-style: none;
    padding: 0;
}
.mhp-gallery-page .gallery br { display: none; } /* shortcode wraps rows in <br style="clear:both"> */
.mhp-gallery-page .gallery .gallery-item { margin: 0; padding: 0; width: auto; }
.mhp-gallery-page .wp-block-gallery img,
.mhp-gallery-page .blocks-gallery-grid img,
.mhp-gallery-page .gallery img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border: 2px solid #cfcfcf;
    cursor: zoom-in;
}

/* Text block below the thumbnails (original block-61) — same treatment as the
   homepage main column: Arial Narrow 16px #555, left-aligned. */
.mhp-frank-blurb {
    font-family: "Arial Narrow", Arial, sans-serif;
    font-size: 16px;
    color: #555555;
    line-height: 1.3;
    text-align: left;
    margin-top: 1.5rem;
}
.mhp-frank-blurb p { margin: 0 0 1em; }
.mhp-frank-blurb .mhp-phone-block { text-align: left; }
.mhp-frank-blurb .mhp-phone-red { color: red; }
.mhp-frank-blurb .mhp-services-columns {
    list-style: none;
    columns: 3;
    max-width: 550px;
    margin: 0 0 1em;
    padding: 0;
}
.mhp-frank-blurb .mhp-services-columns li { padding: 1px 0; }
.mhp-frank-blurb .mhp-delivers {
    list-style: square;
    display: inline-block;
    text-align: left;
    margin: 0 0 1em;
    padding-left: 1.25em;
    font-weight: bold;
}
.mhp-frank-blurb .mhp-blurb-photo {
    float: right;
    width: 330px;
    max-width: 100%;
    height: auto;
    margin: 0 0 1em 1.5em;
    border: 1px solid #000;
}

/* Inner-page bottom photo (original #block-35) — space-coast paint-cans strip,
   full column width at the bottom of the main column. Mirrors the homepage's
   .mhp-home-footer-photo but unscoped from .home for the inner-page template
   part. clear:both drops it below the company block's right-floated HS photo. */
.mhp-footer-photo { clear: both; margin-top: 1.5rem; }
.mhp-footer-photo img { width: 100%; height: auto; }

/* Contact page — phone number called out in a large font (email form removed,
   so the page leads with the call-to-call). Matches the site's blue phone. */
.mhp-contact-phone {
    font-family: "Arial Black", Gadget, sans-serif;
    font-weight: bold;
    color: #299CB6;
    font-size: clamp(2rem, 7vw, 48px);
    line-height: 1.1;
    white-space: nowrap;
}
/* Contact page only: drop the company-info block (#block-61) further down the
   column, below the short phone/license intro (Brian, ~200px). */
.page-id-80 .mhp-frank-blurb { margin-top: 200px; }

/* --- Footer --- */
.mhp-site-footer {
    text-align: center;
    padding: 1.5rem 1rem;
    background: var(--mhp-sidebar-bg);
    border-top: 1px solid var(--mhp-border);
    margin-top: 2rem;
    font-size: 0.9rem;
}
.mhp-site-footer__contact a { color: var(--mhp-accent); }

/* --- Desktop (>= 768px) --- */
@media (min-width: 768px) {
    .mhp-layout {
        grid-template-columns: 220px 1fr;
        gap: 2rem;
    }
    .mhp-nav__list { justify-content: center; }
}

/* --- Print --- */
@media print {
    .mhp-nav, .mhp-carousel-wrap, .mhp-sidebar { display: none; }
}
