/*
Theme Name: MotorHub Child (Experimental)
Theme URI: https://motorhub.news
Description: Experimental fork of MotorHub Child — day/night toggle and layout experiments.
Author: MotorHub
Template: generatepress
Version: 1.4.2
Text Domain: autopulse-child-exp
*/

/* Readable text column for body copy only */
:root {
    --mh-text-measure: 48rem;
}

/* Titles + meta — full card/content width (list + single) */
.single-post .entry-header,
body:not(.single-post) .entry-header {
    width: 100%;
    max-width: 100%;
}

.single-post .entry-header .entry-title,
.single-post .entry-header .entry-meta,
body:not(.single-post) .entry-header .entry-title,
body:not(.single-post) .entry-header .entry-meta {
    width: 100%;
    max-width: 100%;
    text-align: left;
}

.single-post .entry-header .entry-title a,
body:not(.single-post) .entry-header .entry-title a {
    display: block;
    width: 100%;
}

/* Single: h1 has no inner link; list: h2 + link — force full measure */
.single-post h1.entry-title,
body:not(.single-post) h2.entry-title,
.inside-article .entry-header .entry-title {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* entry-header — no extra horizontal inset (single post; list already in .inside-article rules) */
.single-post .entry-header {
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
}

/* Title scale — one clamp() instead of multiple breakpoints */
.single-post h1.entry-title,
body:not(.single-post) h2.entry-title {
    font-size: clamp(1.35rem, 2.5vw + 1rem, 2.25rem);
    line-height: 1.25;
    margin-bottom: 0.5rem;
}

/* Single post — body text readable measure */
.single-post .motorhub-article-body p,
.single-post .entry-content > .motorhub-cta,
.single-post .entry-content > .motorhub-source {
    width: 100%;
    max-width: var(--mh-text-measure);
    text-align: left;
}

/* List/archive — excerpt full card width (same as title + preview image) */
body:not(.single-post) .entry-summary,
body:not(.single-post) .entry-summary p,
body:not(.single-post) .entry-content {
    width: 100%;
    max-width: 100%;
    text-align: left;
}

.entry-content figure img {
    max-width: 100%;
    height: auto;
}

/* Single post — inline photos same width as text column (no card bleed) */
.single-post .entry-content .motorhub-inline-image,
.single-post .entry-content .motorhub-gallery {
    display: block;
    width: 100%;
    max-width: var(--mh-text-measure, 48rem);
    margin: 1.75em 0;
}

.single-post .entry-content .motorhub-inline-image img,
.single-post .entry-content .motorhub-gallery img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}

.single-post .entry-content .motorhub-inline-image {
    cursor: zoom-in;
}

.single-post .featured-image img,
.single-post img.wp-post-image {
    width: 100%;
    max-width: 100%;
    height: auto;
}

/* Single post: entry-content wrapper full width; body copy uses --mh-text-measure */
.single-post .entry-content {
    max-width: 100%;
}

/* List card layout */
body:not(.single-post) .inside-article > .entry-header,
body:not(.single-post) .inside-article > .entry-summary,
body:not(.single-post) .inside-article > .entry-content {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

body:not(.single-post) .entry-summary,
body:not(.single-post) .entry-summary p {
    text-align: justify;
    text-align-last: left;
    line-height: 1.65;
}

/* List views — title, excerpt, preview share one content box */
body:not(.single-post) .inside-article > .entry-header,
body:not(.single-post) .inside-article > .entry-summary,
body:not(.single-post) .inside-article > .post-image,
body:not(.single-post) .inside-article > .post-image-aligned {
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    max-width: 100%;
}

body:not(.single-post) .inside-article > .post-image,
body:not(.single-post) .inside-article > .post-image-aligned {
    display: block;
    width: 100%;
    margin-bottom: 1.5em;
    padding: 0;
    clear: both;
    overflow: hidden;
}

body:not(.single-post) .inside-article > .entry-header + .post-image,
body:not(.single-post) .inside-article > .entry-header + .post-image-aligned {
    margin-top: 1.5em;
}

body:not(.single-post) .inside-article > .post-image a,
body:not(.single-post) .inside-article > .post-image-aligned a {
    display: block;
    line-height: 0;
    max-width: 100%;
    overflow: hidden;
}

body:not(.single-post) .inside-article > .post-image img,
body:not(.single-post) .inside-article > .post-image-aligned img {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0;
    border-radius: 4px;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    object-position: center;
    background: rgba(0, 0, 0, 0.04);
}

html[data-mh-theme="dark"] body:not(.single-post) .inside-article > .post-image img,
html[data-mh-theme="dark"] body:not(.single-post) .inside-article > .post-image-aligned img {
    background: rgba(255, 255, 255, 0.06);
}

/* Separate-containers cards — no bleed past card padding */
body:not(.single-post).separate-containers .inside-article > .post-image,
body:not(.single-post).separate-containers .inside-article > .post-image-aligned {
    margin-bottom: 1.5em;
    width: 100%;
    max-width: 100%;
}

body:not(.single-post).separate-containers .inside-article > .post-image img,
body:not(.single-post).separate-containers .inside-article > .post-image-aligned img {
    border-radius: 4px;
}

@media (max-width: 768px) {
    body:not(.single-post).separate-containers .inside-article > .post-image,
    body:not(.single-post).separate-containers .inside-article > .post-image-aligned {
        margin-bottom: 1.25em;
    }
}

.entry-content .ap-disclaimer {
    margin-top: 1.5em;
    padding: 0.75em 1em;
    border-left: 3px solid #ccc;
    font-size: 0.95em;
}

html[data-mh-theme="dark"] .entry-content .ap-disclaimer {
    border-left-color: #555;
}

/* Sidebar — «Свежие записи» / Latest Posts: air between multi-line titles */
.sidebar .widget_recent_entries ul,
.sidebar .wp-block-latest-posts {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar .widget_recent_entries ul li,
.sidebar .wp-block-latest-posts li {
    margin: 0 0 1.35em;
    padding: 0 0 1.35em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    line-height: 1.5;
}

.sidebar .widget_recent_entries ul li:last-child,
.sidebar .wp-block-latest-posts li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sidebar .widget_recent_entries ul li a,
.sidebar .wp-block-latest-posts a {
    display: block;
    text-decoration: none;
}

.sidebar .widget_recent_entries ul li a:hover,
.sidebar .widget_recent_entries ul li a:focus-visible,
.sidebar .wp-block-latest-posts a:hover,
.sidebar .wp-block-latest-posts a:focus-visible {
    text-decoration: underline;
}

html[data-mh-theme="dark"] .sidebar .widget_recent_entries ul li,
html[data-mh-theme="dark"] .sidebar .wp-block-latest-posts li {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}
