/**
 * Sport News Styles
 * Secondary navigation and news archive styling
 */

/* =====================================================
   SECONDARY NAVIGATION (Sport Subnav)
   ===================================================== */

/* Hide header border when subnav is present */
body.has-sport-subnav .site-header {
    border-bottom-color: transparent;
}

.sport-subnav {
    background-color: rgba(0, 0, 0, 0.85);
    position: fixed;
    top: var(--header-height, 80px);
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* When admin bar is present */
.admin-bar .sport-subnav {
    top: calc(var(--header-height, 80px) + 32px);
}

@media screen and (max-width: 782px) {
    .admin-bar .sport-subnav {
        top: calc(var(--header-height, 70px) + 46px);
    }
}

.sport-subnav .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.sport-subnav .subnav-items {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}

/* Center nav items when there's enough space (but NOT when overflow exists) */
@media (min-width: 1200px) {
    .sport-subnav:not(.has-overflow) .subnav-items {
        justify-content: center;
    }
}

/* When overflow exists, always start from left to allow proper scrolling */
.sport-subnav.has-overflow .subnav-items {
    justify-content: flex-start;
}

/* Scroll arrows for desktop */
.subnav-scroll-arrow {
    display: none;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: opacity 0.2s ease;
    align-items: center;
    justify-content: center;
}

.subnav-scroll-arrow:hover {
    color: #65b32e;
}

.subnav-scroll-arrow:focus {
    outline: none;
}

.subnav-scroll-arrow.left {
    left: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.95) 60%, rgba(0, 0, 0, 0));
    padding-right: 15px;
}

.subnav-scroll-arrow.right {
    right: 0;
    background: linear-gradient(to left, rgba(0, 0, 0, 0.95) 60%, rgba(0, 0, 0, 0));
    padding-left: 15px;
}

.subnav-scroll-arrow.disabled {
    opacity: 0.3;
    pointer-events: none;
    cursor: default;
}

/* Show arrows only on desktop when there's overflow */
@media (min-width: 769px) {
    .sport-subnav .container {
        position: relative;
    }

    .sport-subnav.has-overflow .subnav-scroll-arrow {
        display: flex;
    }
}

.sport-subnav .subnav-items::-webkit-scrollbar {
    display: none;
}

.sport-subnav .subnav-item {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.sport-subnav .subnav-item:hover {
    color: #65b32e;
    background-color: rgba(255, 255, 255, 0.05);
}

.sport-subnav .subnav-item.active {
    color: #65b32e;
    border-bottom-color: #65b32e;
}

.sport-subnav .subnav-item:focus,
.sport-subnav .subnav-item:focus-visible {
    outline: none;
    box-shadow: none;
}

.sport-subnav .subnav-sport-name {
    font-weight: 700;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .sport-subnav .subnav-item {
        padding: 10px 15px;
        font-size: 13px;
    }
}


/* =====================================================
   NEWS HERO SECTION
   ===================================================== */

.sport-news-hero {
    min-height: 50vh;
}

.sport-news-hero .hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
}

.sport-news-header-simple {
    background-color: #65b32e;
    padding: 60px 0 40px;
    color: #ffffff;
}

.sport-news-header-simple .page-title {
    font-size: 3rem;
    font-weight: 800;
    margin: 0 0 10px;
}


.sport-news-header-simple .page-subtitle {
    font-size: 1.25rem;
    margin: 0;
    opacity: 0.9;
}


/* =====================================================
   NEWS MAIN CONTENT
   ===================================================== */

.sport-news-main {
    background-color: #1a1a1a;
    padding: 40px 0 60px;
    min-height: 60vh;
}

.sport-news-main .container {
    max-width: 1200px;
}


/* =====================================================
   NEWS GRID (Featured Cards)
   ===================================================== */

.sport-news-featured {
    margin-bottom: 50px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Year preview grid - spacing below cards */
.news-year-grid {
    margin-bottom: 30px;
}

.news-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    padding: 0;
    text-align: left;
    width: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.news-card-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background-color: #f0f0f0;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-card-image img {
    transform: scale(1.05);
}

.news-card-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8e8e8, #f5f5f5);
}

.news-card-no-image .placeholder-icon {
    font-size: 48px;
    color: #bbb;
}

.news-card-no-image .placeholder-logo {
    width: 80px;
    height: auto;
    object-fit: contain;
    opacity: 0.6;
}

.news-card-content {
    padding: 15px;
}

.news-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-date {
    font-size: 13px;
    color: #777;
}


/* =====================================================
   NEWS ARCHIVE (Year Groups)
   ===================================================== */

.sport-news-archive {
    margin-top: 40px;
}

.news-year-group {
    margin-bottom: 40px;
}

.news-year-heading {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.news-year-articles {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


/* =====================================================
   NEWS ACCORDION
   ===================================================== */

.news-accordion-item {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}

.news-accordion-header {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 18px 20px;
    background: #ffffff;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s ease;
    gap: 15px;
}

.news-accordion-header:hover {
    background-color: #f9f9f9;
}

.news-accordion-title {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

.news-accordion-date {
    font-size: 14px;
    color: #777;
    white-space: nowrap;
}

.news-accordion-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.news-accordion-icon svg {
    width: 20px;
    height: 20px;
    color: #65b32e;
}

.news-accordion-item.open .news-accordion-icon {
    transform: rotate(180deg);
}

.news-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.news-accordion-item.open .news-accordion-content {
    max-height: 2000px;
}

.news-accordion-inner {
    padding: 20px 20px 20px;
    border-top: 1px solid #eee;
}

.news-article-image {
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
}

.news-article-image img {
    width: 100%;
    height: auto;
    display: block;
}

.news-article-text {
    color: #444;
    line-height: 1.7;
}

.news-article-text p {
    margin: 0 0 1em;
}

.news-article-text p:last-child {
    margin-bottom: 0;
}


/* =====================================================
   NO NEWS MESSAGE
   ===================================================== */

.no-news-message {
    text-align: center;
    padding: 60px 20px;
    color: #ffffff;
}

.no-news-message p {
    font-size: 1.25rem;
    margin-bottom: 20px;
}


/* =====================================================
   BACK TO SPORT LINK
   ===================================================== */

.back-to-sport {
    margin-top: 40px;
    text-align: center;
}

.back-to-sport-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.back-to-sport-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}


/* =====================================================
   NEWS MODAL
   ===================================================== */

.news-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.news-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.news-modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.news-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.news-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.news-modal-content {
    overflow-y: auto;
    max-height: 90vh;
}

.news-modal-image {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
    background: #f0f0f0;
}

.news-modal-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.news-modal-body {
    padding: 30px;
}

.news-modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px;
    line-height: 1.3;
}

.news-modal-date {
    font-size: 14px;
    color: #777;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.news-modal-text {
    color: #444;
    line-height: 1.7;
}

.news-modal-text p {
    margin: 0 0 1em;
}


/* =====================================================
   RESPONSIVE ADJUSTMENTS
   ===================================================== */

@media (max-width: 768px) {
    .sport-news-header-simple .page-title {
        font-size: 2rem;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .news-accordion-header {
        padding: 15px;
        flex-wrap: wrap;
    }

    .news-accordion-title {
        font-size: 15px;
        order: 1;
        width: calc(100% - 40px);
    }

    .news-accordion-icon {
        order: 2;
    }

    .news-accordion-date {
        order: 3;
        width: 100%;
        margin-top: 5px;
        font-size: 13px;
    }

    .news-year-heading {
        font-size: 1.5rem;
    }

    .news-modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .news-modal-body {
        padding: 20px;
    }

    .news-modal-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .news-card-image {
        height: 150px;
    }

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

    .news-card-title {
        font-size: 14px;
    }
}


/* =====================================================
   DARK MODE SUPPORT
   ===================================================== */

@media (prefers-color-scheme: dark) {
    /* News Cards */
    .news-card {
        background: #2d2d2d;
    }

    .news-card:hover {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    }

    .news-card-title {
        color: #ffffff;
    }

    .news-card-date {
        color: #b0b0b0;
    }

    .news-card-no-image {
        background: linear-gradient(135deg, #3a3a3a, #2d2d2d);
    }

    /* Accordion Items */
    .news-accordion-item {
        background: #2d2d2d;
    }

    .news-accordion-header {
        background: #2d2d2d;
    }

    .news-accordion-header:hover {
        background-color: #3a3a3a;
    }

    .news-accordion-title {
        color: #ffffff;
    }

    .news-accordion-date {
        color: #b0b0b0;
    }

    .news-accordion-inner {
        border-top-color: #404040;
    }

    .news-article-text {
        color: #e0e0e0;
    }

    /* Modal */
    .news-modal-container {
        background: #2d2d2d;
    }

    .news-modal-title {
        color: #ffffff;
    }

    .news-modal-date {
        color: #b0b0b0;
        border-bottom-color: #404040;
    }

    .news-modal-text {
        color: #e0e0e0;
    }
}
