/* categorys.css – auto.pub /en/css/ */

/* ===== ÜLDISED STIILID ===== */
body, html {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f8f8f8;
}

.page-wrapper {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

main {
    padding: 0 20px 30px;
    margin-top: 5px;
}

/* ===== KATEGOORIA PEALKIRI ===== */
.category-title {
    border-bottom: 2px solid red;
    padding-bottom: 5px;
    margin-bottom: 15px;
    font-family: Arial, sans-serif;
    font-size: 1.2em;
    text-transform: uppercase;
}

/* ===== NEWS GRID ===== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin: 0;
}

/* ===== ÜKSIK KAART ===== */
.news-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.news-card a,
.news-card a:visited {
    text-decoration: none;
    color: inherit;
    display: block;
}

.news-card a:hover h3 span {
    text-decoration: underline;
}

.news-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    border-radius: 5px 5px 0 0;
}

/* ===== PEALKIRI ===== */
.news-card h3 {
    font-family: Arial, sans-serif;
    font-size: 1em;
    font-weight: normal;
    line-height: 1.4;
    color: #111;
    padding: 8px 10px 10px;
    margin: 0;
    box-sizing: border-box;
}

/* NB: line-clamp on eraldi span'i peal, sest padding samal elemendil võib
   lasta neljanda rea ellipsi alt nähtavale. */
.news-card h3 span {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: calc(1em * 1.4 * 3);
}

/* ===== PAGINATION ===== */
.pagination {
    text-align: center;
    margin: 20px 0;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 5px 10px;
    margin: 2px;
    border: 1px solid #ccc;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
    font-family: Arial, sans-serif;
    font-size: 0.9em;
}

.pagination span.current {
    font-weight: bold;
    background-color: #e53935;
    color: #fff;
    border-color: #e53935;
}

.pagination a:hover {
    background-color: #eee;
}

/* ===== FOOTER ===== */
footer {
    background-color: #f0f0f0;
    border-top: 1px solid #ddd;
    color: #555;
    text-align: center;
    padding: 14px 20px;
    font-size: 0.88em;
    font-family: Arial, sans-serif;
    margin-top: 10px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
    .news-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 800px) {
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .news-card img {
        height: 120px;
    }
    .news-card h3 {
        font-size: 0.92em;
    }
    .news-card h3 span {
        max-height: calc(1em * 1.4 * 3);
    }
}

@media (max-width: 600px) {
    main {
        padding: 0 10px 20px;
    }
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 7px;
    }
    .news-card img {
        height: 105px;
    }
    .news-card h3 {
        font-size: 0.88em;
        padding: 6px 8px 8px;
    }
    .news-card h3 span {
        max-height: calc(1em * 1.4 * 3);
    }
    .category-title {
        font-size: 1em;
    }
}

@media (max-width: 400px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
    .news-card img {
        height: 180px;
    }
}
