/*--------------------------------------------------------------
#                    BLOG-STYLES.CSS
#---------------------------------------------------------------
#               Styles the blog.html page
--------------------------------------------------------------*/

@import url('/src/css/components/base.css');


/*--------------------------------------------------------------
# /BLOG PAGE STYLES
--------------------------------------------------------------*/

#article-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin: 20px auto;
    max-width: 1200px;
}

.article {
    background: rgba(10, 25, 45, 0.25);
    background-image: linear-gradient(135deg, 
        rgba(var(--main-color-rgb, 114, 182, 255), 0.2), 
        rgba(var(--main-color-rgb, 114, 182, 255), 0.08));
    backdrop-filter: blur(5px);
    max-width: 550px;
    border-radius: 0px; /* was 10px */
    padding: 0;
    margin: 0;
    flex: 1 1 calc(45% - 30px);
    
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s, background 0.3s;
    text-align: center;
    display: flex;
    flex-direction: column;
    height: auto; /* blog article image height */
    min-height: 500px;
    overflow: hidden;
    border: 1px solid rgba(var(--main-color-rgb, 114, 182, 255), 0.4);
    position: relative;
}

.article::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0px; /* was 10px */
    box-shadow: inset 0 0 30px rgba(var(--main-color-rgb, 114, 182, 255), 0.2);
    pointer-events: none;
    z-index: 1;
}

/* Only apply hover effects on non-touch devices and when effects are enabled */
@media (hover: hover) and (pointer: fine) {
    /* This class will be added to body when effects are enabled */
    body:not(.effects-disabled) .article:hover {
        transform: translateY(-4px);
        border-color: var(--main-color);
        background: rgba(15, 35, 60, 0.35);
        background-image: linear-gradient(135deg, 
            rgba(var(--main-color-rgb, 114, 182, 255), 0.20), 
            rgba(var(--main-color-rgb, 114, 182, 255), 0.1));
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 20px rgba(var(--main-color-rgb, 114, 182, 255), 0.2);
    }

    body:not(.effects-disabled) .article:hover::after {
        box-shadow: inset 0 0 40px rgba(var(--main-color-rgb, 114, 182, 255), 0.3);
    }
}

.article-thumbnail-container {
    width: 100%;
    height: 200px;  /* fixed image height */
    flex-shrink: 0; /* prevents image from shrinking */
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.article-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    z-index: 2;
    background: linear-gradient(180deg, 
        rgba(var(--main-color-rgb, 114, 182, 255), 0.03) 0%,
        rgba(10, 30, 60, 0.1) 100%);
}

.article-title {
    font-size: 1.5em;
    margin: 0;
    padding-bottom: 15px;
    color: var(--main-color);
    text-shadow: 0 0 8px rgba(var(--main-color-rgb, 114, 182, 255), 0.4);
    word-wrap: break-word;
}

.article-title::after {
    content: "";
    display: block;
    height: 2px;
    width: 80%;
    margin: 15px auto 0;
    border-radius: 0px; /* was 10px */
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.1), 
        rgba(var(--main-color-rgb, 114, 182, 255), 0.8), 
        rgba(255, 255, 255, 0.1));
    box-shadow: 0 0 10px rgba(var(--main-color-rgb, 114, 182, 255), 0.5);
}

.article-date {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    text-align: center;
    display: block;
    margin-bottom: 15px;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.article-description {
    font-size: 1em;
    line-height: 1.5;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
    word-wrap: break-word;
}

.read-more-container {
    margin-top: auto;
    padding: 15px 0;
    width: 100%;
    text-align: center;
    border-top: 1px solid rgba(var(--main-color-rgb, 114, 182, 255), 0.4);
    position: relative;
    z-index: 2;
    background: rgba(10, 25, 45, 0.25);
    background-image: linear-gradient(to bottom, 
        rgba(var(--main-color-rgb, 114, 182, 255), 0.08), 
        rgba(var(--main-color-rgb, 114, 182, 255), 0.15));
}

.read-more {
    text-decoration: none;
    display: inline-block;
    color: var(--main-color);
    font-weight: bold;
    transition: all 0.25s ease-out;
    padding: 8px 20px;
    border-radius: 0px; /* was 5px */
    border: 1px solid transparent;
    text-shadow: 0 0 5px rgba(var(--main-color-rgb, 114, 182, 255), 0.3);
    letter-spacing: 0.5px;
}

/* Only apply hover effects on non-touch devices */
@media (hover: hover) and (pointer: fine) {
    .read-more:hover {
        background-color: rgba(var(--main-color-rgb, 114, 182, 255), 0.2);
        color: white;
        border: 1px solid rgba(var(--main-color-rgb, 114, 182, 255), 0.5);
        text-shadow: 0 0 8px rgba(var(--main-color-rgb, 114, 182, 255), 0.6);
        box-shadow: 0 0 15px rgba(var(--main-color-rgb, 114, 182, 255), 0.3);
        transform: translateY(-1px);
    }
}

@media (max-width: 900px) {
    #article-section {
        flex-direction: column;
        align-items: center;
    }

    .article {
        max-width: 100%;
        width: 100%;
        margin-bottom: 30px;
    }
}

@media (max-width: 600px) {
    .article {
        height: auto; /* Auto height for mobile to accommodate full description */
        min-height: 450px;
    }
    
    .article-thumbnail-container {
        height: 180px;
    }
    
    .article-description {
        -webkit-line-clamp: initial; /* Remove line clamp to show full description */
        overflow: visible;
        display: block; /* Change from -webkit-box to normal block display */
        margin-bottom: 20px;
    }
    
    .read-more-container {
        position: relative;
        margin-top: 15px;
    }
}