/* ==========================================================================
   BLOG & ARTICLES - FULL STYLESHEET
   ========================================================================== */

:root {
    --blog-primary: #6366f1;
    --blog-primary-hover: #4f46e5;
    --blog-text-dark: #0f172a;
    --blog-text-muted: #475569;
    --blog-bg-light: #f8fafc;
    --blog-border: #e2e8f0;
    --blog-radius: 24px;
    /* Сучасний шрифт: Inter, Plus Jakarta Sans або системний */
    --blog-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    font-family: var(--blog-font-sans);
    -webkit-font-smoothing: antialiased;
}

/* --- Hero Section Styles --- */
.articles-hero {
    position: relative;
    background: #0f172a;
    background: radial-gradient(circle at top right, #1e1b4b 0%, #0f172a 100%);
    padding: clamp(60px, 12vw, 120px) 24px;
    color: #ffffff;
    border-radius: 0 0 60px 60px;
    margin-bottom: 60px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-badge {
    display: inline-block;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.articles-hero h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    background: linear-gradient(to bottom right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    color: #94a3b8;
    max-width: 700px;
    line-height: 1.6;
    font-weight: 400;
}

.btn-filter-reset {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 10px 22px;
    border-radius: 50px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-filter-reset:hover {
    background: #fff;
    color: #0f172a;
}

/* --- Blog Grid --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 32px;
    padding: 20px;
    max-width: 1300px;
    margin: 0 auto;
}

/* Site-specific overrides for /articles page (replaces inline styles) */
.articles-hero--site { background: #ffffff; background-image: none; border-bottom:1px solid var(--blog-border); border-radius:0; box-shadow:none; padding:60px 20px 40px 20px; margin:0; width:100%; display:block; }
.hero-badge--site { display:inline-block; background:#f1f5f9; color:var(--blog-text-muted); padding:6px 18px; border-radius:50px; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:1px; margin-bottom:20px; border:1px solid var(--blog-border); }
.articles-hero-title { font-size:clamp(2rem,5vw,3rem); font-weight:800; color:var(--blog-text-dark); margin-bottom:15px; margin-top:0; letter-spacing:-1px; }
.articles-hero-text { color:#000; font-family: 'Iowan Old Style', 'Sitka Text', 'Palatino Linotype', serif; font-style:italic; font-size:21px; letter-spacing:0.1px; text-align:center; line-height:1.7; opacity:0.9; max-width:700px; margin:0 auto; }
.btn-filter-reset--site { display:none; background:#f1f5f9; border:1px solid var(--blog-border); border-radius:6px; padding:6px 14px; font-size:13px; color:var(--blog-text-muted); cursor:pointer; }

/* Make blog cards square on articles index and adjust grid sizing */
.articles-blog-grid .blog-img-wrapper { position:relative; width:100%; aspect-ratio:1 / 1; overflow:hidden; background:#f1f5f9; border-radius:20px 20px 0 0; }
.articles-blog-grid .blog-img-wrapper img { width:100%; height:100%; object-fit:cover; object-position:center; transition:transform 0.6s cubic-bezier(0.4,0,0.2,1); }
.articles-blog-grid .blog-card:hover .blog-img-wrapper img { transform:scale(1.05); }
.articles-blog-grid .blog-content { padding:24px; display:flex; flex-direction:column; flex-grow:1; }
.articles-blog-grid .blog-preview { color: #64748b; font-size: 1rem; line-height:1.5; margin-bottom:20px; }
.articles-blog-grid .blog-tags { margin-top:auto; display:flex; flex-wrap:wrap; gap:8px; }
.blog-img-placeholder { height:100%; display:flex; align-items:center; justify-content:center; font-size:3rem; background:#f1f5f9; }

/* --- Card Design --- */
.blog-card {
    background: #ffffff;
    border-radius: var(--blog-radius);
    border: 1px solid var(--blog-border);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    height: 100%;
    overflow: hidden;
    position: relative;
}

.blog-link-wrapper {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 30px 60px -15px rgba(99, 102, 241, 0.25);
    border-color: var(--blog-primary);
}

/* Image styling */
.blog-img-wrapper {
    position: relative;
    width: 100%;
    /* Використовуємо пропорцію замість фіксованої висоти */
    aspect-ratio: 16 / 10; 
    overflow: hidden;
    background: #f1f5f9;
}

.blog-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.blog-card:hover .blog-img-wrapper img {
    transform: scale(1.1);
}

.blog-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    opacity: 0;
    transition: 0.4s;
    backdrop-filter: blur(4px);
}

.blog-card:hover .blog-overlay {
    opacity: 1;
}

.blog-img-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: #e2e8f0;
}

/* Content styling */
.blog-content {
    padding: 32px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-meta {
    margin-bottom: 15px;
}

.blog-date {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--blog-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.blog-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--blog-text-dark);
    line-height: 1.25;
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}

.blog-preview {
    font-size: 1rem;
    color: var(--blog-text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tags styling */
.blog-tags {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-pill {
    background: #f1f5f9;
    color: var(--blog-text-muted);
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: 0.3s;
}

.tag-pill:hover {
    background: var(--blog-primary);
    color: #fff;
}

/* --- Back Button --- */
.link-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--blog-text-muted);
    font-weight: 700;
    padding: 12px 30px;
    background: #fff;
    border: 1px solid var(--blog-border);
    border-radius: 50px;
    transition: 0.3s;
}

.link-back-btn:hover {
    color: var(--blog-primary);
    border-color: var(--blog-primary);
    background: var(--blog-bg-light);
    transform: translateX(-5px);
}

/* ==========================================================================
   ADAPTIVE (RESPONSIVE)
   ========================================================================== */

/* --- Responsive Updates --- */
@media (max-width: 992px) {
    .blog-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}

@media (max-width: 640px) {
    .articles-hero { 
        padding: 60px 20px; 
        border-radius: 0 0 40px 40px; 
    }
    .blog-grid { 
        grid-template-columns: 1fr; 
    }
    .blog-content { padding: 24px; }
    .blog-title { font-size: 1.35rem; }
}
