/* WP News Plugin Styles */

/* Import Poppins font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Global font family */
* {
    font-family: 'Poppins', sans-serif;
}

/* =============================================
   SEARCH FORM STYLES
   ============================================= */
.wp-news-search-form {
    margin-bottom: 30px;
}

.news-search-form {
    position: relative;
}

.search-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.news-search-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.news-search-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.news-search-button {
    padding: 12px 24px;
    background: #2271b1;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-search-button:hover {
    background: #135e96;
}

.news-search-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
    margin-top: 10px;
}

/* Search Results Container */
.news-search-results-container {
    margin-top: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-results-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.search-results-wrapper h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 10px;
}

/* Search results use the same layout as news list */
.search-results-layout,
.category-filter-layout {
    display: block;
}

/* =============================================
   CATEGORY FILTER STYLES
   ============================================= */
.wp-news-categories-filter {
    margin-bottom: 30px;
}

.categories-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.category-filter-btn {
    padding: 8px 16px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.category-filter-btn .category-icon {
    width: 16px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
}

.category-filter-btn:hover {
    background: var(--category-color, #e9ecef);
    color: white;
    border-color: var(--category-color, #dee2e6);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.category-filter-btn.active {
    background: var(--category-color, #2271b1);
    color: white;
    border-color: var(--category-color, #2271b1);
}

/* Special styling for ALL button */
.category-filter-btn[data-category="all"].active {
    background: #001b69;
    border-color: #001b69;
}

.category-filter-btn[data-category="all"]:hover {
    background: #001b69;
    border-color: #001b69;
    color: white;
}

.category-filter-btn .count {
    font-size: 12px;
    opacity: 0.8;
}

.news-category-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

/* =============================================
   NEWS LIST & GRID STYLES
   ============================================= */
.wp-news-list {
    margin-bottom: 30px;
}

.news-layout {
    display: block;
    margin-bottom: 30px;
}

.featured-news-wrapper {
    width: 100%;
    margin-bottom: 40px;
}

.regular-news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 0;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.news-item {
    background: transparent;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    border: none;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Ensure featured news items don't interfere with regular grid */
.featured-news-item.news-item {
    display: block;
    height: auto;
    box-shadow: none;
    border: none;
}

.news-item-image {
    position: relative;
    height: 250px;
    overflow: hidden;
    border-radius: 15px;
}

.news-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-item:hover .news-item-image img {
    transform: scale(1.05);
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-style: italic;
}

.news-categories {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

/* Category Overlay Styles */
.category-overlay {
    position: absolute;
    bottom: 15px;
    left: 15px;
    padding: 8px 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.category-overlay-icon {
    width: 20px;
    height: 20px;
    object-fit: cover;
    filter: brightness(0) invert(1);
}

.category-overlay-icon:not(img) {
    font-size: 18px;
    line-height: 1;
}

.category-tag {
    background: rgba(34, 113, 177, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-tag.small {
    font-size: 10px;
    padding: 2px 6px;
}

.news-item-content {
    padding: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Category text under image (for regular news items) */
.news-item-category-text {
    font-size: 15px;
    color: #809ab3;
    margin: 0 0 10px 0;
    font-weight: 400;
}

.news-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    line-height: 1.4;
}

.news-title a {
    color: #001b69;
    text-decoration: none;
    font-weight: 600;
}

.news-excerpt {
    margin: 0 0 15px 0;
    color: #6a667d;
    line-height: 1.5;
    font-size: 15px;
    font-weight: 400;
    flex-grow: 1;
}

.news-meta {
    border-top: none;
    padding-top: 15px;
    margin-top: auto;
}

.news-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.author-name {
    font-weight: 700;
    color: #000;
    font-size: 15px;
}

.post-date {
    color: #6a667d;
    font-size: 15px;
    font-weight: 400;
}

/* =============================================
   PAGINATION STYLES
   ============================================= */
.news-pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.news-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.news-pagination .page-numbers:hover,
.news-pagination .page-numbers.current {
    background: #2271b1;
    color: white;
    border-color: #2271b1;
}

/* =============================================
   FEATURED NEWS ITEM STYLES
   ============================================= */
.featured-news-item {
    background: white;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    border: none;
    transition: transform 0.3s ease;
    margin-bottom: 30px;
}

.featured-news-item:hover {
    transform: translateY(-5px);
    box-shadow: none;
}

.featured-news-layout {
    display: grid;
    grid-template-columns: 50% 50%;
    min-height: 400px;
}

.featured-news-image {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.featured-news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-news-item:hover .featured-news-image img {
    transform: scale(1.05);
}

.featured-news-content {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.featured-category {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 6px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: flex-start;
    margin-bottom: 5px;
}

.category-icon-small {
    width: 16px;
    height: 16px;
    object-fit: cover;
    filter: brightness(0) invert(1);
}

.featured-news-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    color: #001b69;
}

.featured-news-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.featured-news-title a:hover {
    color: #2271b1;
}

.featured-news-excerpt {
    color: #6a667d;
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 25px 0;
    flex-grow: 1;
    font-weight: 400;
}

.featured-news-meta {
    margin-top: auto;
    padding-top: 20px;
    border-top: none;
}

.featured-author {
    display: flex;
    align-items: center;
    gap: 15px;
}

.featured-author .author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: none;
}

.featured-author .author-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.featured-author .author-name {
    font-size: 15px;
    font-weight: 700;
    color: #000;
}

.featured-author .post-date {
    font-size: 15px;
    color: #6a667d;
    font-style: normal;
    font-weight: 400;
}

/* =============================================
   SINGLE NEWS ARTICLE STYLES
   ============================================= */
.single-news-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.single-news-article {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Hero Section */
.news-hero {
    position: relative;
    height: 400px;
    overflow: hidden;
}

.hero-image {
    width: 100%;
    height: 100%;
    position: relative;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* YouTube Play Overlay */
.hero-image.has-youtube {
    cursor: pointer;
}

.youtube-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    pointer-events: none;
}

.youtube-play-overlay .youtube-play-button {
    pointer-events: auto;
}

.youtube-play-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.9;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.youtube-play-button:hover {
    transform: scale(1.1);
    opacity: 1;
}

.youtube-play-button img {
    width: 50px;
    height: 50px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    display: block;
}

/* YouTube Modal */
.youtube-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.youtube-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1;
}

.youtube-modal-content {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 1200px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.youtube-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 36px;
    cursor: pointer;
    z-index: 3;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    line-height: 1;
}

.youtube-modal-close:hover {
    opacity: 0.7;
}

.youtube-video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.youtube-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.5) 100%);
    display: flex;
    align-items: flex-end;
    padding: 40px 30px 30px;
    z-index: 5;
    pointer-events: none;
}

.hero-overlay .hero-content {
    pointer-events: auto;
}

.hero-content .news-title {
    color: white;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-content .news-excerpt {
    color: rgba(255, 255, 255, 0.9);
    font-size: 18px;
    line-height: 1.5;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Content Wrapper */
.news-content-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    padding: 30px;
}

/* Main Content */
.news-main-content {
    min-width: 0; /* Prevents overflow */
}

.news-author-info {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 30px;
}

.news-author-info .author-avatar {
    width: 60px;
    height: 60px;
}

.author-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.author-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.author-details .author-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.meta-separator {
    font-size: 14px;
    color: #999;
}

.author-details .post-date {
    font-size: 14px;
    color: #666;
}

.post-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.article-content {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    margin: 30px 0 15px 0;
    color: #2c3e50;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

/* Sidebar */
.news-sidebar {
    min-width: 0; /* Prevents overflow */
}

.sidebar-content {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    position: sticky;
    top: 20px;
}

.sidebar-title {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 10px;
}

/* Related Articles */
.related-articles {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.related-article {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.related-article:hover {
    transform: translateY(-2px);
}

.related-image {
    height: 120px;
    overflow: hidden;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-content {
    padding: 15px;
}

.related-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.related-category {
    font-size: 15px;
    color: #000;
    font-weight: 500;
}

.related-separator {
    font-size: 15px;
    color: #809ab3;
}

.related-date {
    font-size: 15px;
    color: #809ab3;
}

.related-categories {
    margin-bottom: 8px;
}

.related-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.related-title a {
    color: #001b69;
    text-decoration: none;
    transition: color 0.3s ease;
}

.related-title a:hover {
    color: #2271b1;
}

.related-excerpt {
    font-size: 15px;
    color: #6a667d;
    line-height: 1.5;
}

.no-related {
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 0;
}

/* =============================================
   NO NEWS FOUND STYLES
   ============================================= */
.no-news-found {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */
@media (max-width: 1024px) {
    .regular-news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .regular-news-grid,
    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .featured-news-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    
    .featured-news-image {
        height: 250px;
    }
    
    .featured-news-content {
        padding: 25px;
    }
    
    .featured-news-title {
        font-size: 26px;
        margin-bottom: 12px;
    }
    
    .featured-news-excerpt {
        font-size: 16px;
        margin-bottom: 20px;
    }
    
    .featured-author .author-avatar {
        width: 50px;
        height: 50px;
    }
    
    .featured-author .author-name {
        font-size: 16px;
    }
    
    .featured-author .post-date {
        font-size: 14px;
    }
    
    .search-input-wrapper {
        flex-direction: column;
    }
    
    .categories-buttons {
        justify-content: center;
    }
    
    .news-content-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .hero-content .news-title {
        font-size: 24px;
    }
    
    .hero-content .news-excerpt {
        font-size: 16px;
    }
    
    .news-author-info {
        flex-direction: column;
        text-align: center;
    }
    
    .author-details {
        align-items: center;
    }
    
    .post-categories {
        justify-content: center;
    }
    
    .related-articles {
        gap: 15px;
    }
    
    .sidebar-content {
        position: static;
    }
    
    /* YouTube modal responsive */
    .youtube-modal-content {
        width: 95%;
    }
    
    .youtube-modal-close {
        top: -35px;
        font-size: 30px;
    }
    
    .youtube-play-button {
        width: 40px;
        height: 40px;
    }
    
    .youtube-play-button img {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .single-news-container {
        padding: 10px;
    }
    
    .news-hero {
        height: 300px;
    }
    
    .hero-overlay {
        padding: 20px 15px 15px;
    }
    
    .hero-content .news-title {
        font-size: 20px;
    }
    
    .hero-content .news-excerpt {
        font-size: 14px;
    }
    
    .news-content-wrapper {
        padding: 15px;
    }
    
    .sidebar-content {
        padding: 15px;
    }
    
    .category-filter-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .news-item-content {
        padding: 15px;
    }
    
    .news-title {
        font-size: 18px;
    }
    
    /* YouTube modal mobile */
    .youtube-modal-content {
        width: 100%;
        border-radius: 0;
    }
    
    .youtube-play-button {
        width: 35px;
        height: 35px;
    }
    
    .youtube-play-button img {
        width: 35px;
        height: 35px;
    }
}