/*
Theme Name: Konserwator
Theme URI:
Author: Tech Master
Description: Motyw dla Dawid Pasierb - Konserwacja i Restauracja Zabytków
Version: 1.0
Text Domain: konserwator
*/

/* =========================================
   1. ZMIENNE I RESET
   ========================================= */
:root {
    --color-bg: #F9F7F2;
    --color-text: #2C2C2C;
    --color-gold: #C5A065;
    --color-gold-dark: #A3824A;
    --color-dark: #1A1A1A;
    --color-light: #FFFFFF;

    --font-heading: 'EB Garamond', serif;
    --font-body: 'Lato', sans-serif;

    --spacing-section: 4rem;
    --border-radius: 4px;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* Skip link */
.skip-link {
    position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
    background: var(--color-gold); color: #fff; padding: 10px 20px; font-weight: 700;
    z-index: 9999; text-decoration: none;
}
.skip-link:focus {
    position: fixed; left: 10px; top: 10px; width: auto; height: auto; overflow: visible;
}

/* Focus indicators */
:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-heading); color: var(--color-dark); font-weight: 600; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

.container { width: 90%; max-width: 1200px; margin: 0 auto; }
.section-padding { padding: var(--spacing-section) 0; }
.bg-light { background-color: #fff; }
.bg-dark { background-color: var(--color-dark); color: #fff; }
.text-white { color: #fff !important; }
.center { text-align: center; }

/* =========================================
   2. TYPOGRAFIA & PRZYCISKI
   ========================================= */
.section-title {
    font-size: 2.2rem; margin-bottom: 1rem; position: relative; display: inline-block;
}
.section-title::after {
    content: ''; display: block; width: 60px; height: 2px;
    background: var(--color-gold); margin: 10px auto 0;
}
.section-subtitle {
    text-transform: uppercase; letter-spacing: 2px; font-size: 0.85rem;
    color: var(--color-gold); display: block; margin-bottom: 0.5rem;
}

.btn {
    display: inline-block; padding: 12px 30px; border: 1px solid transparent;
    cursor: pointer; font-weight: 700; text-transform: uppercase;
    font-size: 0.9rem; letter-spacing: 1px;
}
.btn-gold { background: var(--color-gold); color: #fff; }
.btn-gold:hover { background: var(--color-gold-dark); }
.btn-hero { border: 1px solid #fff; color: #fff; margin-top: 2rem; }
.btn-hero:hover { background: #fff; color: var(--color-dark); }
.btn-outline { background: transparent; border: 1px solid var(--color-gold); color: var(--color-text); }
.btn-small { padding: 8px 20px; font-size: 0.8rem; }
.link-btn-inline { background: none; border: none; padding: 0; text-decoration: underline; cursor: pointer; font-size: inherit; font-family: inherit; }

/* =========================================
   3. HEADER
   ========================================= */
header {
    position: fixed; top: 0; width: 100%; padding: 15px 0; z-index: 1000;
    background: rgba(255, 255, 255, 0.95); border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: 0.3s; backdrop-filter: blur(5px);
}
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.logo { 
    font-family: var(--font-heading); 
    font-size: 1.8rem; 
    font-weight: 600; 
    line-height: 1.1; 
    color: var(--color-dark);
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-initials {
    font-size: 2.2rem;
    color: var(--color-gold);
    font-weight: 700;
    letter-spacing: 2px;
    border: 2px solid var(--color-gold);
    padding: 5px 12px;
    border-radius: 4px;
}
.logo-text { 
    font-size: 0.9rem; 
    font-family: var(--font-body); 
    font-weight: 400; 
    color: var(--color-dark);
    letter-spacing: 0.5px;
}
.main-nav ul { display: none; }
.main-nav ul.active {
    display: flex; flex-direction: column; position: absolute;
    top: 100%; left: 0; width: 100%; background: #fff; padding: 20px 0;
    border-bottom: 1px solid #eee; text-align: center; gap: 15px;
}
.main-nav a { font-weight: 700; font-size: 0.9rem; text-transform: uppercase; }
.main-nav li.btn-nav > a {
    background: var(--color-gold);
    color: #fff;
    padding: 8px 20px;
    border-radius: 4px;
    transition: background 0.3s, transform 0.2s;
}
.main-nav li.btn-nav > a:hover {
    background: var(--color-gold-dark);
    transform: translateY(-1px);
}
.hamburger { background: none; border: none; cursor: pointer; display: flex; flex-direction: column; gap: 5px; }
.bar { width: 25px; height: 3px; background: var(--color-dark); transition: 0.3s; }

/* =========================================
   4. HERO SECTION
   ========================================= */
.hero-section {
    height: 100vh; min-height: 600px; display: flex; align-items: center;
    justify-content: center; position: relative; color: #fff; text-align: center; overflow: hidden;
}
.hero-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: no-repeat center center/cover; z-index: 0;
}
.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); z-index: 1;
}
.hero-content { position: relative; z-index: 5; max-width: 900px; }
.hero-text-stack { 
    display: flex; 
    flex-direction: column; 
    gap: 0.5rem; 
    margin-bottom: 2rem;
}
.hero-line { 
    color: #fff; 
    font-weight: 400; 
    letter-spacing: 2px; 
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    margin: 0;
    line-height: 1.3;
}
.hero-line:first-child { 
    font-size: 2.5rem; 
    font-weight: 600; 
    letter-spacing: 3px;
    margin-bottom: 0.8rem;
}
.hero-line:nth-child(2) { 
    font-size: 1.3rem; 
    color: var(--color-gold);
    margin-bottom: 1rem;
}
.hero-line:nth-child(n+3) { 
    font-size: 1rem; 
    font-weight: 300;
    letter-spacing: 1px;
    color: #e0e0e0;
}
.hero-content .fade-in { opacity: 0; animation: onLoadFadeIn 1s ease-out forwards; }
.hero-content .delay-1 { animation-delay: 0.2s; }
.hero-content .delay-2 { animation-delay: 0.4s; }
.hero-content .delay-3 { animation-delay: 0.6s; }
.hero-content .delay-4 { animation-delay: 0.8s; }
.hero-content .delay-5 { animation-delay: 1s; }
@keyframes onLoadFadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* =========================================
   5. O MNIE / GRID
   ========================================= */
.center-element {
    display: block;
    text-align: center;
}

.grid-2-col { display: grid; grid-template-columns: 1fr; gap: 3rem; }

.about-content {
    max-width: 950px;
    margin: 0 auto;
    position: relative;
}

.about-text-main {
    text-align: center;
    font-size: 1.15rem;
    line-height: 1.9;
    margin: 2.5rem auto 4rem;
    color: var(--color-text);
    font-weight: 400;
    padding: 0 1rem;
}

.about-content::before {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-gold), var(--color-gold-dark));
    margin: 0 auto 2rem;
    border-radius: 2px;
}

.about-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    margin-top: 3rem;
    text-align: left;
}

.about-section {
    background: #fff;
    padding: 2rem 2.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--color-gold);
    box-shadow: 0 2px 15px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.about-section:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.about-section h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: 1.5rem;
    text-transform: none;
    letter-spacing: 0.3px;
}
.about-section h3.about-separator {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 400;
    font-style: italic;
    color: var(--color-gold);
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

.about-section h3.about-separator::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--color-gold);
}
.about-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.about-list li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1.3rem;
    line-height: 1.8;
    color: var(--color-text);
}

.about-list li:last-child {
    margin-bottom: 0;
}

.about-list li::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0.65em;
    width: 8px;
    height: 8px;
    background: var(--color-gold);
    border-radius: 50%;
}

.about-list li strong {
    color: var(--color-dark);
    font-weight: 600;
    font-size: 1.05rem;
}

.about-list .sub-text {
    display: block;
    font-size: 0.95rem;
    color: #666;
    margin-top: 0.7rem;
    line-height: 1.7;
    padding-left: 0;
    font-style: normal;
}

.styled-list li { display: flex; gap: 15px; margin-bottom: 1.5rem; align-items: flex-start; }
.styled-list .icon { font-size: 1.5rem; color: var(--color-gold); }

/* =========================================
   6. REALIZACJE GRID
   ========================================= */
.realizacje-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin: 20px auto;
    max-width: 1200px;
}

.realizacja-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    background: #fff;
}

.realizacja-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.realizacja-thumb {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #222;
}

.realizacja-thumb-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(20px);
    transform: scale(1.1);
    opacity: 0.6;
}

.realizacja-thumb-img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.5s;
}

.realizacja-item:hover .realizacja-thumb-img {
    transform: scale(1.03);
}

.realizacja-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    padding: 20px 15px 15px;
    color: #fff;
    z-index: 2;
}

.realizacja-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.realizacja-count {
    font-size: 0.85rem;
    color: var(--color-gold);
    letter-spacing: 0.5px;
}

@media (min-width: 768px) {
    .realizacje-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .realizacje-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
/* Sekcja nadzory - lekko inna kolorystyka */
#nadzory {
    background: linear-gradient(to bottom, #fafafa, #fff);
}

#nadzory .section-title::after {
    background: var(--color-dark);
}

#nadzory .section-subtitle {
    color: var(--color-dark);
}
/* =========================================
   7. SLIDER W MODALU & NAWIGACJA
   ========================================= */
.project-modal-content { text-align: center; position: relative; }
.project-modal-content h3 { margin-top: 1rem; font-size: 1.5rem; color: var(--color-dark); }
.project-modal-content p { color: #666; margin-bottom: 0; }

.project-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.8);
    border: none;
    width: 40px; height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 20;
    font-size: 1.5rem;
    color: var(--color-dark);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: 0.3s;
}
.project-nav-btn:hover { background: var(--color-gold); color: #fff; }
.project-prev { left: -20px; }
.project-next { right: -20px; }

.project-counter {
    font-size: 0.8rem;
    color: #999;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ba-slider {
    position: relative;
    width: 100%;
    height: 70vh;
    max-height: 800px;
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
    cursor: col-resize;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    background-color: #f4f4f4;
    border: 1px solid #ddd;
}

/* Obrazki slidera - oba pełnowymiarowe, clip-path przycina "przed" */
.ba-img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}
.ba-img-after { z-index: 1; }
.ba-img-before {
    z-index: 2;
    clip-path: inset(0 50% 0 0);
}

/* Linia podziału */
.ba-divider {
    position: absolute; top: 0; left: 50%; width: 2px; height: 100%;
    background: #fff; z-index: 8; pointer-events: none;
    transform: translateX(-50%);
}

/* Labele Przed / Po */
.ba-label {
    position: absolute; top: 10px; background: rgba(0,0,0,0.6); color: #fff;
    padding: 4px 10px; font-size: 0.8rem; border-radius: 2px; z-index: 5; pointer-events: none;
}
.ba-label-before { left: 10px; }
.ba-label-after { right: 10px; }

.ba-handle {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 40px; height: 40px; background: rgba(255,255,255,0.8);
    border-radius: 50%; z-index: 10; display: flex; align-items: center; justify-content: center;
    pointer-events: none; box-shadow: 0 0 10px rgba(0,0,0,0.3);
}
.ba-handle::after { content: '\2194'; color: var(--color-dark); font-weight: bold; }

/* =========================================
   8. KONTAKT (KAFELKI)
   ========================================= */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.contact-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px 20px;
    text-align: center;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 4px;
    color: #fff;
}

a.contact-box:hover {
    transform: scale(1.05);
    border-color: var(--color-gold);
    background: rgba(255, 255, 255, 0.08);
}

.contact-box .icon { font-size: 2.5rem; margin-bottom: 15px; }
.contact-box h3 { font-size: 1.2rem; margin-bottom: 5px; color: #fff; font-family: var(--font-heading); }
.contact-box p { font-size: 0.95rem; color: #ccc; margin-bottom: 0; }

.contact-box .action-text {
    margin-top: 15px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-gold);
    opacity: 0;
    transform: translateY(10px);
    transition: 0.3s;
}

a.contact-box:hover .action-text { opacity: 1; transform: translateY(0); }
.contact-box.static { cursor: default; border-color: var(--color-gold-dark); }
.contact-nip { margin-top: 40px; color: #666; font-size: 0.9rem; letter-spacing: 1px; }

/* =========================================
   9. FOOTER & MODALS
   ========================================= */
footer { background: #111; color: #666; padding: 3rem 0; font-size: 0.85rem; text-align: center; }
.link-btn { background: none; border: none; color: #bbb; cursor: pointer; text-decoration: underline; margin: 0 10px; }
.link-btn:hover { color: #fff; }

.modal-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); display: flex; justify-content: center; align-items: center;
    z-index: 2000; opacity: 0; pointer-events: none; transition: 0.3s;
}
.modal-backdrop.active { opacity: 1; pointer-events: all; }
.modal-content {
    background: #fff; width: 90%; max-width: 600px; max-height: 80vh; overflow-y: auto;
    padding: 2rem; position: relative; border-radius: 4px;
}
.large-modal { max-width: 1000px; max-height: 95vh; padding: 3rem 1rem 1rem 1rem; background: #fff; }
.modal-close { position: absolute; top: 10px; right: 15px; background: none; border: none; font-size: 2rem; cursor: pointer; z-index: 20; color: #333; }


@media (min-width: 768px) {
    .grid-2-col { grid-template-columns: 1fr 1fr; align-items: center; }
    .main-nav ul { display: flex; position: static; flex-direction: row; background: transparent; padding: 0; border: none; gap: 30px; }
    .hamburger { display: none; }
}

@media (max-width: 768px) {
    .hero-line:first-child { font-size: 1.8rem; }
    .hero-line:nth-child(2) { font-size: 1.1rem; }
    .hero-line:nth-child(n+3) { font-size: 0.85rem; }
    
    .logo-initials { font-size: 1.6rem; padding: 4px 10px; }
    .logo-text { font-size: 0.75rem; }
    
    .ba-slider { height: 60vh; }
    .project-nav-btn { width: 30px; height: 30px; font-size: 1rem; top: 50%; }
    .project-prev { left: -10px; }
    .project-next { right: -10px; }
    
    .section-title { font-size: 1.8rem; }
    
    .about-text-main { 
        font-size: 1rem; 
        padding: 0 0.5rem;
        margin: 1.5rem auto 2.5rem;
    }
    
    .about-sections {
        grid-template-columns: 1fr;
    }

    .about-section {
        padding: 1.5rem 1.25rem;
        border-radius: 6px;
    }
    
    .about-section h3 { 
        font-size: 1.1rem; 
        margin-bottom: 1.2rem;
    }
    
    .about-list li { 
        padding-left: 1.5rem; 
        font-size: 0.95rem;
        margin-bottom: 1.1rem;
    }
    
    .about-list li::before {
        left: 0.3rem;
        width: 6px;
        height: 6px;
    }
}

/* =========================================
   10. SCROLL ANIMATIONS
   ========================================= */
.fade-in-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Warianty kierunku */
.fade-in-scroll.from-left {
    transform: translateX(-50px);
}
.fade-in-scroll.from-left.visible {
    transform: translateX(0);
}

.fade-in-scroll.from-right {
    transform: translateX(50px);
}
.fade-in-scroll.from-right.visible {
    transform: translateX(0);
}

.fade-in-scroll.scale-in {
    transform: scale(0.9);
}
.fade-in-scroll.scale-in.visible {
    transform: scale(1);
}

/* Staggered delays dla dzieci */
.stagger-children > *:nth-child(1) { transition-delay: 0s; }
.stagger-children > *:nth-child(2) { transition-delay: 0.15s; }
.stagger-children > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children > *:nth-child(4) { transition-delay: 0.45s; }

/* Header scrolled */
header.scrolled {
    padding: 8px 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

@media (prefers-reduced-motion: reduce) {
    .fade-in-scroll {
        opacity: 1;
        transform: none;
        transition: none;
    }
    html { scroll-behavior: auto; }
}
