:root {
    --brand-blue: #3b6df3;
    --text-dark: #222222;
    --text-muted: #666666;
    --bg-white: #ffffff;
    --bg-dark: #111111;
    --container-width: 1200px;
    --content-width: 800px;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-white);
    line-height: 1.6;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    max-width: var(--container-width);
    margin: 0 auto;
}

.logo {
    font-weight: 700;
    font-size: 24px;
    text-decoration: none;
    color: #000;
}

.cta-button {
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    color: #000;
    font-size: 14px;
    font-weight: 500;
    transition: 0.3s;
}

.cta-button:hover {
    border-color: var(--brand-blue);
    box-shadow: 0 4px 15px rgba(59, 109, 243, 0.1);
}

/* Content Styles */
.container {
    max-width: var(--content-width);
    margin: 60px auto;
    padding: 0 20px;
}

.article-header {
    margin-bottom: 40px;
}

h1 {
    font-size: 42px;
    line-height: 1.2;
    margin-bottom: 20px;
    font-weight: 700;
}

.article-meta {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 40px;
}

.content img {
    display: block;
    max-width: 100%;
    max-height: 75vh;
    /* Предотвращаем огромные по высоте картинки */
    width: auto;
    height: auto;
    border-radius: 12px;
    margin: 32px auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.content h2,
.content h3 {
    margin-top: 40px;
    margin-bottom: 20px;
}

.content h4 {
    margin-top: 48px;
    margin-bottom: 16px;
    font-size: 24px;
}

.content p {
    margin-bottom: 20px;
}

.content ul,
.content ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

.content li {
    margin-bottom: 12px;
}

.content blockquote {
    border-left: 4px solid var(--brand-blue);
    padding: 10px 0 10px 24px;
    margin: 32px 0;
    font-style: italic;
    color: var(--text-muted);
    font-size: 1.1em;
}

.content hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 48px 0;
}

.content strong {
    font-weight: 700;
}

/* Case Grid & Index Page */
.hero {
    text-align: center;
    margin-bottom: 80px;
}

.hero h1 {
    font-size: 56px;
    margin-bottom: 16px;
}

.hero p {
    color: var(--text-muted);
    font-size: 20px;
}

.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 40px;
    margin-bottom: 100px;
}

/* Tag Filter Bar */
.tag-filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 48px;
}

.tag-filter-btn {
    background: #f4f4f5;
    border: 1px solid transparent;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
}

.tag-filter-btn:hover {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}

.tag-filter-btn.active {
    background: var(--brand-blue);
    color: #fff;
    border-color: var(--brand-blue);
}

/* Tag Badges on Cards */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.tag-badge {
    background: rgba(59, 109, 243, 0.08);
    color: var(--brand-blue);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: lowercase;
    letter-spacing: 0.3px;
}

.case-card {
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.case-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.card-image {
    height: 220px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.case-card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: 30px;
}

.card-meta {
    font-size: 12px;
    color: var(--brand-blue);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.case-card h3 {
    font-size: 24px;
    margin-bottom: 12px;
    line-height: 1.3;
}

.case-card p {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    font-weight: 600;
    font-size: 14px;
    color: var(--brand-blue);
}

/* Footer Styles */
footer {
    background: var(--bg-dark);
    color: #fff;
    padding: 60px 40px;
    margin-top: 100px;
}

.footer-grid {
    max-width: var(--container-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    font-size: 14px;
    opacity: 0.8;
}

.footer-column a {
    color: #fff;
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
}

.footer-logo {
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 20px;
    display: block;
}

@media (max-width: 768px) {
    h1 {
        font-size: 32px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    header {
        padding: 20px;
    }
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 18px 28px;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    transform: translateY(200%);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 900px;
    margin: 0 auto;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-text {
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.5;
    margin-right: 24px;
}

.cookie-text a {
    color: var(--brand-blue);
    text-decoration: underline;
    font-weight: 500;
}

.cookie-btn {
    background: var(--text-dark);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.3s;
}

.cookie-btn:hover {
    background: var(--brand-blue);
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .cookie-banner {
        flex-direction: column;
        text-align: center;
        gap: 16px;
        bottom: 16px;
        left: 16px;
        right: 16px;
    }

    .cookie-text {
        margin-right: 0;
    }
}

/* CTA Banner */
.cta-banner {
    background: linear-gradient(135deg, #f8faff 0%, #eef4ff 100%);
    border: 1px solid rgba(0, 102, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    margin: 60px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
}

.cta-content h2 {
    margin: 0 0 12px 0;
    font-size: 24px;
    color: var(--text-dark);
}

.cta-content p {
    margin: 0 0 24px 0 !important;
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.6;
}

.cta-stats {
    display: flex;
    gap: 32px;
}

.stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-blue);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cta-main-btn {
    background: var(--brand-blue);
    color: #fff;
    text-decoration: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 600;
    transition: 0.3s;
    white-space: nowrap;
}

.cta-main-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 102, 255, 0.15);
}

/* Related Section */
.related-section {
    margin-top: 80px;
    padding-top: 60px;
    border-top: 1px solid #eee;
}

.related-title {
    font-size: 28px;
    margin-bottom: 32px;
    text-align: center;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.related-card {
    display: flex;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    border: 1px solid #eee;
    transition: 0.3s;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.related-card-image {
    width: 140px;
    min-width: 140px;
}

.related-card-image img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    margin: 0 !important;
    border-radius: 0 !important;
}

.related-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.related-card-content h3 {
    font-size: 16px;
    margin: 0 0 12px 0;
    line-height: 1.4;
    color: var(--text-dark);
}

.related-card-content span {
    font-size: 13px;
    color: var(--brand-blue);
    font-weight: 600;
}

@media (max-width: 900px) {
    .cta-banner {
        flex-direction: column;
        text-align: center;
        padding: 32px;
    }

    .cta-stats {
        justify-content: center;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }
}

/* Corner Widget */
.corner-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 320px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 1000;
    animation: slideInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.widget-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    color: #666;
    transition: 0.2s;
}

.widget-close:hover {
    background: #fff;
    color: #000;
}

.widget-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
}

.widget-image img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    margin: 0 !important;
}

.widget-body {
    padding: 24px;
}

.widget-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.widget-badge span {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.widget-body h3 {
    font-size: 18px;
    margin: 0 0 10px 0;
    line-height: 1.4;
    color: #000;
}

.widget-body p {
    font-size: 14px;
    color: #666;
    margin: 0 0 20px 0 !important;
    line-height: 1.5;
}

.widget-link {
    display: inline-block;
    color: var(--brand-blue);
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    transition: 0.2s;
}

.widget-link:hover {
    letter-spacing: 0.3px;
}

@media (max-width: 480px) {
    .corner-widget {
        width: calc(100% - 40px);
        bottom: 20px;
        right: 20px;
    }
}