/*
Theme Name: yessen.kz
Author: Developer
Description: Custom theme for yessen.kz
Version: 1.0.0
*/

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=Rubik:wght@400;500;700;800&display=swap');

:root {
    --primary: #0d47a1;
    --secondary: #ff1744;
    --accent: #00e676;
    --bg-main: #f0f4f8;
    --white: #ffffff;
    --text-main: #1e293b;
    --text-muted: #475569;
    
    --container-width: 1280px;
    --transition: all 0.3s ease;
    --radius: 12px;
    --section-pad: clamp(4rem, 10vw, 8rem);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05); /* V-A */
}

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

html, body {
    overflow-x: hidden;
    position: relative;
    width: 100%;
    max-width: 100%;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: 'IBM Plex Sans', sans-serif;
    line-height: 1.6;
}

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

h1 { font-size: clamp(2rem, 6vw, 4.5rem); margin-bottom: 1.5rem; }
h2 { font-size: clamp(1.8rem, 5vw, 3.5rem); margin-bottom: 3rem; }
h3 { font-size: 1.4rem; margin-bottom: 1rem; }

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

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

/* Sections - Isolation required by rules */
section {
    isolation: isolate;
    position: relative;
    overflow: hidden;
    padding: var(--section-pad) 0;
}

/* Buttons */
.btn-arc {
    display: inline-block;
    padding: 1.2rem 3rem;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius);
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 1px;
    box-shadow: var(--shadow-soft);
    border-bottom: 4px solid var(--accent); /* D-E Accent stripe */
}
.btn-arc:hover {
    background: var(--secondary);
    transform: translateY(-3px);
}

/* Axis 1: N-C Hamburger Always */
.site-header {
    height: 90px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    background: var(--white);
    box-shadow: var(--shadow-soft);
}
.header-inner {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    gap: clamp(1rem, 5vw, 4rem);
}
.header-spacer { width: 30px; display: none; } /* Balancer for centered logo if needed, but flex mostly handles it */

.logo {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    font-size: clamp(1.5rem, 4vw, 2rem) !important;
    color: var(--primary) !important;
    flex-shrink: 0;
    flex-wrap: wrap !important;
    min-width: 100px;
    min-height: 1em;
}
.logo span { color: var(--secondary); }

.nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 10001;
    background: transparent;
    border: none;
    padding: 5px;
    flex-shrink: 0;
}
.nav-toggle span {
    width: 30px;
    height: 3px;
    background: var(--primary);
    transition: var(--transition);
}

.main-nav {
    display: block;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100vh;
    background: var(--white);
    z-index: 10000;
    transform: translateY(-100%);
    transition: transform 0.4s ease;
    visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
body.menu-open .main-nav {
    transform: translateY(0);
    visibility: visible;
}
body.menu-open .nav-toggle span:nth-child(1) { transform: rotate(45deg) translate(6px, 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(6px, -6px); }

.main-nav ul { list-style: none; text-align: center; display: flex; flex-direction: column; gap: 3rem; }
.main-nav a { font-size: 2rem; font-weight: 700; font-family: 'Rubik', sans-serif; color: var(--text-main); text-transform: uppercase; overflow-wrap: break-word; white-space: normal; display: block; }
.main-nav a:hover { color: var(--primary); }

/* Padding for fixed header */
.site-main > section:first-child {
    padding-top: 150px;
}

/* Axis 2: H-B Split-screen Hero */
.hero-split {
    min-height: 80vh;
    display: flex;
    align-items: center;
    background: var(--white);
}
.hero-split .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}
.hero-content p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}
.hero-image img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    border-left: 10px solid var(--accent); /* D-E */
}

/* Axis 3: F-B Cards grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 3rem;
}
.feature-card {
    background: var(--white);
    padding: 3rem 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    text-align: center;
    border-top: 5px solid var(--accent); /* D-E */
    transition: var(--transition);
}
.feature-card:hover { transform: translateY(-5px); }
.feature-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--secondary);
}

/* Axis 5: U-C Horizontal Scroll Tape */
.scroll-tape-section {
    background: var(--primary);
    color: var(--white);
}
.scroll-tape-section h2 { color: var(--white); }
.scroll-tape {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding: 2rem 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--primary);
}
.scroll-tape::-webkit-scrollbar { height: 8px; }
.scroll-tape::-webkit-scrollbar-track { background: rgba(255,255,255,0.1); border-radius: 4px; }
.scroll-tape::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

.tape-item {
    flex: 0 0 320px;
    scroll-snap-align: start;
    background: rgba(255,255,255,0.1);
    padding: 2rem;
    border-radius: var(--radius);
    border-left: 5px solid var(--accent); /* D-E */
}
.tape-item h4 { font-size: 1.3rem; margin-bottom: 1rem; color: var(--white); }

/* Axis 4: C-A Vertical Cards & Rule 21 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}
.post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border-top: 5px solid var(--accent); /* D-E */
    transition: var(--transition);
}
.post-card:hover { transform: translateY(-10px); }
.post-card .thumb {
    height: clamp(180px, 25vw, 300px);
    position: relative;
    flex-shrink: 0;
}
.post-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}
.post-card .meta-tag {
    position: absolute;
    top: 15px; left: 15px;
    background: var(--primary);
    color: var(--white);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}
.post-card-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.post-card-content h3 {
    font-size: 1.3rem;
    color: var(--text-main);
    margin-bottom: 1rem;
    flex-grow: 1;
}
.post-card-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}
.post-card-content .btn-link {
    margin-top: auto;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Rule 8: 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(--text-muted);
    transition: 0.3s;
    border-radius: var(--radius);
}
.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-A Minimalist Footer */
.site-footer {
    background: var(--white);
    padding: 4rem 0;
    text-align: center;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.03);
}
.footer-logo {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    color: var(--primary);
    font-family: 'Rubik', sans-serif;
    font-weight: 700;
    margin-bottom: 1rem;
    overflow-wrap: anywhere;
    flex-wrap: wrap !important;
    justify-content: center;
}
.footer-logo span { color: var(--secondary); }
.footer-desc {
    color: var(--text-muted);
    max-width: 100%;
    overflow-wrap: break-word;
    font-size: 1rem;
}

@media (max-width: 1024px) {
    .hero-split .container { grid-template-columns: 1fr; text-align: center; }
    .hero-image img { border-left: none; border-top: 10px solid var(--accent); }
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .site-header { height: 80px; }
    .header-inner { gap: 1rem; }
    .posts-grid { grid-template-columns: 1fr; }
    .site-main > section:first-child { padding-top: 100px; }
}

/* Base styles for post content */
.post-content h2, .post-content h3 { color: var(--primary); margin-top: 3rem; }
.post-content ul, .post-content ol { padding-left: 2rem; margin-bottom: 1.5rem; }
.post-content table { width: 100%; border-collapse: collapse; margin-bottom: 2rem; }
.post-content th, .post-content td { border: 1px solid var(--text-muted); padding: 1rem; }
.post-content th { background: var(--bg-main); font-weight: 700; }

/* 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;
}
