/* --- Сброс стилей и переменные --- */
:root {
    --bg-color: #1a1025;       /* Темно-фиолетовый фон */
    --card-bg: #2d1b4e;        /* Фон карточек */
    --text-color: #e0e0e0;     /* Светлый текст */
    --accent-color: #ffd700;   /* Золотой акцент */
    --accent-hover: #ffea00;
    --font-heading: 'Cinzel', serif;
    --font-body: 'Lato', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
}

a.s_page {
	display:inline-block;
	color: #0f0;
	width: 28px;
	border:1px solid #f60;
	text-align: center;
	font-weight: bold;
	height: 28px;
	text-decoration: none;
	line-height: 28px;
	background-color: #030;
	margin-top: 20px;
	margin-right: 30px;
	margin-bottom: 20px;
}

a.s_page:hover {
    color: #ff0; 
    border:1px solid #ff0;
	font-weight: bold;
	line-height: 28px;
	background-color: #630;
}

#lit {
	width: 100%;
	text-align: center;
	margin: 20px 0 20px 0;
}

.links-container {
    display: flex;
    flex-wrap: wrap; /* Разрешает перенос на новую строку */
    gap: 10px; /* Отступы между ссылками по вертикали и горизонтали */
}

.link-item {
    display: inline-block; /* Важно! Позволяет управлять шириной и высотой */
    box-sizing: border-box; /* Важно! Чтобы padding не увеличивал ширину блока */
    text-decoration: none;
    color: #0f0;
    border: 1px solid #f60;
    padding: 10px; /* Единый padding для обоих состояний */
    background: #030;
    border-radius: 5px;
    text-align: center;
    min-width: 120px; /* Опционально: задайте минимальную ширину, чтобы ссылки были одинаковыми */
    transition: all 0.3s ease; /* Плавная анимация изменений */
}

.link-item:hover {
    color: #ff0;
    border: 1px solid #ff0;
    background: #630;
    /* Убрали padding: 10px! Если очень хочется больше воздуха, увеличьте padding в обычном состоянии до 10px */
    transform: translateY(-2px); /* Легкий эффект поднятия вверх при наведении (опционально) */
}

@media (max-width: 600px) {
  .links-container {
    grid-template-columns: 1fr; /* Или flex-direction: column; для Flexbox */
  }
}

a {
    text-decoration: none;
    color: var(--accent-color);
    transition: 0.3s;
}

a:hover {
    color: var(--accent-hover);
}

ul {
    list-style: none;
}

/* --- Контейнер --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    background-color: #1a1025; /* Темный фон для примера */
}

/* --- Шапка (Header) --- */
.site-header {
    background-color: #333; /* Темный фон для примера */
    color: #fff;
    padding: 15px 0;
    font-family: sans-serif;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #1a1025; /* Темный фон для примера */
}

/* Стили логотипа */
.logo {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
    z-index: 102; /* Чтобы логотип был поверх меню при открытии */
}

/* --- Стили для гамбургера (скрыты на десктопе) --- */
.burger-menu {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    z-index: 102;
}

.burger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #fff;
    transition: all 0.3s ease;
}

/* Скрываем стандартный чекбокс */
.menu-toggle-input {
    display: none;
}

/* --- Стили для меню (десктоп) --- */
.main-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}

.main-menu a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
}

.main-menu a:hover {
    color: #ffd700; /* Золотой цвет при наведении (подходит для мистики) */
}

/* =========================================
   АДАПТИВНОСТЬ (Mobile)
   ========================================= */
@media (max-width: 768px) {
    /* Показываем гамбургер */
    .burger-menu {
        display: flex;
    }

    /* Скрываем меню по умолчанию */
    .main-menu {
        position: relative;
        top: 100%; /* Появляется сразу под хедером */
        left: 0;
        width: 100%;
        background-color: #222; /* Чуть темнее фона хедера */
        flex-direction: column;
        max-height: 0; /* Скрыто по высоте */
        overflow: hidden;
        transition: max-height 0.4s ease-out;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    
/* Меняем список на вертикальный */
    .main-menu ul {
        flex-direction: column;
        padding: 0;
        gap: 0;
    }

    .main-menu li {
        text-align: center;
        border-bottom: 1px solid #444;
    }

    .main-menu a {
        display: block;
        padding: 15px;
        width: 100%;
        box-sizing: border-box;
    }
    
        /* ЛОГИКА ОТКРЫТИЯ МЕНЮ */
    /* Когда чекбокс отмечен, меняем стиль лейбла (анимация крестика) */
    .menu-toggle-input:checked ~ .burger-menu span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }
    .menu-toggle-input:checked ~ .burger-menu span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle-input:checked ~ .burger-menu span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }

    /* И раскрываем само меню */
    .menu-toggle-input:checked ~ .main-menu {
        max-height: 500px; /* Достаточная высота для раскрытия */
    }
}

/* --- Основной лейаут (Grid) --- */
.main-wrapper {
    display: grid;
    grid-template-columns: 3fr 1fr; /* 3 части контент, 1 часть сайдбар */
    gap: 40px;
    margin-top: 40px;
    margin-bottom: 40px;
}

/* --- Контент (Main) --- */
.content article {
    background-color: var(--card-bg);
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    border: 1px solid #444;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.content ul li {
 list-style: none;
 background: url('img/disk.jpg') no-repeat 4px 5px;
 padding-left: 20px;
 }

h1 {
  font-size: clamp(1.5rem, 5vw, 3rem); /* Адаптивный размер шрифта */
  line-height: 1.2;
  color: var(--accent-color);
}

h2 {
  font-size: clamp(1.25rem, 4vw, 2.5rem);
  color: var(--accent-color);
}

h3 {
  font-size: clamp(1.25rem, 4vw, 2.5rem);
  color: var(--accent-color);
}

/* и так далее для h3-h6 */

@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem; /* Уменьшение на мобильных */
  }
}

.meta {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 20px;
    font-style: italic;
}

.post-image {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 20px 0;
    filter: brightness(0.8) contrast(1.2);
}

.float-img {
  float: left; /* Или right */
  margin-top: 10px;
  margin-right: 20px;
  margin-bottom: 10px;
  max-width: 50%; /* Чтобы картинка не была слишком огромной */
}

.float-img {
  display: flex;
  justify-content: center; /* Центрирование по горизонтали */
  align-items: center;     /* Центрирование по вертикали */
  
}

img {
  max-width: 100%;         /* Адаптивность: картинка не вылезет за пределы */
  height: auto;
}

/* Важно: после float-элемента нужно очистить поток, если за картинкой идет другой блок */
.container::after {
  content: "";
  display: table;
  clear: both;
}

.read-more {
    display: inline-block;
    margin-top: 15px;
    border: 1px solid var(--accent-color);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.ch {
 color: #f60;
 font-weight: bolder;
 font:normal 14px/1.4 "MS Sans Serif", Tahoma;
 }

.read-more:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
}



/* ???????? ????????? ???????? */
.card {
    margin-bottom: 20px; /* ?????? ????? ???????? ???? */
}

/* ????? ???????? */
.card-grid {
    display: grid;
    /* ?????????????? ??????????: ??????? 150px, ???????? - ??????? ?????? */
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px; /* ?????????? ????? ?????????? */
    width: 100%;
}

/* ???? ???????? (???????) */
.card-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    
    /* ?????: ????????? ??????, ????? ??? ???????? ???? ??????? */
    height: 200px; /* ????? ?????? ??? ??? ?????? */
    border: 1px solid #2d1b4e; /* ???????????: ????? ??? ????????? */
    border-radius: 8px;
    overflow: hidden; /* ???????? ???, ??? ??????? ?? ??????? */
    background-color: #2d1b4e;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* ?????? ?????? ???????? */
.card-item a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 10px;
    box-sizing: border-box;
}

/* ???????? */
.card-item img.fig {
    max-width: 100%;
    max-height: 140px; /* ???????????? ?????? ????????, ????? ???????? ????? ??? ?????? */
    object-fit: contain; /* ???????? ??????????? ???????, ???????? ????????? */
    /* ???? ??????, ????? ???????? ????????? ??????? ? ?????????? ??????, ??????????? object-fit: cover; */
    
    /* ???????? ?????????? ????????? */
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto 10px auto;
}

/* ????????? ??? ????????? */
.card-title {
    font-size: 14px;
    line-height: 1.2;
    color: #6f6;
    font-weight: normal;
    display: block;
    /* ????????????? ??????? ????, ???? ?????, ??? ????????? ??? ???? */
    white-space: normal; 
}
.card-title a:hover{
    font-size: 14px;
    line-height: 1.2;
    color: #fff;
    font-weight: normal;
    display: block;
    /* ????????????? ??????? ????, ???? ?????, ??? ????????? ??? ???? */
    white-space: normal; 
}





/* --- Сайдбар (Sidebar) --- */
.sidebar .widget {
    background-color: var(--card-bg);
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
}

.sidebar h3 {
    font-family: var(--font-heading);
    color: var(--accent-color);
    margin-bottom: 15px;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}

.sidebar ul li {
    margin-bottom: 10px;
    border-bottom: 1px dashed #444;
    padding-bottom: 5px;
}

.search-input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    background: #1a1025;
    border: 1px solid #444;
    color: var(--accent-color);
    border-radius: 4px;
}

.btn-magic {
    width: 100%;
    padding: 10px;
    background-color: var(--accent-color);
    border: none;
    color: var(--bg-color);
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: 0.3s;
}

.btn-magic:hover {
    background-color: var(--accent-hover);
}

/* --- Подвал (Footer) --- */
.site-footer {
    background-color: #0f0a14;
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid #333;
    margin-top: auto;
}

.disclaimer {
    font-size: 0.8rem;
    color: #666;
    margin-top: 10px;
}

/* --- Адаптивность (Mobile) --- */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .main-menu ul {
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
    }

    .main-wrapper {
        grid-template-columns: 1fr; /* Одна колонка на мобильных */
    }
    
    .sidebar {
        order: 2; /* Сайдбар уходит вниз контента */
    }
}