/* common.css - style wspólne dla bloga i portfolio */

/* Tu trafią zmienne, utility, typografia, przyciski, layouty globalne, itp. */

/* Universal scroll and overflow fixes */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    -moz-overflow-scrolling: touch;
    -ms-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Fix for iOS Safari */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection where needed */
p, h1, h2, h3, h4, h5, h6, span, a, button, input, textarea {
    -webkit-user-select: text;
    -khtml-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Fix for mobile viewport */
@viewport {
    width: device-width;
    initial-scale: 1;
    maximum-scale: 1;
    user-scalable: no;
}

/* Universal touch and scroll fixes */
* {
    box-sizing: border-box;
}

/* Fix for iOS momentum scrolling */
.container, .section, .hero {
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
}

/* Fix for Android Chrome */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    html, body {
        -webkit-overflow-scrolling: touch;
    }
}

/* Fix for Firefox */
@-moz-document url-prefix() {
    html, body {
        scroll-behavior: smooth;
    }
}

/* Fix for Edge/IE */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    html, body {
        overflow-x: hidden;
    }
}

/* Fix for Safari */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .navbar, .nav-menu, .vertical-nav {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* Touch event improvements */
.nav-link, .mobile-menu-btn, .vertical-nav-link, .btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* Fix for mobile menu scrolling */
.nav-menu {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Fix for vertical nav on mobile */
@media (max-width: 768px) {
    .vertical-nav {
        touch-action: manipulation;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    .vertical-nav-link {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
}

/* Prevent horizontal scroll on mobile */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }
    
    .container {
        overflow-x: hidden;
        width: 100%;
    }
}

/* Logo styles */
.logo-img {
    height: 40px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

/* Navigation layout */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    flex-shrink: 0;
    margin-right: auto;
}

.nav-menu {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mobile-menu-btn {
    flex-shrink: 0;
    margin-left: auto;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    transform: scale(1.1);
    color: #667eea;
}

/* Responsive logo */
@media (max-width: 768px) {
    .logo-img {
        height: 35px;
        max-width: 120px;
    }
    
    .nav-container {
        padding: 0 20px;
    }
    
    .nav-menu {
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .logo-img {
        height: 30px;
        max-width: 100px;
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    .nav-menu {
        gap: 20px;
    }
    
    .mobile-menu-btn {
        font-size: 20px;
        padding: 8px;
    }
}

/* Mobile menu styles */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 50px;
        gap: 30px;
        transition: left 0.3s ease;
        z-index: 999;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-link {
        color: #fff;
        text-decoration: none;
        font-size: 18px;
        font-weight: 500;
        transition: all 0.3s ease;
        padding: 15px 0;
    }
    
    .nav-link:hover {
        color: #667eea;
        transform: scale(1.05);
    }
}

/* Desktop menu styles */
@media (min-width: 769px) {
    .mobile-menu-btn {
        display: none;
    }
    
    .nav-link {
        color: #fff;
        text-decoration: none;
        font-size: 16px;
        font-weight: 500;
        transition: all 0.3s ease;
        padding: 10px 15px;
        border-radius: 5px;
    }
    
    .nav-link:hover {
        color: #667eea;
        background: rgba(102, 126, 234, 0.1);
        transform: scale(1.05);
    }
} 