/*
Theme Name: Kamieniarstwo Wojnicki
Theme URI: https://example.com/wojcicki
Author: Your Name
Author URI: https://example.com
Description: Nowoczesna jednostronicowa witryna dla firmy kamieniarskiej KAMIENIARSTWO WOJNICKI. Responsywny design z użyciem Tailwind CSS, gotowy do integracji z WordPress.
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wojcicki
Tags: one-column, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready, full-width-template, block-styles, wide-blocks, blog, portfolio, business
*/

/* ============================================
   KAMIENIARSTWO WOJNICKI - Custom Styles
   ============================================ */

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
    height: 100%;
}

/* Layout strony - zawsze pełna wysokość */
html {
    height: 100%;
}

html,
body {
    min-height: 100vh;
}

body {
    padding-top: var(--header-height, 100px);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Główna treść - wypełnia dostępną przestrzeń */
#main,
main,
.site-content,
#main-content {
    flex: 1 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Na stronach innych niż front-page - zmniejsz padding-top dla main */
/* Nadpisuje Tailwind py-20 dla lepszego wyglądu na krótkich stronach */
body:not(.front-page) #main.site-content,
body:not(.front-page) main.site-content,
body:not(.front-page) #main,
body:not(.front-page) main {
    padding-top: 1.5rem !important; /* Zmniejszone z py-20 (5rem = 80px) do 1.5rem (24px) */
    padding-bottom: 5rem !important; /* Zachowaj padding-bottom */
}

/* Front-page zachowuje stare ustawienia - nie zmieniamy */
body.front-page section {
    /* Zachowaj stare ustawienia - py-20 z Tailwind */
}

/* Dodatkowo zmniejszamy odstęp dla breadcrumbs na innych stronach */
body:not(.front-page) main nav:first-child,
body:not(.front-page) main .breadcrumbs:first-child {
    margin-top: 0;
    margin-bottom: 1.5rem; /* Zmniejszone z mb-8 (2rem) */
}

/* Dla front-page bez main - wszystkie sekcje poza hero */
body.front-page > section:not(#hero) {
    flex-grow: 0;
    flex-shrink: 0;
    flex-basis: auto;
}

/* Ostatnia sekcja przed footerem wypełnia przestrzeń */
body.front-page > section:not(#hero):last-of-type {
    flex: 1 0 auto;
    min-height: 0;
}

/* Dla front-page - ostatnia sekcja przed footerem wypełnia przestrzeń */
body.front-page > section:last-of-type:not(#hero) {
    flex: 1 0 auto;
    min-height: 0;
}

/* Footer - zawsze na dole */
footer {
    flex-shrink: 0;
    margin-top: auto;
    width: 100%;
}

/* Upewnij się, że sekcje nie psują layoutu */
section {
    width: 100%;
}

/* Dla stron z krótką treścią - upewnij się, że główna sekcja wypełnia przestrzeń */
body > section:not(#hero):last-of-type {
    flex: 1 0 auto;
    min-height: 0;
}

/* Wrapper dla treści - jeśli istnieje */
body > .wrapper,
body > .container {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Hero section - zachowuje pełną wysokość ekranu */
#hero {
    margin-top: calc(-1 * var(--header-height, 100px));
    padding-top: var(--header-height, 100px);
}

/* Animacje */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 1s ease-out;
}

/* Header scroll effect */
header.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Zapobieganie nachodzeniu headera na treść */
#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease;
}

/* Wszystkie sekcje z anchor links - scroll-margin-top */
/* Na front-page większy margin dla anchor links */
body.front-page section[id],
body.front-page div[id],
body.front-page article[id] {
    scroll-margin-top: 120px;
}

/* Na innych stronach mniejszy margin - tylko dla anchor links w treści */
body:not(.front-page) section[id],
body:not(.front-page) div[id],
body:not(.front-page) article[id] {
    scroll-margin-top: 100px;
}

@media (max-width: 768px) {
    body.front-page section[id],
    body.front-page div[id],
    body.front-page article[id] {
        scroll-margin-top: 100px;
    }
    
    body:not(.front-page) section[id],
    body:not(.front-page) div[id],
    body:not(.front-page) article[id] {
        scroll-margin-top: 80px;
    }
}

/* Logo w menu */
.logo-container img {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.logo-container a {
    display: inline-block;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.logo-container a:hover {
    opacity: 0.9;
}

.logo-container a:hover img {
    transform: scale(1.05);
}

/* Rozwijane menu - Nasza oferta */
nav ul li.relative.group ul {
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

nav ul li.relative.group:hover ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Menu items - płynne przejścia */
nav ul li a {
    transition: color 0.3s ease, background-color 0.3s ease, opacity 0.3s ease;
}

nav ul li a:hover {
    transition: color 0.3s ease, background-color 0.3s ease, opacity 0.3s ease;
}

/* Hero section parallax effect */
#hero {
    background-attachment: fixed;
}

@media (max-width: 768px) {
    #hero {
        background-attachment: scroll;
    }
}

/* Service cards hover effects */
.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.service-card-small {
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

.service-card-small:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Gallery items */
.gallery-item {
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.gallery-item img {
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.gallery-item:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Realizacje gallery items */
.realizacja-gallery-item {
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
}

.realizacja-gallery-item img {
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.realizacja-gallery-item:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.realizacja-gallery-item:hover img {
    transform: scale(1.1);
}

/* Lightbox dla realizacji */
#realizacje-lightbox {
    backdrop-filter: blur(5px);
}

#realizacje-lightbox img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

#lightbox-close,
#lightbox-prev,
#lightbox-next {
    background: rgba(0, 0, 0, 0.5);
    padding: 1rem;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

#lightbox-close:hover,
#lightbox-prev:hover,
#lightbox-next:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

#lightbox-prev,
#lightbox-next {
    top: 50%;
    transform: translateY(-50%);
}

#lightbox-counter {
    font-size: 0.875rem;
}

/* Realizacja card */
.realizacja-card {
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.realizacja-card img {
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.realizacja-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.realizacja-card:hover img {
    transform: scale(1.1);
}

/* Paginacja */
.wojnicki-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.wojnicki-pagination .page-numbers {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.wojnicki-pagination .page-numbers.current {
    background-color: var(--wojcicki-primary);
    color: white;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.wojnicki-pagination .page-numbers:hover:not(.current) {
    background-color: var(--wojcicki-bg-card);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wojnicki-pagination .page-numbers:active:not(.current) {
    transform: translateY(0);
}

/* Line clamp utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Form inputs - płynne przejścia */
input,
textarea,
select {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

input:hover,
textarea:hover,
select:hover {
    border-color: #60a5fa;
}

/* Mobile menu animation */
#mobile-menu {
    transition: max-height 0.3s ease-out, opacity 0.3s ease, visibility 0.3s ease;
    overflow: hidden;
}

#mobile-menu.hidden {
    max-height: 0;
    opacity: 0;
    visibility: hidden;
}

#mobile-menu:not(.hidden) {
    max-height: 500px;
    opacity: 1;
    visibility: visible;
}

#mobile-menu a {
    transition: color 0.3s ease, background-color 0.3s ease, padding 0.3s ease;
}

#mobile-menu a:hover {
    background-color: rgba(59, 130, 246, 0.1);
    padding-left: 1.5rem;
}

/* Loading state for form */
.form-loading {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Success/Error messages */
.form-message {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    display: none;
    transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
}

.form-message.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.form-message.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Accessibility improvements */
a:focus,
button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    transition: outline 0.2s ease;
}

/* Wszystkie linki - płynne przejścia */
a {
    transition: color 0.3s ease, background-color 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

/* Wszystkie przyciski - płynne przejścia */
button {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

button:hover {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

button:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Print styles */
@media print {
    header,
    footer,
    #kontakt {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* Ikony - płynne przejścia */
i.fas,
i.far,
i.fab,
svg {
    transition: color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

/* Obrazy - płynne przejścia */
img {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Wszystkie elementy z klasą group - płynne przejścia dla hover */
.group {
    transition: all 0.3s ease;
}

/* Overlay effects - płynne przejścia */
.overlay,
.bg-black.bg-opacity-50,
.bg-gradient-to-t {
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

/* Shadow transitions dla kart */
.shadow-md,
.shadow-lg,
.shadow-xl {
    transition: box-shadow 0.3s ease;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .service-card,
    .gallery-item {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   Wojnicki CSS Variables (z ACF)
   ============================================ */

.wojnicki-btn-primary {
    background-color: var(--wojcicki-primary, #2563eb) !important;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease !important;
}

.wojnicki-btn-primary:hover {
    background-color: var(--wojcicki-primary-hover, #1d4ed8) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4) !important;
}

.wojnicki-btn-primary:active {
    transform: scale(0.98) !important;
    transition: transform 0.1s ease !important;
}

.wojnicki-text-accent {
    color: var(--wojcicki-accent, #2563eb) !important;
    transition: color 0.3s ease !important;
}

.wojnicki-text-heading {
    color: var(--wojcicki-text-heading, #1f2937) !important;
    transition: color 0.3s ease !important;
}

.wojnicki-text-body {
    color: var(--wojcicki-text-body, #4b5563) !important;
    transition: color 0.3s ease !important;
}

.wojnicki-bg-section {
    background-color: var(--wojcicki-bg-section, #ffffff) !important;
}

.wojnicki-bg-alt {
    background-color: var(--wojcicki-bg-alt, #f9fafb) !important;
}

.wojnicki-bg-card {
    background-color: var(--wojcicki-bg-card, #f3f4f6) !important;
}

.wojnicki-border {
    border-color: var(--wojcicki-border, #e5e7eb) !important;
}

.wojnicki-focus-ring:focus {
    --tw-ring-color: var(--wojcicki-primary, #2563eb) !important;
}

a.wojnicki-text-body {
    transition: color 0.3s ease !important;
}

a.wojnicki-text-body:hover {
    color: var(--wojcicki-accent, #2563eb) !important;
}

/* Mobile menu button */
#mobile-menu-btn {
    transition: transform 0.3s ease, opacity 0.3s ease, color 0.3s ease;
}

#mobile-menu-btn:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

#mobile-menu-btn:active {
    transform: scale(0.95);
}

/* Lightbox transitions */
#realizacje-lightbox {
    backdrop-filter: blur(5px);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#realizacje-lightbox.hidden {
    opacity: 0;
    visibility: hidden;
}

#realizacje-lightbox:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

#lightbox-prev,
#lightbox-next {
    transition: transform 0.3s ease, background-color 0.3s ease, opacity 0.3s ease !important;
}

#lightbox-prev:hover,
#lightbox-next:hover {
    transform: translateY(-50%) scale(1.1) !important;
}
