/* Обнуляем базовые отступы браузера */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Задаем космический фон */
body {
    background-image: url('images/Background-Image.jpg');
    background-size: cover;
    background-attachment: fixed;
    font-family: Arial, sans-serif;
    color: #333;
}

/* Ограничиваем ширину сайта и ставим по центру */
.wrapper {
    width: 960px;
    margin: 0 auto;
}

/* --- ПОИСК --- */
.top-bar {
    width: 960px;
    margin: 0 auto;
    text-align: right; /* Сдвигаем поиск вправо */
    padding: 15px 0;
}

.search-box input {
    padding: 5px 10px;
    border-radius: 15px; /* Закругляем углы у поля ввода */
    border: none;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

/* --- ШАПКА И ИКОНКИ --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.4); /* Темная полупрозрачная полоса */
    padding: 15px 30px;
    border-radius: 15px; /* Скругляем саму полосу */
    margin-bottom: 30px;
}

.social-icons {
    display: flex;
    align-items: center;
    gap: 10px; /* Расстояние между иконками */
}

    /* Уменьшаем иконки соцсетей */
    .social-icons img {
        width: 48px;
        cursor: pointer;
        transition: transform 0.2s; /* Плавность для анимации */
    }

        /* Эффект увеличения иконки при наведении мышки (преподаватель это оценит) */
        .social-icons img:hover {
            transform: scale(1.1);
        }

        /* Иконку Яблока делаем крупнее, как на макете */
        .social-icons img:first-child {
            width: 75px;
            margin-right: 15px;
        }

/* --- ОСНОВНОЙ КОНТЕНТ --- */
.main-container {
    display: flex;
    justify-content: space-between;
}

.content {
    width: 65%;
}

.sidebar {
    width: 30%;
}

/* Красивые блоки для статей и бокового меню */
/* Разделяем стили для постов и виджетов, чтобы рамки были как на оригинале */
.post {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    border: 3px solid #111; /* Толстая темная рамка как на макете */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6);
    position: relative; /* Это нужно, чтобы дата позиционировалась относительно этого блока */
}

.widget {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid #ccc; /* Светлая тонкая рамка */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6);
}

/* --- ПОЗИЦИОНИРОВАНИЕ ИКОНКИ ДАТЫ --- */
.post-date {
    position: absolute;
    top: -15px;
    right: -10px;
    width: 32px; /* Примерная ширина картинки Date.png */
    height: 38px; /* Примерная высота */
    background-image: url('images/Date.png');
    background-size: cover;
    text-align: center;
    padding-top: 12px; /* Сдвигаем цифру вниз, чтобы она попала в белую зону иконки */
    font-weight: bold;
    font-size: 14px;
    color: #444;
    z-index: 10;
}

    /* Оформление заголовков внутри блоков */
    .post h2, .widget h3 {
        margin-bottom: 15px;
        color: #222;
        border-bottom: 1px solid #ccc; /* Линия под заголовком */
        padding-bottom: 8px;
    }

    .post p, .widget ul {
        margin-bottom: 15px;
        line-height: 1.5;
    }

    /* Убираем точки у списка рубрик в меню */
    .widget ul {
        list-style-type: none;
    }

        .widget ul li {
            padding: 5px 0;
        }

/* Подвал статьи (комментарии и рубрика) */
.post-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: #555;
    border-top: 1px solid #ccc;
    padding-top: 10px;
    font-weight: bold;
}

/* Стили для ссылок в подвале статьи */
.back-link {
    text-decoration: none;
    color: #0066cc;
    font-weight: bold;
}

    .back-link:hover {
        text-decoration: underline;
    }
/* --- ИГРА ПЯТНАШКИ --- */
#puzzle-board {
    width: 200px;
    height: 200px;
    background-color: #ccc;
    border: 3px solid #888;
    border-radius: 5px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 2px;
    padding: 3px;
    margin: 0 auto;
}

.puzzle-tile {
    background-color: #f9f9f9;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 3px;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    user-select: none; /* Чтобы текст не выделялся при кликах */
    transition: background-color 0.2s;
}

    .puzzle-tile:hover {
        background-color: #e0e0e0;
    }

    /* Скрываем пустую клетку */
    .puzzle-tile.empty {
        background-color: transparent;
        box-shadow: none;
        cursor: default;
    }
/* Индикатор чтения */
#progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 9999;
}

#progress-bar {
    height: 100%;
    background: #a64ca6; /* Фиолетовый цвет под стиль твоего сайта */
    width: 0%;
    transition: width 0.1s;
}

/* Кнопка наверх */
#scroll-to-top {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    font-size: 24px;
    border: none;
    outline: none;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

    #scroll-to-top:hover {
        background-color: #a64ca6;
    }
/* === ГАЛЕРЕЯ И LIGHTBOX === */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.gallery-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 2px solid #ccc;
}

    .gallery-img:hover {
        transform: scale(1.05);
        box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    }

/* Стили всплывающего окна (Lightbox) */
.lightbox {
    display: none;
    position: fixed;
    z-index: 99999;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 80%;
    max-height: 80%;
    border-radius: 10px;
}

.close-lightbox {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

#caption {
    margin: auto;
    display: block;
    width: 80%;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    font-size: 18px;
}
/* Выравнивание Стива по центру */
.steve-container {
    text-align: center;
    margin-bottom: 25px; /* Отступ от Стива до компьютеров */
}

/* Делаем Стива чуть крупнее остальных */
.steve-img {
    max-width: 350px;
    border: 3px solid #ccc;
}

/* Новая сетка для 6 компьютеров (3 колонки) */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Ровно 3 колонки */
    gap: 15px;
}