/* ===========================================================
   Unified style.css — desktop + mobile (mobile rules at bottom)
   Save as static/blog/style.css
   =========================================================== */

/* === ПЕРЕМЕННЫЕ ТЕМЫ === */
:root{
    --page-bg: #fbf7f5;
    --paper: #fffefc;
    --text: #222222;
    --heading: #111111;
    --muted: #6b5f5b;
    --subtle-border: #e6dcd9;
    --shadow-1: rgba(0,0,0,0.06);
    --shadow-2: rgba(0,0,0,0.08);

    --link: #7a4f46;
    --link-dark: #5b3a33;
    --accent: #9a4b3c;
    --accent-dark: #6b0f2a;

    --muted-bg: #fbf9f8;
}

/* === БАЗОВЫЕ НАСТРОЙКИ === */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--page-bg);
    color: var(--text);
    font-family: 'Source Serif 4', serif;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,h2,h3,h4 { color: var(--heading); margin: 0 0 .5rem; }

a { color: var(--link); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--link-dark); text-decoration: underline; }

button { cursor: pointer; font-family: inherit; transition: background-color .18s ease; }

/* === КОНТЕЙНЕРЫ === */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 15px;
}

/* === ШАПКА === */
header {
    top: 0;
    z-index: 1000;
    padding: 12px 20px 8px;
    background: linear-gradient(135deg, #fbf5f4, #f3e9e6);
    box-shadow: 0 2px 4px var(--shadow-1);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* логотип и меню-кнопка слева */
.menu-logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.menu-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 6px;
    line-height: 1;
}

/* логотип */
.logo img {
    height: 50px;
    border-radius: 6px;
    display: block;
}

/* навигация справа */
nav {
    display: flex;
    gap: 15px;
    align-items: center;
}
nav a {
    color: #5a3f3b;
    font-family: 'DM Serif Display', serif;
    font-weight: 500;
}
nav a:hover { color: var(--accent-dark); }

/* цитата под шапкой */
.header-quote {
    margin-top: 5px;
    text-align: center;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--muted);
    opacity: 0;
    animation: fadeIn 1.6s ease forwards;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px);} to { opacity:1; transform: translateY(0);} }

/* === ОСНОВНОЙ КОНТЕНТ === */
main {
    max-width: 800px;
    margin: 100px auto 60px;
    padding: 0 15px;
}

/* === ПОСТЫ / КАРТОЧКИ === */
.post, .post-form-container, .comment {
    background: var(--paper);
    border-radius: 8px;
    box-shadow: 0 1px 3px var(--shadow-1);
}

.post {
    padding: 25px;
    margin-bottom: 30px;
}

.post h1 { margin-top: 0; }
.post-content { margin-top: 15px; }

.post-content img { max-width: 100%; height: auto; border-radius: 6px; }
.post-content a { color: var(--link); }
.post-content a:hover { color: var(--link-dark); }

/* === ФОРМА ПОСТА === */
.post-form-container { padding: 25px; margin-bottom: 40px; }
.post-form-container h1 { font-family: 'Montserrat', sans-serif; margin-bottom: 20px; }

.post-form-container input[type="text"],
.post-form-container textarea,
.comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #d6cfcf;
    border-radius: 4px;
    font-family: 'Merriweather', serif;
    margin-bottom: 15px;
    background: #fffdfc;
}

.post-form-container button,
.comment-form button {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: .95rem;
}
.post-form-container button:hover,
.comment-form button:hover { background: var(--accent-dark); }

/* === КОММЕНТАРИИ === */
.comment {
    border-left: 3px solid #e8d8d6;
    padding: 15px;
    margin: 10px 0;
    border-radius: 6px;
}

.comment .comment-author { font-weight:600; font-family:'Montserrat',sans-serif; color:#4b3f3c; }
.comment .comment-text { margin-top:8px; font-family:'Merriweather',serif; color:var(--text); }
.comment button { background:none; border:none; color:var(--accent); font-size:.9rem; margin-right:10px; }
.comment .replies { margin-left:20px; margin-top:10px; border-left:1px dashed #e3d6d4; padding-left:15px; }

/* === ПОСТ-ЛИСТ / КАРТОЧКИ === */
.post-list { display:flex; flex-direction:column; gap:2rem; }

.post-card {
    background: var(--paper);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 4px var(--shadow-1);
    transition: box-shadow .18s ease;
}
.post-card:hover { box-shadow: 0 4px 12px var(--shadow-2); }

.post-card h2 { margin:0 0 .5rem; font-weight:500; font-size:1.6rem; }
.post-meta { font-size:.9rem; color:#7a6f6f; font-style:italic; margin-bottom:1rem; }

/* === КНОПКИ === */
.btn, .btn-primary, .btn-secondary, .btn-small { display:inline-block; border-radius:5px; text-decoration:none; transition:background .18s ease; }
.btn-primary { background:var(--accent); color:#fff; padding:8px 14px; }
.btn-primary:hover { background:var(--accent-dark); }
.btn-small { padding:4px 8px; font-size:.85rem; border:1px solid #d6cfcf; color:#3b3433; background:#fffdfc; }

/* === DASHBOARD / SORTABLE === */
#sortable-posts, .sortable { list-style:none; padding:0; margin:20px 0; }
#sortable-posts li, .sortable-item {
    background: var(--paper);
    border-radius:5px;
    box-shadow: 0 1px 3px var(--shadow-1);
    padding:10px 15px;
    margin-bottom:8px;
    cursor:grab;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

/* класс для отключения pointer (анонимные) */
.no-pointer { cursor: default; text-decoration: none; }

/* === ТЕМЫ / НИТИ === */
.thread-container {
    max-width:700px;
    margin:0 auto;
    background:var(--paper);
    padding:2rem;
    border-radius:1rem;
    box-shadow:0 2px 8px var(--shadow-1);
}
.thread-navigation, .thread-links { display:flex; justify-content:space-between; align-items:center; font-size:.95rem; margin:1.5rem 0; }
.thread-name { font-style:italic; color:#5a4745; }

/* === СЛАЙД-МЕНЮ / SIDE MENU === */
.side-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    background-color: var(--paper);
    box-shadow: 2px 0 8px rgba(0,0,0,0.12);
    padding: 1.5rem;
    transition: left .28s ease;
    z-index: 1200;
    display:flex;
    flex-direction:column;
}
.side-menu h3 { margin-top:0; margin-bottom:1rem; }
.side-menu ul { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:.5rem; }
.side-menu ul li a { color:#5a3f3b; text-decoration:none; }
#menu-close { position:absolute; top:.5rem; right:.5rem; background:none; border:none; font-size:1.5rem; cursor:pointer; }
.menu-overlay {
    position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,.25); display:none; z-index:1100;
}

/* === ПОДВАЛ === */
footer { text-align:center; font-size:.8rem; color:#7a6f6f; padding:15px 0; border-top:1px solid var(--subtle-border); background:#f6f4f3; }

/* === Утилиты === */
.hint { font-style:italic; font-size:.9rem; color:var(--muted); margin-bottom:1rem; }

/* ===========================================================
   MOBILE / Adaptive section — put at the end so it overrides
   =========================================================== */

/* Базовая адаптивность: до 768px */
@media (max-width: 768px) {

    /* общий контейнер и типографика */
    html, body { font-size: 16px; line-height: 1.5; }
    main { margin: 70px auto 40px; padding: 0 12px; max-width: 100%; }

    /* header: логотип + кнопка меню */
    header { padding: 10px 12px; }
    .header-top { flex-direction: column; align-items: stretch; gap: 10px; }
    .menu-logo-container { justify-content: space-between; width: 100%; align-items: center; }
    .menu-button { font-size: 26px; padding: 4px; }
    .logo img { max-width: 140px; height: auto; }

    /* навигация: компактнее, перенос строк */
    nav { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; font-size: .95rem; }
    nav a { padding: 6px 8px; }

    /* пост-лист и карточки */
    .post-card { padding: 14px; }
    .post-card h2 { font-size: 1.15rem; }
    .post-meta { font-size: .85rem; }

    /* пост детально */
    .post { padding: 14px; margin-bottom: 18px; }
    .post h1 { font-size: 1.5rem; }
    .post-content { font-size: 1rem; line-height: 1.5; }

    /* комментарии — компактнее */
    .comment { padding: 10px; margin-bottom: 12px; border-radius: 6px; }
    .comment .comment-author { font-size: .95rem; }
    .comment .comment-text { font-size: .95rem; }

    /* сортируемые элементы — становятся блочными */
    .sortable-item { display: block; padding: 12px; border-radius: 8px; border: 1px solid #eee; background:#fbfbfa; margin-bottom: 10px; }
    .sortable-item .post-link { font-size: 1.05rem; display:block; word-break: break-word; }
    .sortable-item .meta { display:block; font-size:.85rem; margin-top:6px; color:#6b5f5b; }

    /* thread navigation vertical */
    .thread-navigation { flex-direction: column; gap: .5rem; margin-top: 12px !important; }
    .thread-navigation a { display:block; padding:8px 10px; background:#f1efed; border-radius:6px; text-align:center; }

    /* side menu — make it percentage-based and hidden by default left */
    .side-menu { width: 80vw; left: -80vw; padding: 18px; }
    .menu-overlay { display: none; } /* controlled by JS — show/hide */

    /* post content media */
    .post-content img, .post-content iframe, .post-content video { max-width: 100%; height: auto; display:block; margin: 12px auto; border-radius:6px; }

    /* reduce margin for main elements */
    .thread-container { padding: 1.25rem; margin: .75rem; border-radius: .75rem; }

    /* footer smaller */
    footer { font-size: .8rem; padding: 12px 0; }

    /* small utility tweaks */
    .hint { font-size: .9rem; }
}

/* ===========================================================
   End of file
   =========================================================== */
