/* ========================================
   Sports News Website - Main Styles
   ======================================== */

/* ---------- RESET & BASE ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a56db;
    --primary-dark: #1e40af;
    --secondary: #e53e3e;
    --bg: #f5f6f8;
    --white: #ffffff;
    --text: #1a1a1a;
    --text-light: #4b5563;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.12);
    --radius: 12px;
    --transition: 0.2s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* ---------- AD SPACES ---------- */
.ad-space {
    background: #f8f9fa;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-header {
    margin: 0;
}

.ad-middle {
    margin: 32px 0;
}

.ad-sidebar {
    margin: 32px 0;
}

.ad-content-footer {
    margin: 32px 0 16px;
}

/* ---------- HEADER ---------- */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}

.logo span {
    color: var(--secondary);
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.main-nav a {
    color: var(--text);
    font-weight: 500;
    font-size: 15px;
    transition: color var(--transition);
    display: inline-block;
}

.main-nav a:hover,
.main-nav a:focus {
    color: var(--primary);
    outline: none;
}

/* Search */
.search-box {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 8px 16px;
    flex: 0 1 360px;
    transition: background var(--transition), box-shadow var(--transition);
}

.search-box:focus-within {
    background: var(--white);
    box-shadow: 0 0 0 2px var(--primary);
}

.search-box input {
    border: none;
    background: transparent;
    padding: 6px 8px;
    width: 100%;
    font-size: 14px;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    font-size: 16px;
}

.search-box button:hover {
    color: var(--primary);
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text);
    padding: 8px;
    border-radius: 8px;
}

.menu-toggle:hover,
.menu-toggle:focus {
    background: #f3f4f6;
    outline: none;
}

/* ---------- TRENDING SECTION ---------- */
.trending-section {
    padding: 32px 0;
}

.trending-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.trending-header h2 {
    font-size: 28px;
    font-weight: 700;
}

.fire {
    color: var(--secondary);
}

.trending-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.trending-main .article-card.featured .card-image {
    aspect-ratio: 16/9;
}

.trending-main .article-card.featured .card-title {
    font-size: 24px;
}

.trending-main .article-card.featured h1 {
    font-size: 24px;
    margin: 0;
}

.trending-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.trending-side .article-card.mini {
    display: flex;
    gap: 16px;
    padding: 12px 16px;
}

.trending-side .article-card.mini .card-image {
    flex-shrink: 0;
    width: 80px;
    aspect-ratio: 1/1;
}

.trending-side .article-card.mini .card-content {
    padding: 0;
    flex: 1;
}

.trending-side .article-card.mini h4 {
    font-size: 15px;
    line-height: 1.3;
}

/* ---------- ARTICLE CARDS ---------- */
.article-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.card-image {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f0f0f0;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .card-image img {
    transform: scale(1.02);
}

.card-content {
    padding: 16px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.category {
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.time {
    color: var(--text-muted);
}

.card-title {
    font-size: 18px;
    margin-bottom: 8px;
    line-height: 1.3;
}

.card-title a {
    color: var(--text);
    transition: color var(--transition);
}

.card-title a:hover,
.card-title a:focus {
    color: var(--primary);
    outline: none;
}

.card-summary {
    color: var(--text-light);
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 12px;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-muted);
    gap: 12px;
    flex-wrap: wrap;
}

.author {
    font-weight: 500;
    color: var(--text);
}

.views {
    display: flex;
    align-items: center;
    gap: 4px;
}

.read-more {
    color: var(--primary);
    font-weight: 500;
    margin-left: auto;
}

.read-more:hover,
.read-more:focus {
    color: var(--primary-dark);
    outline: none;
}

/* ---------- LATEST SECTION ---------- */
.latest-section {
    padding: 32px 0;
    background: #f8f9fa;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.category-filter {
    display: flex;
    align-items: center;
}

.category-filter label {
    margin-right: 8px;
    font-weight: 500;
}

.category-filter select {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    font-size: 14px;
    cursor: pointer;
    transition: border-color var(--transition);
}

.category-filter select:hover,
.category-filter select:focus {
    border-color: var(--primary);
    outline: none;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.load-more {
    text-align: center;
    margin-top: 32px;
}

/* ---------- CATEGORIES ---------- */
.categories-section {
    padding: 32px 0;
}

.categories-section h2 {
    font-size: 24px;
    margin-bottom: 16px;
    font-weight: 700;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.category-card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    display: block;
    color: var(--text);
    text-decoration: none;
}

.category-card:hover,
.category-card:focus {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    outline: none;
}

.category-card h3 {
    font-size: 18px;
    margin-bottom: 4px;
    font-weight: 600;
}

.category-card p {
    font-size: 14px;
    color: var(--text-muted);
}

/* ---------- FULL ARTICLE ---------- */
.full-article {
    padding: 32px 0;
}

.breadcrumb {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.breadcrumb a {
    color: var(--primary);
}

.breadcrumb span {
    margin: 0 8px;
}

.article-header {
    max-width: 800px;
    margin: 0 auto 32px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--text-muted);
}

.article-meta .category {
    font-size: 14px;
}

.article-header h1 {
    font-size: 36px;
    line-height: 1.2;
    margin: 16px 0;
    font-weight: 700;
}

.article-excerpt {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 24px;
}

.article-author {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.author-info {
    flex: 1;
}

.author-name {
    font-weight: 600;
    display: block;
}

.author-bio {
    font-size: 14px;
    color: var(--text-muted);
}

.share-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.share-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity var(--transition), transform var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
}

.share-btn:hover,
.share-btn:focus {
    transform: scale(1.05);
    outline: none;
}

.share-btn.twitter {
    background: #1da1f2;
    color: #fff;
}

.share-btn.facebook {
    background: #1877f2;
    color: #fff;
}

.share-btn.copy {
    background: var(--border);
    color: var(--text);
}

.article-featured-image {
    max-width: 900px;
    margin: 0 auto 32px;
    border-radius: var(--radius);
    overflow: hidden;
    background: #f0f0f0;
}

.article-featured-image img {
    width: 100%;
    height: auto;
}

.article-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 18px;
    line-height: 1.8;
    word-wrap: break-word;
}

.article-content h2 {
    font-size: 28px;
    margin: 32px 0 16px;
    font-weight: 700;
}

.article-content h3 {
    font-size: 22px;
    margin: 24px 0 12px;
    font-weight: 600;
}

.article-content h4 {
    font-size: 18px;
    margin: 20px 0 10px;
    font-weight: 600;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 24px 0;
}

.article-content ul,
.article-content ol {
    margin: 16px 0 24px 24px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 20px;
    margin: 24px 0;
    font-style: italic;
    color: var(--text-light);
    background: #f8f9fa;
    padding: 16px 20px;
    border-radius: 8px;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.article-content table th,
.article-content table td {
    border: 1px solid var(--border);
    padding: 10px 14px;
    text-align: left;
}

.article-content table th {
    background: #f8f9fa;
    font-weight: 600;
}

.article-footer {
    max-width: 800px;
    margin: 32px auto 0;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.article-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---------- RELATED ARTICLES ---------- */
.related-articles {
    padding: 32px 0;
    background: #f8f9fa;
}

.related-articles h2 {
    font-size: 24px;
    margin-bottom: 24px;
    font-weight: 700;
}

/* ---------- BUTTONS ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn:hover,
.btn:focus {
    outline: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

/* ---------- PAGE TEMPLATES ---------- */
.page {
    padding: 40px 0;
}

.page h1 {
    font-size: 36px;
    margin-bottom: 24px;
    font-weight: 700;
}

.page-content {
    max-width: 800px;
    font-size: 17px;
    line-height: 1.8;
}

.page-content h2 {
    font-size: 24px;
    margin: 32px 0 12px;
    font-weight: 700;
}

.page-content h3 {
    font-size: 20px;
    margin: 24px 0 10px;
    font-weight: 600;
}

.page-content p {
    margin-bottom: 16px;
}

.page-content ul,
.page-content ol {
    margin: 12px 0 20px 24px;
}

/* ---------- CONTACT PAGE ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    margin-top: 24px;
}

.contact-info h2 {
    margin-bottom: 12px;
    font-weight: 700;
}

.contact-details {
    margin-top: 24px;
}

.contact-item {
    margin-bottom: 12px;
}

.contact-item strong {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
}

/* Contact Form */
.contact-form .form-group {
    margin-bottom: 16px;
}

.contact-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 14px;
}

.contact-form input,
.contact-form textarea,
.contact-form select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: border-color var(--transition);
    font-family: inherit;
}

.contact-form input:hover,
.contact-form textarea:hover,
.contact-form select:hover {
    border-color: var(--text-muted);
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

/* ---------- ALERTS ---------- */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid transparent;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-color: #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

/* ---------- SEARCH PAGE ---------- */
.search-header h1 {
    margin-bottom: 16px;
    font-weight: 700;
}

.search-form {
    display: flex;
    gap: 12px;
    max-width: 500px;
}

.search-form input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color var(--transition);
}

.search-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

.search-form button {
    padding: 12px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
}

.search-form button:hover {
    background: var(--primary-dark);
}

.search-results-count {
    margin: 16px 0 24px;
    color: var(--text-muted);
}

.no-results,
.no-articles {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 18px;
}

/* ---------- CATEGORY PAGE ---------- */
.category-header {
    padding: 24px 0 32px;
}

.category-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
    font-weight: 700;
}

.category-header p {
    color: var(--text-muted);
    font-size: 17px;
}

/* ---------- FOOTER ---------- */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 40px 0 24px;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}

.footer-brand h3 {
    font-size: 22px;
    color: var(--primary);
    font-weight: 700;
}

.footer-brand h3 span {
    color: var(--secondary);
}

.footer-brand p {
    color: var(--text-muted);
    margin-top: 8px;
    font-size: 15px;
}

.footer-links h4 {
    font-size: 16px;
    margin-bottom: 12px;
    font-weight: 600;
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 6px;
}

.footer-links ul li a {
    color: var(--text-muted);
    font-size: 14px;
    transition: color var(--transition);
    display: inline-block;
}

.footer-links ul li a:hover,
.footer-links ul li a:focus {
    color: var(--primary);
    outline: none;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 14px;
    color: var(--text-muted);
}

.footer-bottom a {
    color: var(--primary);
}

.footer-bottom a:hover {
    color: var(--primary-dark);
}

.footer-social {
    display: flex;
    gap: 16px;
}

.footer-social a {
    color: var(--text-muted);
    transition: color var(--transition);
    display: inline-block;
}

.footer-social a:hover,
.footer-social a:focus {
    color: var(--primary);
    outline: none;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
    .trending-grid {
        grid-template-columns: 1fr;
    }
    
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    /* Header */
    .menu-toggle {
        display: block;
    }
    
    .main-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 16px 0;
        gap: 12px;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--border);
        z-index: 99;
    }
    
    .main-nav.open {
        display: flex;
    }
    
    .search-box {
        flex: 1 1 100%;
        order: 3;
    }
    
    .header-content {
        flex-wrap: wrap;
    }
    
    /* Grids */
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .categories-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .trending-main .article-card.featured .card-title {
        font-size: 20px;
    }
    
    /* Article */
    .article-header h1 {
        font-size: 28px;
    }
    
    .article-content {
        font-size: 16px;
    }
    
    .article-content h2 {
        font-size: 24px;
    }
    
    .article-author {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .share-buttons {
        width: 100%;
        justify-content: flex-start;
    }
    
    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    /* Section headers */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .trending-grid {
        gap: 16px;
    }
    
    .article-card {
        max-height: none;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 16px;
    }
    
    .trending-header h2 {
        font-size: 22px;
    }
    
    .card-title {
        font-size: 16px;
    }
    
    .article-header h1 {
        font-size: 24px;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .section-header {
        flex-direction: column;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- UTILITY CLASSES ---------- */
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }