/* ========================================
   1. CSS VARIABLES & CORE DESIGN SYSTEM
   ========================================
*/
:root {
    --primary: #ff4500;
    --primary-hover: #e03e00;
    --bg-body: #ffffff;
    --bg-card: #ffffff;
    --bg-footer: #0a0a0a;
    --text-main: #1a1a1a;
    --text-muted: #666666;
    --border-color: #eeeeee;
    --header-bg: #000000;
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    --container-max: 1300px;
    --light-gray: #f4f4f4;
    --dark-bg: #111;
}

/* Dark Mode Override */
[data-theme="dark"] {
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --text-main: #f0f0f0;
    --text-muted: #aaaaaa;
    --border-color: #333333;
    --light-gray: #2a2a2a;
    --dark-bg: #000;
    --shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* ========================================
   2. BASE RESET & TYPOGRAPHY
   ========================================
*/
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { 
    font-family: 'Inter', sans-serif; 
    background-color: var(--bg-body); 
    color: var(--text-main); 
    line-height: 1.6;
    transition: background 0.3s ease;
}
a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
button { cursor: pointer; border: none; outline: none; transition: var(--transition); }

.container { max-width: var(--container-max); margin: 0 auto; padding: 0 25px; }

/* ========================================
   3. COMPONENTS (Utilities)
   ========================================
*/
.section-padding { padding: 80px 0; }
.badge { 
    background: var(--primary); color: white; padding: 4px 10px; 
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase; 
    border-radius: 2px;
}
.title-serif { font-family: 'Playfair Display', serif; }

/* ========================================
   4. HEADER & TICKER
   ========================================
*/
.top-ticker {
    background: var(--primary); color: white; overflow: hidden;
    white-space: nowrap; padding: 8px 0; font-weight: 600; font-size: 0.85rem;
}
.ticker-move { display: inline-block; animation: ticker-anim 40s linear infinite; }
@keyframes ticker-anim { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }

header {
    background: var(--header-bg); padding: 20px 0;
    position: sticky; top: 0; z-index: 1000; box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.nav-wrapper { display: flex; justify-content: space-between; align-items: center; }
.logo { 
    font-family: 'Playfair Display', serif; color: white; font-size: 1.8rem; 
    letter-spacing: 4px; font-weight: 900; 
}
.nav-tools { display: flex; align-items: center; gap: 20px; color: white; }
.theme-toggle { font-size: 1.2rem; cursor: pointer; color: #ffcc00; }

/* ========================================
   5. HERO SECTION
   ========================================
*/
.hero {
    height: 70vh; min-height: 550px;
    background: linear-gradient(rgba(0,0,0,0.8), rgba(0,0,0,0.3)), url('https://images.unsplash.com/photo-1585829365234-781f7c47c1ca?auto=format&fit=crop&q=80&w=1920');
    background-size: cover; background-position: center;
    display: flex; align-items: center; color: white;
}
.hero-text { max-width: 700px; animation: fadeInUp 1s ease; }
.hero-text h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); line-height: 1.1; margin-bottom: 20px; }
.hero-text p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 30px; border-left: 4px solid var(--primary); padding-left: 20px; }
.cta-btn { 
    background: var(--primary); color: white; padding: 18px 45px; font-weight: 800; 
    text-transform: uppercase; letter-spacing: 1px;
}
.cta-btn:hover { background: white; color: black; transform: translateY(-5px); }

/* ========================================
   6. NEWS GRID & FILTERING
   ========================================
*/
.filter-bar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 40px; border-bottom: 2px solid var(--border-color);
    padding-bottom: 20px; flex-wrap: wrap; gap: 20px;
}
.categories button {
    background: none; color: var(--text-muted); font-weight: 600; padding: 8px 15px;
    font-size: 0.95rem;
}
.categories button.active { color: var(--primary); position: relative; }
.categories button.active::after {
    content: ''; position: absolute; bottom: -22px; left: 0; width: 100%; height: 2px; background: var(--primary);
}
.search-container { position: relative; width: 300px; }
.search-container input {
    width: 100%; padding: 12px 15px 12px 40px; border: 1px solid var(--border-color);
    background: var(--bg-card); color: var(--text-main); border-radius: 5px;
}
.search-container i { position: absolute; left: 15px; top: 15px; color: var(--text-muted); }

.news-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 40px;
}
.card { 
    background: var(--bg-card); border-bottom: 1px solid var(--border-color); 
    transition: var(--transition); display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-8px); border-color: var(--primary); }
.card-img { width: 100%; height: 240px; overflow: hidden; position: relative; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: 0.6s; }
.card:hover img { transform: scale(1.1); }
.card-body { padding: 25px 0; flex-grow: 1; }
.card-meta { display: flex; gap: 15px; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 15px; }
.card-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 15px; line-height: 1.3; }
.card-desc { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 20px; }
.card-link { font-weight: 700; color: var(--primary); text-transform: uppercase; font-size: 0.8rem; }

/* ========================================
   7. SIDEBAR & NEWSLETTER
   ========================================
*/
.sidebar { padding: 30px; background: var(--light-gray); border-radius: 5px; }
.newsletter-box {
    background: var(--dark-bg); color: white; padding: 40px; text-align: center;
    margin-top: 80px; border-radius: 10px;
}
.newsletter-box h2 { margin-bottom: 15px; }
.newsletter-box input { 
    padding: 15px; width: 60%; margin-right: 10px; border: none; border-radius: 5px;
}

/* ========================================
   8. CONTACT SECTION
   ========================================
*/
.contact-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 60px; }
.contact-form input, .contact-form textarea {
    width: 100%; padding: 15px; margin-bottom: 20px; border: 1px solid var(--border-color);
    background: var(--bg-card); color: var(--text-main);
}

/* ========================================
   9. MEGA FOOTER
   ========================================
*/
footer { background: var(--bg-footer); color: #888; padding: 100px 0 40px; margin-top: 100px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 50px; margin-bottom: 60px; }
.footer-logo { color: white; font-size: 2rem; font-family: 'Playfair Display'; margin-bottom: 25px; }
.footer-col h4 { color: white; text-transform: uppercase; margin-bottom: 25px; font-size: 0.9rem; letter-spacing: 2px; }
.footer-links li { margin-bottom: 15px; }
.footer-links a:hover { color: var(--primary); padding-left: 8px; }
.social-icons { display: flex; gap: 15px; margin-top: 20px; }
.social-icons a { 
    width: 40px; height: 40px; background: #222; display: flex; 
    align-items: center; justify-content: center; border-radius: 50%; color: white;
}
.social-icons a:hover { background: var(--primary); }
.copyright { text-align: center; border-top: 1px solid #222; padding-top: 40px; font-size: 0.8rem; }

/* ========================================
   10. MODAL & ANIMATIONS
   ========================================
*/
.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 2000;
    display: none; justify-content: center; align-items: center; padding: 20px;
}
.modal-content {
    background: var(--bg-card); max-width: 800px; width: 100%; max-height: 90vh;
    overflow-y: auto; padding: 40px; position: relative;
}
.close-modal { position: absolute; top: 20px; right: 20px; font-size: 2rem; cursor: pointer; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 992px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .hero-text h1 { font-size: 3rem; }
}
@media (max-width: 600px) {
    .footer-grid, .contact-grid { grid-template-columns: 1fr; }
    .news-grid { grid-template-columns: 1fr; }
    .search-container { width: 100%; }
}