/*
Theme Name: bspk.by
Author: Theme Master
Description: Theme for bspk.by
Version: 1.0.0
*/

@import url('https://fonts.googleapis.com/css2?family=Bitter:wght@400;700;800&family=Nunito:wght@300;400;600;700&display=swap');

:root {
    --primary: #263238;
    --secondary: #ffab00;
    --accent: #d50000;
    --bg-main: #ffffff;
    --white: #ffffff;
    --text-main: #263238;
    --text-muted: #4f5b62;
    --border: #000000;
    
    --container-width: 1280px;
    --content-width: 800px;
    --transition: all 0.3s ease;
    --radius: 0px;

    --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: 'Nunito', sans-serif;
    line-height: 1.7;
}

h1, h2, h3, h4, h5, h6, .logo, .btn-arc {
    font-family: 'Bitter', serif;
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: break-word;
    word-break: break-word;
    color: var(--primary);
}

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 2rem;
}

/* Base section style with isolation */
section {
    position: relative;
    isolation: isolate;
    padding: var(--section-pad) 0;
    overflow: hidden;
}

/* Axis 1: N-A Classic Nav */
.site-header {
    height: 100px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: var(--bg-main);
    border-bottom: 3px solid var(--border);
    transition: var(--transition);
}
.site-header.scrolled { height: 70px; }

/* Fixed Header Padding Protection */
.site-main > section:first-child {
    padding-top: max(var(--section-pad), 120px);
}

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

.logo {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    font-size: clamp(1.5rem, 4vw, 2.2rem) !important;
    color: var(--primary) !important;
    min-width: 100px;
    min-height: 1em;
    flex-shrink: 0;
    flex-wrap: wrap !important;
}
.logo span { color: var(--accent); }

.main-nav { flex: 1; min-width: 0; overflow: hidden; display: flex; justify-content: flex-end; }
.main-nav ul { display: flex; list-style: none; gap: 3.5rem; }
.main-nav a { font-size: 1rem; font-weight: 700; text-transform: uppercase; color: var(--primary); }
.main-nav a:hover { color: var(--accent); }

.nav-toggle { display: none; }

/* Axis 7: V-B Neobrutalism */
.neobrutal-card {
    background: var(--white);
    border: 3px solid var(--border);
    box-shadow: 8px 8px 0 var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 0;
}
.neobrutal-card:hover {
    transform: translate(-4px, -4px);
    box-shadow: 12px 12px 0 var(--border);
}

.btn-arc {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--secondary);
    color: var(--primary);
    border: 3px solid var(--border);
    box-shadow: 4px 4px 0 var(--border);
    font-weight: 800;
    text-transform: uppercase;
}
.btn-arc:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--border);
    background: var(--accent);
    color: var(--white);
}

/* Axis 2: H-D Breakout Asymmetric Hero */
.hero-arc-section {
    padding-bottom: 0;
}
.hero-arc {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    align-items: center;
    gap: 4rem;
}
.hero-content {
    padding: 2rem 0 6rem;
    z-index: 2;
}
.hero-image-wrapper {
    position: relative;
    height: 100%;
    min-height: 500px;
    z-index: 1;
}
.hero-image-wrapper img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    max-width: none;
    object-fit: cover;
    transform: translate(-40%, -50%) rotate(3deg);
    border: 4px solid var(--border);
    box-shadow: 15px 15px 0 var(--border);
}

/* Axis 3: F-D Single text block features */
.manifesto-section {
    background: var(--primary);
    color: var(--white);
    text-align: center;
    border-top: 3px solid var(--border);
    border-bottom: 3px solid var(--border);
}
.manifesto-section h2 { color: var(--secondary); }
.manifesto-text {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    line-height: 1.8;
    max-width: 900px;
    margin: 0 auto;
    font-family: 'Bitter', serif;
}

/* Axis 5: U-B Method + Visual */
.methodology-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}
.method-content h3 {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
}
.method-content p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}
.method-visual img {
    border: 3px solid var(--border);
    box-shadow: -10px 10px 0 var(--secondary);
}

/* Axis 4: C-F Timeline Cards */
.timeline-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 40px;
}
.timeline-wrapper::before {
    content: '';
    position: absolute;
    top: 0; left: 10px; bottom: 0;
    width: 4px;
    background: var(--border);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.post-card-arc {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--white);
    border: 3px solid var(--border);
    box-shadow: 6px 6px 0 var(--border);
    position: relative;
}

/* timeline dot simulation */
.post-card-arc::before {
    content: '';
    position: absolute;
    top: 30px;
    left: -33px; /* point back to timeline if in first col */
    width: 15px;
    height: 15px;
    background: var(--accent);
    border: 3px solid var(--border);
    border-radius: 50%;
    z-index: 2;
    display: none;
}
.posts-grid article:nth-child(3n+1)::before {
    display: block; /* only show dot on first column */
}

.post-card-arc .thumb {
    height: clamp(180px, 25vw, 300px);
    border-bottom: 3px solid var(--border);
    display: block;
}
.post-card-arc .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}
.post-card-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.post-card-content h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    flex-grow: 1;
}

/* Pagination (Golden Standard) */
.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(--white);
    box-shadow: 3px 3px 0 var(--border);
}
.pagination .page-numbers.current { background: var(--primary); color: var(--white); box-shadow: none; transform: translate(3px, 3px); }
.pagination .page-numbers.dots { border: none; background: transparent; box-shadow: none; cursor: default; }
.pagination .page-numbers:hover:not(.current):not(.dots) { background: var(--secondary); }

/* Axis 6: FT-C Three-column Footer */
.site-footer {
    background: var(--primary);
    color: var(--white);
    padding: 6rem 0 3rem;
    border-top: 5px solid var(--border);
    position: relative;
    isolation: isolate;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(2rem, 5vw, 6rem);
}
.footer-logo {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    font-size: clamp(1.5rem, 5vw, 3rem);
    color: var(--white) !important;
    margin-bottom: 1.5rem;
    font-family: 'Bitter', serif;
    flex-wrap: wrap !important;
}
.footer-logo span { color: var(--secondary); }
.footer-desc { color: #cfd8dc; font-size: 1rem; max-width: 100%; overflow-wrap: break-word; }

.footer-col h4 {
    color: var(--accent);
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}
.footer-nav ul { list-style: none; }
.footer-nav li { margin-bottom: 1rem; }
.footer-nav a { color: var(--white); transition: color 0.2s; }
.footer-nav a:hover { color: var(--secondary); }

.footer-contact p { margin-bottom: 0.8rem; color: #cfd8dc; max-width: 100%; overflow-wrap: break-word; }
.footer-contact strong { color: var(--secondary); }

.footer-bottom {
    border-top: 2px solid rgba(255,255,255,0.1);
    margin-top: 4rem;
    padding-top: 2rem;
    text-align: center;
    color: #90a4ae;
    font-size: 0.9rem;
}

/* Axis 8: D-D Background SVG Patterns */
.bg-pattern {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23000000' fill-opacity='0.05' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
    z-index: -1;
    pointer-events: none;
}

/* Content Styles */
.post-content h2, .post-content h3 { margin-top: 4rem; color: var(--primary); }
.post-content p { margin-bottom: 1.5rem; }
.post-content ul, .post-content ol { margin-bottom: 1.5rem; padding-left: 2rem; }
.post-content table { width: 100%; border-collapse: collapse; margin-bottom: 2rem; border: 3px solid var(--border); }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 1rem; }
.post-content th { background: var(--secondary); color: var(--primary); font-family: 'Bitter', serif; }

@media (max-width: 1024px) {
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-arc { grid-template-columns: 1fr; }
    .hero-image-wrapper { height: 400px; order: -1; }
    .hero-image-wrapper img { transform: translate(-50%, -50%); width: 100%; }
    .methodology-grid { grid-template-columns: 1fr; }
    
    .timeline-wrapper { padding-left: 30px; }
    .post-card-arc::before { left: -38px; }
    .posts-grid article:nth-child(3n+1)::before { display: none; }
    .posts-grid article:nth-child(2n+1)::before { display: block; }
}

@media (max-width: 768px) {
    .site-header { height: 80px; }
    .main-nav { display: none; }
    .nav-toggle { 
        display: flex; flex-direction: column; gap: 5px; cursor: pointer; z-index: 10001; 
        background: none; border: none; padding: 5px;
    }
    .nav-toggle span { width: 30px; height: 3px; background: var(--primary); 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(5px, -6px); }

    body.menu-open .main-nav { 
        display: flex; position: fixed; inset: 0; background: var(--bg-main); 
        z-index: 10000; align-items: center; justify-content: center;
    }
    body.menu-open .main-nav ul { flex-direction: column; text-align: center; gap: 2.5rem; }
    body.menu-open .main-nav a { font-size: 1.8rem; }

    .posts-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    
    .timeline-wrapper { padding-left: 20px; }
    .post-card-arc::before { left: -28px; width: 15px; height: 15px; }
    .posts-grid article:nth-child(2n+1)::before { display: none; }
    .posts-grid article::before { display: block; }
}

.logo, .footer-logo { flex-wrap: wrap !important; }
/* 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;
}
