/* ===== ВАШИ СУЩЕСТВУЮЩИЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    min-height: 100vh;
    padding-top: 70px;
    padding-bottom: 70px;
    margin: 0;
}

#bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.4);
    filter: blur(30px);
    opacity: 0;
    transition: opacity 0.6s ease-in-out, transform 0.1s ease-out;
}

.bg-layer.active {
    opacity: 0.35;
}

.site-header, .site-footer {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.site-header { top: 0; border-radius: 0 0 20px 20px; }
.site-footer { bottom: 0; border-radius: 20px 20px 0 0; }

.panel-inner {
    max-width: 600px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
}

.site-title {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #333;
}

.header-buttons { display: flex; gap: 8px; }
.footer-buttons { display: flex; gap: 8px; }

.btn-header, .btn-footer {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
}

.btn-footer {
    padding: 8px 12px;
    min-width: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-header:hover, .btn-footer:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.footer-phone {
    font-size: 18px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
}

.container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
    z-index: 1;
}

.post {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(5px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.post:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.post-text {
    font-size: 18px;
    line-height: 1.6;
    color: #222;
    word-wrap: break-word;
    white-space: pre-wrap;
    font-weight: 500;
}

.post-media {
    margin-bottom: 15px;
    border-radius: 12px;
    overflow: hidden;
}

.post-media img {
    width: 100%;
    display: block;
    border-radius: 12px;
}

.loading, .error {
    text-align: center;
    padding: 40px;
    background: rgba(255,255,255,0.9);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.error { color: #e74c3c; }

.refresh-btn {
    margin-top: 20px;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}
.modal.active { display: flex; }
.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    position: relative;
    animation: fadeIn 0.3s;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-close {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    background: none;
    border: none;
}
.modal-close:hover { color: #333; }

.modal h3 { font-size: 32px; margin-bottom: 15px; color: #333; }
.modal p  { font-size: 24px; line-height: 1.5; color: #555; }

/* Адаптивность */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
        padding-bottom: 60px;
    }
    #bg-container {
        display: none;
    }
    .site-header, .site-footer {
        backdrop-filter: none;
        background: white;
    }
    .panel-inner {
        padding: 10px 15px;
    }
    .site-title { font-size: 18px; }
    .btn-header { padding: 6px 12px; font-size: 13px; }
    .btn-footer { padding: 6px 10px; font-size: 13px; min-width: 36px; }
    .footer-phone { font-size: 16px; }

    .modal h3 { font-size: 28px; }
    .modal p  { font-size: 20px; }

    /* Контейнер занимает всю ширину без полей */
    .container {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    /* Посты — прямоугольные, без скруглений, прижаты к краям */
    .post {
        padding: 0;
        margin-bottom: 10px;
        border-radius: 15px;
        overflow: hidden;
        background: #fff;
    }
    /* Текст внутри поста сохраняет внутренние отступы (уже задано) */
    .post-text {
        padding: 15px 20px;
    }
    .post-media,
    .carousel {
        margin-bottom: 0;
        border-radius: 0;
    }
    .post-media img,
    .carousel-slide img {
        border-radius: 0;
    }
}

/* Видео-блок */
.video-wrapper {
    position: relative;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
}

.video-wrapper img {
    width: 100%;
    display: block;
    border-radius: 12px;
}

.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s, transform 0.2s;
    pointer-events: none; /* чтобы клик шёл на весь контейнер */
}

.video-wrapper:hover .video-play-btn {
    background: rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.05);
}

.video-wrapper {
    aspect-ratio: 9 / 16;
}

/* Карусель */
.carousel {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 15px;
}
.carousel-track {
    display: flex;
    transition: transform 0.3s ease-in-out;
}
.carousel-slide {
    min-width: 100%;
    user-select: none;
    -webkit-user-drag: none;
}
.carousel-slide img {
    width: 100%;
    display: block;
    border-radius: 12px;
}
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 2;
}
.carousel-btn:hover { background: rgba(0,0,0,0.8); }
.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }
.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
}
.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.2s;
}
.carousel-dot.active { background: #fff; }
