/* =========================================================
   EZViews v1.1.0 — Front-end styles
   ========================================================= */

/* ---------------------------------------------------------
   Grid container
   --------------------------------------------------------- */
.ezviews-grid {
    display: grid;
    grid-template-columns: repeat(var(--ezv-cols, 3), 1fr);
    gap: 1.5rem;
    margin: 1.5rem 0;
}

/* ---------------------------------------------------------
   Single-column: horizontal card (thumb left, content right)
   --------------------------------------------------------- */
.ezviews-grid.ezviews-single-col {
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.ezviews-grid.ezviews-single-col .ezviews-card {
    flex-direction: row;
    align-items: flex-start;
}

.ezviews-grid.ezviews-single-col .ezviews-thumb {
    flex: 0 0 150px;
    width: 150px;
    height: 150px;
}

.ezviews-grid.ezviews-single-col .ezviews-thumb img {
    width: 150px;
    height: 150px;
    object-fit: cover;
}

/* ---------------------------------------------------------
   Card
   --------------------------------------------------------- */
.ezviews-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease;
}

.ezviews-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ---------------------------------------------------------
   Thumbnail — multi-column: fixed height + object-fit
   ensures images fill the space without upscaling or blur
   --------------------------------------------------------- */
.ezviews-thumb {
    overflow: hidden;
    background: #f3f4f6;
}

.ezviews-grid:not(.ezviews-single-col) .ezviews-thumb {
    height: 200px;
}

.ezviews-grid:not(.ezviews-single-col) .ezviews-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.ezviews-grid:not(.ezviews-single-col) .ezviews-thumb a:hover img {
    transform: scale(1.03);
}

/* ---------------------------------------------------------
   Card content
   --------------------------------------------------------- */
.ezviews-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ezviews-category {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 6px;
}

.ezviews-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 6px;
}

.ezviews-title a {
    color: inherit;
    text-decoration: none;
}

.ezviews-title a:hover {
    text-decoration: underline;
}

.ezviews-date {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 8px;
}

.ezviews-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
    flex: 1;
    margin-bottom: 10px;
}

.ezviews-excerpt p {
    margin: 0;
}

.ezviews-readmore {
    margin-top: auto;
}

.ezviews-readmore a {
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: #667eea;
}

.ezviews-readmore a:hover {
    text-decoration: underline;
}

/* ---------------------------------------------------------
   Featured + Grid layout — hero card
   --------------------------------------------------------- */
.ezviews-hero-card {
    display: flex;
    flex-direction: row;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1.75rem;
    transition: box-shadow 0.2s ease;
}

.ezviews-hero-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.ezviews-hero-thumb {
    flex: 0 0 48%;
    overflow: hidden;
    background: #f3f4f6;
}

.ezviews-hero-thumb img {
    width: 100%;
    height: 100%;
    min-height: 320px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.ezviews-hero-card:hover .ezviews-hero-thumb img {
    transform: scale(1.02);
}

.ezviews-hero-content {
    flex: 1;
    padding: 2rem 2rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
}

.ezviews-hero-title {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.5rem;
}

.ezviews-hero-title a {
    color: inherit;
    text-decoration: none;
}

.ezviews-hero-title a:hover {
    text-decoration: underline;
}

/* Hero inherits .ezviews-date, .ezviews-excerpt, .ezviews-readmore,
   .ezviews-category from above -- no overrides needed */

.ezviews-hero-content .ezviews-excerpt {
    font-size: 15px;
    -webkit-line-clamp: 4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------------------------------------------------------
   Pagination
   --------------------------------------------------------- */
.ezviews-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 2rem 0 1rem;
    flex-wrap: wrap;
}

.ezviews-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    color: #374151;
    background: #fff;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s;
}

.ezviews-page-link:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    text-decoration: none;
}

.ezviews-page-current {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
    font-weight: 600;
    cursor: default;
}

.ezviews-page-current:hover {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

.ezviews-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    color: #9ca3af;
    font-size: 14px;
}

/* ---------------------------------------------------------
   Empty / error messages
   --------------------------------------------------------- */
.ezviews-none,
.ezviews-error {
    color: #6b7280;
    font-style: italic;
    padding: 1rem 0;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 900px) {
    .ezviews-grid:not(.ezviews-single-col) {
        grid-template-columns: repeat(min(var(--ezv-cols, 3), 2), 1fr);
    }

    .ezviews-hero-thumb img {
        min-height: 240px;
    }
}

@media (max-width: 660px) {
    /* Grid collapses to single column */
    .ezviews-grid:not(.ezviews-single-col) {
        grid-template-columns: 1fr;
    }

    /* Hero card stacks vertically */
    .ezviews-hero-card {
        flex-direction: column;
    }

    .ezviews-hero-thumb {
        flex: none;
        width: 100%;
    }

    .ezviews-hero-thumb img {
        min-height: 200px;
        width: 100%;
    }

    .ezviews-hero-content {
        padding: 1.25rem;
    }

    .ezviews-hero-title {
        font-size: 1.25rem;
    }

    /* Single-col: stack on mobile too */
    .ezviews-grid.ezviews-single-col .ezviews-card {
        flex-direction: column;
    }

    .ezviews-grid.ezviews-single-col .ezviews-thumb,
    .ezviews-grid.ezviews-single-col .ezviews-thumb img {
        width: 100%;
        height: auto;
    }
}
