/* ============================================================
 *  Sigma Chess — реестр презентаций
 *  Полная таблица стилей.
 * ============================================================ */

/* ------------------------------------------------------------
 *  Обёртка шорткода
 * ------------------------------------------------------------ */

.sigmachess-pres-wrap {
    margin: 0 0 40px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1a1a1a;

    /* Горизонтальный скролл таблицы на узких экранах. */
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.sigmachess-pres-empty {
    padding: 24px 0;
    color: #6b7280;
    font-size: 15px;
}

/* ------------------------------------------------------------
 *  Таблица
 * ------------------------------------------------------------ */

.sigmachess-pres-table {
    width: 100%;
    min-width: 720px;          /* ниже не сжимается — вместо этого скролл */
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    table-layout: auto;
}

.sigmachess-pres-table th {
    background: #f9fafb;
    text-align: left;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #475467;
    border-bottom: 1px solid #e5e7eb;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.sigmachess-pres-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    vertical-align: middle;
}

.sigmachess-pres-table tr:last-child td {
    border-bottom: 0;
}

.sigmachess-pres-table tr:hover td {
    background: #f9fafb;
}

/* Колонка с датой — чтобы не переносилась. */
.sigmachess-pres-table td[data-label="Дата"],
.sigmachess-pres-table th:first-child {
    white-space: nowrap;
}

.sigmachess-pres-note {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

.sigmachess-pres-dash {
    color: #98a2b3;
}

/* ------------------------------------------------------------
 *  Кнопка «Смотреть»
 * ------------------------------------------------------------ */

.sigmachess-pres-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 0;
    border-radius: 8px;
    background: #eef2ff;
    color: #3538cd !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
    font-family: inherit;
    white-space: nowrap;
}

.sigmachess-pres-view-btn:hover {
    background: #e0e7ff;
}

.sigmachess-pres-view-btn:active {
    transform: translateY(1px);
}

.sigmachess-pres-view-btn:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

/* ------------------------------------------------------------
 *  Кнопки скачивания
 * ------------------------------------------------------------ */

.sigmachess-pres-dl {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 8px;
    background: #eef2ff;
    color: #3538cd !important;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transition: background .15s ease;
}

.sigmachess-pres-dl:hover {
    background: #e0e7ff;
    color: #1e1b4b !important;
}

/* ============================================================
 *  Модальное окно — на весь экран
 * ============================================================ */

body.sigmachess-pres-modal-locked {
    overflow: hidden;
}

.sigmachess-pres-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    align-items: stretch;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}

.sigmachess-pres-modal--open {
    display: flex;
}

.sigmachess-pres-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 17, 21, .82);
    backdrop-filter: blur(3px);
    animation: sigmachess-pres-fade .18s ease;
}

.sigmachess-pres-modal__dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    background: #0f1115;
    border-radius: 0;
    box-shadow: none;
    padding: 50px;
    box-sizing: border-box;
    animation: sigmachess-pres-pop .2s ease;
}

.sigmachess-pres-modal__title {
    flex: 0 0 auto;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 44px 10px 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sigmachess-pres-modal__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .10);
    color: #ffffff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease;
    z-index: 2;
}

.sigmachess-pres-modal__close:hover {
    background: rgba(255, 255, 255, .22);
}

.sigmachess-pres-modal__frame-wrap {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.sigmachess-pres-modal__frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

@keyframes sigmachess-pres-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes sigmachess-pres-pop {
    from { opacity: 0; transform: translateY(8px) scale(.985); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ============================================================
 *  Адаптив
 * ============================================================ */

@media (max-width: 768px) {

    /* ---------- Таблица ---------- */

    .sigmachess-pres-wrap {
        /* отступ снизу, чтобы скролл не «слипался» с контентом */
        padding-bottom: 4px;
    }

    .sigmachess-pres-table {
        min-width: 640px;      /* включается горизонтальный скролл */
    }

    .sigmachess-pres-table th,
    .sigmachess-pres-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .sigmachess-pres-view-btn,
    .sigmachess-pres-dl {
        padding: 7px 10px;
        font-size: 12.5px;
    }

    /* ---------- Модалка ---------- */

    .sigmachess-pres-modal__dialog {
        padding: 8px 8px 12px;
    }

    .sigmachess-pres-modal__title {
        font-size: 13px;
        margin: 0 40px 8px 2px;
    }

    .sigmachess-pres-modal__close {
        top: 6px;
        right: 6px;
        width: 32px;
        height: 32px;
        font-size: 20px;
    }

    .sigmachess-pres-modal__frame-wrap {
        border-radius: 6px;
    }
}

@media (max-width: 480px) {

    .sigmachess-pres-table {
        min-width: 560px;
    }

    .sigmachess-pres-table th,
    .sigmachess-pres-table td {
        padding: 8px 10px;
        font-size: 12.5px;
    }

    .sigmachess-pres-modal__dialog {
        padding: 6px 6px 10px;
    }

    .sigmachess-pres-modal__title {
        font-size: 12px;
        margin-right: 36px;
    }

    .sigmachess-pres-modal__close {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
}

/* Безопасные зоны iPhone (опционально). */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .sigmachess-pres-modal__dialog {
            padding-top:    max(20px, env(safe-area-inset-top));
            padding-bottom: max(20px, env(safe-area-inset-bottom));
            padding-left:   max(8px, env(safe-area-inset-left));
            padding-right:  max(8px, env(safe-area-inset-right));
        }
    }
}

.text-name {
	font-size: 16px;
    font-weight: 500;
    color: #6346f8;
}