/* /var/www/xstartx.ru/www/static/css/page-detail.css */
/* Стили страницы /page/<slug>/ (page_detail.html) */

/* ============================================================
   1. КОНТЕЙНЕР СТРАНИЦЫ
   ============================================================ */

.page-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
    color: #212529;
    caret-color: #212529;
}

.page-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.page-content h2 {
    font-size: 1.75rem;
    margin: 1.5rem 0 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.page-content h3 {
    font-size: 1.35rem;
    margin: 1.25rem 0 0.75rem;
    font-weight: 600;
    line-height: 1.3;
}

.page-content p {
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* Медиа внутри контента */
.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.page-content iframe {
    max-width: 100%;
    border-radius: 8px;
}

.page-content video {
    max-width: 100%;
    border-radius: 8px;
}

.page-content audio {
    width: 100%;
    max-width: 400px;
}

/* Таблицы */
.page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.page-content table th,
.page-content table td {
    border: 1px solid #dee2e6;
    padding: 8px 12px;
}

.page-content table th {
    background: #f8f9fa;
    font-weight: 600;
}

/* Цитаты, код */
.page-content blockquote {
    border-left: 4px solid #0d6efd;
    padding-left: 16px;
    margin-left: 0;
    color: #6c757d;
}

.page-content pre {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
}

.page-content code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.875em;
}

/* Тело контента — только line-height для читаемости */
.page-content-body {
    line-height: 1.7;
    color: #212529;
}

/* ============================================================
   2. ПЛЕЙСХОЛДЕР ПЕРЕВОДА
   ============================================================ */

.translation-placeholder {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    text-align: center;
    border: 1px dashed #dee2e6;
}

.translation-placeholder .spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid #e9ecef;
    border-top-color: #0d6efd;
    border-radius: 50%;
    animation: pageDetailSpin 0.8s linear infinite;
}

@keyframes pageDetailSpin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   3. АДМИНСКИЕ КНОПКИ (плав. кнопка справа снизу)
   ============================================================ */

.admin-controls {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-controls .btn {
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
}

.admin-controls .btn:hover {
    transform: scale(1.1);
}

.admin-controls .btn:focus-visible {
    outline: 3px solid #ffc107;
    outline-offset: 2px;
}

.admin-controls .btn-edit {
    background: #0d6efd;
    color: white;
}

.admin-controls .btn-edit:hover {
    background: #0b5ed7;
}

/* ============================================================
   4. ПАНЕЛЬ ПУБЛИКАЦИИ
   ============================================================ */

.publish-toggle-wrapper {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.publish-toggle-wrapper .status-label {
    font-weight: 500;
    color: #495057;
    margin-right: 0.5rem;
}

/* Глобальный статус — работает и в page_detail.html, и в page_edit.html */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-badge.published {
    background: #d1e7dd;
    color: #0a3622;
}

.status-badge.unpublished {
    background: #f8d7da;
    color: #58151c;
}

/* Альтернативный класс — используется в page_edit.html */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-indicator.published {
    background: #d1e7dd;
    color: #0a3622;
}

.status-indicator.unpublished {
    background: #f8d7da;
    color: #58151c;
}

/* ============================================================
   5. TOGGLE SWITCH (переключатель)
   ============================================================ */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #198754;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================================
   6. АДАПТИВНОСТЬ
   ============================================================ */

@media (max-width: 768px) {
    .page-content {
        padding: 1.5rem 1rem;
    }

    .page-content h1 {
        font-size: 2rem;
    }

    .page-content h2 {
        font-size: 1.5rem;
    }

    .page-content h3 {
        font-size: 1.2rem;
    }

    .publish-toggle-wrapper {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-controls {
        bottom: 20px;
        right: 16px;
    }

    .admin-controls .btn {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .page-content h1 {
        font-size: 1.75rem;
    }

    .page-content h2 {
        font-size: 1.35rem;
    }

    .page-content h3 {
        font-size: 1.1rem;
    }

    .page-content table {
        font-size: 0.875rem;
    }

    .page-content table th,
    .page-content table td {
        padding: 6px 8px;
    }
}
 
