/**
 * Tabulky v článcích blogu — editor i veřejná stránka.
 */
.article-body figure.table,
.ck-content figure.table {
    margin: 1.5rem 0;
    max-width: 100%;
    overflow-x: auto;
    border-radius: 1rem;
    box-shadow: 0 8px 24px -16px rgba(15, 23, 42, 0.25);
}

.article-body figure.table table,
.ck-content figure.table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
    line-height: 1.5;
}

.article-body figure.table td,
.article-body figure.table th,
.ck-content figure.table td,
.ck-content figure.table th {
    border: 1px solid #e2e8f0;
    padding: 0.7rem 0.95rem;
    vertical-align: top;
}

.article-body figure.table th,
.ck-content figure.table th {
    background: #f8fafc;
    color: #0f172a;
    font-weight: 700;
    text-align: left;
}

.article-body figure.table.blog-table-striped tbody tr:nth-child(even) td,
.ck-content figure.table.blog-table-striped tbody tr:nth-child(even) td {
    background-color: #f8fafc;
}

.article-body figure.table.blog-table-accent th,
.ck-content figure.table.blog-table-accent th {
    background: linear-gradient(135deg, #d4af37, #b8962e);
    color: #0f172a;
    border-color: #c4a030;
}

.article-body figure.table.blog-table-borderless td,
.article-body figure.table.blog-table-borderless th,
.ck-content figure.table.blog-table-borderless td,
.ck-content figure.table.blog-table-borderless th {
    border: none;
    border-bottom: 1px solid #f1f5f9;
}

.article-body figure.table.blog-table-borderless th,
.ck-content figure.table.blog-table-borderless th {
    border-bottom: 2px solid #d4af37;
}

.article-body figure.table.blog-table-align-center,
.ck-content figure.table.blog-table-align-center {
    margin-left: auto;
    margin-right: auto;
}

.article-body figure.table.blog-table-align-right,
.ck-content figure.table.blog-table-align-right {
    margin-left: auto;
    margin-right: 0;
}

.article-body figure.table.blog-table-align-left,
.ck-content figure.table.blog-table-align-left {
    margin-left: 0;
    margin-right: auto;
}

/* Plovoucí panel úpravy tabulky v editoru článku */
.blog-table-format-bar {
    display: none;
    position: fixed;
    z-index: 45;
    width: 300px;
    max-width: calc(100vw - 24px);
    max-height: min(560px, calc(100dvh - 24px));
    overflow-x: hidden;
    overflow-y: auto;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e8e4d8;
    border-radius: 1.25rem;
    box-shadow: 0 22px 50px -18px rgba(15, 23, 42, 0.35);
}

.blog-table-format-bar.is-visible {
    display: flex;
}

.blog-table-format-bar.is-docked {
    left: 12px !important;
    right: 12px !important;
    top: auto !important;
    bottom: 12px;
    width: auto;
    max-height: 46dvh;
}

.blog-table-format-bar .btf-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    background: linear-gradient(135deg, #fffbeb 0%, #fff 70%);
    border-bottom: 1px solid #f1f5f9;
    position: sticky;
    top: 0;
    z-index: 1;
}

.blog-table-format-bar .btf-head-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, #d4af37, #b8962e);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px -8px rgba(184, 150, 46, 0.8);
    flex-shrink: 0;
}

.blog-table-format-bar .btf-head-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.blog-table-format-bar .btf-head-sub {
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 0.15rem;
}

.blog-table-format-bar .btf-section {
    padding: 0.85rem 1rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.blog-table-format-bar .btf-section:last-child {
    border-bottom: none;
}

.blog-table-format-bar .btf-section h3 {
    margin: 0 0 0.65rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #b8962e;
}

.blog-table-format-bar .btf-hint {
    margin: 0.55rem 0 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
}

.blog-table-format-bar .btf-hint:first-of-type {
    margin-top: 0;
}

.blog-table-format-bar .btf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    width: 100%;
    min-height: 44px;
    padding: 0 0.75rem;
    border-radius: 0.8rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.blog-table-format-bar .btf-btn i {
    width: 1.1rem;
    text-align: center;
    color: #b8962e;
}

.blog-table-format-bar .btf-btn:hover {
    border-color: #d4af37;
    color: #0f172a;
    background: #fffbeb;
}

.blog-table-format-bar .btf-btn.is-active {
    border-color: #d4af37;
    background: #fef3c7;
    color: #0f172a;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.16);
}

.blog-table-format-bar .btf-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.blog-table-format-bar .btf-stack {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.blog-table-format-bar .btf-swatches {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.4rem;
}

.blog-table-format-bar .btf-swatch {
    width: 100%;
    aspect-ratio: 1;
    min-height: 44px;
    border-radius: 0.65rem;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    padding: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.blog-table-format-bar .btf-swatch:hover,
.blog-table-format-bar .btf-swatch.is-active {
    transform: scale(1.06);
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #d4af37;
}

.blog-table-format-bar .btf-swatch.is-none {
    background:
        linear-gradient(to bottom right, transparent calc(50% - 1px), #ef4444 calc(50% - 1px), #ef4444 calc(50% + 1px), transparent calc(50% + 1px)),
        #fff;
}

.blog-table-format-bar .btf-align-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
}

.blog-table-format-bar .btf-align-grid .btf-btn {
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.4rem 0.25rem;
    font-size: 0.68rem;
    text-align: center;
}

.blog-table-format-bar .btf-align-grid .btf-btn i {
    width: auto;
}
