/*
Theme Name: m-kit.by
Author: Theme Dev
Description: Theme for m-kit.by
Version: 1.0.0
*/

@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,300;0,400;0,700;1,400&family=Oswald:wght@400;600;700&display=swap');

:root {
    --primary: #e74c3c;
    --secondary: #2c3e50;
    --accent: #f1c40f;
    --bg-main: #1a1a2e;
    --white: #ffffff;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #e74c3c;
    
    --container-width: 1280px;
    --content-width: 800px;
    --transition: all 0.3s ease;
    --radius: 0px; /* V-B: Neobrutalism hard borders */

    --section-pad: clamp(5rem, 12vw, 10rem);
}

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

h1, h2, h3, h4, h5, h6, .logo, .btn-arc {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    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: 4rem; text-align: center; word-break: break-word; }
h3 { font-size: 1.5rem; 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 2.5rem;
}

/* Sections - Critical Fixes */
section {
    isolation: isolate;
    position: relative;
    overflow: hidden;
}

/* Axis 1: N-C Hamburger always */
.site-header {
    height: 100px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    transition: var(--transition);
}
.site-header.scrolled { height: 70px; background: var(--bg-main); border-bottom: 3px solid var(--border); } /* V-B Neobrutalism */

.header-inner {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    gap: clamp(1rem, 5vw, 4rem); /* Rule 1.4 */
}

.logo, .footer-logo {
    display: inline-flex !important;
    align-items: center;
    gap: 10px; /* Rule 1.9 */
    font-size: clamp(1.5rem, 4vw, 2.5rem) !important;
    color: var(--white) !important;
    text-transform: uppercase;
    min-width: 100px;
    min-height: 1em;
    flex-shrink: 0;
    flex-wrap: wrap !important;
}
.logo span { color: var(--primary); }

.nav-toggle { 
    display: flex; 
    flex-direction: column; 
    gap: 6px; 
    cursor: pointer; 
    z-index: 10001;
    background: transparent;
    border: none;
    flex-shrink: 0;
}
.nav-toggle span { width: 30px; height: 3px; background: var(--white); transition: 0.3s; }
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 { 
    display: block;
    position: fixed; 
    inset: 0; 
    width: 100%;
    height: 100vh;
    background: var(--secondary); 
    z-index: 10000; 
    align-items: center; 
    justify-content: center;
    transform: translateY(-100%);
    transition: transform 0.4s ease;
    visibility: hidden;
}
body.menu-open .main-nav {
    transform: translateY(0);
    visibility: visible;
    display: flex;
}
body.menu-open .main-nav ul { flex-direction: column; text-align: center; gap: 3rem; list-style: none; }
body.menu-open .main-nav a { font-size: 2.5rem; font-weight: 700; text-transform: uppercase; color: var(--white); font-family: 'Oswald', sans-serif;}
body.menu-open .main-nav a:hover { color: var(--primary); }

/* Fixed header padding protection */
.site-main > section:first-child {
    padding-top: max(100px, var(--section-pad));
}

/* Axis 2: H-A Full Bleed Overlay */
.hero-ha {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 0 2rem;
    overflow: hidden;
}
.hero-ha .hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}
.hero-ha .hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-ha .hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}
.hero-content { max-width: 900px; z-index: 1; }

/* Buttons V-B Neobrutalism */
.btn-arc {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--primary);
    color: var(--white);
    border: 3px solid var(--white);
    box-shadow: 6px 6px 0 var(--white);
    font-size: 1.2rem;
    text-transform: uppercase;
    transition: transform 0.1s, box-shadow 0.1s;
}
.btn-arc:hover { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--white); color: var(--white); }

/* Axis 3: F-F Number counters */
.counters-section { padding: var(--section-pad) 0; border-top: 4px solid var(--border); border-bottom: 4px solid var(--border); } /* D-E Accent borders */
.counters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4rem; text-align: center; }
.counter-item { display: flex; flex-direction: column; align-items: center; }
.counter-num { font-size: clamp(3rem, 8vw, 6rem); font-weight: 700; color: var(--primary); line-height: 1; font-family: 'Oswald', sans-serif;}
.counter-label { font-size: 1.2rem; text-transform: uppercase; letter-spacing: 2px; color: var(--text-main); margin-top: 1rem;}

/* Axis 5: U-E Number infographic */
.infographic-section { padding: var(--section-pad) 0; background: var(--secondary); border-left: 15px solid var(--accent); } /* D-E Accent stripes */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.info-text h2 { text-align: left; }
.info-numbers { display: flex; flex-direction: column; gap: 2rem; }
.info-number-block { border: 3px solid var(--white); padding: 2rem; background: var(--bg-main); box-shadow: 8px 8px 0 var(--primary); }
.info-number-block h3 { font-size: 3rem; color: var(--accent); margin: 0; }
.info-number-block p { font-size: 1.1rem; color: var(--text-muted); }

/* Axis 4: C-C Overlay cards */
.posts-section { padding: var(--section-pad) 0; border-top: 15px solid var(--primary); } /* D-E Accent stripes */
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem; }

/* Robust flexbox for .post-card-arc */
.post-card-arc { 
    display: flex; flex-direction: column; height: 100%;
    position: relative;
    overflow: hidden;
    min-height: 350px;
    border: 3px solid var(--border); /* V-B Neobrutalism */
    box-shadow: 8px 8px 0 var(--border);
    transition: var(--transition);
}
.post-card-arc:hover { transform: translate(-4px, -4px); box-shadow: 12px 12px 0 var(--border); }
.post-card-arc .thumb { position: absolute; inset: 0; z-index: 0; }
.post-card-arc .thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.post-card-arc .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.1) 100%);
    z-index: 1;
}
.post-card-content { 
    position: relative; z-index: 2; 
    padding: 2rem; 
    display: flex; flex-direction: column; justify-content: flex-end; flex-grow: 1;
}
.post-card-content h3 { font-size: 1.6rem; color: var(--white); text-shadow: 2px 2px 4px rgba(0,0,0,0.8); margin-bottom: 1rem; }
.post-card-content h3 a { color: var(--white); }
.post-card-content p { color: var(--white); font-size: 0.95rem; margin-bottom: 1.5rem; text-shadow: 1px 1px 3px rgba(0,0,0,0.8); display: none; }
.meta-cat { font-size: 0.85rem; font-weight: 700; color: var(--accent); text-transform: uppercase; margin-bottom: 0.5rem; text-shadow: 1px 1px 2px rgba(0,0,0,0.8); }

.card-btn {
    align-self: flex-start;
    padding: 0.5rem 1.5rem;
    background: var(--primary);
    color: var(--white);
    border: 2px solid var(--white);
    text-transform: uppercase;
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
}
.card-btn:hover { background: var(--white); color: var(--primary); border-color: var(--primary); }

/* Rule 8: Golden Standard 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: 3px solid var(--border);
    transition: 0.3s;
    background: var(--bg-main);
    color: var(--white);
}
.pagination .page-numbers.current { background: var(--primary); color: var(--white); border-color: var(--primary); }
.pagination .page-numbers.dots { border: none; background: transparent; cursor: default; }
.pagination .page-numbers:hover:not(.current):not(.dots) { background: var(--white); color: var(--primary); }

/* Axis 6: FT-A Minimal Footer */
.site-footer { background: var(--secondary); color: var(--white); padding: 4rem 0; border-top: 5px solid var(--accent); }
.footer-minimal { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2rem; }
.footer-logo { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 0; color: var(--white); }
.footer-logo span { color: var(--primary); }
.footer-copy { font-size: 1rem; color: var(--text-muted); max-width: 100%; overflow-wrap: break-word; }

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

@media (max-width: 768px) {
    .site-header { height: 80px; }
    .counters-grid { grid-template-columns: 1fr; }
    .posts-grid { grid-template-columns: 1fr; }
    .infographic-section { border-left: 8px solid var(--accent); }
    .posts-section { border-top: 8px solid var(--primary); }
}

/* Standard Content Protocol */
.post-content h1, .post-content h2, .post-content h3, .post-content h4 { margin-top: 3rem; margin-bottom: 1.5rem; color: var(--accent); }
.post-content p { margin-bottom: 1.5rem; }
.post-content ul, .post-content ol { margin-bottom: 1.5rem; padding-left: 2rem; }
.post-content li { margin-bottom: 0.5rem; }
.post-content table { width: 100%; border-collapse: collapse; margin-bottom: 2rem; border: 2px solid var(--border); }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 1rem; text-align: left; }
.post-content th { background: var(--secondary); color: var(--white); font-family: 'Oswald', sans-serif; text-transform: uppercase; }

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