/* ----------------- General ----------------- */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background: #f8f8f8;
    color: #222;
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* ----------------- Header ----------------- */
h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

nav.cats {
    margin-bottom: 20px;
}

nav.cats a {
    display: inline-block;
    margin-right: 10px;
    padding: 5px 12px;
    background: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

nav.cats a:hover {
    background: #555;
}



/* ------------------- Navigation -----------------*/
.cats .active {
    font-weight: 700;
    border-bottom: 2px solid #000;
}


/* ----------------- Search Bar ----------------- */
.search-bar {
    margin-bottom: 30px;
}

.search-bar input[type="text"] {
    width: 70%;
    padding: 8px 12px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
    outline: none;
}

.search-bar button {
    padding: 8px 12px;
    font-size: 1rem;
    border: 1px solid #333;
    border-left: none;
    background: #333;
    color: #fff;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.search-bar button:hover {
    background: #555;
}

/* ----------------- Featured Article ----------------- */
.featured {
    display: block;
    position: relative;
    margin-bottom: 40px;
    overflow: hidden;
    border-radius: 12px;
    text-decoration: none;
    color: #fff;
}

.featured img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s;
}

.featured:hover img {
    transform: scale(1.05);
}

.featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    padding: 20px;
}

.featured-overlay h2 {
    margin: 0 0 10px 0;
    font-size: 2rem;
}

.featured-overlay p {
    margin: 0;
    font-size: 1rem;
}

/* ----------------- Pills ----------------- */
.pill {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 10px;
    background: #e74c3c;
    color: #fff;
    margin-bottom: 5px;
}

.pill.small {
    font-size: 0.65rem;
    background: #3498db;
}

/* ----------------- Main Flex / Grid ----------------- */
.main-flex {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* Grid */
.grid {
    flex: 3;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Card */
.card {
    display: block;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: #222;
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.card-content {
    padding: 10px 12px;
}

.card-content h3 {
    margin: 5px 0;
    font-size: 1.1rem;
}

.card-content p {
    margin: 5px 0 0 0;
    font-size: 0.9rem;
    color: #555;
}

/* ----------------- Sidebar ----------------- */
.sidebar {
    flex: 1;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    height: fit-content;
}

.sidebar h3 {
    margin-top: 0;
}

.sidebar ul {
    list-style: none;
    padding-left: 0;
}

.sidebar ul li {
    margin-bottom: 8px;
}

.sidebar ul li a {
    text-decoration: none;
    color: #3498db;
    transition: color 0.2s;
}

.sidebar ul li a:hover {
    color: #e74c3c;
}

/* ----------------- Article Page ----------------- */
.meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 10px;
}

article img {
    max-width: 100%;
    margin: 20px 0;
    border-radius: 6px;
}

article h1 {
    font-size: 2rem;
}

article p {
    line-height: 1.6;
    margin-bottom: 15px;
}

/* ----------------- Related Articles ----------------- */
ul.related {
    list-style: none;
    padding-left: 0;
}

ul.related li {
    margin-bottom: 6px;
}

ul.related li a {
    color: #e74c3c;
    text-decoration: none;
}

ul.related li a:hover {
    text-decoration: underline;
}

/* ----------------- Responsive ----------------- */
@media screen and (max-width: 900px){
    .main-flex {
        flex-direction: column;
    }
}

@media screen and (max-width: 600px){
    nav.cats a { margin-bottom: 5px; }
    .search-bar input[type="text"] { width: 60%; }
}

/* ✅ FIX: prevent images from overflowing */
.article img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px 0;
}
