/* ==========================================================================
   Kudrovo.Online — основные стили
   ========================================================================== */

:root {
    --color-primary: #4F46E5;
    --color-primary-dark: #3730A3;
    --color-accent: #F59E0B;
    --color-bg: #F9FAFB;
    --color-text: #374151;
    --color-heading: #111827;
    --radius-card: 1rem;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-card-hover: 0 16px 32px -12px rgba(0, 0, 0, 0.12);
    --news-featured-height: 460px;
    --transition-fast: 0.2s ease;
    --transition-image: 0.45s ease;
}

/* --- Base --- */

body {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--color-bg);
}

/* --- Utilities --- */

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* --- Cards --- */

.card-hover {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover);
}

/* --- Images --- */

.news-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    transition: transform var(--transition-image);
}

.group:hover .news-img {
    transform: scale(1.04) translateZ(0);
}

/* --- News: featured row --- */

.news-featured {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .news-featured {
        grid-template-columns: 2fr 1fr;
        height: var(--news-featured-height);
    }
}

.news-hero {
    position: relative;
    border-radius: var(--radius-card);
    overflow: hidden;
    cursor: pointer;
    min-height: 20rem;
    box-shadow: var(--shadow-card);
    isolation: isolate;
}

@media (min-width: 1024px) {
    .news-hero {
        min-height: 0;
        height: 100%;
    }
}

/* --- Overlay cards (hero, side, grid) --- */

.news-overlay-card {
    position: relative;
    border-radius: var(--radius-card);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    isolation: isolate;
}

.news-overlay-card--side {
    min-height: 0;
    height: 100%;
}

.news-overlay-card--grid {
    aspect-ratio: 4 / 3;
    min-height: 13rem;
}

.news-overlay-card__fallback {
    background: linear-gradient(135deg, #374151 0%, #1F2937 100%);
}

.news-overlay-card__overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: linear-gradient(
        to bottom,
        rgba(17, 24, 39, 0.55) 0%,
        rgba(17, 24, 39, 0.15) 35%,
        rgba(17, 24, 39, 0.25) 60%,
        rgba(17, 24, 39, 0.92) 100%
    );
    pointer-events: none;
}

.news-overlay-card__overlay--hero {
    background: linear-gradient(
        to bottom,
        rgba(17, 24, 39, 0.4) 0%,
        rgba(17, 24, 39, 0.1) 40%,
        rgba(17, 24, 39, 0.35) 65%,
        rgba(17, 24, 39, 0.93) 100%
    );
}

.news-overlay-card__top {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    width: 100%;
    padding: 0.75rem 1rem;
    pointer-events: none;
}

.news-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    background: var(--color-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.news-overlay-card__body {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 10;
    width: 100%;
    padding: 1rem;
    pointer-events: none;
}

.news-overlay-card__body--hero {
    padding: 1.5rem;
}

.news-overlay-card__title {
    font-weight: 700;
    color: #fff;
    line-height: 1.35;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: color var(--transition-fast);
}

.news-overlay-card__title--hero {
    font-size: 1.5rem;
    line-height: 1.25;
    margin-bottom: 0.625rem;
}

@media (min-width: 640px) {
    .news-overlay-card__title--hero {
        font-size: 1.875rem;
    }
}

.group:hover .news-overlay-card__title {
    color: #fff;
}

.news-overlay-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
}

.news-overlay-card__meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.news-overlay-card__meta i {
    opacity: 0.75;
    font-size: 0.875rem;
}

.news-side {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 1.5rem;
    min-height: 0;
}

@media (min-width: 1024px) {
    .news-side {
        height: 100%;
    }
}

/* --- News: grid row --- */

.news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (min-width: 640px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* --- Promo banner --- */

.promo-banner {
    margin-top: 1.5rem;
    position: relative;
    z-index: 30;
}

.promo-banner__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    border-radius: var(--radius-card);
    text-align: center;
    background: linear-gradient(135deg, #4F46E5 0%, #9333EA 50%, #C026D3 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px -4px rgba(79, 70, 229, 0.35);
    overflow: hidden;
    transition: box-shadow var(--transition-fast);
}

@media (min-width: 640px) {
    .promo-banner__inner {
        flex-direction: row;
        text-align: left;
    }
}

.promo-banner__inner:hover {
    box-shadow: 0 12px 32px -4px rgba(79, 70, 229, 0.45);
}

.promo-banner__glow {
    position: absolute;
    width: 10rem;
    height: 10rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    filter: blur(48px);
    pointer-events: none;
}

.promo-banner__glow--tl { top: -2.5rem; left: -2.5rem; }
.promo-banner__glow--br { bottom: -2.5rem; right: -2.5rem; }

.promo-banner__label {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.promo-banner__content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

@media (min-width: 640px) {
    .promo-banner__content {
        flex-direction: row;
    }
}

.promo-banner__icon {
    width: 4rem;
    height: 4rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.promo-banner__title {
    font-weight: 800;
    font-size: 1.25rem;
    color: #fff;
    line-height: 1.25;
    margin-bottom: 0.25rem;
}

@media (min-width: 640px) {
    .promo-banner__title {
        font-size: 1.5rem;
    }
}

.promo-banner__text {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
}

.promo-banner__btn {
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    background: #fff;
    color: #4338CA;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.promo-banner__btn:hover {
    background: #F9FAFB;
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

/* --- Tag scroll arrows --- */

.tag-scroll {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tag-scroll::-webkit-scrollbar {
    display: none;
}

.tag-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    border: 1px solid #E5E7EB;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: opacity 0.2s, background 0.2s;
}

.tag-arrow:hover {
    background: #F9FAFB;
}

.tag-arrow.disabled {
    opacity: 0.2;
    pointer-events: none;
}

.tag-arrow-left { left: 0; }
.tag-arrow-right { right: 0; }

/* --- Article typography --- */

.article-content {
    color: var(--color-text);
    font-size: 1.05rem;
    line-height: 1.75;
}

.article-content p {
    margin-bottom: 1.25em;
}

.article-content p:last-child {
    margin-bottom: 0;
}

.article-content h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-heading);
    margin-top: 2em;
    margin-bottom: 1em;
    line-height: 1.3;
}

.article-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1F2937;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    line-height: 1.4;
}

.article-content h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1F2937;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}

.article-content ul {
    list-style-type: disc;
    padding-left: 1.5em;
    margin-bottom: 1.25em;
}

.article-content ol {
    list-style-type: decimal;
    padding-left: 1.5em;
    margin-bottom: 1.25em;
}

.article-content li {
    margin-bottom: 0.5em;
    padding-left: 0.25em;
}

.article-content li::marker {
    color: var(--color-primary);
    font-weight: bold;
}

.article-content img {
    border-radius: 0.75rem;
    margin: 1.5em auto;
    max-width: 100%;
    height: auto;
    box-shadow: var(--shadow-card);
}

.article-content iframe {
    width: 100%;
    max-width: 100%;
    border-radius: 0.75rem;
    margin: 1.5em 0;
    aspect-ratio: 16 / 9;
}

.article-content blockquote {
    border-left: 4px solid var(--color-primary);
    background-color: #EEF2FF;
    padding: 1em 1.5em;
    border-radius: 0 0.5rem 0.5rem 0;
    margin-bottom: 1.5em;
    font-style: italic;
    color: #4B5563;
}

.article-content blockquote p {
    margin-bottom: 0;
}

.article-content a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: #C7D2FE;
    transition: all 0.2s;
}

.article-content a:hover {
    color: var(--color-primary-dark);
    text-decoration-color: var(--color-primary);
}

.article-content strong,
.article-content b {
    font-weight: 700;
    color: var(--color-heading);
}

.article-content em,
.article-content i {
    font-style: italic;
}

.article-content table {
    width: 100%;
    margin-bottom: 1.5em;
    border-collapse: collapse;
}

.article-content th,
.article-content td {
    padding: 0.75em;
    border: 1px solid #E5E7EB;
    text-align: left;
}

.article-content th {
    background-color: var(--color-bg);
    font-weight: 600;
    color: var(--color-heading);
}
