/* --- PLIK: portfolio.css --- */

/* 1. WYMUSZENIE MAŁEGO NAGŁÓWKA NA PODSTRONACH */
body.subpage header {
    background: rgba(255, 255, 255, 0.95) !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
    padding: 4px 0 !important;
    box-shadow: var(--shadow-sm);
}

body.subpage header .logo-header {
    width: 90px !important;
    height: 90px !important;
}

/* 2. SUB-HERO (Wyśrodkowane) */
.sub-hero {
    padding-top: 150px;
    padding-bottom: 50px;
    background: var(--bg-white);
    position: relative;
    border-bottom: 1px solid #E2E8F0;
}

.sub-hero .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.sub-hero-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin-top: 15px;
    line-height: 1.6;
    margin-left: auto;
    margin-right: auto;
}

/* 3. BREADCRUMBS (Wyśrodkowane) */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-head);
    width: 100%;
    display: flex;
    justify-content: center;
    text-align: center;
}

.breadcrumbs a { color: var(--text-secondary); text-decoration: none; transition: color 0.2s; }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs .sep { margin: 0 8px; color: #CBD5E1; }
.breadcrumbs .current { color: var(--primary); font-weight: 700; }

/* 4. FILTRACJA */
.portfolio-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 50px;
}

.filter-btn {
    padding: 10px 24px;
    background: #ffffff;
    border: 1px solid #E2E8F0;
    border-radius: 999px;
    font-family: var(--font-head);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.filter-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.filter-btn.active {
    background: var(--primary); color: #ffffff; border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(138, 90, 197, 0.3);
}

/* 5. PORTFOLIO GRID */
.portfolio-grid {
    display: grid;
    /* ZMIANA: Sztywno 2 kolumny na desktopie */
    grid-template-columns: repeat(2, 1fr);
    gap: 40px; /* Zwiększony odstęp, żeby duże kafelki "oddychały" */
}

.project-card {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-card);
    background: #000;
    transition: opacity 0.3s ease, transform 0.3s ease; 
}

.project-image-box {
    position: relative;
    width: 100%;
    /* ZMIANA: Idealne proporcje 1424x771 */
    aspect-ratio: 1424 / 771;
    overflow: hidden;
    background: #0f172a;
}

.project-image-box img {
    width: 100%;
    height: 100%;
    /* Ponieważ aspect-ratio kontenera jest identyczne jak zdjęcia, cover nie przytnie nic */
    object-fit: cover; 
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 1;
}

.project-card:hover .project-image-box img {
    transform: scale(1.08);
    opacity: 0.6;
}

/* OVERLAY */
.project-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.6) 80%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 30px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.project-card:hover .project-overlay { opacity: 1; transform: translateY(0); }

.project-content { color: #ffffff; }
.project-tags { margin-bottom: 12px; display: flex; gap: 8px; }
.project-tags .tag {
    font-size: 0.7rem; background: rgba(53, 195, 255, 0.2); color: #35C3FF;
    border: 1px solid rgba(53, 195, 255, 0.4); padding: 4px 10px;
    border-radius: 4px; text-transform: uppercase; font-weight: 700;
    font-family: var(--font-head); letter-spacing: 0.05em;
}
.project-content h3 { font-size: 1.4rem; margin-bottom: 8px; color: #ffffff; font-family: var(--font-head); }
.project-link {
    display: inline-flex; align-items: center; gap: 8px; color: #ffffff;
    text-decoration: none; font-weight: 600; font-size: 0.9rem; margin-top: 10px;
    padding-bottom: 2px; border-bottom: 1px solid rgba(255,255,255,0.3); transition: 0.2s;
}
.project-link:hover { color: var(--accent); border-color: var(--accent); }
.project-link .arrow { transition: transform 0.2s; }
.project-link:hover .arrow { transform: translate(3px, -3px); }

/* 6. KLASY TECHNICZNE (FILTROWANIE) */
.project-card.hidden-card {
    display: none !important;
    opacity: 0 !important;
    transform: scale(0.95);
    pointer-events: none;
}
.project-card.visible-card {
    display: block !important;
    animation: fadeInCard 0.4s ease forwards;
}
@keyframes fadeInCard {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   RESPONSYWNOŚĆ PORTFOLIO (MOBILE & TABLET)
   ========================================= */
@media (max-width: 900px) {
    /* 1 kolumna na mobile */
    .portfolio-grid { grid-template-columns: 1fr; }
    
    /* PRZYCIEMNIENIE ZDJĘCIA NA MOBILE */
    /* Dzięki temu białe napisy będą czytelne */
    .project-image-box img {
        transform: scale(1);
        filter: brightness(0.4); /* 40% jasności */
    }
    
    /* OVERLAY ZAWSZE WIDOCZNY */
    .project-overlay {
        opacity: 1; 
        transform: translateY(0);
        /* Mocniejszy gradient od dołu, żeby tekst był wyraźny */
        background: linear-gradient(
            to top, 
            rgba(15, 23, 42, 0.95) 0%, 
            rgba(15, 23, 42, 0.7) 50%, 
            rgba(15, 23, 42, 0.1) 100%
        );
    }

    /* Poprawa czytelności tekstu */
    .project-content h3 {
        font-size: 1.5rem;
        text-shadow: 0 2px 4px rgba(0,0,0,0.6);
    }
    
    .project-link {
        font-size: 1rem;
        color: #fff;
        font-weight: 700;
        text-shadow: 0 1px 2px rgba(0,0,0,0.6);
    }
}

/* =========================================
   STYLIZACJA TREŚCI (Polityka Prywatności i inne)
   ========================================= */

/* 1. Kontener tekstu - pełna szerokość kontenera */
.subpage .page-content {
    background-color: #ffffff;
    padding: 50px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    font-family: 'Inter', sans-serif;
    color: #334155;
    line-height: 1.8;
    font-size: 16px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

/* 2. Nagłówki - hierarchia i odstępy */
.page-content h2,
.page-content h3,
.page-content h4 {
    color: #0f172a;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    margin-top: 3.5rem;
    margin-bottom: 1.2rem;
    line-height: 1.3;
}

.page-content h2 { font-size: 1.8rem; border-bottom: 2px solid #f1f5f9; padding-bottom: 10px; }
.page-content h3 { font-size: 1.5rem; }
.page-content h4 { font-size: 1.25rem; }

.page-content > h2:first-child,
.page-content > h3:first-child {
    margin-top: 0;
}

/* 3. Paragrafy */
.page-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

/* 4. Listy (ul, ol) */
.page-content ul,
.page-content ol {
    margin-bottom: 2rem;
    padding-left: 2rem;
}

.page-content li {
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.page-content ul li::marker {
    color: #2563eb;
    font-weight: bold;
}

/* 5. Linki w treści */
.page-content a {
    color: #2563eb;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.3s ease;
}

.page-content a:hover {
    color: #1e40af;
    text-decoration: none;
}

/* =========================================
   NOWOCZESNE TABELE
   ========================================= */

.page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2.5rem 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: none !important;
    font-size: 0.95rem;
}

.page-content table thead th,
.page-content table th {
    background-color: #1e293b !important;
    color: #ffffff !important;
    font-weight: 600;
    padding: 16px 20px !important;
    text-align: left;
    border: none !important;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.page-content table td {
    padding: 16px 20px !important;
    border: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #475569;
}

.page-content table tr:nth-child(even) {
    background-color: #f8fafc;
}

.page-content table tr:hover {
    background-color: #f1f5f9;
}

.page-content table tr:last-child td {
    border-bottom: none !important;
}

/* =========================================
   RESPONSYWNOŚĆ (MOBILE)
   ========================================= */

@media (max-width: 768px) {
    .subpage .page-content {
        padding: 25px 20px;
    }
    
    .page-content h2 { font-size: 1.5rem; }
    .page-content h3 { font-size: 1.3rem; }
    
    .page-content table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }
}
/* =========================================
   NOWOCZESNY OBRAZEK WYRÓŻNIAJĄCY (MAGAZINE STYLE)
   ========================================= */

.article-featured-image.floated-image {
    float: right;
    width: 45%;
    margin-left: 40px;
    margin-bottom: 25px;
    margin-top: 10px;
    position: relative;
    z-index: 1;
}

.article-featured-image.floated-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-featured-image.floated-image:hover img {
    transform: scale(1.02);
}

.article-body p {
    text-align: left;
}

@media (max-width: 900px) {
    .article-featured-image.floated-image {
        float: none;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 30px;
        margin-top: 0;
    }
    
    .article-featured-image.floated-image img {
        width: 100%;
        max-height: 400px;
        object-fit: cover;
    }
}
/* =========================================
   BLOG ARCHIVE (KAFELKI & PAGINACJA)
   ========================================= */

.blog-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 60px;
}

.blog-tile {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #f1f5f9;
}

.blog-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}

.tile-image-link {
    display: block;
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
    background-color: #e2e8f0;
}

.tile-img {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.tile-image-link:hover .tile-img {
    transform: scale(1.05);
}

.tile-img-placeholder {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

.tile-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.tile-meta {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.tile-cat {
    color: #7a00df;
    text-decoration: none;
    transition: color 0.2s;
}

.tile-cat:hover {
    color: #5b00a6;
    text-decoration: underline;
}

.tile-cat-sep {
    margin: 0 6px;
    color: #cbd5e1;
}

.tile-title {
    font-family: 'Manrope', sans-serif;
    font-size: 1.25rem;
    line-height: 1.4;
    margin: 0 0 15px 0;
    font-weight: 700;
}

.tile-title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s;
}

.tile-title a:hover {
    color: #7a00df;
}

.tile-excerpt {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 15px;
}

.tile-read-more-btn {
    position: absolute;
    bottom: 10px; right: 10px;
    background: rgba(255,255,255,0.9);
    color: #0f172a;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.tile-image-link:hover .tile-read-more-btn {
    opacity: 1;
    transform: translateY(0);
}

/* PAGINACJA */
.blog-pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.blog-pagination .nav-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-pagination .nav-links a,
.blog-pagination .nav-links span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 15px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #475569;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
}

.blog-pagination .nav-links span.current {
    background: #7a00df;
    color: #fff;
    border-color: #7a00df;
}

.blog-pagination .nav-links a:hover {
    background: #f8fafc;
    border-color: #7a00df;
    color: #7a00df;
}

.blog-pagination h2.screen-reader-text {
    display: none;
}

@media (max-width: 1024px) {
    .blog-archive-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .blog-archive-grid { grid-template-columns: 1fr; }
    .tile-image-link { padding-top: 65%; }
}
/* =========================
   Darmowe wtyczki - listing + single
   ========================= */

.ps-plugins-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.ps-plugin-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: 0.3s;
    display: flex;
    flex-direction: column;
}

.ps-plugin-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
}

.ps-plugin-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.ps-plugin-title a {
    text-decoration: none;
    color: var(--text-main);
}

.ps-plugin-excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

.ps-plugin-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ps-meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(138, 90, 197, 0.12);
    color: var(--primary-dark);
    border: 1px solid rgba(138, 90, 197, 0.25);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: var(--font-head);
}

.ps-meta-date {
    font-size: 0.85rem;
    color: #64748B;
    font-weight: 600;
}

.ps-plugin-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

@media (min-width: 1025px) {
    .ps-plugin-actions {
        flex-wrap: nowrap;
        justify-content: center;
    }
    .ps-plugin-actions .btn {
        white-space: nowrap;
        flex: 1;
        max-width: 230px;
        justify-content: center;
    }
}

.ps-plugin-muted {
    font-weight: 600;
    color: #64748B;
}

/* Single - akcje */
.ps-single-actions {
    margin-top: 18px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

@media (min-width: 1025px) {
    .ps-single-actions {
        flex-wrap: nowrap;
    }
}

/* Galeria */
.ps-plugin-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.ps-plugin-gallery img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    display: block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: zoom-in;
}

.ps-plugin-gallery a:hover img {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

@media (max-width: 1024px) {
    .ps-plugins-grid { grid-template-columns: 1fr; }
    .ps-plugin-gallery { grid-template-columns: 1fr; }
    .ps-plugin-gallery img { height: auto; }
}

/* Lightbox */
.ps-lightbox {
    position: fixed;
    inset: 0;
    z-index: 5000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.ps-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.ps-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
}

.ps-lightbox-inner {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
}

.ps-lightbox-img {
    max-width: min(1100px, 92vw);
    max-height: 82vh;
    border-radius: 14px;
    border: 1px solid rgba(226, 232, 240, 0.25);
    box-shadow: 0 30px 80px rgba(0,0,0,0.45);
    background: #020617;
}

.ps-lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(226, 232, 240, 0.3);
    background: rgba(2, 6, 23, 0.55);
    color: #fff;
    cursor: pointer;
    font-size: 18px;
}

.ps-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 1px solid rgba(226, 232, 240, 0.3);
    background: rgba(2, 6, 23, 0.55);
    color: #fff;
    cursor: pointer;
    font-size: 28px;
    display: grid;
    place-items: center;
}

.ps-lightbox-nav.prev { left: 18px; }
.ps-lightbox-nav.next { right: 18px; }

@media (max-width: 768px) {
    .ps-lightbox-nav { width: 42px; height: 42px; font-size: 24px; }
}

.ps-plugin-actions .btn-outline,
.ps-single-actions .btn-outline {
  margin-left: 0 !important;
}

@media (max-width: 640px) {
  .ps-single-actions {
    flex-wrap: nowrap !important;
    gap: 10px;
  }
  .ps-single-actions .btn {
    flex: 1;
    padding: 12px 12px;
    font-size: 0.82rem;
    justify-content: center;
    white-space: nowrap;
  }
}