/*
 * NK Theme — Karty Pracy page styles
 * ============================================================ */

/* ============================================================
   SEKCJA GŁÓWNA
============================================================ */
.nk-karty-pracy-section {
    background: var(--color-sand);
    position: relative;
    z-index: 5;
}

.nk-karty-pracy-section .page-content {
    padding: 60px 0 80px;
}

/* Opcjonalny wstęp (treść z edytora strony) */
.nk-karty-intro {
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--color-blue-dark);
    margin-bottom: 40px;
}

.nk-karty-intro p {
    margin: 0 0 12px;
}

/* ============================================================
   TABELA
============================================================ */
.nk-karty-table-wrap {
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(var(--color-blue-dark-rgb), 0.08);
}

.nk-karty-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

/* --- NAGŁÓWEK --- */
.nk-karty-table thead tr {
    background: var(--color-blue-dark);
}

.nk-karty-table thead th {
    font-family: 'Francois One', sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    padding: 18px 24px;
    text-align: left;
    font-weight: normal;
}

.nk-karty-th-nr      { width: 100px; }
.nk-karty-th-film    { width: 170px; text-align: center; }
.nk-karty-th-pobierz { width: 150px; text-align: center; }

/* --- WIERSZE --- */
.nk-karty-row {
    border-bottom: 1px solid var(--color-grey);
    transition: background 0.2s ease;
}

.nk-karty-row:last-child {
    border-bottom: none;
}

.nk-karty-row:nth-child(even) {
    background: rgba(var(--color-sand-rgb), 0.5);
}

.nk-karty-row:hover {
    background: rgba(var(--color-orange-rgb), 0.06);
}

/* --- KOMÓRKI --- */
.nk-karty-table td {
    padding: 16px 24px;
    vertical-align: middle;
}

/* Numer odcinka — badge w kolorze orange */
.nk-karty-td-nr {
    width: 110px;
}

.nk-karty-nr-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 32px;
    padding: 0 10px;
    background: var(--color-orange);
    color: #fff;
    font-family: 'Francois One', sans-serif;
    font-size: 0.9rem;
    border-radius: 20px;
}

/* Nazwa karty */
.nk-karty-td-nazwa {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.97rem;
    font-weight: 700;
    color: var(--color-blue-dark);
    line-height: 1.4;
}

/* Film */
.nk-karty-td-film {
    width: 170px;
    text-align: center;
}

/* Pobierz */
.nk-karty-td-pobierz {
    width: 150px;
    text-align: center;
}

/* ============================================================
   PRZYCISK POBIERZ
============================================================ */
.nk-karty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 18px;
    height: 38px;
    background: var(--color-blue-dark);
    color: #fff;
    font-family: 'Francois One', sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 20px;
    transition: background 0.25s ease, transform 0.15s ease;
    white-space: nowrap;
}

.nk-karty-btn:hover {
    background: var(--color-orange);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.nk-karty-btn i {
    font-size: 0.9rem;
}

/* Wariant YouTube — magenta zamiast dark blue */
.nk-karty-btn--film {
    background: var(--color-magenta);
}

.nk-karty-btn--film:hover {
    background: var(--color-orange);
}

/* Placeholder gdy brak pliku */
.nk-karty-brak {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.82rem;
    color: rgba(var(--color-blue-dark-rgb), 0.4);
    font-style: italic;
}

/* Pusty stan */
.nk-karty-empty {
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem;
    color: rgba(var(--color-blue-dark-rgb), 0.5);
    text-align: center;
    padding: 40px 0;
}

/* ============================================================
   SEKCJA SEO (rozwijany tekst na dole)
============================================================ */
.nk-karty-seo {
    background: var(--color-sand);
    position: relative;
    z-index: 4;
}

.nk-karty-seo .page-content {
    padding: 0 0 60px;
}

.seo-expandable-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.seo-text-collapsed,
.seo-text-expanded {
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
    width: 100%;
}

.seo-text-collapsed {
    max-height: 250px;
    position: relative;
}

.seo-text-expanded {
    max-height: 2000px;
    position: relative;
}

.seo-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(
        to bottom,
        rgba(var(--color-sand-rgb), 0),
        rgba(var(--color-sand-rgb), 1)
    );
    pointer-events: none;
}

.seo-content h2 {
    font-family: 'Francois One', sans-serif;
    font-size: 1.2rem;
    color: var(--color-blue-dark);
    margin: 24px 0 10px;
}

.seo-content h2:first-child {
    margin-top: 0;
}

.seo-content p {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.95rem;
    line-height: 1.75;
    color: rgba(var(--color-blue-dark-rgb), 0.8);
    margin: 0 0 12px;
}

.seo-btn.boxed-link {
    margin-top: 15px;
    cursor: pointer;
}

/* ============================================================
   RESPONSIVE — zamiana tabeli na flex rows (≤768px)
   Przyciski zawsze widoczne po prawej, tytuł się owija.
============================================================ */
@media (max-width: 768px) {
    .nk-karty-table-wrap {
        border-radius: 16px;
    }

    /* Zamień całą tabelę na bloki, żeby móc używać flexboxa na wierszach */
    .nk-karty-table,
    .nk-karty-table thead,
    .nk-karty-table tbody,
    .nk-karty-table tr,
    .nk-karty-table th,
    .nk-karty-table td {
        display: block;
    }

    /* Ukryj nagłówki */
    .nk-karty-table thead {
        display: none;
    }

    /* Wiersz jako flex — !important żeby pokonać display: block z reguły wyżej */
    .nk-karty-row {
        display: flex !important;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 12px 16px;
        border-bottom: 1px solid var(--color-grey);
    }

    /* Resetuj komórki */
    .nk-karty-table td {
        padding: 0;
        border: none;
        width: auto !important;
    }

    /* Numer odcinka — nie kurczy się */
    .nk-karty-td-nr {
        flex-shrink: 0;
    }

    /* Tytuł — zajmuje resztę miejsca, może się zawijać */
    .nk-karty-td-nazwa {
        flex: 1;
        min-width: 0;
    }

    /* Przyciski — nie kurczą się, zawsze po prawej */
    .nk-karty-td-film,
    .nk-karty-td-pobierz {
        flex-shrink: 0;
        text-align: center;
    }

    /* Przyciski jako kółka z samą ikoną */
    .nk-karty-btn span {
        display: none;
    }

    .nk-karty-btn {
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 50%;
        margin: 0;
    }

    .nk-karty-btn i {
        font-size: 1rem;
    }
}
