/*
Theme Name: Astra Child
Theme URI: https://wpastra.com/
Template: astra
Author: Brainstorm Force
Description: Custom blog archive design
Version: 1.0.4
*/

/* Reset some Astra defaults for the archive container */
body.blog .ast-container,
body.archive .ast-container {
    max-width: 1200px !important;
    padding: 0 20px;
    margin: 0 auto;
}

body.blog #primary, body.archive #primary {
    margin: 60px 0;
}

/* Container for the grid - IMPORTANT: ONLY target the row inside main */
body.blog #primary > main > .ast-row, 
body.archive #primary > main > .ast-row,
.custom-blog-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    gap: 40px !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

body.blog #primary > main > .ast-row::before,
body.blog #primary > main > .ast-row::after,
body.archive #primary > main > .ast-row::before,
body.archive #primary > main > .ast-row::after,
.custom-blog-grid::before,
.custom-blog-grid::after {
    display: none !important;
}

/* Card Styling - FORCE FULL WIDTH OF GRID CELL */
article.custom-blog-card {
    background: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04) !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    width: 100% !important;
    max-width: none !important;
    flex: none !important;
    min-width: 0 !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

article.custom-blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08) !important;
}

.custom-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.custom-card-image {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.custom-card-image img,
.custom-card-image > a {
    width: 100%;
    display: block;
}

.custom-card-image img {
    height: 240px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.custom-card-category {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 14px;
    font-family: "Inter", "Helvetica Neue", Helvetica, sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #444;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 2;
}

.custom-card-content {
    padding: 35px 30px 25px !important;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.custom-card-title {
    font-family: "Playfair Display", "Times New Roman", Georgia, serif !important;
    font-size: 26px !important;
    font-weight: 400 !important;
    line-height: 1.3 !important;
    margin-top: 0 !important;
    margin-bottom: 15px !important;
    color: #222 !important;
}

.custom-card-title a {
    color: inherit !important;
    text-decoration: none !important;
    box-shadow: none !important;
    border: none !important;
    background-image: none !important;
}

.custom-card-title a:hover {
    color: #555;
}

.custom-card-excerpt {
    font-family: "Inter", "Helvetica Neue", Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #777;
    margin-bottom: 0;
    word-break: break-word;
}

.custom-card-excerpt p {
    margin: 0;
}

.custom-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px !important;
    border-top: 1px solid #f0f0f0 !important;
    background: #ffffff !important;
    margin-top: auto;
    box-sizing: border-box;
}

.custom-card-author {
    font-family: "Inter", "Helvetica Neue", Helvetica, sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: #999;
}

.custom-card-readmore {
    font-family: "Inter", "Helvetica Neue", Helvetica, sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: #333 !important;
    text-decoration: none !important;
    box-shadow: none !important;
    border: none !important;
    transition: color 0.2s ease;
}

.custom-card-readmore:hover {
    color: #888;
}

/* Background for the whole page */
body.blog, body.archive {
    background-color: #f6f5ee !important; 
}

/* Transparent wrappers so body color shows */
body.blog .site-content,
body.archive .site-content,
body.blog .ast-container,
body.archive .ast-container,
body.blog .site,
body.archive .site {
    background-color: transparent !important;
}