* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1c2526, #2e3536);
    color: #e0e0e0;
    line-height: 1.6;
}

.page-wrapper {
    width: 40%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: rgba(40, 45, 50, 0.95);
    border-radius: 15px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.header {
    text-align: center;
    padding: 40px 0;
    background: linear-gradient(45deg, #2a2f33, #3c4447);
    color: #ffffff;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
    font-size: 2.5em;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
}

.header p {
    font-size: 1.1em;
}

.nav {
    display: flex;
    justify-content: center;
    gap: 25px;
    padding: 15px 0;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav a {
    color: #b0b8c0;
    text-decoration: none;
    font-weight: 700;
    font-size: 1em;
    transition: all 0.3s ease;
    padding: 8px 15px;
    border-radius: 5px;
}

.nav a:hover, .nav a.active {
    color: #ffffff;
    background: rgba(60, 70, 80, 0.3);
}

.container {
    flex: 1;
    padding: 25px;
}

section {
    display: none;
    text-align: center;
}

section.active {
    display: block;
}

section h2 {
    color: #a0a8b0;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px 0;
}

.post {
    background: rgba(50, 55, 65, 0.9);
    border-radius: 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease-in-out;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    width: 90%;
    margin: 0 auto;
    padding: 15px;
    overflow: hidden;
    position: relative;
}

.post.show {
    opacity: 1;
    transform: translateY(0);
}

.post-header {
    margin-bottom: 10px;
    text-align: left;
}

.post h3 {
    color: #c0c8d0;
    font-size: 1.2em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}

.post p {
    font-size: 0.9em;
    color: #d0d8e0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.post img {
    width: 100%;
    object-fit: contain;
    border-radius: 5px;
    margin: 10px 0;
}

.post .no-image {
    width: 100%;
    background: rgba(60, 65, 75, 0.8);
    border-radius: 5px;
    margin: 10px 0;
    padding-top: 56.25%; /* Пропорция 16:9 для заглушки */
    background-size: cover;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.post .read-more {
    background: rgba(60, 70, 80, 0.8);
    color: #ffffff;
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    font-family: 'Arial', sans-serif;
    font-weight: 700;
    transition: background 0.3s ease;
    font-size: 0.9em;
    text-decoration: none;
    display: inline-block;
}

.post .read-more:hover {
    background: rgba(80, 90, 100, 0.8);
}

.post-date {
    color: #90a0b0;
    font-size: 0.8em;
}

.post-full {
    text-align: left;
    padding: 15px;
}

.post-full img {
    width: 100%; /* Занимает 100% ширины основного блока */
    object-fit: contain; /* Сохраняем пропорции, подстраиваем целиком */
    border-radius: 5px;
    margin: 10px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

#admin-auth, #admin-content {
    display: block;
    padding: 25px;
    text-align: center;
}

#admin-auth input, #admin-content input, #admin-content textarea {
    width: 100%;
    padding: 12px;
    margin: 15px auto;
    background: rgba(50, 55, 65, 0.8);
    color: #e0e0e0;
    border: none;
    border-radius: 8px;
    font-family: 'Arial', sans-serif;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
    display: block;
}

#admin-auth button, #admin-content button {
    background: rgba(60, 70, 80, 0.8);
    color: #ffffff;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Arial', sans-serif;
    font-weight: 700;
    transition: background 0.3s ease;
    margin: 15px auto;
    display: block;
}

#admin-auth button:hover, #admin-content button:hover {
    background: rgba(80, 90, 100, 0.8);
}

.admin-section {
    margin-top: 25px;
}

.edit-post {
    background: rgba(50, 55, 65, 0.9);
    padding: 15px;
    margin: 15px 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    text-align: left;
}

.edit-post img {
    max-width: 100px;
    border-radius: 5px;
    margin: 10px auto;
    display: block;
}

#stats p {
    font-size: 1.1em;
    margin: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#stats .icon {
    font-size: 1.5em;
}

.footer {
    text-align: center;
    padding: 25px;
    color: #a0b0c0;
    font-size: 1em;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 600px) {
    .header h1 {
        font-size: 2em;
    }
    .nav {
        flex-direction: column;
        gap: 15px;
    }
    .page-wrapper {
        width: 90%;
    }
    .post {
        width: 100%;
    }
}