/* ==========================================
   ТОЧНАЯ КОПИЯ ДИЗАЙНА С ИСХОДНИКА
   ========================================== */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');

:root {
    --rn-red: #ef4f4f;
    --rn-bg: #f8f8fa;
    --rn-text: #0c0c0c;
    --rn-border: #d6d6d6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
    word-break: normal;
}

html, body {
    max-width: 100vw;
    overflow-x: hidden;
}
body {
    background-color: var(--rn-bg);
    color: #333;
    font-size: 14px;
    line-height: 1.42857143;
}

a {
    color: inherit;
    text-decoration: none;
    outline: none !important;
}

a:hover {
    text-decoration: none;
}

/* Header */
.rn-header {
    background-color: #fff;
    position: relative;
    z-index: 20;
    height: 80px;
    border-bottom: 5px solid transparent;
    border-image: repeating-linear-gradient(45deg, var(--rn-red), var(--rn-red) 5px, transparent 5px, transparent 10px) 5;
}

.rn-navbar {
    max-width: 1230px;
    margin: 0 auto;
    padding: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rn-nav-list {
    display: flex;
    flex: 1;
    list-style: none;
    padding-left: 0;
    gap: 20px;
}

.rn-nav-link {
    color: var(--rn-text);
    font-size: 20px;
    font-weight: 500;
    transition: 0.15s;
}

.rn-nav-link:hover, .rn-nav-link.active {
    color: var(--rn-red);
    text-decoration: underline;
}

.rn-logo {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
    text-decoration: none !important;
    text-transform: uppercase;
}

.rn-logo-letter {
    border: 3px solid var(--rn-red);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: #000;
    font-size: 24px;
    font-weight: 700;
    margin-right: 5px;
}

.rn-logo-text-red {
    color: var(--rn-red);
    font-size: 21px;
    font-weight: 700;
}

.rn-logo-text-black {
    color: #000;
    font-size: 21px;
    font-weight: 400;
    opacity: 0.8;
    margin-left: 5px;
    white-space: nowrap;
}

.rn-header-right {
    display: flex;
    flex: 1;
    justify-content: flex-end;
}

.rn-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--rn-border);
    color: #000;
}

.rn-hamburger {
    display: none;
    width: 44px;
    height: 44px;
    background-color: var(--rn-red);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.rn-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: #fff;
    border-radius: 2px;
    transition: 0.3s;
}

.rn-mobile-only {
    display: none;
}

/* Main Content */
.rn-content {
    background-color: var(--rn-bg);
    margin: 0 auto;
    max-width: 100%;
    padding: 0;
}

.rn-section {
    width: 100%;
    padding-top: 40px;
    padding-bottom: 40px;
}

.rn-section.white {
    background-color: #fff;
    padding-top: 0;
}

.rn-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 15px;
}

.rn-section-title {
    color: #000;
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 26px;
    text-transform: uppercase;
}

/* Grids */
.rn-row {
    display: flex;
    margin-left: -15px;
    margin-right: -15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.rn-row:last-child {
    margin-bottom: 0;
}

.rn-col-33 { width: 33.33333%; padding: 0 15px; }
.rn-col-25 { width: 25%; padding: 0 15px; }
.rn-col-50 { width: 50%; padding: 0 15px; }
.rn-col-100 { width: 100%; padding: 0 15px; }

/* Pink Native Ad */
.rn-pink-ad {
    background-color: #fcdcdc;
    border-top: 1px solid #d6d6d6;
    border-bottom: 1px solid #d6d6d6;
    margin: 20px -15px;
    padding: 12px 20px;
}

/* Red Offers (mobile feed only) */
@media(max-width: 600px) {
    .offer-bg-pink {
        background-color: #fceaea !important;
    }
    .offer-text-lg {
        font-size: 16px !important;
        font-weight: 600 !important;
        line-height: 1.4 !important;
    }
}

/* Block 4x3 Vertical (Big & Medium Cards) */
.rn-block-vertical {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.rn-card-vert {
    background-color: #fff;
    border: 1px solid var(--rn-border);
    color: #000;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    transition: 0.15s;
}

.rn-card-vert:hover .rn-title {
    color: var(--rn-red);
    text-decoration: underline;
}

.rn-card-img-wrap {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.rn-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rn-card-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 15px 20px 25px;
}

.rn-title {
    font-size: 19px;
    font-weight: 500;
    line-height: 130%;
    margin-bottom: auto;
    padding-bottom: 10px;
}

.rn-meta {
    color: #818181;
    font-size: 15px;
    display: flex;
    align-items: center;
}

.rn-meta svg {
    color: var(--rn-red);
    margin-right: 10px;
    width: 16px;
    height: 16px;
}

/* Block 1x1 Horizontal (Small Cards) */
.rn-card-horiz {
    background-color: #fff;
    color: #333;
    display: flex;
    flex: 1 1 auto;
    flex-direction: row;
    gap: 22px;
    padding: 0;
    border: 1px solid var(--rn-border);
    text-decoration: none;
}

.rn-card-horiz:hover .rn-horiz-title {
    color: var(--rn-red);
    text-decoration: underline;
}

.rn-horiz-img-wrap {
    width: 130px;
    aspect-ratio: 1;
    flex-shrink: 0;
    height: 100%;
}

.rn-horiz-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rn-horiz-content {
    padding-block: 6px;
    padding-right: 6px;
    display: flex;
    align-items: center;
}

.rn-horiz-title {
    font-size: 19px;
    font-weight: 500;
    color: inherit;
}

/* Decorator Dashed Line */
.rn-dashed-line {
    background: #fff;
    border-bottom: 5px solid transparent;
    border-image: repeating-linear-gradient(45deg, var(--rn-red), var(--rn-red) 5px, transparent 5px, transparent 10px) 5;
    display: block;
    height: 5px;
    width: 100%;
}

/* Modal Popup (Main News) */
.rn-popup-overlay {
    background-color: rgba(0, 0, 0, 0.4);
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.rn-popup-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.rn-popup-container {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    width: 90%;
    max-width: 1000px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.rn-popup-close {
    position: absolute;
    right: 20px;
    top: 20px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    opacity: 0.3;
}

.rn-popup-close:hover { opacity: 1; }
.rn-popup-close::before, .rn-popup-close::after {
    content: '';
    position: absolute;
    left: 15px;
    height: 33px;
    width: 2px;
    background-color: #333;
}
.rn-popup-close::before { transform: rotate(45deg); }
.rn-popup-close::after { transform: rotate(-45deg); }

.rn-popup-title {
    font-size: 28px;
    margin-top: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 700;
}

.rn-popup-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px 20px;
}

/* Article Page Layout */
.rn-article-layout {
    display: flex;
    gap: 0;
    margin-top: 0;
    margin-left: -15px;
    margin-right: -15px;
}

.rn-article-main {
    width: 50%;
    padding: 0 15px;
    background: transparent;
    border: none;
}

.rn-article-sidebar {
    width: 50%;
    padding: 0 15px;
}

.rn-article-title {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 20px;
    line-height: 1.2;
}

.rn-article-img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    margin-bottom: 25px;
}

.rn-article-body {
    font-size: 18px;
    line-height: 1.6;
}

/* Sidebar & In-Article Offers styled EXACTLY like vertical news cards to blend in */
.rn-offer-card {
    background-color: #fff;
    border: 1px solid var(--rn-border);
    color: #000;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    margin-bottom: 20px;
    transition: 0.15s;
}
.rn-offer-card:hover .rn-offer-title {
    color: var(--rn-red);
    text-decoration: underline;
}

.rn-offer-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.rn-offer-content {
    padding: 15px 20px 25px;
    display: flex;
    flex-direction: column;
}

.rn-offer-title {
    font-size: 19px;
    font-weight: 500;
    line-height: 130%;
    margin-bottom: 10px;
}

/* Toast Notifications (Kept exactly as requested) */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 380px;
    pointer-events: none;
    align-items: flex-end;
}

.toast-container .notif {
    pointer-events: auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    padding: 12px;
    width: 100%;
    transform: translateX(calc(100% + 40px));
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #eaeaea;
}

.toast-container .notif.show { transform: translateX(0); opacity: 1; }
.toast-container .notif.hide { transform: translateX(calc(100% + 40px)); opacity: 0; }

.toast-container .notif .n-img {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.toast-container .notif .n-content { flex: 1; min-width: 0; }
.toast-container .notif .n-title { font-size: 14px; font-weight: 500; color: #333; line-height: 1.3; }
.toast-container .notif .n-title b { color: #000; font-weight: 700; }
.toast-container .notif .n-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #666;
    border: none;
    cursor: pointer;
}

/* Push Envelope Modal */
.push-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
}
.push-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}
.push-modal {
    background: #fff;
    width: 90%;
    max-width: 400px;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}
.push-modal-header {
    height: 40px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    position: relative;
}
.push-modal-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 15px;
    width: 50%;
    height: 2px;
    background-color: var(--rn-red);
}
.push-modal-close {
    font-size: 20px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}
.push-modal-body {
    padding: 20px;
    text-align: center;
}
.push-modal-img {
    width: 100%;
    max-width: 250px;
    margin: 0 auto 15px;
    display: block;
}
.push-modal-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    line-height: 1.3;
}
.push-modal-btn {
    background-color: var(--rn-red);
    color: #fff;
    border: none;
    padding: 15px 20px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 4px;
    width: 100%;
    text-transform: uppercase;
    cursor: pointer;
}
.push-modal-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    color: #666;
    font-size: 13px;
}

@media(max-width: 1024px) {
    .rn-col-33, .rn-col-25, .rn-col-50 { width: 50%; }
    .rn-article-layout { flex-direction: column; }
    .rn-article-main { width: 100%; }
    .rn-article-sidebar { width: 100%; }
    
    /* MOBILE HEADER */
    .rn-hamburger { display: flex; }
    .rn-search-btn { display: none; }
    .rn-mobile-only { display: block; }
    
    .rn-navbar { flex-wrap: wrap; }
    .rn-header-right { flex: 0; }
    .rn-logo { justify-content: flex-start; }
    
    .rn-nav-list {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #f9f9f9;
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        border-bottom: 2px solid var(--rn-border);
        box-shadow: 0 10px 20px rgba(0,0,0,0.05);
        gap: 0;
    }
    
    .rn-nav-list.active {
        display: flex;
    }
    
    .rn-nav-list li {
        width: 100%;
        text-align: center;
        padding: 15px 0;
    }
    
    .rn-nav-link {
        font-size: 22px;
        text-transform: uppercase;
        display: block;
    }
}

@media(max-width: 600px) {
    .rn-col-33, .rn-col-25, .rn-col-50 { width: 100%; }
    .rn-popup-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .rn-popup-container { padding: 15px; width: 95%; max-height: 85vh; }
    .rn-offer-title { font-size: 13px; line-height: 1.2; }
}

/* loader for infinite scroll */
.loader { text-align: center; padding: 20px; font-weight: bold; color: var(--rn-text); }

/* ВИДЕО/ГИФ в блоках офферов — ведут себя как картинки */
.rn-offer-img,
video.rn-offer-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
}
.rn-horiz-img,
video.rn-horiz-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ВИДЕО/ГИФ в блоках офферов — ведут себя как картинки */
.rn-offer-img,
video.rn-offer-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
}
.rn-horiz-img,
video.rn-horiz-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
