/* EPL News Hub - Master Responsive Design System */
/* Optimized for all device sizes from mobile to desktop */

/* ========================================
   CSS VARIABLES FOR RESPONSIVE SCALING
   ======================================== */
:root {
    /* Responsive font sizes */
    --font-size-base: clamp(14px, 1.5vw, 16px);
    --font-size-small: clamp(12px, 1.2vw, 14px);
    --font-size-large: clamp(16px, 2vw, 20px);
    --font-size-h1: clamp(24px, 5vw, 48px);
    --font-size-h2: clamp(20px, 4vw, 36px);
    --font-size-h3: clamp(18px, 3vw, 28px);
    
    /* Responsive spacing */
    --spacing-xs: clamp(4px, 0.5vw, 8px);
    --spacing-sm: clamp(8px, 1vw, 16px);
    --spacing-md: clamp(16px, 2vw, 32px);
    --spacing-lg: clamp(24px, 3vw, 48px);
    --spacing-xl: clamp(32px, 4vw, 64px);
    
    /* Container widths */
    --container-xs: 100%;
    --container-sm: 540px;
    --container-md: 720px;
    --container-lg: 960px;
    --container-xl: 1140px;
    --container-xxl: 1320px;
}

/* ========================================
   GLOBAL RESPONSIVE RESETS
   ======================================== */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-size: var(--font-size-base);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   RESPONSIVE CONTAINER SYSTEM
   ======================================== */
.container, .content-wrapper, .container-fluid {
    width: 100%;
    padding-right: var(--spacing-sm);
    padding-left: var(--spacing-sm);
    margin-right: auto;
    margin-left: auto;
}

/* ========================================
   RESPONSIVE HEADER
   ======================================== */
.header {
    padding: var(--spacing-sm) 0;
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-sm);
}

.header-logo {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    flex-shrink: 0;
}

.header-nav {
    display: flex;
    gap: clamp(0.5rem, 2vw, 2rem);
    flex-wrap: wrap;
    justify-content: center;
}

.header-nav a {
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    padding: var(--spacing-xs) var(--spacing-sm);
    white-space: nowrap;
}

/* Mobile menu button (hidden by default) */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: 2px solid white;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
}

/* ========================================
   RESPONSIVE MAIN CONTENT
   ======================================== */
.main-content {
    padding: var(--spacing-md) 0;
}

/* Hero Section */
.hero-section {
    padding: var(--spacing-lg) var(--spacing-md);
}

.main-title {
    font-size: var(--font-size-h1);
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

.subtitle {
    font-size: clamp(0.9rem, 1.8vw, 1.1rem);
    margin-bottom: var(--spacing-md);
}

/* ========================================
   RESPONSIVE ARTICLE CARDS
   ======================================== */
.story-card, .article-card, .featured-article-card {
    margin-bottom: var(--spacing-md);
    border-radius: clamp(8px, 1vw, 16px);
}

.story-headline, .article-title, .featured-title {
    font-size: clamp(1.2rem, 3vw, 2rem);
    line-height: 1.3;
    margin-bottom: var(--spacing-sm);
}

.story-summary, .article-excerpt, .featured-excerpt {
    font-size: clamp(0.9rem, 1.5vw, 1.05rem);
    line-height: 1.6;
    margin-bottom: var(--spacing-sm);
}

.story-image-wrapper {
    height: clamp(180px, 40vw, 400px);
    overflow: hidden;
}

.story-content-wrapper {
    padding: clamp(1rem, 2vw, 2rem);
}

/* ========================================
   RESPONSIVE BREAKING NEWS TICKER
   ======================================== */
.breaking-news-ticker {
    height: clamp(40px, 6vw, 48px);
    font-size: clamp(0.8rem, 1.4vw, 0.95rem);
}

.ticker-label {
    min-width: clamp(120px, 20vw, 180px);
    padding: 0 clamp(10px, 1.5vw, 20px);
}

.ticker-badge {
    font-size: clamp(0.65rem, 1.2vw, 0.75rem);
    padding: clamp(3px, 0.5vw, 4px) clamp(6px, 1vw, 10px);
}

.ticker-text {
    font-size: clamp(0.85rem, 1.4vw, 1rem);
}

.ticker-item {
    padding: 0 clamp(15px, 3vw, 40px);
    font-size: clamp(0.8rem, 1.4vw, 0.95rem);
}

/* ========================================
   RESPONSIVE GRIDS
   ======================================== */
.articles-grid, .secondary-stories {
    display: grid;
    gap: var(--spacing-md);
}

.content-grid {
    display: grid;
    gap: var(--spacing-lg);
}

/* ========================================
   RESPONSIVE FOOTER
   ======================================== */
.site-footer, .footer {
    padding: var(--spacing-lg) var(--spacing-md);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    justify-content: space-between;
}

.footer-section {
    flex: 1 1 200px;
    min-width: 0;
}

/* ========================================
   RESPONSIVE TABLES
   ======================================== */
.stats-table, table {
    font-size: clamp(0.8rem, 1.4vw, 1rem);
    overflow-x: auto;
    display: block;
}

.stats-table th, .stats-table td {
    padding: clamp(6px, 1vw, 12px);
    white-space: nowrap;
}

/* ========================================
   RESPONSIVE BUTTONS
   ======================================== */
button, .btn, .quick-btn {
    padding: clamp(8px, 1.5vw, 12px) clamp(16px, 2.5vw, 24px);
    font-size: clamp(0.875rem, 1.4vw, 1rem);
    border-radius: clamp(4px, 0.5vw, 8px);
}

/* ========================================
   DEVICE-SPECIFIC MEDIA QUERIES
   ======================================== */

/* Extra Small Devices (Phones in Portrait) */
@media (max-width: 575.98px) {
    .container {
        max-width: 100%;
        padding: 0 10px;
    }
    
    /* Show mobile menu button, hide desktop nav */
    .mobile-menu-toggle {
        display: block;
    }
    
    .header-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #262627;
        flex-direction: column;
        padding: 1rem;
        z-index: 1000;
    }
    
    .header-nav.mobile-active {
        display: flex;
    }
    
    /* Stack content vertically */
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .coverage-areas {
        grid-template-columns: 1fr;
    }
    
    /* Optimize ticker for mobile */
    .ticker-content {
        animation-duration: 15s;
    }
    
    /* Full width cards */
    .story-card, .article-card {
        border-radius: 0;
        margin-left: -10px;
        margin-right: -10px;
    }
    
    /* Smaller hero text */
    .main-title {
        font-size: 1.5rem;
    }
    
    /* Hide less important elements */
    .breadcrumb {
        font-size: 0.75rem;
    }
    
    .live-badge {
        display: none;
    }
}

/* Small Devices (Phones in Landscape, Small Tablets) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .container {
        max-width: var(--container-sm);
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .header-nav {
        gap: 1rem;
    }
    
    .main-title {
        font-size: 1.8rem;
    }
}

/* Medium Devices (Tablets) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        max-width: var(--container-md);
    }
    
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .coverage-areas {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .main-title {
        font-size: 2rem;
    }
}

/* Large Devices (Small Laptops, Desktops) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: var(--container-lg);
    }
    
    .articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .coverage-areas {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Extra Large Devices (Large Desktops) */
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .container {
        max-width: var(--container-xl);
    }
    
    .articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* XXL Devices (Very Large Desktops) */
@media (min-width: 1400px) {
    .container {
        max-width: var(--container-xxl);
    }
    
    .articles-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

/* Hide on mobile */
@media (max-width: 767.98px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide on tablet */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hide-tablet {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 992px) {
    .hide-desktop {
        display: none !important;
    }
}

/* ========================================
   RESPONSIVE TYPOGRAPHY SCALING
   ======================================== */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    html {
        font-size: 15px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    html {
        font-size: 16px;
    }
}

@media (min-width: 1025px) {
    html {
        font-size: 16px;
    }
}

/* ========================================
   RESPONSIVE FPL TOOLS
   ======================================== */
@media (max-width: 768px) {
    .fpl-pitch {
        padding: 10px;
        min-height: 300px;
    }
    
    .player-slot {
        width: 60px;
        height: 70px;
        font-size: 0.7rem;
    }
    
    .formation-row {
        gap: 5px;
    }
    
    .team-builder-panel, 
    .chat-panel, 
    .analytics-panel {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .main-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   RESPONSIVE FORMS
   ======================================== */
input, textarea, select {
    font-size: 16px; /* Prevents zoom on iOS */
    width: 100%;
    padding: clamp(8px, 1.5vw, 12px);
}

/* ========================================
   RESPONSIVE MODALS/POPUPS
   ======================================== */
.modal, .popup {
    width: calc(100% - 20px);
    max-width: 600px;
    margin: 10px;
}

@media (max-width: 480px) {
    .modal, .popup {
        width: 100%;
        height: 100%;
        margin: 0;
        border-radius: 0;
    }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Reduce animations on small devices */
@media (max-width: 768px) {
    *, *::before, *::after {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }
}

/* Disable parallax on mobile for performance */
@media (max-width: 768px) {
    .parallax {
        background-attachment: scroll !important;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .header-nav, 
    .breaking-news-ticker, 
    .footer, 
    .ads, 
    .mobile-menu-toggle {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .container {
        max-width: 100%;
    }
}