/*
Theme Name: StroyMag Portal
Author: Senior Frontend Designer
Description: Концепция "Technical Catalog": Структура товарного каталога, четкие индексы и прикладная польза.
Version: 1.0.0
Text Domain: stroymag
*/

:root {
    /* Colors - Technical & High Contrast */
    --bg: #ffffff;
    --surface: #f3f4f6;
    --surface-dark: #111827;
    --primary: #dc2626; /* Signal Red */
    --primary-dim: rgba(220, 38, 38, 0.05);
    --accent: #2563eb; /* Info Blue */
    --text: #111827;
    --text-muted: #4b5563;
    --border: #e5e7eb;
    
    /* Spacing */
    --gap: 2rem;
    --header-height: 100px;
    --container-width: 1400px;
    
    /* Fonts */
    --font-display: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Space 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.5; 
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: 0.3s; }
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; letter-spacing: -0.04em; text-transform: uppercase; }
.text-mono { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.2em; font-weight: 600; }

/* Header - Floating Index Nav */
.site-header {
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 1.75rem;
    font-weight: 950;
    color: var(--surface-dark);
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo::after {
    content: 'CATALOG';
    font-family: var(--font-mono);
    font-size: 0.6rem;
    background: var(--primary);
    color: #fff;
    padding: 2px 6px;
    letter-spacing: 1px;
}
.logo span { color: var(--primary); }

.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 { 
    padding: 2.5rem 2rem;
    display: block;
    font-weight: 700; 
    font-size: 0.8rem; 
    text-transform: uppercase; 
    color: var(--text-muted);
    transition: 0.2s;
}
.main-nav a:hover, .main-nav .current-menu-item a { 
    background: var(--surface);
    color: var(--primary);
}

.menu-toggle { display: none; background: var(--primary); color: #fff; border: none; padding: 1rem; 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; }

/* Hero - Option C: Centered Text / Background Blur */
.hero {
    padding: 12rem 0;
    background: var(--surface-dark);
    color: #fff;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.hero-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url('banner.png') center/cover no-repeat;
    opacity: 0.2;
    filter: grayscale(1) blur(5px);
}

.hero-content { position: relative; z-index: 2; max-width: 900px; margin: 0 auto; }
.hero h1 { font-size: clamp(3rem, 10vw, 6.5rem); margin-bottom: 2.5rem; }
.hero h1 span { color: var(--primary); }
.hero-desc { font-size: 1.4rem; color: rgba(255,255,255,0.7); max-width: 700px; margin: 0 auto 4rem; line-height: 1.4; }

/* Catalog Index Grid */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    margin-top: -4rem;
    position: relative;
    z-index: 10;
    box-shadow: 0 30px 60px rgba(0,0,0,0.1);
}

.catalog-card {
    background: #fff;
    padding: 4rem 2.5rem;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
}
.catalog-card:hover { background: var(--surface); transform: translateY(-5px); }
.catalog-num { font-family: var(--font-mono); font-size: 0.75rem; color: var(--primary); margin-bottom: 2rem; display: block; }
.catalog-card h3 { font-size: 1.25rem; margin-bottom: 1.5rem; color: var(--surface-dark); }
.catalog-card p { font-size: 0.95rem; color: var(--text-muted); line-height: 1.5; }

/* Expert Instruction Section */
.expert-section { padding: 10rem 0; }
.instruction-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #fff;
    border: 1px solid var(--border);
}
.instruction-image {
    background: url('banner.png') center/cover;
    min-height: 500px;
    filter: grayscale(1) contrast(1.2);
}
.instruction-content { padding: 6rem; }
.instruction-content h2 { font-size: 3rem; margin-bottom: 2.5rem; color: var(--surface-dark); }
.instruction-list { list-style: none; }
.instruction-item { 
    padding: 1.5rem 0; 
    border-top: 1px solid var(--border); 
    display: flex; 
    gap: 2rem;
    align-items: center;
}
.instruction-item:last-child { border-bottom: 1px solid var(--border); }
.instruction-icon { font-family: var(--font-mono); color: var(--primary); font-weight: 900; }

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

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

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

.card-img-wrap {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    position: relative;
    background: var(--surface);
    margin-bottom: 2.5rem;
    border: 1px solid var(--border);
}

.card-img { width: 100%; height: 100%; object-fit: cover; transition: 0.8s; opacity: 0.9; }
.post-card:hover .card-img { transform: scale(1.05); opacity: 1; }

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

.btn-mag {
    background: var(--text);
    color: #fff;
    padding: 1.2rem 2.5rem;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.8rem;
    width: fit-content;
}
.btn-mag:hover { background: var(--primary); }

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

/* 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: 1px solid var(--border);
    font-weight: 900;
    font-family: var(--font-mono);
}
.pagination-item.is-active span { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Mobile */
@media (max-width: 1024px) {
    .main-nav a { padding: 2.5rem 1.2rem; }
    .catalog-grid { grid-template-columns: repeat(2, 1fr); margin-top: 0; padding-top: 4rem; }
    .instruction-box { 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; border-bottom: 1px solid var(--border);
    }
    .main-nav ul { flex-direction: column; }
    .main-nav li { border: none; border-bottom: 1px solid var(--border); }
    .main-nav a { padding: 2rem; text-align: center; }
    .menu-toggle { display: block; }
}

@media (max-width: 640px) {
    .catalog-grid { grid-template-columns: 1fr; }
    .post-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 3rem; }
    .instruction-content { padding: 3rem 1.5rem; }
}
