/*
Theme Name: StroyCub Portal
Author: Senior Frontend Designer
Description: Концепция "Geometric Precision": Геометрия качества, точность расчетов и надежность конструкций.
Version: 1.0.0
Text Domain: stroycub
*/

:root {
    /* Colors - Industrial & Sharp */
    --bg: #ffffff;
    --surface: #f1f5f9;
    --surface-dark: #0f172a;
    --primary: #facc15; /* Construction Yellow */
    --primary-dim: rgba(250, 204, 21, 0.1);
    --accent: #3b82f6; /* Blueprint Blue */
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    
    /* Spacing */
    --gap: 2rem;
    --header-height: 90px;
    --container-width: 1400px;
    
    /* Fonts */
    --font-display: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    background-color: var(--bg); 
    color: var(--text); 
    font-family: var(--font-body); 
    line-height: 1.6; 
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
ul { list-style: none; }

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

/* Typography */
h1, h2, h3 { font-weight: 900; line-height: 1.1; letter-spacing: -0.05em; text-transform: uppercase; }
.text-mono { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.15em; font-weight: 600; }

/* Header - Asymmetric Block Concept */
.site-header {
    height: auto;
    background: transparent;
    position: fixed;
    top: 0; left: 0; width: 100%;
    z-index: 1000;
    padding: 0;
    pointer-events: none;
}

.header-inner {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: stretch;
    pointer-events: auto;
}

.logo-block {
    background: var(--surface-dark);
    padding: 2.5rem 4rem;
    color: #fff;
    position: relative;
    box-shadow: 15px 15px 0 var(--primary);
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
}
.logo-block:hover { box-shadow: 20px 20px 0 var(--accent); transform: translate(-5px, -5px); }

.logo {
    font-size: 1.4rem;
    font-weight: 950;
    color: #fff;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo::before {
    content: '';
    width: 20px;
    height: 20px;
    background: var(--primary);
    transform: rotate(45deg);
}
.logo span { color: var(--primary); }

.nav-block {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 4px solid var(--surface-dark);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 4rem;
    margin-bottom: 15px; /* Alignment gap */
}

.main-nav ul { 
    display: flex; 
    gap: 0; 
}

.main-nav li {
    border-left: 1px solid var(--border);
}
.main-nav li:last-child { border-right: 1px solid var(--border); }

.main-nav a { 
    font-weight: 800; 
    font-size: 0.75rem; 
    color: var(--text-muted); 
    text-transform: uppercase; 
    padding: 2.5rem 2rem;
    display: block;
    position: relative;
    transition: 0.3s;
}

.main-nav a:hover, 
.main-nav .current-menu-item a { 
    color: var(--surface-dark);
    background: var(--surface);
}

.main-nav a::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 0;
    background: var(--primary);
    transition: 0.2s;
}
.main-nav a:hover::after, 
.main-nav .current-menu-item a::after { height: 6px; }

.menu-toggle { 
    display: none; 
    background: var(--surface-dark); 
    color: #fff; 
    border: none; 
    padding: 1.5rem; 
    cursor: pointer;
}

.hamburger { width: 24px; height: 2px; background: #fff; position: relative; display: block; }
.hamburger::before, .hamburger::after { content: ''; position: absolute; width: 100%; height: 2px; background: #fff; left: 0; transition: 0.3s; }
.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }

/* Mobile Adjustments for Asymmetric Header */
@media (max-width: 1024px) {
    .logo-block { padding: 1.5rem 2rem; box-shadow: 10px 10px 0 var(--primary); }
    .nav-block { padding: 0 2rem; }
    .main-nav a { padding: 1.5rem 1rem; }
}

@media (max-width: 768px) {
    .nav-block { display: none; }
    .menu-toggle { display: block; position: absolute; right: 0; top: 0; height: 100%; }
    .header-inner { display: block; position: relative; }
    
    .main-nav.is-active {
        display: block; 
        position: fixed; 
        top: 0; left: 0; width: 100%; height: 100vh;
        background: var(--surface-dark); 
        padding: 10rem 2rem; 
        z-index: -1;
    }
    .main-nav.is-active ul { flex-direction: column; gap: 1rem; text-align: center; }
    .main-nav.is-active li { border: none; }
    .main-nav.is-active a { color: #fff; font-size: 1.5rem; padding: 1.5rem; }
}

/* Hero - Option B: Image Left / Text Right (Randomized layout) */
.hero {
    padding: 10rem 0;
    background: var(--surface);
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 6rem;
    align-items: center;
}

.hero-image-wrap {
    position: relative;
    padding: 2rem;
}

.hero-banner-img {
    width: 100%;
    height: auto;
    filter: grayscale(0.5) brightness(0.9);
    border: 1px solid var(--surface-dark);
    box-shadow: 40px 40px 0px var(--primary);
    transition: 0.5s ease;
}
.hero-image-wrap:hover .hero-banner-img { 
    filter: grayscale(0);
    transform: translate(-10px, -10px);
    box-shadow: 50px 50px 0px var(--accent);
}

.hero-content h1 { font-size: clamp(3rem, 7vw, 5rem); margin-bottom: 2rem; color: var(--surface-dark); }
.hero-content h1 span { color: var(--primary); }
.hero-desc { 
    font-size: 1.3rem; 
    color: var(--text-muted); 
    line-height: 1.5; 
    margin-bottom: 4rem; 
    border-left: 6px solid var(--surface-dark);
    padding-left: 2rem;
}

/* Cube Matrix Block */
.cube-matrix {
    padding: 8rem 0;
}

.matrix-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem;
}

.matrix-card {
    background: #fff;
    padding: 3.5rem 2.5rem;
    border: 1px solid var(--border);
    position: relative;
    transition: 0.4s;
}

.matrix-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: var(--border);
    transition: 0.3s;
}

.matrix-card:hover { border-color: var(--surface-dark); transform: translateY(-10px); }
.matrix-card:hover::before { background: var(--primary); }

.matrix-num { font-family: var(--font-mono); font-size: 0.8rem; color: var(--primary); margin-bottom: 2rem; display: block; font-weight: 700; }
.matrix-card h3 { font-size: 1.25rem; margin-bottom: 1rem; }
.matrix-card p { font-size: 0.95rem; color: var(--text-muted); }

/* Technical Banner Section */
.tech-banner {
    background: var(--surface-dark);
    color: #fff;
    padding: 10rem 0;
    text-align: center;
}

.tech-banner h2 { font-size: 3.5rem; margin-bottom: 2rem; color: var(--primary); }
.tech-banner p { font-size: 1.2rem; color: rgba(255,255,255,0.6); max-width: 800px; margin: 0 auto 4rem; }

.tech-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4rem;
    text-align: left;
}

.tech-item {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
}

.tech-item h4 { font-family: var(--font-mono); color: var(--primary); margin-bottom: 1rem; }

/* Post Grid */
.section-header {
    padding: 8rem 0 3rem;
    border-bottom: 4px solid var(--surface-dark);
    margin-bottom: 5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3.5rem;
    padding-bottom: 10rem;
}

.post-card {
    display: flex;
    flex-direction: column;
}

.card-img-wrap {
    width: 100%;
    aspect-ratio: 1/1; /* Geometric square */
    overflow: hidden;
    position: relative;
    background: var(--surface-dark);
    margin-bottom: 2.5rem;
}

.card-img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    filter: grayscale(1);
}

.post-card:hover .card-img { transform: scale(1.05); filter: grayscale(0); }

.card-body { flex-grow: 1; display: flex; flex-direction: column; }
.card-category { font-family: var(--font-mono); font-size: 0.7rem; color: var(--accent); font-weight: 700; margin-bottom: 1rem; display: block; }
.card-title { font-size: 1.75rem; margin-bottom: 1.5rem; line-height: 1.1; }
.card-excerpt { font-size: 1rem; color: var(--text-muted); margin-bottom: 3rem; flex-grow: 1; }

.btn-cub {
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--surface-dark);
    padding: 1.2rem 2.5rem;
    border: 3px solid var(--surface-dark);
    width: fit-content;
    transition: 0.3s;
    letter-spacing: 1px;
}

.btn-cub:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* Pagination */
.pagination-container { padding-bottom: 10rem; }
.pagination-list { display: flex; justify-content: center; gap: 0.5rem; }
.pagination-item a, .pagination-item span {
    width: 60px; height: 60px;
    display: flex; align-items: center; justify-content: center;
    border: 3px solid var(--border);
    font-family: var(--font-mono);
    font-weight: 800;
}
.pagination-item.is-active span { background: var(--surface-dark); color: #fff; border-color: var(--surface-dark); }

/* Footer */
.site-footer {
    padding: 10rem 0 5rem;
    background: var(--surface-dark);
    color: #fff;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 6rem;
    margin-bottom: 8rem;
}

.footer-col h4 { font-family: var(--font-mono); font-size: 0.8rem; color: var(--primary); margin-bottom: 3rem; text-transform: uppercase; }

.footer-contact-item { margin-bottom: 3rem; }
.footer-contact-item label { display: block; font-size: 0.75rem; color: rgba(255,255,255,0.4); text-transform: uppercase; margin-bottom: 0.75rem; }
.footer-contact-item span { font-size: 1.3rem; font-weight: 700; }

.footer-bottom {
    padding-top: 4rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.4);
}

/* Mobile */
@media (max-width: 1024px) {
    .hero-grid { grid-template-columns: 1fr; gap: 4rem; }
    .hero-image-wrap { order: 2; padding: 0; }
    .hero-content { order: 1; }
    .matrix-grid { grid-template-columns: repeat(2, 1fr); }
    .tech-grid { grid-template-columns: 1fr; }
    .post-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .main-nav { display: none; }
    .main-nav.is-active {
        display: block; position: fixed; top: var(--header-height); left: 0; width: 100%;
        background: #fff; padding: 3rem; border-bottom: 1px solid var(--surface-dark);
    }
    .main-nav ul { flex-direction: column; gap: 2rem; }
    .main-nav a { color: var(--text); }
    .menu-toggle { display: block; }
}

@media (max-width: 640px) {
    .matrix-grid { grid-template-columns: 1fr; }
    .post-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2.8rem; }
}
