/* =========================================
   STYLE GLOBALNE I SCROLL
========================================= */
html {
    scroll-behavior: smooth !important;
}

/* =========================================
   STYLE DLA MENU WONDERCMS (DESKTOP & MOBILE)
========================================= */
.neo-menu-container ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.neo-menu-container li {
    position: relative; 
}

.neo-menu-container li a {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration-thickness: 4px;
    text-underline-offset: 4px;
    transition: all 0.2s;
    display: block;
}

.neo-menu-container > ul > li > a:hover, 
.neo-menu-container > ul > li.active > a {
    text-decoration: underline;
    text-decoration-color: #FF6B6B;
}

.neo-menu-container li ul {
    display: none; 
    position: absolute;
    top: 100%;
    left: 0;
    flex-direction: column;
    gap: 0;
    background-color: #fff;
    border: 4px solid #000;
    box-shadow: 4px 4px 0px 0px #000;
    padding: 0;
    min-width: 220px;
    z-index: 100;
    margin-top: 10px; 
}

.neo-menu-container li ul::before {
    content: '';
    position: absolute;
    top: -15px; 
    left: 0;
    width: 100%;
    height: 15px;
    background: transparent;
}

.neo-menu-container li:hover > ul {
    display: flex;
}

.neo-menu-container li ul li {
    width: 100%;
    border-bottom: 2px solid #000;
}

.neo-menu-container li ul li:last-child {
    border-bottom: none;
}

.neo-menu-container li ul li a {
    padding: 12px 16px;
    font-size: 0.9rem;
    text-decoration: none !important; 
}

.neo-menu-container li ul li a:hover {
    background-color: #FFD93D; 
    color: #000;
}

#mobile-menu ul {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

#mobile-menu li {
    display: flex;
    flex-direction: column;
}

#mobile-menu li a {
    display: block;
    font-size: 1.25rem;
    font-weight: 900;
    text-transform: uppercase;
    border: 2px solid #000;
    padding: 0.75rem;
    background-color: #fff;
    box-shadow: 4px 4px 0px 0px #000;
    transition: transform 0.2s;
    text-decoration: none;
}

#mobile-menu li a:hover {
    transform: translateX(4px);
}

#mobile-menu li ul {
    display: flex;
    flex-direction: column;
    padding-left: 1.5rem; 
    margin-top: 0.75rem;
    gap: 0.75rem;
}

#mobile-menu li ul li a {
    background-color: #FFFDF5; 
    font-size: 1rem; 
    box-shadow: 2px 2px 0px 0px #000; 
}

/* =========================================
   INTELIGENTNY STYLIZATOR TREŚCI (.cms-content)
========================================= */
.cms-content {
    line-height: 1.6;
    word-wrap: break-word; /* Wymuszenie łamania zbyt długich słów */
    overflow-wrap: break-word;
}

.cms-content h1 {
    background-color: #FF6B6B;
    color: #fff;
    border: 4px solid #000;
    display: inline-block;
    padding: 0.5rem 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    font-size: clamp(1.6rem, 5vw, 2.5rem); /* Zoptymalizowane i zmniejszone */
    margin: 2.5rem 0 1.5rem 0;
    box-shadow: 6px 6px 0px 0px #000;
    transform: rotate(-1.5deg);
    line-height: 1.1;
    word-break: break-word;
}

.cms-content h2, .cms-content h3, .cms-content h4 {
    font-weight: 900;
    text-transform: uppercase;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    word-break: break-word;
}

.cms-content h2 {
    font-size: clamp(1.4rem, 4vw, 2rem); /* Dynamiczny rozmiar - super na mobile */
    border-left: 8px solid #FF6B6B;
    padding-left: 15px;
}

.cms-content h3 { 
    font-size: clamp(1.2rem, 3vw, 1.75rem); 
}

.cms-content p {
    margin-bottom: 1.5rem;
    font-size: clamp(1rem, 2vw, 1.125rem); /* Zmniejsza się odrobinę na telefonach */
}

.cms-content strong, .cms-content b {
    background-color: #FFD93D;
    padding: 0 4px;
    border: 2px solid #000;
    font-weight: 900;
}

.cms-content em, .cms-content i {
    background-color: #C4B5FD;
    padding: 0 2px;
    font-style: italic;
}

.cms-content a {
    color: #000;
    font-weight: 900;
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 4px;
    transition: all 0.2s;
}

.cms-content a:hover {
    background-color: #000;
    color: #fff;
    text-decoration: none;
    padding: 2px 6px;
}

.cms-content hr {
    border: 0;
    border-top: 4px solid #000;
    margin: 3rem 0;
}

.cms-content ul, .cms-content ol {
    margin-bottom: 2rem;
    padding-left: 1.5rem;
}

.cms-content ul { list-style: none; }
.cms-content ol { list-style: decimal; font-weight: 700; }

.cms-content ul li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 12px;
    font-size: clamp(1rem, 2vw, 1.1rem);
}

.cms-content ul li::before {
    content: "■";
    position: absolute;
    left: 0;
    color: #FF6B6B;
    font-size: 1.5rem;
    line-height: 1;
}

.cms-content blockquote {
    background-color: #fff;
    border: 4px solid #000;
    padding: 1.25rem 1.5rem;
    margin: 2.5rem 0;
    font-size: clamp(0.95rem, 2vw, 1.1rem); /* Na telefonie drobniejszy cytat */
    font-weight: 700;
    font-style: italic;
    box-shadow: 6px 6px 0px 0px #C4B5FD;
    transform: rotate(1deg);
}

.cms-content img {
    max-width: 100%;
    height: auto;
    border: 4px solid #000;
    box-shadow: 6px 6px 0px 0px #000;
    margin: 2rem 0;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.cms-content img:hover {
    transform: rotate(2deg) scale(1.02);
}

.cms-content pre {
    background-color: #000;
    color: #fff; 
    padding: 2rem 1.5rem;
    border: 4px solid #000;
    box-shadow: 8px 8px 0px 0px #aaa;
    font-family: 'Courier New', monospace;
    overflow-x: auto;
    margin: 2rem 0;
    position: relative;
}

.cms-content pre::after {
    content: "CODE";
    position: absolute;
    top: 0;
    right: 0;
    background: #FFD93D;
    color: #000;
    padding: 2px 10px;
    font-size: 0.8rem;
    font-weight: 900;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 4px solid #000;
    box-shadow: 6px 6px 0px 0px #000;
    margin: 2rem 0;
    background: #fff;
}

.cms-content table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.cms-content th, .cms-content td {
    border: 2px solid #000;
    padding: 12px 15px;
    text-align: left;
}

.cms-content th {
    background-color: #000;
    color: #fff;
    text-transform: uppercase;
}

.cms-content tr:nth-child(even) { background-color: #f3f3f3; }
.cms-content tr:hover { background-color: #FFD93D; }

/* =========================================
   FAQ (Rozwijane panele <details>)
========================================= */
.cms-content details {
    background: #fff;
    border: 4px solid #000;
    margin-bottom: 1.5rem;
    box-shadow: 6px 6px 0px 0px #000;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.cms-content details:hover {
    box-shadow: 8px 8px 0px 0px #000;
    transform: translate(-2px, -2px);
}

.cms-content summary {
    padding: 1rem 1.5rem;
    font-weight: 900;
    font-size: clamp(0.85rem, 2vw, 0.9rem);
    text-transform: uppercase;
    cursor: pointer;
    background: #FFD93D;
    border-bottom: 4px solid transparent;
    list-style: none;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cms-content summary::-webkit-details-marker {
    display: none;
}

/* Wrzucamy Plusa (+) */
.cms-content summary::after {
    content: '+';
    font-size: 1.5rem;
    line-height: 1;
    font-weight: 900;
    transition: transform 0.2s ease;
}

/* Po rozwinięciu zmieniamy na Minusa (-) */
.cms-content details[open] summary::after {
    content: '-';
}

.cms-content details[open] summary {
    border-bottom-color: #000;
}

.cms-content details div, 
.cms-content details p {
    padding: 1.5rem;
    margin: 0;
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    font-weight: 700;
    background: #fff;
}

.cms-content form {
    margin: 2rem 0;
}

.cms-content input[type="text"],
.cms-content input[type="email"],
.cms-content input[type="number"],
.cms-content input[type="password"],
.cms-content select,
.cms-content textarea {
    width: 100%;
    border: 4px solid #000;
    padding: 1rem;
    font-weight: 700;
    font-family: inherit;
    background-color: #FFFDF5;
    margin-bottom: 1rem;
    box-shadow: 4px 4px 0px 0px #000;
    transition: all 0.2s;
    outline: none;
}

.cms-content input:focus,
.cms-content select:focus,
.cms-content textarea:focus {
    background-color: #fff;
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px 0px #000;
}

.cms-content button, 
.cms-content input[type="submit"] {
    background-color: #000;
    color: #fff;
    border: 4px solid #000;
    padding: 1rem 2rem;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 4px 4px 0px 0px #000;
    transition: all 0.2s;
}

.cms-content button:hover, 
.cms-content input[type="submit"]:hover {
    background-color: #FF6B6B;
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px 0px #000;
}

.cms-content button:active, 
.cms-content input[type="submit"]:active {
    transform: translate(2px, 2px);
    box-shadow: 0px 0px 0px 0px #000;
}

.custom-check {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border: 3px solid #000;
    background: #fff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 8px;
    box-shadow: 2px 2px 0px 0px #000;
}

.custom-check:checked { 
    background: #FF6B6B; 
}

.custom-check:checked::after {
    content: '✔';
    position: absolute;
    top: 50%; 
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    font-size: 16px;
}

.hover-lift { transition: transform 0.2s, box-shadow 0.2s; }
.hover-lift:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0px 0px #000; }
.click-press:active { transform: translate(2px, 2px); box-shadow: 0px 0px 0px 0px #000; }

/* =========================================
   PURE CSS LIGHTBOX (Odporny na serwery)
========================================= */
a.css-lightbox-trigger {
    display: inline-block;
    cursor: pointer;
    width: 100%;
    margin: 2rem 0;
}

a.css-lightbox-trigger img {
    margin: 0 !important;
}

.css-lightbox-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.css-lightbox-modal:target {
    display: flex;
}

.css-lightbox-bg {
    position: fixed;
    inset: 0;
    background-color: rgba(255, 253, 245, 0.95) !important;
    backdrop-filter: blur(5px);
    cursor: default;
    z-index: 1;
    display: block;
}

.css-lightbox-bg:hover {
    background-color: rgba(255, 253, 245, 0.95) !important;
}

.css-lightbox-content {
    position: relative;
    max-width: 64rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    animation: lb-pop 0.3s ease-out;
    width: 100%;
}

.css-lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border: 4px solid #000;
    background: #fff;
    padding: 0.5rem;
    box-shadow: 8px 8px 0px 0px #000;
    margin: 0;
    filter: none !important;
    transform: none !important;
}

.css-lightbox-content img:hover {
    filter: none !important;
    transform: none !important;
}

.css-lightbox-caption {
    margin-top: 1.5rem;
    background: #fff;
    border: 4px solid #000;
    padding: 0.5rem 1rem;
    font-weight: 900;
    text-transform: uppercase;
    box-shadow: 4px 4px 0px 0px #000;
    text-align: center;
    max-width: 100%;
}

.css-lightbox-close {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    background: #FFD93D !important;
    border: 4px solid #000 !important;
    color: #000 !important;
    font-weight: 900;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 4px 4px 0px 0px #000 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    transition: all 0.2s;
    z-index: 100;
}

.css-lightbox-close:hover {
    background: #000 !important;
    color: #fff !important;
    transform: translate(-2px, -2px) !important;
    box-shadow: 6px 6px 0px 0px #000 !important;
}

@keyframes lb-pop {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* =========================================
   OPTYMALIZACJA RWD (DLA URZĄDZEŃ MOBILNYCH)
========================================= */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr !important;
        padding: 0 15px !important;
    }
    .featuredimage-wrapper {
        height: 200px !important; 
    }

    .post:not(.card) .featuredimage-wrapper { 
        margin-bottom: 1rem !important; 
    }
    
    .cms-content h1 {
        margin-top: 1rem !important; 
        margin-bottom: 1rem !important; 
        padding: 0.5rem 1rem !important; 
    }
    
    /* Na telefonie ten pionowy pasek z boku H2 i H3 musi być chudszy */
    .cms-content h2 {
        border-left-width: 5px !important;
        padding-left: 10px !important;
    }

    .post.card h3 { margin: 1rem 1rem 0.5rem !important; }
    .post.card .meta { margin: 0 1rem 1rem !important; }
    .post.card .description { margin: 0 1rem 1.5rem !important; }
    .post.card a.text-right { padding: 0.75rem 1rem !important; }

    .cms-content blockquote {
        padding: 1rem !important;
        margin: 1.5rem 0 !important;
    }
    .cms-content summary {
        padding: 0.75rem 1rem !important;
    }
    .cms-content details div, 
    .cms-content details p {
        padding: 1rem !important;
    }
    .cms-content pre {
        padding: 1rem !important;
    }
}

/* =========================================
   WYMÓG WONDERCMS - KLASA EDYCJI
========================================= */
.editText.editable {
    border: 2px dashed #000;
    padding: 5px;
    min-height: 30px;
}