/**
 * Regulaminy – lista [pmsm_regulaminy] i strona pojedynczego regulaminu.
 * Kolorystyka i rozmiary spójne z portalem (duże czcionki, wysoki kontrast).
 */

.pmsm-regulations,
.pmsm-regulation-single {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 17px;
    color: #334155;
}

.pmsm-regulations {
    /* Szerokość kontenera OceanWP – na stronie bez paska bocznego lista wypełnia całą kolumnę. */
    max-width: 1200px;
    margin: 0 auto;
}

/* === LISTA === */

.pmsm-regulations-list {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.pmsm-regulations-list li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #e2e8f0;
}

.pmsm-regulations-list li:last-child {
    border-bottom: none;
}

.pmsm-regulation-row {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 64px;
    padding: 16px 22px;
    border-left: 4px solid transparent;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s;
}

.pmsm-regulation-row:hover,
.pmsm-regulation-row:focus {
    background: #eff6ff;
    border-left-color: #3b82f6;
    color: inherit;
    text-decoration: none;
}

.pmsm-regulation-row:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: -3px;
}

/* Motyw (OceanWP) podkreśla linki – wiersz ma być czystym kafelkiem bez podkreśleń. */
.pmsm-regulations .pmsm-regulation-row,
.pmsm-regulations .pmsm-regulation-row:hover,
.pmsm-regulations .pmsm-regulation-row:focus,
.pmsm-regulations .pmsm-regulation-row * {
    text-decoration: none !important;
    box-shadow: none;
}

/* Przekreślenie i podkreślenie z edytora – reguła wyżej gasiłaby je razem z podkreśleniem linków. */
.pmsm-regulations .pmsm-regulation-row s,
.pmsm-regulations .pmsm-regulation-row del {
    text-decoration: line-through !important;
}

.pmsm-regulations .pmsm-regulation-row u {
    text-decoration: underline !important;
}

.pmsm-regulation-row-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.pmsm-regulation-title {
    font-size: 19px;
    font-weight: 600;
    color: #1e40af;
}

.pmsm-regulation-excerpt {
    line-height: 1.5;
    color: #475569;
}

.pmsm-regulation-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    font-size: 15px;
    color: #64748b;
}

.pmsm-regulation-meta:empty {
    display: none;
}

.pmsm-regulation-badge {
    background: #dbeafe;
    color: #1e40af;
    font-size: 13px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
}

.pmsm-regulation-badge--pdf {
    background: #fee2e2;
    color: #b91c1c;
}

.pmsm-regulation-row-arrow {
    font-size: 32px;
    line-height: 1;
    color: #94a3b8;
}

.pmsm-regulation-row:hover .pmsm-regulation-row-arrow {
    color: #1e40af;
}

/* === STRONA REGULAMINU === */

.pmsm-regulation-back {
    margin: 0 0 16px;
}

.pmsm-regulation-back a {
    display: inline-block;
    padding: 8px 0;
    font-weight: 600;
    color: #1e40af;
    text-decoration: none;
}

.pmsm-regulation-back a:hover,
.pmsm-regulation-back a:focus {
    text-decoration: underline;
}

.pmsm-regulation-date {
    margin: 0 0 20px;
    color: #64748b;
}

.pmsm-regulation-body {
    line-height: 1.7;
    margin-bottom: 24px;
}

.pmsm-regulation-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.pmsm-regulation-button {
    display: inline-block;
    min-height: 44px;
    padding: 10px 20px;
    border-radius: 8px;
    border: 2px solid #1e40af;
    background: #1e40af;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.pmsm-regulation-button:hover,
.pmsm-regulation-button:focus {
    background: #1e3a8a;
    color: #ffffff;
}

.pmsm-regulation-button--secondary {
    background: #ffffff;
    color: #1e40af;
}

.pmsm-regulation-button--secondary:hover,
.pmsm-regulation-button--secondary:focus {
    background: #dbeafe;
    color: #1e40af;
}

.pmsm-regulation-button:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}

.pmsm-regulation-pdf-viewer {
    display: block;
    width: 100%;
    height: 80vh;
    min-height: 500px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

/* === OKNO PODGLĄDU PDF === */

.pmsm-pdf-dialog {
    width: min(1100px, 95vw);
    height: 92vh;
    max-width: none;
    max-height: none;
    padding: 0;
    border: none;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.pmsm-pdf-dialog[open] {
    display: flex;
    flex-direction: column;
}

.pmsm-pdf-dialog::backdrop {
    background: rgba(15, 23, 42, 0.6);
}

.pmsm-pdf-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.pmsm-pdf-dialog-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
}

.pmsm-pdf-dialog-actions {
    display: flex;
    gap: 10px;
}

.pmsm-pdf-dialog .pmsm-regulation-button {
    cursor: pointer;
    font-family: inherit;
    line-height: 1.2;
}

.pmsm-pdf-dialog-frame {
    flex: 1;
    width: 100%;
    border: none;
    background: #e2e8f0;
}

/* === KOMUNIKATY === */

.pmsm-regulations-empty,
.pmsm-regulations-note,
.pmsm-regulations-locked {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 18px;
    color: #475569;
}

@media (max-width: 480px) {
    .pmsm-regulation-row {
        padding: 14px 16px;
    }

    .pmsm-regulation-title {
        font-size: 18px;
    }

    .pmsm-regulation-button {
        width: 100%;
        text-align: center;
    }

    /* Na telefonach PDF osadzony na stronie zwykle się nie wyświetla – zostają przyciski. */
    .pmsm-regulation-pdf-viewer {
        display: none;
    }
}
