/* 
* Основные стили для блога о количественных методах прогнозирования рынка США
* Версия: 1.0
* Последнее обновление: 2023
*/

/* ======= Сброс и базовые стили ======= */
:root {
    --primary-color: #1a56db;
    --secondary-color: #4f46e5;
    --accent-color: #7c3aed;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --gray-color: #64748b;
    --light-gray-color: #e2e8f0;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
    --header-height: 80px;
    --footer-bg: #0f172a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', 'Arial', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
    overflow-x: hidden;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button, input, textarea {
    font-family: inherit;
    font-size: inherit;
}

ul, ol {
    list-style-position: inside;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ======= Нестандартная рамка для изображений ======= */
.custom-frame {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.custom-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 4px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius);
    pointer-events: none;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0) 100%
    );
}

.custom-frame img {
    display: block;
    transition: transform 0.5s ease;
    width: 100%;
}

.custom-frame:hover img {
    transform: scale(1.05);
}

/* ======= Заголовки ======= */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

/* ======= Верхнее меню ======= */
header {
    background-color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: var(--header-height);
    display: flex;
    align-items: center;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 50px;
    width: auto;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav ul li a {
    padding: 10px 0;
    font-weight: 500;
    color: var(--dark-color);
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}

nav ul li a.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* ======= Герой секция ======= */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    padding: 100px 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: white;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
}

/* ======= Блок цитаты дня ======= */
.quote-box {
    background-color: #fff;
    padding: 40px 0;
}

.quote {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    padding: 20px;
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, #f0f9ff 0%, #e6f7ff 100%);
    box-shadow: var(--box-shadow);
}

.quote-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.quote blockquote {
    font-size: 1.3rem;
    font-style: italic;
    line-height: 1.7;
    margin-bottom: 15px;
}

.quote cite {
    font-style: normal;
    font-weight: 600;
    color: var(--gray-color);
}

/* ======= Блог ======= */
.blog {
    padding: 80px 0;
    background-color: var(--light-color);
}

.blog h2 {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.blog h2::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
}

.posts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

.post {
    background-color: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
}

.post-img {
    height: 240px;
    overflow: hidden;
}

.post-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-content h3 {
    margin-bottom: 10px;
}

.post-content h3 a {
    color: var(--dark-color);
}

.post-content h3 a:hover {
    color: var(--primary-color);
}

.post-meta {
    font-size: 0.9rem;
    color: var(--gray-color);
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.post p {
    margin-bottom: 20px;
    flex-grow: 1;
}

.read-more {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: auto;
}

.read-more svg {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.read-more:hover svg {
    transform: translateX(5px);
}

/* ======= Страница блога ======= */
.blog-post {
    padding: 80px 0;
}

.blog-post .container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 50px;
}

.post-header {
    margin-bottom: 30px;
}

.post-body {
    margin-top: 30px;
}

.post-body p {
    margin-bottom: 20px;
}

.post-body h2 {
    margin-top: 40px;
    margin-bottom: 20px;
}

.post-body h3 {
    margin-top: 30px;
    margin-bottom: 15px;
}

.post-body ul, .post-body ol {
    margin-bottom: 20px;
    padding-left: 20px;
}

.post-body li {
    margin-bottom: 10px;
}

.post-image {
    margin: 30px 0;
}

.post-tags {
    margin-top: 40px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.post-tags span {
    font-weight: 600;
}

.post-tags a {
    display: inline-block;
    padding: 5px 12px;
    background-color: var(--light-gray-color);
    border-radius: 30px;
    font-size: 0.9rem;
    color: var(--dark-color);
}

.post-tags a:hover {
    background-color: var(--primary-color);
    color: white;
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    border-top: 1px solid var(--light-gray-color);
    padding-top: 30px;
}

.prev-post, .next-post {
    max-width: 48%;
}

.prev-post a, .next-post a {
    display: flex;
    flex-direction: column;
}

.nav-label {
    font-size: 0.9rem;
    color: var(--gray-color);
    margin-bottom: 5px;
}

.nav-title {
    font-weight: 600;
    color: var(--dark-color);
}

.prev-post a:hover .nav-title, .next-post a:hover .nav-title {
    color: var(--primary-color);
}

/* ======= Сайдбар ======= */
.post-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 20px);
    align-self: start;
}

.sidebar-widget {
    background-color: #fff;
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--box-shadow);
}

.sidebar-widget h3 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--light-gray-color);
}

.related-posts li, .categories li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--light-gray-color);
}

.related-posts li:last-child, .categories li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.subscribe-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.subscribe-form input {
    padding: 12px 15px;
    border: 1px solid var(--light-gray-color);
    border-radius: var(--border-radius);
}

.subscribe-form button {
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.subscribe-form button:hover {
    background-color: var(--secondary-color);
}

/* ======= О нас ======= */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.page-header h1 {
    color: white;
    margin-bottom: 15px;
}

.about-intro {
    padding: 80px 0;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-text h2 {
    margin-bottom: 25px;
}

.about-text p {
    margin-bottom: 20px;
}

.team {
    padding: 80px 0;
    background-color: #f8fafc;
}

.team h2 {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.team h2::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 40px;
}

.team-member {
    background-color: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: var(--transition);
}

.team-member:hover {
    transform: translateY(-10px);
}

.member-photo {
    height: 250px;
    overflow: hidden;
}

.member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-member h3 {
    margin: 20px 0 5px;
}

.position {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 15px;
}

.bio {
    padding: 0 20px 20px;
    font-size: 0.9rem;
}

.member-social {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 0 0 20px;
}

.member-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--light-gray-color);
    color: var(--dark-color);
    transition: var(--transition);
}

.member-social a:hover {
    background-color: var(--primary-color);
    color: white;
}

.achievements {
    padding: 80px 0;
}

.achievements h2 {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.achievements h2::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.achievement {
    background-color: #fff;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: var(--transition);
}

.achievement:hover {
    transform: translateY(-5px);
}

.achievement-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e6f7ff;
    border-radius: 50%;
    color: var(--primary-color);
}

/* ======= Контакты ======= */
.contact-info {
    padding: 80px 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.contact-card {
    background-color: #fff;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: var(--transition);
}

.contact-card:hover {
    transform: translateY(-5px);
}

.contact-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e6f7ff;
    border-radius: 50%;
    color: var(--primary-color);
}

.contact-form {
    padding-bottom: 80px;
}

.contact-form .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.form-container h2 {
    margin-bottom: 25px;
}

.form-container p {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.required {
    color: var(--danger-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--light-gray-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 35px;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 25px;
    width: 25px;
    background-color: #eee;
    border-radius: 4px;
}

.checkbox-container:hover input ~ .checkmark {
    background-color: #ccc;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 9px;
    top: 5px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.btn-submit {
    display: inline-block;
    padding: 12px 25px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-submit:hover {
    background-color: var(--secondary-color);
}

.map-container {
    height: 100%;
    width: 100%;
}

/* ======= Modal ======= */
.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.4);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 40px;
    border-radius: var(--border-radius);
    width: 500px;
    max-width: 90%;
    position: relative;
    text-align: center;
    animation: slideIn 0.3s;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-color);
}

.thank-you-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #d1fae5;
    border-radius: 50%;
    color: var(--success-color);
}

.close-btn {
    margin-top: 20px;
}

@keyframes fadeIn {
    from {opacity: 0}
    to {opacity: 1}
}

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

/* ======= Код блоки ======= */
.code-block {
    margin: 30px 0;
    background-color: #1e293b;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.code-block pre {
    padding: 20px;
    overflow-x: auto;
}

.code-block code {
    color: #e2e8f0;
    font-family: 'Courier New', Courier, monospace;
    line-height: 1.6;
}

/* ======= Footer ======= */
footer {
    background-color: var(--footer-bg);
    color: white;
    padding: 80px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 50px;
    margin-bottom: 50px;
}

.footer-logo img {
    height: 50px;
    width: auto;
    margin-bottom: 20px;
}

.footer-links h4, .footer-social h4 {
    color: white;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 15px;
}

.footer-links ul li a {
    color: #cbd5e1;
    transition: var(--transition);
}

.footer-links ul li a:hover {
    color: white;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    transition: var(--transition);
}

.social-icons a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: #94a3b8;
}

/* ======= Cookie Banner ======= */
.cookie-banner {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 20px 0;
    animation: slideUp 0.5s ease;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}

.cookie-content p {
    flex: 1;
    min-width: 300px;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cookie-buttons button {
    padding: 10px 20px;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.accept-all {
    background-color: var(--primary-color);
    color: white;
}

.accept-all:hover {
    background-color: var(--secondary-color);
}

.customize {
    background-color: var(--light-gray-color);
    color: var(--dark-color);
}

.customize:hover {
    background-color: #d1d5db;
}

.decline {
    background-color: transparent;
    color: var(--gray-color);
    border: 1px solid var(--light-gray-color) !important;
}

.decline:hover {
    background-color: var(--light-gray-color);
}

.privacy-link {
    color: var(--primary-color);
    text-decoration: underline;
    margin-left: auto;
}

@keyframes slideUp {
    from {transform: translateY(100%)}
    to {transform: translateY(0)}
}

/* ======= Медиа запросы ======= */
@media (max-width: 1200px) {
    .blog-post .container {
        grid-template-columns: 1fr;
    }
    
    .post-sidebar {
        position: static;
        margin-top: 50px;
    }
}

@media (max-width: 992px) {
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    .hero {
        padding: 80px 0;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .about-image {
        order: -1;
    }
    
    .contact-form .container {
        grid-template-columns: 1fr;
    }
    
    .map-container {
        height: 400px;
    }
}

@media (max-width: 768px) {
    nav ul {
        gap: 15px;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
    
    .modal-content {
        width: 90%;
        padding: 30px;
    }
}

@media (max-width: 576px) {
    header {
        height: auto;
        padding: 15px 0;
    }
    
    header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    nav ul {
        justify-content: center;
    }
    
    .hero {
        padding: 50px 0;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .quote blockquote {
        font-size: 1.1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .cookie-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cookie-buttons {
        width: 100%;
    }
    
    .privacy-link {
        margin-left: 0;
    }
}
