/* Enhanced News Website Styles - Premium Look (CNN, BBC, Geektime inspired) */
:root {
    --primary-bg: #f5f6fa;
    --primary-color: #222;
    --accent: #c00;
    --accent-dark: #900;
    --header-bg: #fff;
    --header-shadow: 0 2px 8px rgba(0,0,0,0.06);
    --nav-link: #222;
    --nav-link-active: var(--accent);
    --nav-link-hover: var(--accent-dark);
    --article-bg: #fff;
    --article-shadow: 0 2px 12px rgba(0,0,0,0.07);
    --footer-bg: #fff;
    --footer-color: #888;
    --meta-color: #888;
    --border-radius: 10px;
    --transition: 0.25s cubic-bezier(.4,0,.2,1);
    --font-main: 'Roboto', Arial, sans-serif;
    --font-headline: 'Roboto Slab', 'Roboto', Arial, sans-serif;
}

body {
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
    background: var(--primary-bg);
    color: var(--primary-color);
    line-height: 1.7;
    font-size: 1.08rem;
    transition: background-color var(--transition), color var(--transition);
}

header {
    background: var(--header-bg);
    box-shadow: var(--header-shadow);
    padding: 2rem 0 1.2rem 0;
    text-align: center;
    position: relative;
    border-bottom: 2px solid #ececec;
    z-index: 10;
}

header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2.8rem;
    font-family: var(--font-headline);
    color: var(--accent);
    letter-spacing: 1.5px;
    font-weight: 900;
    text-shadow: 0 2px 8px rgba(200,0,0,0.04);
    transition: color var(--transition);
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
}

nav a {
    text-decoration: none;
    color: var(--nav-link);
    position: relative;
    padding-bottom: 6px;
    transition: color var(--transition);
}

nav a.active,
nav a:hover {
    color: var(--nav-link-active);
}

nav a.active::after,
nav a:hover::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    transition: background var(--transition);
}

nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    border-radius: 2px;
    transition: background var(--transition);
}

main {
    max-width: 900px;
    margin: 2.5rem auto 2rem auto;
    padding: 0 1.5rem;
    transition: opacity var(--transition);
}

article {
    background: var(--article-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--article-shadow);
    padding: 2rem 2rem 1.5rem 2rem;
    margin-bottom: 2.2rem;
    transition: box-shadow var(--transition), transform var(--transition);
    cursor: pointer;
    border-left: 6px solid var(--accent);
}

article h2, article h3 {
    margin-top: 0;
    font-family: var(--font-headline);
    color: var(--accent);
    font-weight: 800;
    letter-spacing: 0.5px;
    transition: color var(--transition);
}

article h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

article h3 {
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
}

.meta {
    font-size: 0.95rem;
    color: var(--meta-color);
    margin-bottom: 0.7rem;
    font-style: italic;
    letter-spacing: 0.2px;
    transition: color var(--transition);
}

.news-list article {
    margin-bottom: 1.5rem;
    border-left: 4px solid #ececec;
    box-shadow: none;
    padding: 1.2rem 1.5rem 1rem 1.5rem;
}

footer {
    background: var(--footer-bg);
    text-align: center;
    padding: 1.2rem 0 2.5rem 0;
    color: var(--footer-color);
    font-size: 1.05rem;
    border-top: 2px solid #ececec;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.03);
    transition: background-color var(--transition), color var(--transition);
}

/* Animation classes */
.fade-out {
    opacity: 0;
}

.fade-in {
    opacity: 1;
}

/* Article hover and expanded states */
.article-hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 8px 32px rgba(200,0,0,0.10);
    border-left: 8px solid var(--accent-dark);
}

.article-expanded {
    transform: scale(1.025);
    box-shadow: 0 12px 36px rgba(200,0,0,0.13);
    border-left: 10px solid var(--accent);
}

/* Dark theme */
.dark-theme {
    background: #181a1b;
    color: #e0e0e0;
}

.dark-theme header {
    background: #232526;
    border-bottom: 2px solid #232526;
}

.dark-theme header h1 {
    color: #ff5252;
}

.dark-theme nav a {
    color: #e0e0e0;
}

.dark-theme nav a.active,
.dark-theme nav a:hover {
    color: #ff5252;
}

.dark-theme nav a.active::after,
.dark-theme nav a:hover::after {
    background: #ff5252;
}

.dark-theme article {
    background: #232526;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    border-left: 6px solid #ff5252;
}

.dark-theme article h2,
.dark-theme article h3 {
    color: #ff5252;
}

.dark-theme .meta {
    color: #aaa;
}

.dark-theme footer {
    background: #232526;
    color: #e0e0e0;
    border-top: 2px solid #232526;
}

/* Theme toggle button */
.theme-toggle {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    background: #fff;
    border: 1px solid #ececec;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: background-color var(--transition), border var(--transition);
}

.theme-toggle:hover {
    background-color: #f5f5f5;
    border: 1px solid var(--accent);
}

.dark-theme .theme-toggle {
    background: #232526;
    border: 1px solid #444;
}

.dark-theme .theme-toggle:hover {
    background-color: #181a1b;
    border: 1px solid #ff5252;
}

/* Mobile menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    position: absolute;
    top: 1.2rem;
    left: 1.2rem;
    color: var(--accent);
}

/* Search feature */
.search-container {
    position: absolute;
    top: 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    padding: 0.2rem 0.7rem;
}

.search-input {
    padding: 0.5rem;
    border: none;
    border-radius: 20px;
    width: 220px;
    font-size: 1rem;
    background: transparent;
    outline: none;
}

.search-button {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    margin-left: 0.5rem;
    color: var(--accent);
}

/* Newsletter signup */
.newsletter-signup {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #ececec;
    background: #fafbfc;
    border-radius: var(--border-radius);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.dark-theme .newsletter-signup {
    border-top: 1px solid #333;
    background: #232526;
}

.newsletter-signup h3 {
    margin-top: 0;
    color: var(--accent);
    font-family: var(--font-headline);
}

.dark-theme .newsletter-signup h3 {
    color: #ff5252;
}

.newsletter-signup form {
    display: flex;
    margin: 1.2rem 0;
}

.newsletter-signup input {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
}

.dark-theme .newsletter-signup input {
    background: #333;
    color: #e0e0e0;
    border-color: #444;
}

.newsletter-signup button {
    padding: 0.6rem 1.2rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    transition: background-color var(--transition);
}

.newsletter-signup button:hover {
    background: var(--accent-dark);
}

.newsletter-message {
    font-size: 1rem;
    margin: 0.7rem 0;
    height: 1.2em;
}

.newsletter-message.success {
    color: #4caf50;
}

.newsletter-message.error {
    color: #c00;
}

.dark-theme .newsletter-message.success {
    color: #81c784;
}

.dark-theme .newsletter-message.error {
    color: #ff5252;
}

/* Responsive design */
@media (max-width: 900px) {
    main {
        max-width: 100%;
        padding: 0 0.5rem;
    }
}
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    nav ul {
        flex-direction: column;
        gap: 0.7rem;
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition);
    }
    nav.mobile-open ul {
        max-height: 300px;
    }
    .mobile-menu-toggle {
        display: block;
    }
    .search-container {
        position: static;
        transform: none;
        margin: 1rem auto;
        width: 95%;
        max-width: 320px;
    }
    .theme-toggle {
        top: 1.2rem;
        right: 1.2rem;
    }
    .newsletter-signup form {
        flex-direction: column;
    }
    .newsletter-signup input {
        border-radius: 4px;
        margin-bottom: 0.5rem;
    }
    .newsletter-signup button {
        border-radius: 4px;
    }
}