/* 
* Team Falcons News Page Styles
* Fixes for mobile containers and desktop vertical centering
*/

/* ===== MOBILE CONTAINER FIXES ===== */
/* Apply the same container fixes we used for matches page */
@media (max-width: 768px) {
    /* Fix container full-screen issues on mobile */
    .news-page .container,
    body.news-page .container,
    html body.news-page .container {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 auto !important;
        padding: 0 1rem !important;
        min-height: auto !important;
        height: auto !important;
        display: block !important;
        position: relative !important;
    }

    /* Fix specific sections that were taking full screen */
    .news-page .news-filter-section,
    body.news-page .news-filter-section,
    html body.news-page .news-filter-section {
        min-height: auto !important;
        max-height: none !important;
        height: auto !important;
        padding: 1rem 0 !important;
    }

    .news-page .featured-news-section,
    body.news-page .featured-news-section,
    html body.news-page .featured-news-section {
        min-height: auto !important;
        max-height: none !important;
        height: auto !important;
        padding: 1rem 0 !important;
    }

    .news-page .news-grid-section,
    body.news-page .news-grid-section,
    html body.news-page .news-grid-section {
        min-height: auto !important;
        max-height: none !important;
        height: auto !important;
        padding: 1rem 0 !important;
    }

    .news-page .upcoming-events-section,
    body.news-page .upcoming-events-section,
    html body.news-page .upcoming-events-section {
        min-height: auto !important;
        max-height: none !important;
        height: auto !important;
        padding: 1rem 0 !important;
    }

    .news-page .newsletter-section,
    body.news-page .newsletter-section,
    html body.news-page .newsletter-section {
        min-height: auto !important;
        max-height: none !important;
        height: auto !important;
        padding: 1rem 0 !important;
    }

    /* Fix container within sections */
    .news-page .news-filter-section .container,
    body.news-page .news-filter-section .container,
    html body.news-page .news-filter-section .container {
        min-height: auto !important;
        height: auto !important;
        padding: 0 1rem !important;
    }

    .news-page .featured-news-section .container,
    body.news-page .featured-news-section .container,
    html body.news-page .featured-news-section .container {
        min-height: auto !important;
        height: auto !important;
        padding: 0 1rem !important;
    }

    .news-page .news-grid-section .container,
    body.news-page .news-grid-section .container,
    html body.news-page .news-grid-section .container {
        min-height: auto !important;
        height: auto !important;
        padding: 0 1rem !important;
    }

    .news-page .upcoming-events-section .container,
    body.news-page .upcoming-events-section .container,
    html body.news-page .upcoming-events-section .container {
        min-height: auto !important;
        height: auto !important;
        padding: 0 1rem !important;
    }

    .news-page .newsletter-section .container,
    body.news-page .newsletter-section .container,
    html body.news-page .newsletter-section .container {
        min-height: auto !important;
        height: auto !important;
        padding: 0 1rem !important;
    }
}

/* ===== DESKTOP VERTICAL CENTERING ===== */
/* Center h3, news-meta, and news-excerpt vertically in featured-news-content */
@media (min-width: 769px) {
    .featured-news-content {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: flex-start !important;
        min-height: 100% !important;
        height: 100% !important;
        /* Allow text to wrap inside flex layout */
        min-width: 0 !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
    }

    .featured-news-content h3 {
        margin-bottom: var(--spacing-sm) !important;
        margin-top: 0 !important;
    }

    .featured-news-content .news-meta {
        margin-bottom: var(--spacing-md) !important;
        margin-top: 0 !important;
    }

    .featured-news-content .news-excerpt {
        margin-bottom: var(--spacing-lg) !important;
        margin-top: 0 !important;
        flex: 1 !important;
        display: flex !important;
        align-items: center !important;
    }

    /* Ensure the featured news card has proper height */
    .featured-news-card {
        display: flex !important;
        min-height: 400px !important;
        height: auto !important;
        align-items: stretch !important;
    }

    .featured-news-image {
        flex: 0 0 50% !important;
        height: 500px !important;
    }

    .featured-news-content {
        flex: 1 1 50% !important;
        width: auto !important;
        min-width: 0 !important; /* critical for text wrapping in flex children */
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important; /* vertical centering */
    }
    
    /* Homepage featured news slideshow sizing */
    #featuredNewsHomepage {
        max-width: 1300px !important;
        width: 100% !important;
        margin: 0 auto !important;
    }
    
    #featuredNewsHomepage .featured-news-card {
    min-height: 500px !important;
    height: 500px !important;
    }
    
    #featuredNewsHomepage .featured-news-image {
    height: 500px !important;
    }
    
    #featuredNewsHomepage .featured-news-image img {
        height: 500px !important;
        object-fit: cover !important;
        object-position: center center !important;
    }
}

/* ===== ADDITIONAL MOBILE IMPROVEMENTS ===== */
@media (max-width: 768px) {
    /* Ensure featured news content is properly sized on mobile */
    .featured-news-content {
        padding: var(--spacing-md) !important;
        min-height: auto !important;
        height: auto !important;
    }

    .featured-news-content h3 {
        font-size: 1.3rem !important;
        margin-bottom: var(--spacing-sm) !important;
    }

    .featured-news-content .news-meta {
        font-size: 0.8rem !important;
        margin-bottom: var(--spacing-sm) !important;
    }

    .featured-news-content .news-excerpt {
        font-size: 0.9rem !important;
        line-height: 1.6 !important;
        margin-bottom: var(--spacing-md) !important;
    }

    /* Ensure featured news card is properly sized on mobile */
    .featured-news-card {
        display: block !important;
        min-height: auto !important;
        height: auto !important;
    }

    .featured-news-image {
        width: 100% !important;
        height: 200px !important;
    }

    .featured-news-content {
        width: 100% !important;
    }
}

/* ===== LIGHT THEME TEXT VISIBILITY FIXES ===== */
/* Fix light theme text colors for better visibility */
[data-theme="light"] .news-meta,
[data-theme="light"] .news-date,
[data-theme="light"] .news-author,
[data-theme="light"] .news-excerpt {
    color: #333333 !important; /* Darker text for readability */
}

[data-theme="light"] .news-meta i,
[data-theme="light"] .news-date i,
[data-theme="light"] .news-author i {
    color: #888888 !important; /* Slightly lighter gray for icons */
}

/* Ensure featured news content has proper text colors in light theme */
[data-theme="light"] .featured-news-content .news-meta,
[data-theme="light"] .featured-news-content .news-date,
[data-theme="light"] .featured-news-content .news-author,
[data-theme="light"] .featured-news-content .news-excerpt {
    color: #333333 !important;
}

/* Newsletter form fixes */
[data-theme="light"] .newsletter-form input[type="email"]::placeholder {
    color: #888888 !important; /* Visible placeholder in light theme */
}

/* Light theme article bodies and labels */
[data-theme="light"] .article-body,
[data-theme="light"] .tag-label,
[data-theme="light"] .share-label,
[data-theme="light"] .article-author,
[data-theme="light"] .article-date,
[data-theme="light"] .newsletter-content p {
    color: #333333 !important;
}

/* Fix newsletter description text color in light theme */
[data-theme="light"] .newsletter-content p {
    color: #666666 !important; /* Dark gray for better contrast on white background */
}

/* Fix newsletter button height to match input field */
.newsletter-form .form-group input[type="email"] {
    height: 48px !important;
    padding: 0 16px !important;
    border: 2px solid var(--border-color) !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
}

.newsletter-form button[type="submit"] {
    height: 48px !important;
    padding: 0 24px !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Newsletter feedback styling (used below the field/button) */
.newsletter-feedback {
    margin-top: 10px !important;
    font-size: 0.95rem !important;
    width: 100% !important;
    clear: both !important;
    flex-basis: 100% !important;
    order: 999 !important;
}

.newsletter-feedback.success {
    color: #01BE6E !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.newsletter-feedback.error {
    color: #e74c3c !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

/* Force newsletter form to wrap feedback below */
.newsletter-form {
    flex-wrap: wrap !important;
}

.newsletter-form .form-group {
    flex-shrink: 0 !important;
}

.newsletter-form button[type="submit"] {
    flex-shrink: 0 !important;
}

/* Ensure newsletter form is block layout on mobile */
@media (max-width: 768px) {
    .newsletter-form {
        display: block !important;
    }
    
    .newsletter-form input[type="email"],
    .newsletter-form button[type="submit"] {
        width: 100% !important;
        margin-bottom: 10px !important;
    }
    
    .newsletter-feedback {
        width: 100% !important;
        margin-top: 10px !important;
    }
}

/* ===== FEATURED NEWS SLIDESHOW ===== */
.featured-news-slideshow {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.featured-news-slideshow-container {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
}

.featured-news-slide {
    min-width: 100%;
    width: 100%;
    flex: 0 0 100%;
}

.featured-news-slideshow-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.featured-news-slideshow-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.featured-news-slideshow-dot.active {
    background: var(--primary-green);
    border-color: var(--primary-green);
    transform: scale(1.2);
}

/* Light theme: improve visible boundaries for inactive dots */
[data-theme="light"] .featured-news-slideshow-dot {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: #01BE6E !important; /* green border */
}

[data-theme="light"] .featured-news-slideshow-dot.active {
    background: #01BE6E !important;
    border-color: #01BE6E !important;
}

.featured-news-slideshow-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    z-index: 10;
}

.featured-news-slideshow-nav:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.featured-news-slideshow-nav.prev {
    left: 20px;
}

.featured-news-slideshow-nav.next {
    right: 20px;
}

.featured-news-slideshow-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.featured-news-slideshow-nav:disabled:hover {
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
}

/* Hide slideshow controls if only one featured article */
.featured-news-slideshow.single-slide .featured-news-slideshow-controls,
.featured-news-slideshow.single-slide .featured-news-slideshow-nav {
    display: none;
}

/* Mobile responsive slideshow */
@media (max-width: 768px) {
    .featured-news-slideshow-nav {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .featured-news-slideshow-nav.prev {
        left: 10px;
    }
    
    .featured-news-slideshow-nav.next {
        right: 10px;
    }
    
    .featured-news-slideshow-controls {
        bottom: 15px;
    }
    
    .featured-news-slideshow-dot {
        width: 10px;
        height: 10px;
    }
}

/* ===== RTL SUPPORT ===== */
[dir="rtl"] .featured-news-content {
    align-items: flex-end !important;
}

[dir="rtl"] .featured-news-content h3 {
    text-align: right !important;
}

[dir="rtl"] .featured-news-content .news-meta {
    text-align: right !important;
}

[dir="rtl"] .featured-news-content .news-excerpt {
    text-align: right !important;
}
[dir="rtl"] .featured-news-slideshow-nav.prev {
    right: 20px;
    left: auto;
}

[dir="rtl"] .featured-news-slideshow-nav.next {
    left: 20px;
    right: auto;
}

@media (max-width: 768px) {
    [dir="rtl"] .featured-news-slideshow-nav.prev {
        right: 10px;
        left: auto;
    }
    
    [dir="rtl"] .featured-news-slideshow-nav.next {
        left: 10px;
        right: auto;
    }
}

