/*--------------------------------------------------------------
#                    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-controls {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto 12px;
    padding: 0;
    box-sizing: border-box;
}

.search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--main-color-rgb);
    border: 1px solid rgba(var(--main-color-rgb, 114, 182, 255), 0.35);
    padding: 0 12px;
    box-shadow: inset 0 0 16px rgba(var(--main-color-rgb, 114, 182, 255), 0.08);
    width: 100%;
    max-width: 1134px;
    margin: 0 auto;
    box-sizing: border-box;
}


.search-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    width: 100%;
    min-height: 46px;
    box-sizing: border-box;
}

.search-icon {
    color: var(--main-color);
    font-size: 1.2rem;
}

#article-search {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    outline: none;
}

#article-search::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.search-clear {
    width: auto;
    height: auto;
    display: inline-block;
    background: transparent;
    border: none;
    color: var(--main-color);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 10px;
    line-height: 1;
    border-radius: 0;
}

.search-clear[hidden] {
    display: none !important;
}

.search-clear:focus,
.search-clear:focus-visible {
    outline: none;
}

#article-controls input,
#article-controls select,
#article-controls button {
    font-family: "Terminus", monospace;
}

@media (max-width: 1223px) {
    .search-row {
        flex-wrap: wrap;
        padding: 0px 12px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .search-wrapper {
        padding: 0px 4px;
    }
}

@media (max-width: 600px) {
    .search-row {
        margin-top: 1.5rem;
        padding: 0px 12px;
    }

    .search-wrapper {
        max-width: 100%;
        padding: 0px 4px;
    }
}

.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;
    }
}

#pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 25px auto 10px;
    padding: 10px 14px;
    max-width: 1200px;
    color: rgba(255, 255, 255, 0.9);
}

.pagination-info {
    font-size: 0.95em;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.pagination-button {
    font-family: 'Terminus';
    outline: none;
    background: rgba(10, 25, 45, 0.35);
    border: 1px solid rgba(var(--main-color-rgb, 114, 182, 255), 0.5);
    color: var(--main-color);
    padding: 8px 16px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    cursor: pointer;
    transition: all 0.2s ease-out;
    border-radius: 0;
}

.pagination-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

@media (hover: hover) and (pointer: fine) {
    body:not(.effects-disabled) .pagination-button:not(:disabled):hover {
        background: rgba(var(--main-color-rgb, 114, 182, 255), 0.18);
        color: white;
        box-shadow: 0 0 12px rgba(var(--main-color-rgb, 114, 182, 255), 0.35);
    }
}

@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;
    }
}
