/* LB Nástěnka — frontend styly */

.lb-nastenka {
    font-family: inherit;
}

/* ─── Filtrační chipy ─── */
.lb-nastenka-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.lb-filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 20px;
    border: 2px solid var(--cat-color, #95a5a6);
    background: transparent;
    color: var(--cat-color, #444);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.lb-filter-chip--active,
.lb-filter-chip:hover {
    background: var(--cat-color, #95a5a6);
    color: #fff;
}

.lb-filter-chip[data-cat="all"] {
    --cat-color: #555;
}

/* ─── Grid ─── */
.lb-nastenka-grid {
    display: grid;
    gap: 20px;
    grid-auto-rows: 280px; /* uniformní výška všech dlaždic */
}

.lb-nastenka-grid--cols-1 { grid-template-columns: 1fr; }
.lb-nastenka-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.lb-nastenka-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.lb-nastenka-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
    .lb-nastenka-grid--cols-3,
    .lb-nastenka-grid--cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .lb-nastenka-grid--cols-2,
    .lb-nastenka-grid--cols-3,
    .lb-nastenka-grid--cols-4 { grid-template-columns: 1fr; }
}

/* ─── Karta ─── */
.lb-nastenka-card {
    display: flex;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    overflow: hidden;
    transition: box-shadow .2s, transform .15s;
    background: #fff;
}

.lb-nastenka-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.14);
    transform: translateY(-2px);
}

.lb-nastenka-card--pinned {
    border: 2px solid var(--cat-color, #e74c3c);
}

.lb-nastenka-card--hidden {
    display: none;
}

/* Barevný pruh vlevo */
.lb-card-stripe {
    width: 6px;
    flex-shrink: 0;
    background: var(--cat-color, #95a5a6);
}

.lb-card-body {
    flex: 1;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden; /* ořízne obsah přesahující výšku dlaždice */
    min-width: 0;
}

/* Hlavička karty */
.lb-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lb-card-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.lb-card-pin {
    font-size: 14px;
    margin-left: auto;
}

/* Název — max 2 řádky */
.lb-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Obsah — ořezaný zbývající výškou, plný text v modalu */
.lb-card-content {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Jemný fade-out efekt naznačující zkrácený obsah */
.lb-card-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 36px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1));
    pointer-events: none;
}

.lb-card-content p:first-child { margin-top: 0; }
.lb-card-content p:last-child  { margin-bottom: 0; }

/* Patička */
.lb-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #888;
    border-top: 1px solid #f0f0f0;
    padding-top: 8px;
    margin-top: auto;
}

/* Prázdný stav */
.lb-nastenka-empty {
    color: #888;
    font-style: italic;
    padding: 20px 0;
}

/* ─── Klikatelná karta ─── */
.lb-nastenka-card {
    cursor: pointer;
}

/* ─── Modal ─── */
.lb-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.lb-modal--open {
    display: flex;
}

body.lb-modal-open {
    overflow: hidden;
}

.lb-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    cursor: pointer;
}

.lb-modal-content {
    position: relative;
    display: flex;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .22);
    max-width: 680px;
    width: calc(100% - 40px);
    max-height: 90vh;
    overflow: hidden;
    animation: lb-modal-in .2s ease;
}

@keyframes lb-modal-in {
    from { opacity: 0; transform: translateY(16px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.lb-modal-stripe {
    width: 7px;
    flex-shrink: 0;
    background: var(--cat-color, #95a5a6);
    border-radius: 10px 0 0 10px;
}

.lb-modal-body {
    flex: 1;
    padding: 24px 28px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lb-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #888;
    padding: 0 4px;
    border-radius: 4px;
    transition: color .15s, background .15s;
}

.lb-modal-close:hover {
    color: #333;
    background: #f0f0f0;
}

.lb-modal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-right: 32px;
}

.lb-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
}

.lb-modal-text {
    font-size: 15px;
    color: #444;
    line-height: 1.7;
    flex: 1;
}

.lb-modal-text p:first-child { margin-top: 0; }
.lb-modal-text p:last-child  { margin-bottom: 0; }

.lb-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #888;
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
    margin-top: auto;
}

@media (max-width: 600px) {
    .lb-modal-content {
        border-radius: 8px;
    }
    .lb-modal-body {
        padding: 18px 16px;
    }
}

/* ─── Archiv ─── */
.lb-nastenka-archive {
    margin-top: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.lb-archive-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    user-select: none;
}

.lb-archive-header:hover {
    background: #f1f5f9;
}

.lb-archive-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
}

.lb-archive-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.lb-archive-toggle:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.lb-archive-chevron {
    transition: transform .2s;
}

.lb-archive-toggle[aria-expanded="true"] .lb-archive-chevron {
    transform: rotate(180deg);
}

.lb-archive-body {
    padding: 0;
}

.lb-archive-body[hidden] {
    display: none;
}

.lb-archive-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.lb-archive-table th {
    padding: 10px 16px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #94a3b8;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.lb-archive-table td {
    padding: 11px 16px;
    color: #374151;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.lb-archive-table tr:last-child td {
    border-bottom: none;
}

.lb-archive-table tr:hover td {
    background: #f8fafc;
}

.lb-archive-date {
    white-space: nowrap;
    color: #94a3b8;
    font-size: 12px;
}

.lb-archive-title-cell {
    font-weight: 500;
    color: #1e293b;
}

.lb-archive-reason {
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
}

/* ─── Rozkliknutelné řádky v archivních tabulkách ─── */
.lb-archive-row-clickable {
    cursor: pointer;
}

.lb-archive-row-clickable:hover td {
    background: #eff6ff;
}

.lb-archive-row-clickable:focus {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}

.lb-archive-row-clickable .lb-archive-title-cell::after {
    content: ' ›';
    color: #94a3b8;
    font-size: 1.1em;
}

/* Badge důvodu archivace v modalu */
.lb-archive-reason-badge {
    display: inline-block;
    font-size: 11px;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 4px;
    padding: 2px 8px;
    font-style: italic;
}
