/*
Theme Name: rizhenkov.by
Author: AI
Description: Theme for rizhenkov.by
Version: 1.0.0
*/

@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700;900&family=Open+Sans:wght@400;600;700&display=swap');

:root {
    --primary: #6c3483;
    --secondary: #1abc9c;
    --accent: #e67e22;
    --bg-main: #f5f0ff;
    --white: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --border: rgba(108, 52, 131, 0.15);
    
    --container-width: 1200px;
    --transition: all 0.3s ease;
    --section-pad: clamp(4rem, 8vw, 8rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    overflow-x: hidden;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: 'Open Sans', sans-serif;
    line-height: 1.7;
}

h1, h2, h3, h4, h5, h6, .logo, .footer-logo {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: break-word;
    word-break: break-word;
}

h1 { font-size: clamp(1.8rem, 8vw, 4.5rem); margin-bottom: 2rem; }
h2 { font-size: clamp(1.6rem, 5vw, 3rem); margin-bottom: 3rem; text-align: center; }
h3 { font-size: clamp(1.3rem, 3vw, 1.8rem); margin-bottom: 1rem; }

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; transition: var(--transition); }

.container { max-width: var(--container-width); margin: 0 auto; padding: 0 2rem; }

section {
    isolation: isolate; /* Critical CSS fix */
    position: relative;
    overflow: hidden;
}

.site-main > section:first-child {
    padding-top: clamp(100px, 15vh, 150px); /* Fixed header padding */
}

/* Axis 1: N-D Centered Header */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.header-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 2rem;
    gap: clamp(1rem, 3vw, 2rem);
}

.logo {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: clamp(1.5rem, 5vw, 2.5rem) !important;
    color: var(--primary) !important;
    min-width: 100px;
    min-height: 1em;
    flex-shrink: 0;
    flex-wrap: wrap; /* Critical fix */
}

.logo span { color: var(--secondary); font-weight: 400; }

.main-nav { flex: 1; min-width: 0; overflow: hidden; width: 100%; }
.main-nav ul { 
    display: flex; 
    list-style: none; 
    gap: 3.5rem; /* Rule 1: >3.5rem */
    justify-content: center; 
    flex-wrap: wrap;
}
.main-nav a { font-family: 'Open Sans', sans-serif; font-size: 0.95rem; font-weight: 600; text-transform: uppercase; color: var(--text-main); }
.main-nav a:hover { color: var(--primary); }

.nav-toggle { display: none; }

/* Axis 2: H-C Type-Only Hero */
.hero-hc {
    min-height: 60vh;
    display: flex;
    align-items: center;
    text-align: center;
    background: var(--white);
}
.hero-hc h1 { color: var(--primary); }

.btn-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 3rem;
    background: var(--primary);
    color: var(--white);
    font-weight: 700;
    border-radius: 4px;
    transition: var(--transition);
}
.btn-main:hover { background: var(--secondary); color: var(--white); transform: translateY(-2px); }

/* Axis 3: F-A Horizontal Stripes */
.feature-stripe {
    padding: 4rem 0;
    border-top: 1px solid var(--border); /* Axis 8: V-C Thin 1px lines */
    border-bottom: 1px solid var(--border);
}
.feature-stripe:nth-child(even) {
    background: var(--white);
}

.stripe-inner {
    display: flex;
    align-items: center;
    gap: 4rem;
}
.stripe-inner.reverse {
    flex-direction: row-reverse;
}
.stripe-content { flex: 1; }
.stripe-icon {
    font-size: 3rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

/* Axis 5: U-A Expert Quote */
.quote-block {
    padding: var(--section-pad) 0;
    background: var(--primary);
    color: var(--white);
    text-align: center;
}
.quote-content {
    max-width: 800px;
    margin: 0 auto;
}
.quote-text {
    font-family: 'Merriweather', serif;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-style: italic;
    margin-bottom: 2rem;
    line-height: 1.5;
}
.quote-author {
    font-family: 'Open Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Axis 4: C-B Horizontal Cards */
.posts-section { padding: var(--section-pad) 0; background: var(--bg-main); }
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }

.post-card-arc {
    display: flex;
    flex-direction: column; /* Changed for consistent grid */
    background: var(--white);
    border: 1px solid var(--border); /* V-C: Thin 1px lines */
    transition: var(--transition);
    height: 100%;
}
.post-card-arc:hover { border-color: var(--primary); box-shadow: 0 4px 20px rgba(0,0,0,0.05); }

/* Applying C-B (Horizontal Card) style properly */
.post-card-cb-wrapper {
    display: flex;
    flex-direction: row;
    height: 100%;
}

.post-card-arc .thumb {
    width: 40%;
    flex-shrink: 0;
    position: relative;
    border-right: 1px solid var(--border);
}
.post-card-arc .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}

.post-card-content {
    width: 60%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}
.post-card-content h3 { font-size: 1.2rem; color: var(--text-main); margin-bottom: 1rem; flex-grow: 1; }

.meta-category {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    display: block;
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: 1rem;
    text-transform: uppercase;
}
.read-more-btn span { margin-left: 5px; transition: 0.3s; }
.post-card-arc:hover .read-more-btn span { transform: translateX(5px); }

/* Golden Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin: 5rem 0; flex-wrap: wrap; }
.pagination .page-numbers { 
    display: flex; align-items: center; justify-content: center; 
    min-width: 45px; height: 45px; padding: 0 8px;
    text-decoration: none; font-weight: 700; border: 1px solid var(--border);
    transition: 0.3s; background: var(--white);
}
.pagination .page-numbers.current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .page-numbers.dots { border: none; background: transparent; cursor: default; }
.pagination .page-numbers:hover:not(.current):not(.dots) { background: var(--secondary); color: var(--white); border-color: var(--secondary); }

/* Axis 6: FT-B Two-column Footer */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 6rem 0 3rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
}
.footer-logo {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    color: var(--primary) !important;
    margin-bottom: 1.5rem;
    flex-wrap: wrap !important;
}
.footer-logo span { color: var(--secondary); font-weight: 400; }

.footer-desc {
    color: var(--text-muted);
    max-width: 100%;
    overflow-wrap: break-word;
    font-size: 1rem;
}

.footer-nav h4 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}
.footer-nav ul { list-style: none; }
.footer-nav li { margin-bottom: 0.8rem; }
.footer-nav a { color: var(--text-main); transition: var(--transition); }
.footer-nav a:hover { color: var(--secondary); padding-left: 5px; }

.footer-bottom {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Axis 8: D-B Horizontal Accent Lines */
.accent-line {
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
}

@media (max-width: 1024px) {
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
    .stripe-inner, .stripe-inner.reverse { gap: 2rem; }
}

@media (max-width: 768px) {
    .site-header { padding: 0.5rem 0; }
    .header-inner { 
        flex-direction: row; 
        justify-content: space-between; 
        padding: 0.5rem 1rem;
        gap: 1rem;
    }
    
    .main-nav { display: none; }
    .nav-toggle { 
        display: flex; flex-direction: column; gap: 6px; cursor: pointer; z-index: 10001; 
        background: none; border: none; padding: 10px;
    }
    .nav-toggle span { width: 30px; height: 2px; background: var(--primary); transition: 0.3s; }
    
    body.menu-open .nav-toggle span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
    body.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
    body.menu-open .nav-toggle span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

    body.menu-open .main-nav { 
        display: flex; position: fixed; inset: 0; background: var(--bg-main); 
        z-index: 10000; align-items: center; justify-content: center;
    }
    body.menu-open .main-nav ul { flex-direction: column; text-align: center; gap: 2rem; }
    body.menu-open .main-nav a { font-size: 1.5rem; }

    .stripe-inner, .stripe-inner.reverse { flex-direction: column; text-align: center; }
    
    .posts-grid { grid-template-columns: 1fr; }
    .post-card-cb-wrapper { flex-direction: column; }
    .post-card-arc .thumb { width: 100%; height: clamp(180px, 25vw, 300px); border-right: none; border-bottom: 1px solid var(--border); position: relative; display: block; }
    .post-card-content { width: 100%; }

    .footer-grid { grid-template-columns: 1fr; gap: 3rem; text-align: center; }
}

.logo, .footer-logo { flex-wrap: wrap !important; }

/* GLOBAL FIXES FOR RULE 16, 21, AND Z-INDEX */
.site-main > section:first-child {
    padding-top: clamp(140px, 15vh, 180px) !important;
}
.hero-arc {
    height: auto !important;
    min-height: max(400px, 50vh) !important;
}
section, .hero-arc, .hero-split, .site-main > section {
    isolation: isolate;
}
.hero-content, .hero-text {
    position: relative;
    z-index: 1;
}
.post-card-arc {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}
.post-card-arc .thumb {
    display: block !important;
    height: clamp(180px, 25vw, 300px) !important;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.post-card-arc .thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
.post-card-content {
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
}
.post-card-content h3 {
    flex-grow: 1 !important;
}
.btn-read, .read-more-link {
    margin-top: auto !important;
}
.logo, .footer-logo {
    flex-wrap: wrap !important;
}
