/* General Styles */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #000; /* Black background */
    color: white;
}

/* Top Menu */
.top-menu {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    background: #1a1a1a;
}

.top-menu ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 10px;
}

.top-menu a {
    text-decoration: none;
    color: #00bfff;
}

/* Header Container */
.header-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: #000;
}

.header-container .logo {
    flex: 1;
    text-align: center;
    margin-bottom: 10px;
}

.header-container .logo img {
    width: 100%;
    max-width: 450px; /* Increased max width for desktop */
    height: auto;
}

.header-container .banner-ad {
    flex: 3;
    text-align: center;
    margin-bottom: 10px;
}

.header-container .banner-ad img {
    width: 100%;
    max-width: 728px; /* Adjust to banner ad size */
    height: auto;
}

/* Desktop Grid Layout */
.grid-container-desktop {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 200px;
    gap: 10px;
    padding: 20px;
}

.grid-item-desktop, .grid-item-phone {
    position: relative;
    background: #333;
    overflow: hidden;
    border-radius: 5px;
}

.grid-item-desktop img, .grid-item-phone img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Overlay */
.grid-item-desktop .overlay, .grid-item-phone .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px; /* Minimized padding */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 2px;
    height: auto;
    box-sizing: border-box;
}

/* Title */
.title-link {
    text-decoration: none;
    color: white;
}

.title {
    font-size: 18px;
    line-height: 1.2;
    font-weight: bold;
}

/* Source & Date */
.grid-item-desktop .source, .grid-item-phone .source {
    font-weight: bold;
    color: white;
    text-decoration: none;
    margin-bottom: 0; /* Removed unnecessary bottom margin */
    line-height: 1.2;
}

.pub-date {
    font-size: 12px;
    color: #ccc;
    margin: 2px 0 4px 0; /* Adjusted margins to reduce bottom gap */
    line-height: 1.2;
}

/* Mobile View Fix */
@media (max-width: 768px) {
    .desktop-view {
        display: none !important;
    }
    .phone-view {
        display: block !important;
    }
    
    .grid-container-phone {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* 2 columns for mobile */
        gap: 10px;
        padding: 10px;
    }
}
