/*
 * Shared Hallinta rich text: TinyMCE (admin) and front output
 * (.intro-text.hallinta-etusivu-teksti, .hallinta-harraste-content, .hallinta-harraste-intro).
 * Editor iframe has no theme CSS variables; body.mce-content-body uses concrete colors.
 * Front uses var(...) with fallbacks so theme :root still applies when set.
 */

body.mce-content-body {
    box-sizing: border-box;
    max-width: 900px;
    margin: 12px auto;
    padding: 0 4px 8px;
    /*
     * The child theme registers its front stylesheet as an editor style
     * (add_editor_style), which paints the hero background image on <body>.
     * This file is appended after that, so reset the editor canvas to a
     * clean white sheet for every Hallinta rich-text field.
     */
    background-color: #fff;
    background-image: none;
    color: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica,
        Arial, sans-serif;
    font-size: 1.05rem;
    line-height: 1.8;
    font-weight: 400;
}

.intro-text.hallinta-etusivu-teksti,
.hallinta-harraste-content,
.hallinta-harraste-intro {
    box-sizing: border-box;
    color: var(--text-dark, #1a1a1a);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica,
        Arial, sans-serif;
    font-size: 1.05rem;
    line-height: 1.8;
    font-weight: 400;
}

.intro-text.hallinta-etusivu-teksti {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 50px;
}

.hallinta-harraste-content {
    margin-bottom: 1rem;
}

body.mce-content-body::after,
.intro-text.hallinta-etusivu-teksti::after,
.hallinta-harraste-content::after,
.hallinta-harraste-intro::after {
    content: "";
    display: table;
    clear: both;
}

body.mce-content-body > :first-child,
.intro-text.hallinta-etusivu-teksti > :first-child,
.hallinta-harraste-content > :first-child,
.hallinta-harraste-intro > :first-child {
    margin-top: 0;
}

body.mce-content-body p,
.intro-text.hallinta-etusivu-teksti p,
.hallinta-harraste-content p,
.hallinta-harraste-intro p {
    margin: 0 0 1.25em;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

body.mce-content-body p:last-child,
.intro-text.hallinta-etusivu-teksti p:last-child,
.hallinta-harraste-content p:last-child,
.hallinta-harraste-intro p:last-child {
    margin-bottom: 0;
}

body.mce-content-body h1,
.intro-text.hallinta-etusivu-teksti h1,
.hallinta-harraste-content h1,
.hallinta-harraste-intro h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.25;
    color: inherit;
    margin: 0 0 0.75em;
}

body.mce-content-body h2,
.intro-text.hallinta-etusivu-teksti h2,
.hallinta-harraste-content h2,
.hallinta-harraste-intro h2 {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.3;
    color: inherit;
    margin: 1.5em 0 0.85em;
}

body.mce-content-body h3,
.intro-text.hallinta-etusivu-teksti h3,
.hallinta-harraste-content h3,
.hallinta-harraste-intro h3 {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.35;
    color: inherit;
    margin: 1.35em 0 0.65em;
}

body.mce-content-body h4,
.intro-text.hallinta-etusivu-teksti h4,
.hallinta-harraste-content h4,
.hallinta-harraste-intro h4 {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
    color: inherit;
    margin: 1.25em 0 0.5em;
}

body.mce-content-body h5,
body.mce-content-body h6,
.intro-text.hallinta-etusivu-teksti h5,
.intro-text.hallinta-etusivu-teksti h6,
.hallinta-harraste-content h5,
.hallinta-harraste-content h6,
.hallinta-harraste-intro h5,
.hallinta-harraste-intro h6 {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.45;
    color: inherit;
    margin: 1.1em 0 0.45em;
}

body.mce-content-body a {
    color: #bf360c;
    text-decoration: underline;
    text-decoration-color: #e65100;
    text-underline-offset: 2px;
}

body.mce-content-body a:hover,
body.mce-content-body a:focus {
    color: #e65100;
}

.intro-text.hallinta-etusivu-teksti a,
.hallinta-harraste-content a,
.hallinta-harraste-intro a {
    color: var(--accent-orange-dark, #bf360c);
    text-decoration: underline;
    text-decoration-color: var(--accent-orange, #e65100);
    text-underline-offset: 2px;
}

.intro-text.hallinta-etusivu-teksti a:hover,
.intro-text.hallinta-etusivu-teksti a:focus,
.hallinta-harraste-content a:hover,
.hallinta-harraste-content a:focus,
.hallinta-harraste-intro a:hover,
.hallinta-harraste-intro a:focus {
    color: var(--accent-orange, #e65100);
}

body.mce-content-body ul,
body.mce-content-body ol,
.intro-text.hallinta-etusivu-teksti ul,
.intro-text.hallinta-etusivu-teksti ol,
.hallinta-harraste-content ul,
.hallinta-harraste-content ol,
.hallinta-harraste-intro ul,
.hallinta-harraste-intro ol {
    margin: 0 0 1.25em 1.35em;
    padding: 0;
    color: inherit;
}

body.mce-content-body ul ul,
body.mce-content-body ul ol,
body.mce-content-body ol ul,
body.mce-content-body ol ol,
.intro-text.hallinta-etusivu-teksti ul ul,
.intro-text.hallinta-etusivu-teksti ul ol,
.intro-text.hallinta-etusivu-teksti ol ul,
.intro-text.hallinta-etusivu-teksti ol ol,
.hallinta-harraste-content ul ul,
.hallinta-harraste-content ul ol,
.hallinta-harraste-content ol ul,
.hallinta-harraste-content ol ol,
.hallinta-harraste-intro ul ul,
.hallinta-harraste-intro ul ol,
.hallinta-harraste-intro ol ul,
.hallinta-harraste-intro ol ol {
    margin-bottom: 0.5em;
    margin-top: 0.5em;
}

body.mce-content-body li,
.intro-text.hallinta-etusivu-teksti li,
.hallinta-harraste-content li,
.hallinta-harraste-intro li {
    margin-bottom: 0.35em;
    line-height: inherit;
}

body.mce-content-body blockquote,
.intro-text.hallinta-etusivu-teksti blockquote,
.hallinta-harraste-content blockquote,
.hallinta-harraste-intro blockquote {
    margin: 0 0 1.25em;
    padding-left: 1em;
    border-left: 4px solid #e0e0e0;
    color: #333333;
}

body.mce-content-body hr,
.intro-text.hallinta-etusivu-teksti hr,
.hallinta-harraste-content hr,
.hallinta-harraste-intro hr {
    border: 0;
    border-top: 1px solid #e0e0e0;
    margin: 1.5em 0;
}

body.mce-content-body table,
.intro-text.hallinta-etusivu-teksti table,
.hallinta-harraste-content table,
.hallinta-harraste-intro table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.25em;
    font-size: 0.95em;
}

body.mce-content-body th,
body.mce-content-body td,
.intro-text.hallinta-etusivu-teksti th,
.intro-text.hallinta-etusivu-teksti td,
.hallinta-harraste-content th,
.hallinta-harraste-content td,
.hallinta-harraste-intro th,
.hallinta-harraste-intro td {
    border: 1px solid #e0e0e0;
    padding: 0.5rem 0.75rem;
    text-align: left;
    vertical-align: top;
}

body.mce-content-body th,
.intro-text.hallinta-etusivu-teksti th,
.hallinta-harraste-content th,
.hallinta-harraste-intro th {
    background: #f5f5f5;
    font-weight: 600;
}

body.mce-content-body img,
.intro-text.hallinta-etusivu-teksti img,
.hallinta-harraste-content img,
.hallinta-harraste-intro img {
    max-width: 100%;
    height: auto;
}

body.mce-content-body figure,
.intro-text.hallinta-etusivu-teksti figure,
.hallinta-harraste-content figure,
.hallinta-harraste-intro figure {
    margin: 0 0 1.25em;
    max-width: 100%;
}

body.mce-content-body figcaption,
.intro-text.hallinta-etusivu-teksti figcaption,
.hallinta-harraste-content figcaption,
.hallinta-harraste-intro figcaption {
    font-size: 0.9em;
    line-height: 1.5;
    color: #555555;
    margin-top: 0.5em;
}

body.mce-content-body .wp-caption,
.intro-text.hallinta-etusivu-teksti .wp-caption,
.hallinta-harraste-content .wp-caption,
.hallinta-harraste-intro .wp-caption {
    max-width: 100%;
}

body.mce-content-body pre,
body.mce-content-body code,
.intro-text.hallinta-etusivu-teksti pre,
.intro-text.hallinta-etusivu-teksti code,
.hallinta-harraste-content pre,
.hallinta-harraste-content code,
.hallinta-harraste-intro pre,
.hallinta-harraste-intro code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9em;
}

body.mce-content-body pre,
.intro-text.hallinta-etusivu-teksti pre,
.hallinta-harraste-content pre,
.hallinta-harraste-intro pre {
    background: #f6f6f6;
    border: 1px solid #e8e8e8;
    padding: 0.85em 1em;
    overflow-x: auto;
    margin: 0 0 1.25em;
    line-height: 1.5;
}

body.mce-content-body code,
.intro-text.hallinta-etusivu-teksti code,
.hallinta-harraste-content code,
.hallinta-harraste-intro code {
    background: #f0f0f0;
    padding: 0.12em 0.35em;
}

body.mce-content-body pre code,
.intro-text.hallinta-etusivu-teksti pre code,
.hallinta-harraste-content pre code,
.hallinta-harraste-intro pre code {
    background: none;
    padding: 0;
}

body.mce-content-body dl,
.intro-text.hallinta-etusivu-teksti dl,
.hallinta-harraste-content dl,
.hallinta-harraste-intro dl {
    margin: 0 0 1.25em;
}

body.mce-content-body dt,
.intro-text.hallinta-etusivu-teksti dt,
.hallinta-harraste-content dt,
.hallinta-harraste-intro dt {
    font-weight: 700;
    margin-top: 0.75em;
}

body.mce-content-body dt:first-child,
.intro-text.hallinta-etusivu-teksti dt:first-child,
.hallinta-harraste-content dt:first-child,
.hallinta-harraste-intro dt:first-child {
    margin-top: 0;
}

body.mce-content-body dd,
.intro-text.hallinta-etusivu-teksti dd,
.hallinta-harraste-content dd,
.hallinta-harraste-intro dd {
    margin: 0.35em 0 0 1.25em;
}

body.mce-content-body .alignleft,
.intro-text.hallinta-etusivu-teksti .alignleft,
.hallinta-harraste-content .alignleft,
.hallinta-harraste-intro .alignleft {
    float: left;
    margin: 0 1rem 1rem 0;
}

body.mce-content-body .alignright,
.intro-text.hallinta-etusivu-teksti .alignright,
.hallinta-harraste-content .alignright,
.hallinta-harraste-intro .alignright {
    float: right;
    margin: 0 0 1rem 1rem;
}

body.mce-content-body .aligncenter,
.intro-text.hallinta-etusivu-teksti .aligncenter,
.hallinta-harraste-content .aligncenter,
.hallinta-harraste-intro .aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

body.mce-content-body iframe,
body.mce-content-body video,
.intro-text.hallinta-etusivu-teksti iframe,
.intro-text.hallinta-etusivu-teksti video,
.hallinta-harraste-content iframe,
.hallinta-harraste-content video,
.hallinta-harraste-intro iframe,
.hallinta-harraste-intro video {
    max-width: 100%;
}

@media (max-width: 768px) {
    body.mce-content-body h1,
    .intro-text.hallinta-etusivu-teksti h1,
    .hallinta-harraste-content h1,
    .hallinta-harraste-intro h1,
    #main-content .entry-content .intro-text.hallinta-etusivu-teksti h1,
    #main-content .entry-content .hallinta-harraste-content h1,
    #main-content .entry-content .hallinta-harraste-intro h1 {
        font-size: 1.65rem;
    }

    body.mce-content-body h2,
    .intro-text.hallinta-etusivu-teksti h2,
    .hallinta-harraste-content h2,
    .hallinta-harraste-intro h2,
    #main-content .entry-content .intro-text.hallinta-etusivu-teksti h2,
    #main-content .entry-content .hallinta-harraste-content h2,
    #main-content .entry-content .hallinta-harraste-intro h2 {
        font-size: 1.5rem;
    }

    body.mce-content-body h3,
    .intro-text.hallinta-etusivu-teksti h3,
    .hallinta-harraste-content h3,
    .hallinta-harraste-intro h3,
    #main-content .entry-content .intro-text.hallinta-etusivu-teksti h3,
    #main-content .entry-content .hallinta-harraste-content h3,
    #main-content .entry-content .hallinta-harraste-intro h3 {
        font-size: 1.25rem;
    }
}

/*
 * Theme .page-article .entry-content and .content-card rules are (0,2,1) or tie at (0,1,1);
 * these selectors include #main-content .entry-content so Hallinta HTML matches the editor.
 */
#main-content .entry-content .intro-text.hallinta-etusivu-teksti,
#main-content .entry-content .hallinta-harraste-content,
#main-content .entry-content .hallinta-harraste-intro {
    box-sizing: border-box;
    color: var(--text-dark, #1a1a1a);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica,
        Arial, sans-serif;
    font-size: 1.05rem;
    line-height: 1.8;
    font-weight: 400;
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti > :first-child,
#main-content .entry-content .hallinta-harraste-content > :first-child,
#main-content .entry-content .hallinta-harraste-intro > :first-child {
    margin-top: 0;
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti p,
#main-content .entry-content .hallinta-harraste-content p,
#main-content .entry-content .hallinta-harraste-intro p {
    margin: 0 0 1.25em;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti p:last-child,
#main-content .entry-content .hallinta-harraste-content p:last-child,
#main-content .entry-content .hallinta-harraste-intro p:last-child {
    margin-bottom: 0;
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti h1,
#main-content .entry-content .hallinta-harraste-content h1,
#main-content .entry-content .hallinta-harraste-intro h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.25;
    color: inherit;
    margin: 0 0 0.75em;
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti h2,
#main-content .entry-content .hallinta-harraste-content h2,
#main-content .entry-content .hallinta-harraste-intro h2 {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.3;
    color: inherit;
    margin: 1.5em 0 0.85em;
    letter-spacing: normal;
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti h3,
#main-content .entry-content .hallinta-harraste-content h3,
#main-content .entry-content .hallinta-harraste-intro h3 {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.35;
    color: inherit;
    margin: 1.35em 0 0.65em;
    letter-spacing: normal;
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti h4,
#main-content .entry-content .hallinta-harraste-content h4,
#main-content .entry-content .hallinta-harraste-intro h4 {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
    color: inherit;
    margin: 1.25em 0 0.5em;
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti h5,
#main-content .entry-content .intro-text.hallinta-etusivu-teksti h6,
#main-content .entry-content .hallinta-harraste-content h5,
#main-content .entry-content .hallinta-harraste-content h6,
#main-content .entry-content .hallinta-harraste-intro h5,
#main-content .entry-content .hallinta-harraste-intro h6 {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.45;
    color: inherit;
    margin: 1.1em 0 0.45em;
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti a,
#main-content .entry-content .hallinta-harraste-content a,
#main-content .entry-content .hallinta-harraste-intro a {
    color: var(--accent-orange-dark, #bf360c);
    text-decoration: underline;
    text-decoration-color: var(--accent-orange, #e65100);
    text-underline-offset: 2px;
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti a:hover,
#main-content .entry-content .intro-text.hallinta-etusivu-teksti a:focus,
#main-content .entry-content .hallinta-harraste-content a:hover,
#main-content .entry-content .hallinta-harraste-content a:focus,
#main-content .entry-content .hallinta-harraste-intro a:hover,
#main-content .entry-content .hallinta-harraste-intro a:focus {
    color: var(--accent-orange, #e65100);
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti ul,
#main-content .entry-content .intro-text.hallinta-etusivu-teksti ol,
#main-content .entry-content .hallinta-harraste-content ul,
#main-content .entry-content .hallinta-harraste-content ol,
#main-content .entry-content .hallinta-harraste-intro ul,
#main-content .entry-content .hallinta-harraste-intro ol {
    margin: 0 0 1.25em 1.35em;
    padding: 0;
    color: inherit;
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti ul ul,
#main-content .entry-content .intro-text.hallinta-etusivu-teksti ul ol,
#main-content .entry-content .intro-text.hallinta-etusivu-teksti ol ul,
#main-content .entry-content .intro-text.hallinta-etusivu-teksti ol ol,
#main-content .entry-content .hallinta-harraste-content ul ul,
#main-content .entry-content .hallinta-harraste-content ul ol,
#main-content .entry-content .hallinta-harraste-content ol ul,
#main-content .entry-content .hallinta-harraste-content ol ol,
#main-content .entry-content .hallinta-harraste-intro ul ul,
#main-content .entry-content .hallinta-harraste-intro ul ol,
#main-content .entry-content .hallinta-harraste-intro ol ul,
#main-content .entry-content .hallinta-harraste-intro ol ol {
    margin-bottom: 0.5em;
    margin-top: 0.5em;
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti li,
#main-content .entry-content .hallinta-harraste-content li,
#main-content .entry-content .hallinta-harraste-intro li {
    margin-bottom: 0.35em;
    line-height: inherit;
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti blockquote,
#main-content .entry-content .hallinta-harraste-content blockquote,
#main-content .entry-content .hallinta-harraste-intro blockquote {
    margin: 0 0 1.25em;
    padding-left: 1em;
    padding-top: 0;
    padding-bottom: 0;
    padding-right: 0;
    border: none;
    border-left: 4px solid #e0e0e0;
    border-top: none;
    background: transparent;
    font-style: normal;
    color: #333333;
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti hr,
#main-content .entry-content .hallinta-harraste-content hr,
#main-content .entry-content .hallinta-harraste-intro hr {
    border: 0;
    border-top: 1px solid #e0e0e0;
    margin: 1.5em 0;
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti table,
#main-content .entry-content .hallinta-harraste-content table,
#main-content .entry-content .hallinta-harraste-intro table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.25em;
    font-size: 0.95em;
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti th,
#main-content .entry-content .intro-text.hallinta-etusivu-teksti td,
#main-content .entry-content .hallinta-harraste-content th,
#main-content .entry-content .hallinta-harraste-content td,
#main-content .entry-content .hallinta-harraste-intro th,
#main-content .entry-content .hallinta-harraste-intro td {
    border: 1px solid #e0e0e0;
    padding: 0.5rem 0.75rem;
    text-align: left;
    vertical-align: top;
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti th,
#main-content .entry-content .hallinta-harraste-content th,
#main-content .entry-content .hallinta-harraste-intro th {
    background: #f5f5f5;
    font-weight: 600;
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti img,
#main-content .entry-content .hallinta-harraste-content img,
#main-content .entry-content .hallinta-harraste-intro img {
    max-width: 100%;
    height: auto;
    border-radius: 0;
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti figure,
#main-content .entry-content .hallinta-harraste-content figure,
#main-content .entry-content .hallinta-harraste-intro figure {
    margin: 0 0 1.25em;
    max-width: 100%;
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti figcaption,
#main-content .entry-content .hallinta-harraste-content figcaption,
#main-content .entry-content .hallinta-harraste-intro figcaption {
    font-size: 0.9em;
    line-height: 1.5;
    color: #555555;
    margin-top: 0.5em;
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti pre,
#main-content .entry-content .hallinta-harraste-content pre,
#main-content .entry-content .hallinta-harraste-intro pre {
    background: #f6f6f6;
    border: 1px solid #e8e8e8;
    padding: 0.85em 1em;
    overflow-x: auto;
    margin: 0 0 1.25em;
    line-height: 1.5;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9em;
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti code,
#main-content .entry-content .hallinta-harraste-content code,
#main-content .entry-content .hallinta-harraste-intro code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9em;
    background: #f0f0f0;
    padding: 0.12em 0.35em;
}

#main-content .entry-content .intro-text.hallinta-etusivu-teksti pre code,
#main-content .entry-content .hallinta-harraste-content pre code,
#main-content .entry-content .hallinta-harraste-intro pre code {
    background: none;
    padding: 0;
}
