/**
 * Custom styles for Newsmatic Child Theme.
 * Loaded after parent CSS (main + responsive).
 */
:root {
    --menu-texttransform: none;
    --primary-color: #e84a4a;
    --leftc-rights-section-bk-color: transparent;
    --post-title-size-mobile: 16px;
    --post-title-lineheight-mobile: 24px;
}

.main-navigation a:hover {
    color: var(--primary-color) !important;
}

.header-layout-banner-two,
.sidebar-toggle-wrap.position--left {
    display: none;
}

#main-banner-section {
    padding-top: 0;
}

.social-icons {
    display: flex;
}

.site-header.layout--default .social-icons-wrap .social-icon {
    margin-right: 4px;
    display: flex;
    align-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    text-align: center;
    justify-content: center;
}

@media screen and (min-width: 942px) {
    .news-list-post-wrap .list-item .post-title {
        font-size: calc(var(--post-title-size) * 1);
    }
}

.bb-bldr-row .bb-bldr-column {
    flex-wrap: nowrap;
}

header .bb-bldr-row.column-3.tablet-layout-four {
    grid-template-columns: 1fr 1fr !important;
}

header row-wrap.row-one.full-width {
    min-height: 40px;
}

.pagination span,
.pagination a {
    min-width: 30px;
    width: auto;
    padding: 0 2px;
}

body:not(.home) .secondary-left-sidebar {
    margin-right: 0 !important;
}
body:not(.home) .secondary-left-sidebar + .primary-content {
    order: -1;
    margin-right: 20px !important;
}

.main-banner-wrap .post-element .post-title,
.banner-layout--four .banner-trailing-posts .post-title,
.widget_newsmatic_posts_list_widget .card__content-title {
    -webkit-line-clamp: 4;
}

@media screen and (max-width: 1200px) {
    .main-navigation .menu li a,
    .main-navigation .nav.menu li a {
        padding-inline: 5px;
    }
}

@media screen and (max-width: 1025px) {
    body:not(.home) .secondary-left-sidebar + .primary-content {
        margin-right: 0 !important;
    }
}

@media (max-width: 942px) {
    .bb-bldr--responsive .bb-bldr-row.column-3.tablet-layout-five {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 0;
    }
    .random-news-element .title-text,
    .random-news-element {
        display: none;
    }
    .header-custom-button {
        display: flex;
    }
    .header-custom-button .ticker_label_title_string {
        max-width: 52px;
        overflow: hidden;
        white-space: nowrap;
    }
    .tablet-alignment--right .bb-bldr-row .bb-bldr-column {
        row-gap: 0;
    }
    .tablet-alignment--right .custom-button-absolute {
        position: static;
        border-radius: 5px;
        overflow: hidden;
        min-width: 82px;
    }
    .bb-bldr-row.mobile-canvas.open {
        max-height: 500px;
    }
}

.entry-meta,
.post-meta span,
.post-meta time,
.single .entry-header .entry-meta a,
.single .entry-header .entry-meta span {
    text-transform: none !important;
}

.single-related-posts-wrap h2.post-title {
    font-size: calc(var(--post-title-size) * 0.7);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0;
}

.single-related-posts-section-wrap.layout--list .single-related-posts-section article figure.post-thumb-wrap {
    flex: 0 1 30%;
}
.single-related-posts-section-wrap.layout--list .single-related-posts-section article .post-element {
    flex: 1 1 60%;
}

/* Header accent: green (#1b8415) → black (Customizer still outputs green inline). */
body.newsmatic_font_typography {
    --menu-border-top-color: #000;
    --sidebar-toggle-color-hover: #000;
    --search-color-hover: #000;
    --random-news-color-hover: #000;
    --newsletter-color-hover: #000;
    --menu-color-hover: #000;
    --menu-color-active: #000;
    --menu-color-submenu-hover: #000;
    --mode-toggle-color-hover: #000;
}

/* Top bar background */
body.newsmatic_main_body .site-header .row-one.full-width,
body.newsmatic_main_body .site-header .row-one .full-width,
body.newsmatic_main_body .site-header.layout--default .top-header {
    background: #000 !important;
}

body .site-header .row-two .bb-bldr-row:before {
    border-bottom-color: #000 !important;
}

/* Logo row padding (Customizer ~35px). */
body.newsmatic_main_body .site-header .row-two.full-width,
body.newsmatic_main_body .site-header .row-two .full-width {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
}

body.newsmatic_font_typography {
    --header-padding: 12px;
    --header-padding-tablet: 12px;
    --header-padding-smartphone: 12px;
}

.site-header.layout--default .site-branding-section .row {
    padding-top: 0;
    padding-bottom: 0;
}

.site-header.layout--default .site-branding img.custom-logo {
    display: block;
}

/* Masthead height: CSS only (parent theme.js must not control layout via inline height). */
header#masthead.site-header.header-sticky--disabled {
    height: auto !important;
    min-height: 0;
}

/*
 * Sticky mode uses position:fixed on .bb-bldr--*; parent normally sets inline height as spacer.
 * Approximate full header block height (tune if gap/jump appears after scroll > 200px).
 */
@media (max-width: 769px) {
    header#masthead.site-header.header-sticky--enabled {
        min-height: 140px;
    }
}

@media (min-width: 770px) {
    header#masthead.site-header.header-sticky--enabled {
        min-height: 197px;
    }
}

.main-banner-wrap {
    max-width: 648px;
    max-height: 430px;
}

@media (max-width: 1025px) {
    .main-banner-wrap {
        max-width: 936px;
    }
}

@media (max-width: 610px) {
    .banner-layout--four .main-banner-wrap {
        max-height: none;
        aspect-ratio: 1 / 1;
        width: 100%;
    }

    .banner-layout--four .main-banner-wrap .main-banner-slider article,
    .banner-layout--four .main-banner-wrap .main-banner-slider .post-thumb,
    .banner-layout--four .main-banner-wrap .slick-list article,
    .banner-layout--four .main-banner-wrap .slick-list .post-thumb {
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .banner-layout--four .main-banner-wrap .post-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .news-list .post-element {
        padding-top: 0;
    }
}

/*
 * Row-two padding was reduced; Customizer still positions the divider and
 * "Youtube Live" tab at bottom:-32px — that overlaps the menu row.
 */
.bb-bldr--normal .row-two .bb-bldr-row:before,
.bb-bldr--normal .row-two .custom-button-absolute,
.bb-bldr--responsive .row-two .bb-bldr-row:before,
.bb-bldr--responsive .row-two .custom-button-absolute {
    bottom: -12px !important;
}

/* Menu row: breathing room (Customizer sets row-three padding to 0). */
body.newsmatic_main_body .site-header .row-three.full-width,
body.newsmatic_main_body .site-header .row-three .full-width {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.site-header .row-three .bb-bldr-row.has-menu {
    min-height: 48px;
    align-items: center;
}

@media (min-width: 942px) {
    .site-header .row-three .main-navigation .menu li a,
    .site-header .row-three .main-navigation .nav.menu li a {
        padding-top: 12px;
        padding-bottom: 12px;
    }
}

.site-header.layout--default .menu-section .row {
    border-top-color: #000;
}

.site-header .bb-bldr-row.column-3.layout-three {
    grid-template-columns: 0fr 80fr 0fr;
}

body.both-sidebar.wp-singular #theme-content .row .secondary-left-sidebar {
    margin-right: 0;
}

/* Front page: three columns under banner (child replaces leftc-rights markup). */
@media (min-width: 942px) {
    .leftc-rights-section.newsmatic-child-three-columns .secondary-left-sidebar {
        flex: 0 1 25%;
        max-width: 25%;
        margin-right: 20px;
    }

    .leftc-rights-section.newsmatic-child-three-columns .primary-content {
        flex: 0 1 50%;
        max-width: 50%;
    }

    .leftc-rights-section.newsmatic-child-three-columns .secondary-sidebar {
        flex: 0 1 25%;
        max-width: 25%;
        margin-left: 20px;
    }

    .leftc-rights-section.newsmatic-child-three-columns .secondary-left-sidebar .widget {
        background-color: var(--leftc-rights-content-bk-color);
    }
}

@media (max-width: 768px) {
    .leftc-rights-section.newsmatic-child-three-columns .secondary-left-sidebar {
        margin-right: 0;
        margin-bottom: 25px;
    }
}

/*
 * Single post columns (DOM order): article | Передовица | Последние новости.
 * Parent both-sidebar widths: 50% | 25% | 25%.
 */
@media (min-width: 942px) {
    body.single.both-sidebar #theme-content .row .primary-content {
        margin-right: 20px;
    }

    body.single.both-sidebar #theme-content .secondary-left-sidebar .widget {
        background-color: var(--leftc-rights-content-bk-color);
    }
}

@media (max-width: 768px) {
    body.single.both-sidebar #theme-content .row {
        flex-direction: column;
    }

    body.single.both-sidebar #theme-content .secondary-left-sidebar,
    body.single.both-sidebar #theme-content .secondary-sidebar {
        flex: 1 1 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    body.single.both-sidebar #theme-content .primary-content,
    body.pr-meny-directory-page.both-sidebar #theme-content .primary-content {
        flex: 1 1 100%;
        max-width: 100%;
        order: -1;
    }
}

/* PRмены archive: same column layout as single (grid | Передовица | последние). */
@media (min-width: 942px) {
    body.pr-meny-directory-page.both-sidebar #theme-content .row .primary-content {
        margin-right: 20px;
    }

    body.pr-meny-directory-page.both-sidebar #theme-content .secondary-left-sidebar .widget {
        background-color: var(--leftc-rights-content-bk-color);
    }
}

@media (max-width: 768px) {
    body.pr-meny-directory-page.both-sidebar #theme-content .row {
        flex-direction: column;
    }

    body.pr-meny-directory-page.both-sidebar #theme-content .secondary-left-sidebar,
    body.pr-meny-directory-page.both-sidebar #theme-content .secondary-sidebar {
        flex: 1 1 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

/* PRмены directory grid (Drupal 3-column portraits). */
.pr-meny-directory__main {
    width: 100%;
}

.pr-meny-directory {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pr-meny-directory__item {
    text-align: center;
}

.pr-meny-directory__thumb {
    display: block;
    margin-bottom: 0.5rem;
}

.pr-meny-directory__image,
.pr-meny-directory__placeholder {
    width: 100%;
    max-width: 200px;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.pr-meny-directory__placeholder {
    background: #e8e8e8;
}

.pr-meny-directory__name {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.35;
}

.pr-meny-directory__name a {
    color: inherit;
    text-decoration: none;
}

.pr-meny-directory__name a:hover,
.pr-meny-directory__name a:focus-visible {
    color: #e84a4a;
}

@media (max-width: 548px) {
    .pr-meny-directory {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Hide Newsmatic theme admin promo notices. */
.newsmatic-admin-notice {
    display: none !important;
}
.single.sidebar-sticky #theme-content .row .secondary-sidebar aside {
    top: 0 !important;
}

.scroll-to-top-widget {
    z-index: 99;
}
#newsmatic-scroll-to-top {
    padding: 8px 16px;
}

/* ФОТОФАКТ: three-up image carousel in the center column. */
.leftc-rights-section .news-carousel.layout--fotofakt {
    margin-bottom: 32px;
}

.leftc-rights-section .news-carousel.layout--fotofakt .fotofakt-slide {
    margin: 0;
}

.leftc-rights-section .news-carousel.layout--fotofakt .post-thumb-wrap {
    margin: 0;
    overflow: hidden;
}

.leftc-rights-section .news-carousel.layout--fotofakt .post-thumb-wrap a {
    display: block;
    line-height: 0;
}

.leftc-rights-section .news-carousel.layout--fotofakt .post-thumb-wrap img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 16;
    object-fit: cover;
}

.leftc-rights-section .news-carousel.layout--fotofakt .slick-arrow.slick-prev {
    left: -6px;
    background-color: var(--theme-color-red);
}

.leftc-rights-section .news-carousel.layout--fotofakt .slick-arrow.slick-next {
    right: -6px;
    background-color: var(--theme-color-red);
}

@media (max-width: 768px) {
    .leftc-rights-section .news-carousel.layout--fotofakt .slick-dots {
        top: auto;
        bottom: -28px;
        width: 100%;
        right: 0;
        text-align: center;
    }
}

/* Single post: Источник: PRпортал (Drupal field parity). */
.entry-content .post-source-attribution {
    margin-top: 1.25em;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35em;
    clear: both;
}

.entry-content .post-source-attribution__label {
    font-weight: 600;
}

.post-source-attribution__link {
    color: var(--primary-color);
}

/* Single post: social share (under source line). */
.entry-content .post-social-share {
    margin-top: 0.85em;
    clear: both;
}

.entry-content .post-social-share__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5em;
    list-style: none;
    margin: 0;
    padding: 0;
}

.entry-content .post-social-share__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 4px;
    background: #f0f0f0;
    color: #333;
    text-decoration: none !important;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.entry-content .post-social-share--web-share .post-social-share__item--native {
    display: list-item;
}

.entry-content .post-social-share__link:hover,
.entry-content .post-social-share__link:focus-visible {
    background: #e84a4a;
    color: #fff;
}

.entry-content .post-social-share__item--native .post-social-share__link:hover,
.entry-content .post-social-share__item--native .post-social-share__link:focus-visible {
    background: var(--primary-color, #e84a4a);
}

.entry-content .post-social-share__item--facebook .post-social-share__link:hover,
.entry-content .post-social-share__item--facebook .post-social-share__link:focus-visible {
    background: #1877f2;
}

.entry-content .post-social-share__item--twitter .post-social-share__link:hover,
.entry-content .post-social-share__item--twitter .post-social-share__link:focus-visible {
    background: #000;
}

.entry-content .post-social-share__item--linkedin .post-social-share__link:hover,
.entry-content .post-social-share__item--linkedin .post-social-share__link:focus-visible {
    background: #0a66c2;
}

.entry-content .post-social-share__item--whatsapp .post-social-share__link:hover,
.entry-content .post-social-share__item--whatsapp .post-social-share__link:focus-visible {
    background: #25d366;
}

.entry-content a.js-grid-expand,
.entry-content a.js-no-preview {
    display: inline !important;
}

body .site-footer .row-one.full-width,
body .site-footer .row-one .full-width {
    padding: 5px 0px 5px 0px;
}
body .site-footer .row-one .newsmatic-container {
    display: none;
}

/* Stick footer to the bottom of the viewport on short pages (login, etc.). */
#page.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

#page.site > #theme-content {
    flex: 1 1 auto;
}

#page.site > #colophon {
    flex-shrink: 0;
    margin-top: auto;
}

body.admin-bar #page.site {
    min-height: calc(100vh - 32px);
    min-height: calc(100dvh - 32px);
}

@media screen and (max-width: 782px) {
    body.admin-bar #page.site {
        min-height: calc(100vh - 46px);
        min-height: calc(100dvh - 46px);
    }
}

.top-ticker-news .js-top-ticker-track {
    visibility: hidden;
}

.top-ticker-news .js-top-ticker-track.slick-slider {
    visibility: visible;
}

.top-ticker-news .js-top-ticker-track:not(.slick-initialized) {
    height: 20px;
}

.site-header.layout--default .top-date-time .js-header-time {
    padding-left: 10px;
}

body .site .top-date-time.is-display-block .js-header-time {
    padding: 8px 0 0 0;
}

/* Front-end login page (core wp_login_form). */
body.login-page #theme-content .primary-content {
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}

.login-page__form #loginform p {
    margin: 0 0 1rem;
}

.login-page__form #loginform label {
    display: block;
    margin-bottom: 0.35rem;
}

.login-page__form #loginform .login-remember label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0;
}

.login-page__form #loginform input[type="text"],
.login-page__form #loginform input[type="password"] {
    width: 100%;
    height: 41px;
    box-sizing: border-box;
}

.login-page__form #loginform .login-submit #wp-submit {
    padding: 15px 20px;
    vertical-align: middle;
    font-size: 13px;
    text-transform: uppercase;
    font-family: var(--post-title-family);
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--white-text);
    background-color: var(--dark-bk-color);
    border: none;
    cursor: pointer;
}

.login-page__errors {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    color: #7a1c1c;
    background: #fdeeee;
    border: 1px solid #f3c6c6;
}
