/* =========================================================
   AVOZOVA - BLOG SYSTEM (SEMANTIC & OPTIMIZED)
   Blog Listing / Post Cards / Pagination
   ========================================================= */


/* =========================================================
   1. BLOG CONTAINER (uses the global container tokens)
   ========================================================= */

.avozova-blog-container {
    max-width: var(--avozova-container-width) !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding-left: var(--avozova-container-spacing) !important;
    padding-right: var(--avozova-container-spacing) !important;
    padding-top: 60px;
    padding-bottom: 60px;
    box-sizing: border-box !important;
}


/* =========================================================
   2. BLOG POST GRID
   ========================================================= */

.avozova-post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
    align-items: stretch;
}


/* =========================================================
   3. PREMIUM BLOG CARD (Floating Surface Model)
   ========================================================= */

.avozova-post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;

    /* Semantic surface and shadow tokens */
    background: var(--avozova-color-surface);
    /* No real border: the border is drawn by ::after below, ABOVE the image (no clipped edges) */
    position: relative;
    border: 0;
    border-radius: 18px;
    box-shadow: var(--avozova-shadow);

    padding: 0 !important;
    box-sizing: border-box !important;
    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease,
        border-color 0.35s ease;
}

.avozova-post-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 20px 45px rgba(31, 41, 55, 0.15);
}

/* Border overlay: sits above the image and the content, with the card's radius.
 * Width is 1px by default; the Customizer (Design > Border Width) changes only this width. */
.avozova-post-card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 3;
    border-style: solid;
    border-width: 1px;
    border-color: var(--avozova-color-border);
    border-radius: inherit;
    box-sizing: border-box;
    pointer-events: none;
    transition: border-color 0.35s ease;
}

/* Opaque hover colour: a transparent colour would let the image show through behind the border */
.avozova-post-card:hover::after {
    border-color: #cab8a9; /* fallback for older browsers */
    border-color: color-mix(in srgb, var(--avozova-color-primary) 35%, var(--avozova-color-border));
}


/* =========================================================
   4. FEATURED IMAGE
   The image has no radius of its own: the card's border-radius + overflow:hidden
   clips it. Image on top: the top corners are clipped; in the middle: no effect;
   at the bottom: the bottom corners are clipped.
   ========================================================= */

.avozova-post-image {
    display: block;
    width: 100%;
    overflow: hidden;
    background: var(--avozova-color-surface);
    position: relative;
    border-radius: 0;
}

.avozova-post-image img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    transition: transform var(--avozova-transition-slow);
}

.avozova-post-card:hover .avozova-post-image img {
    transform: scale(1.04);
}


/* =========================================================
   5. CARD CONTENT AREA
   ========================================================= */

.avozova-post-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    /* No !important: the Customizer (Design > Padding) overrides this value */
    padding: var(--avozova-space-4);
    box-sizing: border-box !important;
}


/* =========================================================
   6. POST TITLE
   ========================================================= */

.avozova-post-title {
    margin: 0 0 12px !important;
    color: var(--avozova-color-heading);
    font-size: 1.3rem;
    line-height: var(--avozova-line-height-2);
    font-weight: var(--avozova-font-weight-bold);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    list-style: none !important;
}

.avozova-post-title::before,
.avozova-post-title::after {
    content: none !important;
}

.avozova-post-title a {
    color: var(--avozova-color-heading);
    text-decoration: none;
    transition: color 0.2s ease;
}

.avozova-post-title a:hover {
    color: var(--avozova-color-primary);
}


/* =========================================================
   7. POST EXCERPT
   ========================================================= */

.avozova-post-excerpt {
    margin-bottom: var(--avozova-space-3) !important;
}

.avozova-post-excerpt p {
    margin: 0;
    color: var(--avozova-color-text);
    font-size: 0.95rem;
    line-height: var(--avozova-line-height-3);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* =========================================================
   8. POST TICKER ANIMATION
   ========================================================= */

.avozova-post-card.is-playing .avozova-post-excerpt {
    overflow: hidden !important;
    position: relative;
    width: 100%;
}

.avozova-post-card.is-playing .avozova-post-excerpt p {
    display: inline-block !important;
    white-space: nowrap !important;
    -webkit-line-clamp: unset !important;
    line-clamp: 1;
    animation: avozovaTickerScroll 35s linear infinite;
}

@keyframes avozovaTickerScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}


/* =========================================================
   9. POST META
   ========================================================= */

.avozova-post-meta-simple {
    display: flex;
    align-items: center;
    gap: var(--avozova-space-2);
    font-size: 0.88rem;
    color: var(--avozova-color-text);
    font-weight: var(--avozova-font-weight-semibold);
    margin-bottom: 20px !important;
}

.avozova-post-meta-simple a,
.avozova-meta-author,
.avozova-meta-date {
    color: var(--avozova-color-primary);
    text-decoration: none;
}

.avozova-post-meta-simple a:hover {
    text-decoration: underline;
}

.avozova-meta-separator {
    color: var(--avozova-color-text);
    opacity: 0.5;
}


/* =========================================================
   10. CARD ACTIONS
   ========================================================= */

.avozova-card-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: auto;
}


/* =========================================================
   11. PAGINATION
   ========================================================= */

.avozova-pagination {
    margin-top: 50px;
    text-align: center;
}

.avozova-pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--avozova-space-2);
}

.avozova-pagination a,
.avozova-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    padding: var(--avozova-space-2) 14px;

    border: 1px solid var(--avozova-color-border);
    border-radius: var(--avozova-radius-3);
    background: var(--avozova-color-surface);
    color: var(--avozova-color-heading);
}

.avozova-pagination .current,
.avozova-pagination a:hover {
    background: var(--avozova-color-primary);
    border-color: var(--avozova-color-primary);
    color: var(--avozova-color-bg);
}


/* =========================================================
   12. NO POSTS STATE
   ========================================================= */

.avozova-no-posts {
    padding: 60px 30px;
    background: var(--avozova-color-surface);
    border: 1px solid var(--avozova-color-border);
    border-radius: 18px;
    text-align: center;
    box-shadow: var(--avozova-shadow);
}

.avozova-no-posts h2 {
    margin-top: 0;
    color: var(--avozova-color-heading);
}


/* =========================================================
   13. TABLET RESPONSIVE
   ========================================================= */

@media (max-width: 991px) {
    .avozova-post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .avozova-blog-container {
        padding: 45px 0;
    }
}


/* =========================================================
   14. MOBILE RESPONSIVE
   ========================================================= */

@media (max-width: 650px) {
    .avozova-blog-container {
        width: min(100% - var(--avozova-space-4), 600px);
        padding: 30px 0;
    }

    .avozova-post-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .avozova-post-content {
        padding: 22px;
    }

    .avozova-post-title {
        font-size: 1.3rem;
    }

    .avozova-post-excerpt p {
        font-size: 0.95rem;
    }
}