/*
 * CSS for the Defence News Widget
 * Adapted from company-listing-widget styles
 */

.defence-news-widget .grid-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-left: -10px;
    margin-right: -10px;
}

.defence-news-widget .grid-item.news-item { /* Added .news-item for specificity as used in PHP */
    font: normal normal 13px Pridi, Arial, Helvetica, sans-serif;
    color: #333;
    line-height: 1.7;
    word-break: break-word;
    word-wrap: break-word;
    background: #fffaf0;
    box-shadow: 0px 0.48px 0.96px rgba(0, 0, 0, 0.1), 0px 1.6px 4.8px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    transition-duration: 0.7s;
    flex: 0 0 calc(25% - 20px);
    max-width: calc(25% - 20px);
    margin-left: 10px;
    margin-right: 10px;
    margin-bottom: 25px;
    box-sizing: border-box;
    height: auto; /* Ensures height adjusts to content */
}

/* For Issue 2: Handling single item display */
/* If there's only one item, make it take full width on desktop */
.defence-news-widget .grid-container.grid-container-four-column .grid-item.news-item:only-child {
    flex: 0 0 calc(100% - 20px);
    max-width: calc(100% - 20px);
}
/* If you want a single item to always be full width, or to span 2 columns etc.
   You might need more specific rules depending on your exact layout needs.
   The above rule makes a *single* item full width. If you have 2 items and want 50% each,
   you'd need different CSS. This addresses the "half the size" issue if it implies
   a single item should be full width. */


.defence-news-widget .grid-item.news-item:hover {
    background-color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2), /* Elevation shadow */
                0 0 10px rgba(255, 255, 255, 0.7); /* White glow */
    transform: translateY(-3px); /* Slight upward movement for added elevation */
}

.defence-news-widget .grid-item.news-item article {
    padding: 10px;
}

.defence-news-widget .grid-item-title.news-title { /* Added .news-title for specificity */
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 0.7em;
    color: #000;
    padding-left: 3%;
}

.defence-news-widget .grid-item-title.news-title a {
    color: #000;
    text-decoration: none;
}

.defence-news-widget .grid-item-title.news-title a:hover {
    color: #0078d7;
    text-decoration: underline;
}

.defence-news-widget .news-summary-content .news-summary { /* Added wrapper classes for specificity */
    font-size: 1.1em;
    color: #666;
    margin-top: 20px;
    margin-bottom: 1.2em;
    padding-left: 3%;
}

.defence-news-widget .news-date {
    font: normal normal 13px Pridi, Arial, Helvetica, sans-serif;
    font-size: 1.1em;
    color: #888;
    margin-bottom: 1em;
    padding-left: 3%;
}

.defence-news-widget .grid-item-thumbnail.news-thumbnail { /* Added .news-thumbnail for specificity */
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.defence-news-widget .grid-item-thumbnail.news-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 5px 5px 0 0;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.defence-news-widget .grid-item-thumbnail.news-thumbnail:hover img {
    transform: scale(1.2);
}

/* --- FIX for Issue 3: Category Styling --- */
.defence-news-widget .news-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
    padding-left: 3%;
}

.defence-news-widget .news-category-link {
    background-color: #990000; /* Maroon */
    padding: 5px 10px;
    border-radius: 0; /* Removing rounded corners */
    color: white;
    text-decoration: none;
    font-size: 0.8em;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.defence-news-widget .news-category-link:hover {
    background-color: #660000; /* Dark Maroon */
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2); /* Elevation effect */
}
/* --- END FIX for Issue 3 --- */


/* --- FIX for Issue 1: Separate "View All" link --- */
/* Styles for the container of the "View All" link for Defence News */
/* This targets the new class added in the PHP update from our previous conversation */
.defence-news-widget .defence-news-view-all {
    text-align: right; /* Align to the right as per your previous request */
    margin-top: 5px; /* Adjust as needed for spacing from title */
    margin-bottom: 15px; /* Space before the news items grid starts */
    padding-right: 10px; /* Optional: adds padding to align with grid if needed */
}

/* Styles for the link itself */
.defence-news-widget .defence-news-view-all a {
    display: inline-block;
    padding: 5px 20px;
    background-color: #ffd700; /* Gold-like color */
    color: rgb(18, 18, 18);
    text-decoration: underline; /* Retain underline for a clear link */
    font-weight: 600;
    border-radius: 5px;
    font-size: 1em;
}

.defence-news-widget .defence-news-view-all a:hover {
    background-color: #e6c200; /* Slightly darker gold on hover */
    text-decoration: none; /* Remove underline on hover for a cleaner look */
}
/* --- END FIX for Issue 1 --- */


/* Social Media Styles (if you implement them for Defence News) */
.defence-news-widget .social-icons {
    position: absolute; /* This might need adjustment depending on your layout */
    bottom: 10px;
    left: 10px;
    display: flex;
    gap: 5px;
    z-index: 10;
}

.defence-news-widget .social-icon {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 16px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.defence-news-widget .social-icon:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .defence-news-widget .grid-item.news-item {
        flex: 0 0 calc(50% - 20px);  /* Two columns on screens smaller than 768px */ 
        max-width: calc(50% - 20px);
    }
 
