/* Critical CSS - DR.dk inspired above-the-fold styles */
/* This should be inlined in the HTML head for optimal performance */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    font-display: swap;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* DR.dk style header - Critical for above the fold */
.header {
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    will-change: transform;
}

.header-top {
    background-color: #f8f8f8;
    border-bottom: 1px solid #e0e0e0;
    padding: 8px 0;
    font-size: 13px;
}

.header-top .container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.header-links {
    display: flex;
    gap: 20px;
}

.header-link {
    color: #666;
    text-decoration: none;
    font-weight: 400;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-link:hover {
    color: #e74c3c;
}

/* Main header with logo and navigation */
.header-main {
    padding: 15px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #e74c3c;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background-color: #e74c3c;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-weight: bold;
    color: white;
    font-size: 18px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

/* DR.dk style navigation - Critical */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 0;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #e74c3c;
    border-bottom-color: #e74c3c;
    background-color: #f8f8f8;
}

/* Search and menu icons - Critical */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-btn,
.menu-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.search-btn:hover,
.menu-btn:hover {
    color: #e74c3c;
    background-color: #f8f8f8;
}

/* Page title section - Critical */
.page-title-section {
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 20px 0;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin: 0;
    line-height: 1.2;
}

/* Main content - Critical */
.main-content {
    background-color: #fff;
    margin: 0;
    padding: 0;
}

/* Articles grid - Critical above-the-fold */
.articles-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    padding: 30px 0;
    background-color: #fff;
}

.main-articles {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Mobile responsive - Critical */
@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px 0;
    }

    .nav-list {
        display: none;
    }

    .page-title {
        font-size: 24px;
    }

    .container {
        padding: 0 15px;
    }
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    margin: 0;
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #e74c3c;
}

/* Hero section - Critical for homepage */
.hero {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Featured articles grid - Critical for homepage */
.featured-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.featured-article {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.featured-article:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.article-image {
    position: relative;
    overflow: hidden;
}

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

.featured-article:hover .article-image img {
    transform: scale(1.05);
}

/* Mobile optimizations - Critical */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .main-nav {
        display: none;
    }
    
    .menu-btn {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
    }
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Skeleton loading for images */
.img-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Performance optimizations */
img {
    max-width: 100%;
    height: auto;
}

/* Lazy loading placeholder */
img[data-src] {
    filter: blur(5px);
    transition: filter 0.3s;
}

img[data-src].loaded {
    filter: blur(0);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
:focus {
    outline: 2px solid #e74c3c;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hero {
        background: #000;
        color: #fff;
    }
    
    .nav-link:hover {
        background: #000;
        color: #fff;
    }
}
