/*
Theme Name: ibsolutions.kz
Author: Developer
Description: Theme for ibsolutions.kz
Version: 1.0.0
*/

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400&family=Inter:wght@400;600;800;900&display=swap');

:root {
    --primary: #004d40;
    --secondary: #e65100;
    --accent: #7c4dff;
    --bg-main: #f1f8f6;
    --white: #ffffff;
    --text-main: #1f2937;
    --text-muted: #4b5563;
    --border: rgba(0, 77, 64, 0.1);
    
    --container-width: 1280px;
    --content-width: 900px;
    --transition: all 0.3s ease;
    
    --section-pad: clamp(4rem, 10vw, 8rem);
}

* { 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: 'DM Sans', sans-serif;
    line-height: 1.6;
}

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

h1 { font-size: clamp(1.8rem, 8vw, 5rem); margin-bottom: 2rem; word-break: break-word; }
h2 { font-size: clamp(1.6rem, 5vw, 3rem); margin-bottom: 3rem; text-align: center; word-break: break-word; }
h3 { font-size: 1.5rem; 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 1.5rem;
}

/* Base Fixes */
section { isolation: isolate; overflow: hidden; position: relative; }
.site-main > section:first-child { padding-top: 100px; }

/* Header N-E (Minimal top-bar) */
.site-header {
    height: 50px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: clamp(1rem, 5vw, 4rem);
}
.logo {
    display: inline-flex !important;
    flex-wrap: wrap !important;
    align-items: center;
    gap: 10px;
    font-size: clamp(0.75rem, 4vw, 1.2rem) !important;
    color: var(--primary) !important;
    text-transform: uppercase;
    flex-shrink: 0;
    min-width: 100px;
    min-height: 1em;
    white-space: nowrap;
}
.logo span { color: var(--secondary); }

.main-nav ul { display: flex; list-style: none; gap: 3.5rem; }
.main-nav a { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; color: var(--text-main); }
.main-nav a:hover { color: var(--secondary); }

.nav-toggle { display: none; flex-shrink: 0; z-index: 2100; cursor: pointer; border: none; background: transparent; flex-direction: column; gap: 4px; padding: 5px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--primary); transition: var(--transition); }

/* Hero H-C (Type-only) */
.hero-arc {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border);
}
.hero-content { max-width: 900px; margin: 0 auto; z-index: 1; position: relative; }
.hero-content h1 { color: var(--primary); }

.btn-arc {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--secondary);
    color: var(--white);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    border: none;
    cursor: pointer;
}
.btn-arc:hover { background: var(--primary); color: var(--white); }

/* Features F-A (Horizontal stripes) */
.features-section { padding: 0; }
.feature-stripe {
    padding: clamp(3rem, 6vw, 5rem) 0;
    border-bottom: 1px solid var(--border);
}
.feature-stripe:nth-child(even) { background: var(--white); }
.feature-stripe:nth-child(odd) { background: var(--bg-main); }
.feature-inner {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    align-items: center;
}
.feature-title h3 { font-size: clamp(1.5rem, 3vw, 2.5rem); color: var(--primary); margin: 0; }
.feature-desc p { font-size: 1.15rem; color: var(--text-muted); }

/* Unique U-E (Number infographic) */
.stats-section { padding: var(--section-pad) 0; background: var(--primary); color: var(--white); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 3rem; text-align: center; }
.stat-item .stat-num { font-size: clamp(3rem, 8vw, 6rem); font-weight: 900; color: var(--secondary); font-family: 'Inter', sans-serif; line-height: 1; margin-bottom: 1rem; }
.stat-item .stat-label { font-size: 1.2rem; text-transform: uppercase; font-weight: 600; }

/* Posts C-D text-heavy + image (Rule 21) */
.posts-section { padding: var(--section-pad) 0; background: var(--white); }
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.post-card-arc {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--border);
    background: var(--bg-main);
    transition: var(--transition);
}
.post-card-arc:hover { border-color: var(--secondary); }
.post-card-arc .thumb { height: clamp(180px, 25vw, 300px); flex-shrink: 0; position: relative; }
.post-card-arc .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card-content { padding: 2rem; display: flex; flex-direction: column; flex-grow: 1; }
.post-card-content .meta { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 1rem; font-weight: 600; }
.post-card-content h3 { font-size: 1.3rem; margin-bottom: 1rem; flex-grow: 1; }
.post-card-content .btn-link { color: var(--secondary); font-weight: 700; text-transform: uppercase; font-size: 0.9rem; align-self: flex-start; }

/* 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; color: var(--text-main);
}
.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); }

/* Single Post */
.post-content h2, .post-content h3 { margin-top: 4rem; color: var(--primary); }
.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(--border); padding: 1rem; }
.post-content th { background: var(--bg-main); text-align: left; }

/* Footer FT-D (CTA footer) */
.site-footer { background: var(--primary); color: var(--bg-main); }
.footer-cta { text-align: center; padding: 6rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-cta h2 { color: var(--white); margin-bottom: 1.5rem; }
.footer-nav-area { padding: 4rem 0; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: clamp(2rem, 5vw, 8rem); }
.footer-logo {
    display: inline-flex !important;
    flex-wrap: wrap !important;
    align-items: center;
    gap: 10px;
    font-size: clamp(1.2rem, 7vw, 2rem) !important;
    color: var(--white) !important;
    overflow-wrap: anywhere;
    margin-bottom: 1.5rem;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
}
.footer-logo span { color: var(--secondary); }
.footer-desc { color: rgba(255,255,255,0.7); max-width: 100%; overflow-wrap: break-word; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 1rem; }
.footer-col a { color: rgba(255,255,255,0.7); }
.footer-col a:hover { color: var(--secondary); }
.footer-col h4 { color: var(--white); margin-bottom: 1.5rem; text-transform: uppercase; }
.footer-bottom { text-align: center; padding: 2rem 0; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.85rem; color: rgba(255,255,255,0.5); }

/* V-C Thin lines & D-B Horizontal accent lines */
.accent-line { width: 100%; height: 1px; background: var(--secondary); }
.separator { height: 1px; background: var(--border); width: 100%; margin: 3rem 0; }

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

@media (max-width: 768px) {
    .site-main > section:first-child { padding-top: 50px; }
    .header-inner { padding: 0.5rem 1rem; }
    .nav-toggle { display: flex; }
    .main-nav { 
        display: block; 
        position: fixed; 
        top: 0; left: 0; 
        width: 100%; height: 100vh;
        background: var(--white); 
        z-index: 2000;
        transform: translateY(-100%);
        transition: transform 0.4s ease;
        visibility: hidden;
        padding: 5rem 2rem;
    }
    body.menu-open .main-nav { 
        transform: translateY(0); 
        visibility: visible; 
    }
    body.menu-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    body.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
    body.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
    
    .main-nav ul { flex-direction: column; gap: 2rem; text-align: center; }
    .main-nav a { font-size: 1.5rem; display: block; white-space: normal; overflow-wrap: break-word; }

    .feature-inner { grid-template-columns: 1fr; gap: 1rem; }
    .posts-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
}

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