/* Основные стили */
body {
    font-family: 'Georgia', serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Шапка */
header {
    text-align: center;
    padding: 40px 0;
    background-color: #1a1a1a;
    color: #e0e0e0;
    margin-bottom: 30px;
    position: relative;
    z-index: 10;
}

header h1 {
    font-size: 3em;
    margin: 0;
    font-weight: normal;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}
.h1-link {
    color: inherit !important;         /* Наследует цвет заголовка */
    text-decoration: none !important; /* Убирает подчёркивание */
    
    /* Отключает все состояния ссылки */
    &:visited, &:hover, &:active, &:focus {
        color: inherit !important;
        text-decoration: none !important;
        outline: none !important;
    }
}

.tagline {
    font-style: italic;
    color: #aaa;
    margin-top: 10px;
}

/* Форма подписки */
.subscribe-form {
    background-color: #2a2a2a;
    color: #e0e0e0;
    padding: 30px;
    border-radius: 5px;
    margin-bottom: 40px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.subscribe-form h2 {
    margin-top: 0;
    color: #fff;
}

.subscribe-form p {
    margin-bottom: 20px;
}

.subscribe-form input {
    padding: 12px 15px;
    width: 300px;
    max-width: 100%;
    border: none;
    border-radius: 3px;
    margin-right: 10px;
    font-size: 16px;
}

.subscribe-form button {
    padding: 12px 25px;
    background-color: #8b0000;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
    font-weight: bold;
}

.subscribe-form button:hover {
    background-color: #a00;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.hidden {
    display: none;
    opacity: 0;
    transition: opacity 0.5s;
}

/* Сетка историй */
.stories-grid {
    margin-bottom: 60px;
}

.stories-grid h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 2em;
    position: relative;
}

.stories-grid h2::after {
    content: '';
    display: block;
    width: 100px;
    height: 3px;
    background: #8b0000;
    margin: 15px auto 0;
}

.story-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding: 10px;
}

.story-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.story-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.story-card a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.story-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.5s;
}

.story-card:hover img {
    transform: scale(1.05);
}

.story-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.story-card h3 {
    margin: 0 0 10px;
    color: #222;
    font-size: 1.4em;
    line-height: 1.3;
}

.story-card p {
    margin: 0 0 15px;
    color: #666;
    flex-grow: 1;
    font-size: 0.95em;
    line-height: 1.5;
}

.story-card .read-more {
    color: #8b0000;
    font-weight: bold;
    margin-top: auto;
    align-self: flex-start;
    transition: color 0.3s;
}

.story-card:hover .read-more {
    color: #a00;
}

/* Содержимое истории */
.story-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.story-content h2 {
    color: #8b0000;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-top: 0;
    font-size: 2em;
}

.story-content p {
    margin-bottom: 20px;
    line-height: 1.7;
    font-size: 1.1em;
}

.story-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 20px 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.back-link {
    display: inline-flex;
    align-items: center;
    margin-bottom: 25px;
    color: #8b0000;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.back-link:hover {
    color: #a00;
    text-decoration: underline;
}

.back-link::before {
    content: '←';
    margin-right: 8px;
}

/* Подвал */
footer {
    background-color: #1a1a1a;
    color: #aaa;
    padding: 40px 0;
    text-align: center;
    margin-top: 60px;
}

.footer-links {
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
    padding: 5px 10px;
}

.footer-links a:hover {
    color: white;
    text-decoration: underline;
}

footer p {
    margin: 0;
    font-size: 0.9em;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.story-card {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

.story-card:nth-child(1) { animation-delay: 0.1s; }
.story-card:nth-child(2) { animation-delay: 0.2s; }
.story-card:nth-child(3) { animation-delay: 0.3s; }
.story-card:nth-child(4) { animation-delay: 0.4s; }

/* Адаптивность */
@media (max-width: 768px) {
    header {
        padding: 30px 0;
    }
    
    header h1 {
        font-size: 2.2em;
    }
    
    .subscribe-form {
        padding: 20px;
    }
    
    .subscribe-form input {
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .story-thumbnails {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .story-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    header {
        padding: 25px 0;
    }
    
    .subscribe-form button {
        width: 100%;
    }
    
    .story-card img {
        height: 180px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
}