:root {
  --border-color: #D0D0D0;
}

.blog-section {
    background-image: linear-gradient(135deg, #050505, #111111);
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--accent);
    position: relative; /* contient ::before et ťvite des effets de hauteur inattendus */
}

.blog-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--bg-color) 0%, rgba(17, 17, 17, 0.8) 100%);
    z-index: -1;
}

.blog-container {
    margin: 0 auto;
    padding: 0 20px 120px;
    position: relative;
    overflow: hidden;
    max-width: 1600px;
    /* margin: 4rem 10%;  */
    /* max-width: 1200px; */
    /* min-height: 100vh; */
    line-height: 1.6;
}

.blog-grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}

.blog-grid-line {
    position: absolute;
    background-color: var(--border-color);
}

.blog-grid-line-h {
    height: 1px;
    width: 100%;
}

.blog-grid-line-v {
    width: 1px;
    height: 100%;
}


.blog-tech-decoration {
    position: absolute;
    width: 400px;
    aspect-ratio: 1/1;
    border: 1px solid rgba(240, 240, 240, 0.1);
    border-radius: 50%;
    z-index: -1;
}

.blog-tech-decoration-1 {
    top: -130px;
    right: -130px;
}

.blog-tech-decoration-2 {
    bottom: -130px;
    left: -130px;
}

.blog-content {
    max-width: 1200px;
    margin: 0 auto;
}

/*  --- HEADER --- */

.blog-section-header {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

/* .blog-section-title {
            margin-bottom: 15px;
            position: relative;
            display: inline-block;
        } */

.blog-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--accent);
}

.blog-section-intro {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text);
    opacity: 0.8;
    max-width: 1200px;
    margin: 4em auto;
}

/*  --- BLOG GRID --- */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.blog-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Ensure all cards have the same height */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    /* Default shadow with no red */
}

.blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(240, 240, 240, 0.1);
    border-radius: 0.25rem;
    pointer-events: none;
    z-index: 1;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(204, 11, 13, 0.3);
    /* Red glow shadow on hover */
}

.blog-card-image {
    height: 200px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    /* Prevent image from shrinking */
}

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

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

.blog-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    height: calc(100% - 200px);
    /* Fixed height: total height minus image height */
}

.blog-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: rgba(240, 240, 240, 0.7);
}

.blog-card-category {
    background-color: var(--accent);
    color: white;
    padding: 3px 10px;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.blog-card-title {
    font-size: 1.4rem;
    margin-bottom: 12px;
    line-height: 1.3;
    font-weight: 600;
}

.blog-card-excerpt {
    margin-bottom: 20px;
    color: rgba(240, 240, 240, 0.9);
    font-size: 0.95rem;
    flex-grow: 1;
}

.blog-read-more {
    display: inline-block;
    padding: 8px 20px;
    background-color: transparent;
    color: var(--text);
    border: 1px solid var(--accent);
    border-radius: 0.25rem;
    font-family: var(--title-font);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    align-self: flex-start;
    margin-top: auto;
    /* Push to bottom of flex container */
}

.blog-read-more::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: var(--accent);
    transition: all 0.3s ease;
    z-index: -1;
}

.blog-read-more:hover {
    color: white;
}

.blog-read-more:hover::before {
    left: 0;
}


/* --- CTA --- */

.blog-cta {
    text-align: center;
    margin-top: 80px;
    position: relative;
    z-index: 2;
    padding: 40px;
    border-radius: 0.25rem;
    background-color: rgba(26, 26, 26, 0.8);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}


.blog-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(90deg, transparent 95%, rgba(204, 11, 13, 0.2) 95%),
        linear-gradient(0deg, transparent 95%, rgba(204, 11, 13, 0.2) 95%),
        radial-gradient(circle at 50px 50px, rgba(204, 11, 13, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 150px 150px, rgba(204, 11, 13, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 250px 50px, rgba(204, 11, 13, 0.1) 2px, transparent 2px);
    background-size: 50px 50px, 50px 50px, 200px 200px, 200px 200px, 200px 200px;
    opacity: 0.3;
    z-index: -1;
}


.blog-cta::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(90deg, transparent 49%, rgba(204, 11, 13, 0.3) 49%, rgba(204, 11, 13, 0.3) 51%, transparent 51%),
        linear-gradient(0deg, transparent 49%, rgba(204, 11, 13, 0.3) 49%, rgba(204, 11, 13, 0.3) 51%, transparent 51%);
    background-size: 50px 50px;
    opacity: 0.1;
    z-index: -1;
    animation: circuitMove 20s linear infinite;
}

@keyframes circuitMove {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 50px 50px;
    }
}

.blog-cta-title {
    font-family: var(--title-font);
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--text);
}

.blog-cta-text {
    margin-bottom: 25px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}


.blog-cta-button {
    display: inline-block;
    padding: 15px 40px;
    background-color: transparent;
    color: white;
    border: 2px solid var(--accent);
    border-radius: 0.25rem;
    font-family: var(--title-font);
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.blog-cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
    z-index: -1;
}

.blog-cta-button:hover {
    color: white;
}

.blog-cta-button:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.blog-cta-corner {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 2px solid var(--accent);
    opacity: 0.5;
    z-index: 0;
}

.blog-cta-corner-tl {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
}

.blog-cta-corner-tr {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
}

.blog-cta-corner-bl {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
}

.blog-cta-corner-br {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
}

/* --- RESPONSIVE --- */

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-section-title {
        font-size: 2rem;
    }

    .blog-cta-button {
        padding: 12px 30px;
        font-size: 1rem;
    }
}

@media (min-width: 1024px) {
    .blog-section-header {
        text-align: left;
    }

    .blog-section-title::after {
        left: 0;
        transform: translateX(0);
    }

    .blog-section-hosting-title {
        text-align: left;
        margin-left: 1.5rem;
    }

    .blog-section-hosting-title::after {
        left: 0;
        transform: translateX(0);
    }
}
