/* ============================================================
   Sunshine Energy — Structured Blog v1.5
   Self-contained layout and typography for Meta Box articles.
   Common Back button styling is handled by style.css.
   ============================================================ */

/* Main article layout */
body.single-post .se-single-main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow-x: clip;
}

body.single-post .se-single-article.se-structured-article {
    box-sizing: border-box;
    width: min(1104px, calc(100% - 48px));
    max-width: 1104px;
    margin: 0 auto;
    padding: 0 0 38px;
    --se-blog-reading-width: 840px;
}

/* Full-width Post Header */
body.single-post .se-structured-article>.wp-block-sunshine-post-header.se-post-header,
body.single-post .se-structured-article>.se-post-header {
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

body.single-post .se-structured-article .se-post-header__inner {
    max-width: 1104px;
}

/* Shared 840px reading column */
body.single-post .se-structured-article>.wp-block-sunshine-article-notice.se-article-notice,
body.single-post .se-structured-article>.se-article-notice,
body.single-post .se-structured-article>.se-blog-featured-image,
body.single-post .se-structured-article>.se-blog-body-heading,
body.single-post .se-structured-article>.se-blog-body,
body.single-post .se-structured-article>.se-blog-separator {
    box-sizing: border-box;
    width: min(100%, var(--se-blog-reading-width));
    max-width: var(--se-blog-reading-width);
    margin-left: auto;
    margin-right: auto;
}

/* Article Notice */
body.single-post .se-structured-article>.se-article-notice {
    margin-top: 32px;
    margin-bottom: 28px;
}

/* Featured image */
body.single-post .se-structured-article>.se-blog-featured-image {
    margin-top: 32px;
    margin-bottom: 0;
}

body.single-post .se-structured-article .se-blog-featured-image img {
    display: block;
    width: 100%;
    height: auto;
}

/* Optional supporting text below featured image */
body.single-post .se-structured-article>.se-blog-body-heading {
    margin-top: 16px;
    margin-bottom: 18px;
    color: #4b5563;
    font: 400 16px/1.5 Arial, Helvetica, sans-serif;
    letter-spacing: normal;
    text-align: left;
}

/* Article body typography */
body.single-post .se-structured-article .se-blog-body>p,
body.single-post .se-structured-article .se-blog-body>ul,
body.single-post .se-structured-article .se-blog-body>ol {
    margin: 0 0 24px;
    color: #4b5563;
    font: 400 18px/1.6 Arial, Helvetica, sans-serif;
    text-align: justify;
    hyphens: auto;
}

/* Article links */
body.single-post .se-structured-article .se-blog-body a {
    color: #101b35;
    text-underline-offset: 3px;
}

body.single-post .se-structured-article .se-blog-body a:hover {
    color: #268b72;
}

/* Classic Editor headings */
body.single-post .se-structured-article .se-blog-body h2,
body.single-post .se-structured-article .se-blog-body h3 {
    color: #101b35;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 500;
    line-height: 1.25;
}

body.single-post .se-structured-article .se-blog-body h2 {
    font-size: clamp(27px, 3vw, 34px);
    margin: 30px 0 18px;
}

body.single-post .se-structured-article .se-blog-body h3 {
    font-size: clamp(22px, 2.5vw, 27px);
    margin: 26px 0 16px;
}

body.single-post .se-structured-article .se-blog-body h4 {
    color: #101b35;
    font: 500 21px/1.3 Arial, Helvetica, sans-serif;
    margin: 24px 0 14px;
}

/* Lists */
body.single-post .se-structured-article .se-blog-body ul,
body.single-post .se-structured-article .se-blog-body ol {
    padding-left: 1.5em;
}

/* Article separator */
body.single-post .se-structured-article>.se-blog-separator {
    margin-top: 28px;
    margin-bottom: 24px;
}

/* ============================================================
   Responsive — Mobile
   ============================================================ */

@media (max-width: 600px) {

    body.single-post .se-single-article.se-structured-article {
        width: calc(100% - 36px);
    }

    body.single-post .se-structured-article .se-blog-body>p,
    body.single-post .se-structured-article .se-blog-body>ul,
    body.single-post .se-structured-article .se-blog-body>ol {
        font-size: 16px;
        line-height: 1.6;
        margin-bottom: 20px;
        text-align: left;
        hyphens: none;
    }

    body.single-post .se-structured-article .se-blog-body h2 {
        font-size: 26px;
    }

    body.single-post .se-structured-article .se-blog-body h3 {
        font-size: 22px;
    }

    body.single-post .se-structured-article .se-blog-body h4 {
        font-size: 19px;
    }
}

/* ============================================================
   Sunshine Energy — Legacy / Imported Gutenberg Blog Articles
   The imported post content is unchanged; only presentation
   is normalised to the structured Sunshine reading layout.
   ============================================================ */

body.single-post .se-single-article.se-legacy-article {
    box-sizing: border-box;
    width: min(1104px, calc(100% - 48px));
    max-width: 1104px;
    margin: 0 auto;
    padding: 0 0 38px;
    --se-blog-reading-width: 840px;
}

/* Use the existing full-width Post Header on imported articles too. */
body.single-post .se-legacy-article > .se-post-header,
body.single-post .se-legacy-article > .wp-block-sunshine-post-header.se-post-header {
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

body.single-post .se-legacy-article .se-post-header__inner {
    max-width: 1104px;
}

body.single-post .se-legacy-article > .se-legacy-blog-body,
body.single-post .se-legacy-article > .se-blog-separator {
    box-sizing: border-box;
    width: min(100%, var(--se-blog-reading-width));
    max-width: var(--se-blog-reading-width);
    margin-left: auto;
    margin-right: auto;
}

body.single-post .se-legacy-blog-body {
    margin-top: 32px;
    min-width: 0;
    overflow-wrap: anywhere;
    color: #4b5563;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 18px;
    line-height: 1.65;
}

/* Override imported block typography which may inherit tiny theme defaults. */
body.single-post .se-legacy-blog-body p,
body.single-post .se-legacy-blog-body li {
    font-size: 18px;
    line-height: 1.65;
}
body.single-post .se-legacy-blog-body p {
    margin: 0 0 22px;
}
body.single-post .se-legacy-blog-body h2,
body.single-post .se-legacy-blog-body h3,
body.single-post .se-legacy-blog-body h4 {
    color: #101b35;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 500;
    line-height: 1.3;
}
body.single-post .se-legacy-blog-body h2 {
    font-size: clamp(27px, 3vw, 34px);
    margin: 32px 0 18px;
}
body.single-post .se-legacy-blog-body h3 {
    font-size: clamp(22px, 2.5vw, 27px);
    margin: 26px 0 16px;
}
body.single-post .se-legacy-blog-body h4 {
    font-size: 21px;
    margin: 22px 0 14px;
}
body.single-post .se-legacy-blog-body ul,
body.single-post .se-legacy-blog-body ol {
    padding-left: 1.5em;
    margin-bottom: 24px;
}
body.single-post .se-legacy-blog-body a {
    color: #101b35;
    text-underline-offset: 3px;
}
body.single-post .se-legacy-blog-body a:hover {
    color: #268b72;
}

/* Prevent old image and group blocks from escaping the reading column. */
body.single-post .se-legacy-blog-body img,
body.single-post .se-legacy-blog-body video,
body.single-post .se-legacy-blog-body iframe {
    max-width: 100%;
}
body.single-post .se-legacy-blog-body img {
    height: auto;
}
body.single-post .se-legacy-blog-body figure,
body.single-post .se-legacy-blog-body .wp-block-image,
body.single-post .se-legacy-blog-body .wp-block-gallery,
body.single-post .se-legacy-blog-body .alignwide,
body.single-post .se-legacy-blog-body .alignfull {
    box-sizing: border-box;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}
body.single-post .se-legacy-blog-body .alignfull {
    width: 100%;
}
body.single-post .se-legacy-blog-body .wp-block-image img,
body.single-post .se-legacy-blog-body .wp-block-gallery img {
    display: block;
    max-width: 100%;
    height: auto;
}
body.single-post .se-legacy-article > .se-blog-separator {
    margin-top: 28px;
    margin-bottom: 24px;
}

@media (max-width: 600px) {
    body.single-post .se-single-article.se-legacy-article {
        width: calc(100% - 36px);
    }
    body.single-post .se-legacy-blog-body {
        margin-top: 24px;
    }
    body.single-post .se-legacy-blog-body p,
    body.single-post .se-legacy-blog-body li {
        font-size: 16px;
        line-height: 1.6;
    }
    body.single-post .se-legacy-blog-body h2 { font-size: 26px; }
    body.single-post .se-legacy-blog-body h3 { font-size: 22px; }
    body.single-post .se-legacy-blog-body h4 { font-size: 19px; }
}
