/* =========================================
   ULTRA-PREMIUM READING EXPERIENCE
   ========================================= */

.markdown-body {
    width: 100%;
}

/* --- CENTRALIZED READING COLUMN --- */
.markdown-body > p,
.markdown-body > h1,
.markdown-body > h2,
.markdown-body > h3,
.markdown-body > h4,
.markdown-body > ul,
.markdown-body > ol,
.markdown-body > .table-wrapper,
.markdown-body > pre,
.markdown-body > blockquote,
.markdown-body > img,
.markdown-body > .ray-alert {
    max-width: var(--content-text-width);
    margin-left: auto;
    margin-right: auto;
}

/* --- TYPOGRAPHY RHYTHM --- */
.markdown-body h1, 
.markdown-body h2, 
.markdown-body h3, 
.markdown-body h4 {
    color: var(--c-text-primary);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-top: 2.5em;
    margin-bottom: 0.75em;
}

.markdown-body h1 { 
    font-size: 3rem; 
    margin-top: 0; 
    letter-spacing: -0.04em; 
}
.markdown-body h2 { 
    font-size: 1.875rem; 
    border-bottom: 1px solid var(--c-border-subtle); 
    padding-bottom: 0.5em; 
}
.markdown-body h3 { 
    font-size: 1.5rem; 
}

.markdown-body p {
    color: var(--c-text-secondary);
    margin-bottom: 1.5em;
    font-size: 1.05rem; /* ~17px for optimal reading */
}

.markdown-body strong { color: var(--c-text-primary); font-weight: 600; }
.markdown-body em { color: var(--c-text-secondary); font-style: italic; }

.markdown-body a {
    color: var(--c-text-primary);
    text-decoration: underline;
    text-decoration-color: var(--c-border-strong);
    text-underline-offset: 4px;
    transition: var(--transition-fast);
}
.markdown-body a:hover {
    text-decoration-color: var(--c-accent-primary);
    color: var(--c-accent-hover);
}

/* --- LISTS --- */
.markdown-body ul, .markdown-body ol {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
    color: var(--c-text-secondary);
    font-size: 1.05rem;
}
.markdown-body li { margin-bottom: 0.5em; }

/* --- BLOCKQUOTES --- */
.markdown-body blockquote {
    border-left: 2px solid var(--c-border-strong);
    padding: 0.5em 0 0.5em 1.5em;
    margin-top: 2em;
    margin-bottom: 2em;
    color: var(--c-text-secondary);
    font-style: italic;
}

/* --- IMAGES (Standard) --- */
.markdown-body > img {
    border-radius: 8px;
    margin-top: 2em;
    margin-bottom: 2em;
    border: 1px solid var(--c-border-subtle);
    display: block;
    width: 100%;
}

/* --- TABLES (Clean Redesign) --- */
.table-wrapper {
    margin: 2.5em auto;
    border-radius: 8px;
    border: 1px solid var(--c-border-strong);
    background: var(--c-bg-surface);
    overflow-x: auto;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
    white-space: nowrap;
}

.markdown-body th {
    background: rgba(255, 255, 255, 0.03);
    padding: 14px 20px;
    font-weight: 600;
    color: var(--c-text-primary);
    border-bottom: 1px solid var(--c-border-strong);
}

.markdown-body td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--c-border-subtle);
    color: var(--c-text-secondary);
}

.markdown-body tr:last-child td {
    border-bottom: none;
}
.markdown-body tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.01);
}
.markdown-body tbody tr:hover td {
    background: rgba(255,255,255,0.02);
    color: var(--c-text-primary);
}

/* --- CODE BLOCKS --- */
.markdown-body code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--c-border-subtle);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    color: var(--c-text-primary);
}

.markdown-body > pre {
    background: #0A0A0A !important;
    border: 1px solid var(--c-border-subtle) !important;
    border-radius: 8px !important;
    padding: 1.25em !important;
    margin-top: 2em !important;
    margin-bottom: 2em !important;
    overflow-x: auto;
}

.markdown-body pre code {
    background: transparent;
    padding: 0;
    border: none;
    color: inherit;
    font-size: 0.9em;
}

/* --- ALERTS --- */
.ray-alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-top: 2em;
    margin-bottom: 2em;
    border: 1px solid;
}
.ray-alert p { margin-bottom: 0; color: inherit; font-size: 0.95rem; }
.ray-alert p:not(:last-child) { margin-bottom: 12px; }

.ray-alert.info { background: var(--c-info-bg); border-color: var(--c-info-border); color: var(--c-info-text); }
.ray-alert.warn { background: var(--c-warning-bg); border-color: var(--c-warning-border); color: var(--c-warning-text); }
.ray-alert.error { background: var(--c-error-bg); border-color: var(--c-error-border); color: var(--c-error-text); }
.ray-alert.success { background: var(--c-success-bg); border-color: var(--c-success-border); color: var(--c-success-text); }


/* =========================================
   HERO BLOCKS (Wide, Flowing, Professional)
   ========================================= */

.ray-hero-container {
    max-width: var(--content-wide-width);
    margin: 6rem auto;
    display: flex;
    align-items: center;
    gap: 4rem;
    flex-direction: column-reverse;
}

.ray-hero-container:nth-child(even) {
    flex-direction: row-reverse;
}

.ray-hero-text {
    flex: 1;
    min-width: 300px;
    padding: 32px 48px;
    /* background: #0b0b0b; */
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 0 1px rgb(255 255 255 / 5%);
    border: 1px solid var(--c-border-subtle);
    box-shadow: inset -4px -4px 10px rgb(255 255 255 / 7%);
}

.ray-hero-text h1,
.ray-hero-text h2,
.ray-hero-text h3 {
    margin-top: 0;
    letter-spacing: -0.04em;
}

.ray-hero-text h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.ray-hero-text h2 {
    font-size: 2.5rem;
    border-bottom: none;
    margin-bottom: 1rem;
}

.ray-hero-text p {
    font-size: 1.15rem;
    color: var(--c-text-secondary);
    margin: 0;
}

.ray-hero-image {
    flex: 1.2;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0; /* Убраны огромные отступы */
    background: transparent; /* Убран фиолетовый радиальный фон */
    overflow: hidden;
}

.ray-hero-image img {
    width: 100%;
    height: auto;
    border-radius: 18px;
    background: transparent;
    border: 1px solid var(--c-border-subtle);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

img {
    width: 100%;
    height: auto;
    border-radius: 18px;
    background: transparent;
    border: 1px solid var(--c-border-subtle);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* =========================================
   MOBILE RESPONSIVENESS (Phones & Small Tablets)
   ========================================= */
@media (max-width: 1024px) {
    .ray-hero-image {
        padding: 0;
        background: none;
    }
    .ray-hero-image img {
        border-radius: 12px;
    }
}

@media (max-width: 768px) {
    .markdown-body h1 { font-size: 2.2rem; margin-top: 1rem; }
    .markdown-body h2 { font-size: 1.6rem; }
    .markdown-body p { font-size: 1rem; }
    
    .ray-hero-container {
        flex-direction: column !important;
        margin: 2rem auto 4rem auto;
        gap: 1.5rem;
    }
    .ray-hero-text { 
        padding: 24px 20px; 
        text-align: center;
    }
    .ray-hero-text h1 { font-size: 2.2rem; }
    .ray-hero-text p { font-size: 1rem; }
    .ray-hero-image { 
        width: 100%;
        border-radius: 12px;
    }
    
    .markdown-body > pre { padding: 1rem !important; font-size: 0.9rem; }
    .table-wrapper { font-size: 0.85rem; margin: 1.5em auto; }
}
