/* --- css/home.css --- */

/* ================================================= */
/* СУЩЕСТВУЮЩИЕ СТИЛИ (HERO & PRINCIPLES) */
/* ================================================= */

.hero {
    height: 100vh;
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    /* Оранжевый градиент в фоне */
    background: radial-gradient(circle at center, rgba(255, 145, 0, 0.15) 0%, rgba(10,10,10,1) 80%), 
                url('https://images.unsplash.com/photo-1605218427360-36390f855a69?q=80&w=2000&auto=format&fit=crop') no-repeat center/cover;
    position: relative;
}
.hero::before {
    content: ''; position: absolute; top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.7); /* Затемнение */
}
.hero-content { position: relative; z-index: 2; max-width: 800px; padding: 0 20px; }
.hero-title {
    font-size: 4rem; margin-bottom: 20px;
    text-shadow: 0 0 25px rgba(255, 85, 0, 0.6);
}
.hero-subtitle { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 40px; }

.card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 30px; border-radius: 0; /* Острые углы для строгости */
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}
.card:hover {
    transform: translateY(-10px);
    border-bottom-color: var(--accent-primary);
    box-shadow: var(--shadow);
}
.card-icon { font-size: 40px; color: var(--accent-primary); margin-bottom: 20px; }
.grid-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }

/* ================================================= */
/* НОВЫЕ СТИЛИ: НОВОСТНОЙ БЛОК (ПЛИТКИ) */
/* ================================================= */

.news-section {
    padding-top: 80px;
    padding-bottom: 80px;
}

.news-grid {
    display: grid;
    /* Две колонки, одинаковой ширины, с отступом 30px */
    grid-template-columns: 1fr 1fr;
    gap: 30px; 
    margin-top: 40px;
}

.news-card {
    background-color: var(--bg-card);
    border: 1px solid rgba(255, 145, 0, 0.1);
    padding: 25px;
    border-radius: 8px; 
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(255, 145, 0, 0.1);
    border-color: var(--accent-primary);
}

.card-title {
    font-size: 1.5rem;
    margin: 10px 0;
    color: var(--text-main);
}

.card-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    flex-grow: 1; 
    margin-bottom: 15px;
}

/* --- ИСПРАВЛЕНИЕ: width: fit-content предотвращает растягивание --- */
.card-tag, .modal-tag {
    display: inline-block; 
    width: fit-content; /* <--- ВАЖНОЕ СВОЙСТВО */
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
    color: #000;
}

/* Цвета для тегов */
.tag-update { background-color: var(--accent-primary); } /* Оранжевый */
.tag-event { background-color: #00bcd4; } /* Голубой */
.tag-info { background-color: #5cb85c; } /* Зеленый */

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.05);
}

.card-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.read-more-btn {
    color: var(--accent-primary);
    font-weight: 600;
}

/* ================================================= */
/* НОВЫЕ СТИЛИ: МОДАЛЬНОЕ ОКНО */
/* ================================================= */

.modal {
    display: none; /* Скрыто по умолчанию */
    position: fixed;
    z-index: 2000; 
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--bg-dark);
    margin: 5% auto; 
    padding: 40px;
    border: 3px solid var(--accent-primary);
    border-radius: 12px;
    width: 90%; 
    max-width: 900px; 
    position: relative;
    box-shadow: 0 0 50px rgba(255, 145, 0, 0.2);
    animation: fadeIn 0.3s ease-out;
}

.close-btn {
    color: var(--text-muted);
    float: right;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    position: absolute;
    top: 10px; right: 20px;
}

.close-btn:hover, .close-btn:focus {
    color: var(--accent-secondary);
}

.modal-title {
    font-size: 2.5rem;
    margin-top: 10px;
    margin-bottom: 10px;
}

.modal-tag {
    margin-bottom: 10px;
    /* Остальные стили наследуются от группового селектора выше */
}

.modal-date {
    font-size: 0.9rem;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-full-text {
    font-size: 1.1rem;
    color: var(--text-main);
    line-height: 1.8;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================================================= */
/* АДАПТИВНОСТЬ */
/* ================================================= */

@media (max-width: 900px) {
    .news-grid {
        /* На средних экранах делаем один столбец */
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) { 
    .hero-title { font-size: 2.5rem; } 
    .modal-content { margin: 15% auto; }
}