/*
Theme Name: CapStroy Guide Portal
Author: Senior Frontend Designer
Description: Концепция "Solid Foundations": Основательность, качество и экспертный надзор в строительстве.
Version: 1.0.0
Text Domain: capstroy
*/

:root {
    /* Colors - Heavy Construction & Precision */
    --bg: #ffffff;
    --surface: #f8f9fa;
    --surface-dark: #1e293b;
    --primary: #fbbf24; /* Construction Gold */
    --primary-dim: rgba(251, 191, 36, 0.1);
    --accent: #ef4444; /* Alert/Safety Red */
    --text: #0f172a;
    --text-muted: #475569;
    --border: #e2e8f0;
    
    /* Spacing */
    --gap: 2rem;
    --header-height: 90px;
    --container-width: 1300px;
    
    /* Fonts */
    --font-display: 'Syne', 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;
    overflow-x: hidden;
}
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-family: var(--font-display); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.text-mono { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.15em; font-weight: 600; }

/* Header - Bold Industrial */
.site-header {
    height: var(--header-height);
    background: #fff;
    border-bottom: 4px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 4rem; /* MEMO check */
}

.logo {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--text);
    flex-shrink: 0; /* MEMO check */
    text-transform: uppercase;
}
.logo span { color: var(--primary); }

.main-nav ul { 
    display: flex; 
    gap: 3rem; /* MEMO check */
}
.main-nav a { font-weight: 700; font-size: 0.9rem; color: var(--text-muted); text-transform: uppercase; }
.main-nav a:hover, .main-nav .current-menu-item a { color: var(--text); }

.menu-toggle { display: none; background: var(--primary); color: var(--text); border: none; padding: 0.8rem; cursor: pointer; }
.hamburger { width: 24px; height: 3px; background: var(--text); position: relative; display: block; }
.hamburger::before, .hamburger::after { content: ''; position: absolute; width: 24px; height: 3px; background: var(--text); left: 0; transition: 0.3s; }
.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }

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

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url('<?php echo get_template_directory_uri(); ?>/banner.png') center/cover no-repeat;
    opacity: 0.2;
    filter: grayscale(1);
}

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

.hero-floating-image {
    margin-top: 4rem;
    position: relative;
    z-index: 3;
}

.hero-banner-img {
    max-width: 1000px;
    width: 100%;
    height: auto;
    border: 10px solid #fff;
    box-shadow: 0 50px 100px -20px rgba(0,0,0,0.5);
    transform: translateY(0);
    transition: 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.hero-floating-image:hover .hero-banner-img {
    transform: translateY(-20px);
}

/* Quality Blocks */
.quality-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: -5rem;
    position: relative;
    z-index: 10;
}

.quality-card {
    background: #fff;
    padding: 3.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
    transition: 0.3s;
}

.quality-card:hover { border-color: var(--primary); transform: translateY(-10px); }
.quality-icon { font-size: 3rem; margin-bottom: 2rem; display: block; }
.quality-card h3 { font-size: 1.5rem; margin-bottom: 1rem; }
.quality-card p { font-size: 1rem; color: var(--text-muted); }

/* Material Index */
.material-index {
    padding: 10rem 0;
    background: #fff;
}

.index-header { margin-bottom: 6rem; border-left: 8px solid var(--primary); padding-left: 3rem; }
.index-header h2 { font-size: 3.5rem; }

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

.index-item {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 4px;
    border-bottom: 3px solid transparent;
    transition: 0.3s;
}

.index-item:hover {
    background: #fff;
    border-bottom-color: var(--primary);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.index-item h4 { font-size: 1.1rem; margin-bottom: 0.75rem; }
.index-item p { font-size: 0.85rem; color: var(--text-muted); }

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

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

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

.card-img-wrap {
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    position: relative;
    background: var(--surface-dark);
}

.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 { padding: 2.5rem 0; flex-grow: 1; display: flex; flex-direction: column; }
.card-meta { font-family: var(--font-mono); font-size: 0.7rem; color: var(--primary); font-weight: 700; margin-bottom: 1.5rem; background: var(--surface-dark); padding: 0.4rem 0.8rem; width: fit-content; }
.card-title { font-size: 1.6rem; margin-bottom: 1.5rem; line-height: 1.2; font-weight: 800; }
.card-excerpt { font-size: 1rem; color: var(--text-muted); margin-bottom: 2.5rem; flex-grow: 1; }

.btn-cap {
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--text);
    padding: 1rem 2rem;
    border: 2px solid var(--text);
    width: fit-content;
    transition: 0.3s;
}
.btn-cap:hover { background: var(--primary); border-color: var(--primary); }

/* Pagination */
.pagination-container { padding-bottom: 8rem; }
.pagination-list { display: flex; justify-content: center; gap: 0.5rem; }
.pagination-item a, .pagination-item span {
    width: 55px; height: 55px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--border);
    font-weight: 800;
}
.pagination-item.is-active span { background: var(--primary); border-color: var(--primary); color: var(--text); }

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

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

.footer-col h4 { font-family: var(--font-mono); font-size: 0.8rem; color: var(--primary); margin-bottom: 2.5rem; text-transform: uppercase; }
.footer-contact-item { margin-bottom: 2.5rem; }
.footer-contact-item label { display: block; font-size: 0.7rem; color: rgba(255,255,255,0.4); text-transform: uppercase; margin-bottom: 0.5rem; }
.footer-contact-item span { font-size: 1.2rem; font-weight: 700; }

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

/* Mobile */
@media (max-width: 1024px) {
    .quality-grid { grid-template-columns: 1fr; margin-top: 0; padding-top: 4rem; }
    .index-grid { grid-template-columns: repeat(2, 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: absolute; top: 100%; left: 0; width: 100%;
        background: #fff; padding: 2rem; border-bottom: 1px solid var(--border);
    }
    .main-nav.is-active a { color: var(--text); }
    .menu-toggle { display: block; }
}

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