/* Дополнения к style.css — только для страниц блога и админки */

/* Статьи на публичной части */
.blog-hero {
    padding: 40px 0 20px;
}
.blog-hero h1 {
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -1.5px;
    margin-bottom: 16px;
}
.blog-hero p {
    color: var(--gray-dark);
    font-size: 1.1rem;
    max-width: 640px;
}

.post-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding-bottom: 40px;
}

/* Стили карточки статьи */
.post-card {
    background: var(--white);
    border-radius: 20px;
    border: 1px solid var(--gray-light);
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,.08);
    border-color: var(--accent-red);
}
.post-card-img {
    display: block;
    width: 100%;
    height: 320px;
    overflow: hidden;
}
.post-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.post-card:hover .post-card-img img {
    transform: scale(1.05);
}
.post-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.post-card h2 {
    font-size: 1.4rem;
    line-height: 1.25;
    margin-bottom: 12px;
}
.post-card h2 a { color: var(--text-main); }
.post-card h2 a:hover { color: var(--accent-red); }
.post-card .post-meta {
    font-size: .85rem;
    color: var(--gray-dark);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.post-card .post-excerpt {
    color: var(--gray-dark);
    font-size: 1rem;
    flex-grow: 1;
    margin-bottom: 20px;
}
.post-card .post-more {
    font-weight: 700;
    color: var(--accent-red);
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    align-self: flex-start;
}

/* Страница статьи */
.article-wrap {
    max-width: 820px;
    margin: 0 auto;
    padding: 30px 20px 80px;
}
.article-wrap .back-link {
    display: inline-block;
    margin-bottom: 24px;
    color: var(--gray-dark);
    font-size: .9rem;
}
.article-wrap .back-link:hover { color: var(--accent-red); }
.article-title {
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -1px;
    margin-bottom: 16px;
}
.article-meta {
    color: var(--gray-dark);
    font-size: .9rem;
    margin-bottom: 32px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.article-content {
    background: var(--white);
    border-radius: 24px;
    padding: 40px;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #2a2626;
}
.article-content h1, .article-content h2, .article-content h3 {
    margin: 1.4em 0 .5em;
    line-height: 1.15;
}
.article-content h1:first-child, .article-content h2:first-child { margin-top: 0; }
.article-content p { margin-bottom: 1em; }
.article-content ul, .article-content ol { margin: 0 0 1em 1.4em; }
.article-content blockquote {
    border-left: 4px solid var(--accent-red);
    padding: 8px 0 8px 20px;
    color: var(--gray-dark);
    margin: 1.4em 0;
    font-style: italic;
}
.article-content img { border-radius: 12px; margin: 1em 0; }
.article-content a { color: var(--accent-red); text-decoration: underline; }
.article-content pre {
    background: #1d1d1f; color: #f4f4f6;
    padding: 18px 20px; border-radius: 12px;
    overflow-x: auto; font-size: .9rem;
}

/* ------- АДМИНКА ------- */
.admin-wrap { max-width: 1000px; margin: 0 auto; padding: 30px 20px 80px; }
.admin-topbar {
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px; flex-wrap: wrap; margin-bottom: 28px;
}
.admin-topbar h1 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 700; letter-spacing: -.5px;
}
.admin-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-admin {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px 8px;
    border-radius: 50px;
    font-weight: 700;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid var(--text-main);
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    font-family: inherit;
    transition: .3s;
}
.btn-admin:hover { background: var(--text-main); color: var(--white); }
.btn-admin.primary { background: var(--accent-red); border-color: var(--accent-red); color: #fff; }
.btn-admin.primary:hover { background: #d81f1f; border-color: #d81f1f; }
.btn-admin.danger { border-color: var(--accent-red); color: var(--accent-red); }
.btn-admin.danger:hover { background: var(--accent-red); color: #fff; }

.admin-card {
    background: var(--white);
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 20px;
    border: 1px solid var(--gray-light);
}
.admin-card label {
    display: block; font-weight: 700; font-size: .85rem;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--gray-dark); margin: 14px 0 8px;
}
.admin-card label:first-child { margin-top: 0; }
.admin-card input[type=text],
.admin-card input[type=password],
.admin-card textarea {
    width: 100%; padding: 14px 16px;
    border: 2px solid var(--gray-light);
    border-radius: 12px; font-family: inherit;
    font-size: 1rem; background: var(--bg-color);
    transition: border-color .3s;
}
.admin-card input:focus, .admin-card textarea:focus {
    outline: none; border-color: var(--accent-red);
}

.admin-list {
    width: 100%; border-collapse: collapse;
    background: var(--white); border-radius: 20px; overflow: hidden;
    border: 1px solid var(--gray-light);
}
.admin-list th, .admin-list td {
    text-align: left; padding: 16px 20px;
    border-bottom: 1px solid var(--gray-light);
}
.admin-list th {
    background: var(--bg-color); font-size: .8rem;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--gray-dark);
}
.admin-list tr:last-child td { border-bottom: 0; }
.admin-list .actions a {
    color: var(--accent-red); font-weight: 700;
    text-decoration: none; font-size: .9rem;
}
.admin-list code {
    background: var(--bg-color); padding: 3px 8px;
    border-radius: 6px; font-size: .85rem;
}

.admin-flash {
    background: rgba(255,42,42,.08);
    border-left: 4px solid var(--accent-red);
    color: #a01414; padding: 14px 18px;
    border-radius: 10px; margin-bottom: 20px;
    font-weight: 500;
}
.admin-empty {
    background: var(--white); border-radius: 20px;
    padding: 40px; text-align: center; color: var(--gray-dark);
}

/* Редактор Quill — подгоняем под стиль */
#editor {
    background: #fff;
    border: 2px solid var(--gray-light);
    border-radius: 12px;
    min-height: 320px;
    font-size: 1rem;
}
.ql-toolbar.ql-snow {
    border: 2px solid var(--gray-light);
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    background: var(--bg-color);
}
.ql-container.ql-snow {
    border: 2px solid var(--gray-light);
    border-top: 0;
    border-radius: 0 0 12px 12px;
    font-family: 'Ubuntu', sans-serif;
}
.ql-editor { min-height: 300px; font-size: 1rem; line-height: 1.7; }
.ql-editor h1, .ql-editor h2 { font-family: 'Ubuntu', sans-serif; }

@media (max-width: 768px) {
    .article-content { padding: 24px 18px; border-radius: 18px; }
    .admin-card { padding: 20px 16px; }
    .admin-list th:nth-child(2),
    .admin-list td:nth-child(2) { display: none; }
}