/* ==========================================
   Metro Pulse News Portal - Stylesheet
   Designed for US/European Audience
   Compatible with IE8+
   ========================================== */

/* CSS Reset & Base */
*, *:before, *:after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Source Sans Pro', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #2c3e50;
    background: #f5f5f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================
   Header Styles
   ========================================== */
.main-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    position: relative;
    z-index: 100;
}

.header-top {
    background: #1a1a1a;
    color: #fff;
    padding: 8px 0;
    font-size: 12px;
}

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

.date-weather {
    color: #bdc3c7;
}

.edition-selector {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header-main {
    padding: 25px 0;
    border-bottom: 3px solid #e74c3c;
}

.header-main .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 42px;
    margin: 0;
    color: #1a1a1a;
    letter-spacing: -1px;
    animation: fadeInDown 0.8s ease-out;
}

.tagline {
    display: block;
    font-size: 12px;
    color: #7f8c8d;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 3px;
}

/* Navigation */
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
}

.main-nav a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.main-nav a:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #e74c3c;
    transition: width 0.3s ease;
}

.main-nav a:hover,
.main-nav li.active a {
    color: #e74c3c;
}

.main-nav a:hover:after,
.main-nav li.active a:after {
    width: 100%;
}

/* ==========================================
   Hero Section
   ========================================== */
.hero-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #2c3e50 100%);
    padding: 40px 0;
    position: relative;
    overflow: hidden;
}

.hero-section:before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(231,76,60,0.1) 0%, transparent 70%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    position: relative;
    z-index: 1;
}

.hero-main {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.hero-main:hover {
    transform: translateY(-5px);
}

.hero-main .hero-image {
    width: 100%;
    height: 450px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hero-main:hover .hero-image {
    transform: scale(1.05);
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 30px 30px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
}

.hero-category {
    display: inline-block;
    background: #e74c3c;
    color: #fff;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    animation: slideInLeft 0.6s ease-out;
}

.hero-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 32px;
    color: #fff;
    margin: 0;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-meta {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
}

.hero-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hero-card {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out backwards;
}

.hero-card:nth-child(1) { animation-delay: 0.1s; }
.hero-card:nth-child(2) { animation-delay: 0.2s; }

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

.hero-card .card-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

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

.hero-card .card-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 15px;
    color: #2c3e50;
    margin: 0;
    line-height: 1.4;
}

/* ==========================================
   Advertisement Sections
   ========================================== */
.ad-section {
    padding: 30px 0;
    background: #f8f9fa;
    text-align: center;
}

.top-ad {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

.bottom-ad {
    background: #ecf0f1;
}

.ad-banner {
    display: inline-block;
    max-width: 100%;
}

.ad-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #95a5a6;
    margin-bottom: 8px;
}

.ad-content {
    background: linear-gradient(135deg, #e0e0e0 0%, #f0f0f0 100%);
    border: 2px dashed #bdc3c7;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7f8c8d;
    font-weight: 600;
    transition: all 0.3s ease;
}

.ad-placeholder {
    width: 728px;
    height: 90px;
}

.ad-placeholder span {
    font-size: 14px;
    letter-spacing: 2px;
}

.ad-content:hover {
    background: linear-gradient(135deg, #d0d0d0 0%, #e0e0e0 100%);
    border-color: #95a5a6;
}

/* ==========================================
   Main Content & Sidebar
   ========================================== */
.main-content {
    padding: 40px 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
}

/* News Section */
.news-section {
    background: #fff;
    padding: 30px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.section-header h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 24px;
    margin: 0;
    color: #1a1a1a;
    position: relative;
}

.section-header h2:after {
    content: '';
    position: absolute;
    bottom: -17px;
    left: 0;
    width: 60px;
    height: 2px;
    background: #e74c3c;
}

.filter-tabs {
    display: flex;
    gap: 10px;
}

.tab-btn {
    padding: 6px 16px;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #7f8c8d;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.tab-btn:hover,
.tab-btn.active {
    background: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
}

/* News Grid */
.news-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.news-item {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid #ecf0f1;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease-out;
}

.news-item:last-child {
    border-bottom: none;
}

.news-item:hover {
    background: #fafafa;
    margin: 0 -20px;
    padding: 20px;
    border-radius: 4px;
}

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

.news-image-wrapper {
    overflow: hidden;
    border-radius: 4px;
}

.news-image {
    width: 100%;
    height: 170px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-content {
    display: flex;
    flex-direction: column;
}

.news-source {
    color: #e74c3c;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.news-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 20px;
    color: #2c3e50;
    margin: 0 0 12px 0;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.news-item:hover .news-title {
    color: #e74c3c;
}

.news-excerpt {
    color: #7f8c8d;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.news-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #95a5a6;
    margin-top: auto;
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #ecf0f1;
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 40px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.load-more-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.load-more-btn:hover {
    background: #e74c3c;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(231,76,60,0.3);
}

.load-more-btn:hover:before {
    left: 100%;
}

.load-more-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================
   Sidebar
   ========================================== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Ad Widget */
.ad-widget {
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    text-align: center;
}

.ad-placeholder.sidebar-ad {
    width: 100%;
    height: 250px;
}

/* Widget Styles */
.widget {
    background: #fff;
    padding: 25px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.widget h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 18px;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #e74c3c;
    color: #1a1a1a;
}

/* Trending Widget */
.trending-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.trending-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #ecf0f1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.trending-item:last-child {
    border-bottom: none;
}

.trending-item:hover {
    background: #fafafa;
    margin: 0 -15px;
    padding: 15px;
}

.trending-number {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 28px;
    font-weight: 700;
    color: #e74c3c;
    line-height: 1;
    opacity: 0.8;
}

.trending-content {
    flex: 1;
}

.trending-title {
    font-size: 14px;
    color: #2c3e50;
    margin: 0 0 5px 0;
    line-height: 1.4;
    font-weight: 600;
}

.trending-source {
    font-size: 11px;
    color: #95a5a6;
}

/* Newsletter Widget */
.newsletter-widget p {
    color: #7f8c8d;
    font-size: 13px;
    margin-bottom: 15px;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.newsletter-form input {
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.newsletter-form input:focus {
    outline: none;
    border-color: #e74c3c;
}

.newsletter-form button {
    padding: 12px 20px;
    background: #e74c3c;
    color: #fff;
    border: none;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.newsletter-form button:hover {
    background: #c0392b;
}

/* ==========================================
   Modal
   ========================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-container {
    background: #fff;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 4px;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    padding: 15px 20px;
    background: #1a1a1a;
    display: flex;
    justify-content: flex-end;
}

.modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #e74c3c;
}

.modal-body {
    height: calc(90vh - 60px);
}

.modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================
   Footer
   ========================================== */
.main-footer {
    background: #1a1a1a;
    color: #fff;
    padding-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 50px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-section h4 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 16px;
    margin: 0 0 20px 0;
    color: #fff;
}

.footer-section p {
    color: #95a5a6;
    font-size: 14px;
    line-height: 1.8;
    margin: 0 0 20px 0;
}

.footer-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-section li {
    margin-bottom: 10px;
}

.footer-section a {
    color: #95a5a6;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #e74c3c;
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.social-link {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: #e74c3c;
    transform: translateY(-3px);
}

.footer-bottom {
    padding: 25px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.copyright {
    color: #7f8c8d;
}

.footer-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.footer-links a {
    color: #95a5a6;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #e74c3c;
}

.separator {
    color: #34495e;
}

/* ==========================================
   Animations
   ========================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================
   Responsive Design
   ========================================== */
@media screen and (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .header-main .container {
        flex-direction: column;
        gap: 20px;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

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

    .hero-main .hero-image {
        height: 300px;
    }

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

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

    .news-image {
        height: 200px;
    }

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

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ad-placeholder {
        width: 100%;
        max-width: 468px;
        height: 60px;
    }

    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

@media screen and (max-width: 480px) {
    .logo h1 {
        font-size: 32px;
    }

    .main-nav ul {
        gap: 10px;
    }

    .main-nav a {
        font-size: 12px;
    }

    .news-section {
        padding: 20px 15px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* ==========================================
   IE8 Fallbacks
   ========================================== */
.ie8 .hero-section:before,
.ie8 .ad-content:before,
.ie8 .load-more-btn:before {
    display: none;
}

.ie8 .main-nav a:after {
    display: none;
}

.ie8 .news-item:hover,
.ie8 .trending-item:hover {
    background: transparent;
}

/* Print Styles */
@media print {
    .main-header,
    .ad-section,
    .sidebar,
    .main-footer,
    .load-more-container {
        display: none;
    }

    .news-section {
        box-shadow: none;
    }
}
