/*
Theme Name: Autonyt Theme
Theme URI: https://autonyt.online
Author: Manus
Author URI: https://manus.im
Description: A fast, SEO-friendly news theme for autonyt.online, focusing on articles, top reads, latest news, and flexible homepage sections.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: autonyt
*/

/* Basic styles will go here */



/* General Body and Typography */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; /* System font stack */
    color: #111; /* Primary text color */
    background-color: #f0f2f5; /* Light neutral background */
    line-height: 1.6;
}

/* Dark Mode Styles */
body.dark-mode {
    color: #f0f2f5; /* Light text color for dark mode */
    background-color: #1a1a1a; /* Dark neutral background */
}

body.dark-mode a {
    color: #e10600; /* Secondary color for links in dark mode */
}

/* Links */
a {
    color: #e10600; /* Secondary color */
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header */
.site-header {
    background-color: #ffffff;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

body.dark-mode .site-header {
    background-color: #222;
    border-bottom-color: #333;
}

.site-branding .site-title a {
    color: #111;
}

body.dark-mode .site-branding .site-title a {
    color: #f0f2f5;
}

/* Main Content Area */
#primary {
    padding: 20px 0;
}

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

/* Article Cards (Compact) */
.compact-card {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out;
}

body.dark-mode .compact-card {
    background-color: #2a2a2a;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.compact-card:hover {
    transform: translateY(-5px);
}

.compact-card .post-thumbnail img {
    width: 100%;
    height: 180px; /* Fixed height for consistency */
    object-fit: cover;
}

.compact-card .post-content {
    padding: 15px;
}

.compact-card .category-label {
    display: inline-block;
    background-color: #e10600;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    margin-bottom: 10px;
}

.compact-card .entry-title {
    font-size: 1.2em;
    margin-top: 0;
    margin-bottom: 10px;
}

.compact-card .entry-title a {
    color: #111;
}

body.dark-mode .compact-card .entry-title a {
    color: #f0f2f5;
}

.compact-card .entry-meta {
    font-size: 0.85em;
    color: #666;
}

body.dark-mode .compact-card .entry-meta {
    color: #bbb;
}

/* Hero Section */
.hero-section {
    margin-bottom: 30px;
}

.hero-section article {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

body.dark-mode .hero-section article {
    background-color: #2a2a2a;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.hero-section .hero-thumbnail img {
    width: 100%;
    height: 400px; /* Larger image for hero */
    object-fit: cover;
}

.hero-section .entry-header, .hero-section .entry-content {
    padding: 20px;
}

.hero-section .entry-title {
    font-size: 2em;
    margin-top: 0;
}

.hero-section .entry-title a {
    color: #111;
}

body.dark-mode .hero-section .entry-title a {
    color: #f0f2f5;
}

.hero-section .entry-meta {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 15px;
}

body.dark-mode .hero-section .entry-meta {
    color: #bbb;
}

/* Dark Mode Toggle */
#dark-mode-toggle {
    background: #eee;
    border: 1px solid #ccc;
    border-radius: 20px;
    width: 50px;
    height: 25px;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    box-sizing: border-box;
    margin-left: 20px; /* Adjust as needed */
}

#dark-mode-toggle span {
    display: block;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    left: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

body.dark-mode #dark-mode-toggle {
    background: #555;
    border-color: #666;
}

body.dark-mode #dark-mode-toggle span {
    left: 28px;
    background: #333;
}

/* Search Form */
.search-form {
    position: relative;
    margin-left: 20px;
}

.search-field {
    border: 1px solid #ccc;
    padding: 8px 12px;
    border-radius: 5px;
    width: 200px;
}

body.dark-mode .search-field {
    background-color: #333;
    border-color: #444;
    color: #f0f2f5;
}

.search-results {
    position: absolute;
    background-color: #fff;
    border: 1px solid #eee;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    list-style: none;
    padding: 0;
    margin: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: none; /* Hidden by default */
}

body.dark-mode .search-results {
    background-color: #2a2a2a;
    border-color: #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.search-results li a {
    display: block;
    padding: 10px 15px;
    color: #111;
}

body.dark-mode .search-results li a {
    color: #f0f2f5;
}

.search-results li a:hover {
    background-color: #f0f0f0;
    text-decoration: none;
}

body.dark-mode .search-results li a:hover {
    background-color: #3a3a3a;
}

/* Ad Slots */
.autonyt-ad-leaderboard,
.autonyt-ad-in-article,
.autonyt-ad-sticky-footer {
    text-align: center;
    margin: 20px auto;
    background-color: #f8f8f8;
    border: 1px dashed #ccc;
    padding: 10px;
    color: #666;
}

body.dark-mode .autonyt-ad-leaderboard,
body.dark-mode .autonyt-ad-in-article,
body.dark-mode .autonyt-ad-sticky-footer {
    background-color: #333;
    border-color: #555;
    color: #bbb;
}

.autonyt-ad-leaderboard img {
    max-width: 728px;
    height: 90px;
}

.autonyt-ad-in-article img {
    max-width: 300px;
    height: 250px;
}

.autonyt-ad-sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    border-top: 1px solid #eee;
    padding: 5px 0;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    z-index: 999;
}

body.dark-mode .autonyt-ad-sticky-footer {
    background-color: #222;
    border-top-color: #333;
}

.autonyt-ad-sticky-footer img {
    max-width: 320px;
    height: 50px;
}

/* Responsive adjustments for sticky footer */
@media (min-width: 768px) {
    .autonyt-ad-sticky-footer {
        display: none; /* Hide on larger screens */
    }
}

/* Mega Menu (Placeholder) */
.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    display: block;
    padding: 10px 15px;
    color: #111;
}

body.dark-mode .main-navigation a {
    color: #f0f2f5;
}

.main-navigation a:hover {
    background-color: #f0f0f0;
}

body.dark-mode .main-navigation a:hover {
    background-color: #3a3a3a;
}

/* Add more styles as needed for other sections and elements */



/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #111;
}

body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, body.dark-mode h4, body.dark-mode h5, body.dark-mode h6 {
    color: #f0f2f5;
}

/* Customizer Colors (placeholders, actual implementation would use Customizer API) */
:root {
    --color-primary: #111;
    --color-secondary: #e10600;
    --color-neutral-light: #f0f2f5;
    --color-neutral-dark: #1a1a1a;
    --color-text-light: #111;
    --color-text-dark: #f0f2f5;
}

body.dark-mode {
    --color-primary: #f0f2f5;
    --color-secondary: #e10600;
    --color-neutral-light: #1a1a1a;
    --color-neutral-dark: #f0f2f5;
    --color-text-light: #f0f2f5;
    --color-text-dark: #111;
}

/* Site-wide layout */
.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-content {
    flex-grow: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

#primary {
    flex: 1;
    min-width: 0; /* Allow flex item to shrink */
}

#secondary {
    flex-basis: 300px; /* Fixed width for sidebar */
    margin-left: 20px;
    padding-top: 20px;
}

@media (max-width: 768px) {
    .site-content {
        flex-direction: column;
    }

    #secondary {
        margin-left: 0;
        order: 1; /* Move sidebar above main content on mobile */
    }

    #primary {
        order: 2;
    }
}

/* Article View (Single Post) */
.single-post .entry-header {
    text-align: center;
    margin-bottom: 30px;
}

.single-post .entry-title {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.single-post .entry-meta {
    font-size: 0.9em;
    color: #666;
}

body.dark-mode .single-post .entry-meta {
    color: #bbb;
}

.single-post .post-thumbnail {
    margin-bottom: 30px;
}

.single-post .post-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.single-post .entry-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.single-post .entry-content h2 {
    margin-top: 40px;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.single-post .entry-content h4 {
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.4em;
}

/* Footer */
.site-footer {
    background-color: #111;
    color: #f0f2f5;
    padding: 20px 0;
    text-align: center;
    margin-top: auto; /* Pushes footer to the bottom */
}

body.dark-mode .site-footer {
    background-color: #000;
}

.site-footer a {
    color: #e10600;
}

.site-footer .site-info {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Dark Mode Toggle Styling */
#dark-mode-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: #eee;
    border: 1px solid #ccc;
    border-radius: 20px;
    width: 50px;
    height: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    box-sizing: border-box;
    transition: background-color 0.3s, border-color 0.3s;
}

#dark-mode-toggle span {
    display: block;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    left: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

body.dark-mode #dark-mode-toggle {
    background: #555;
    border-color: #666;
}

body.dark-mode #dark-mode-toggle span {
    left: 28px;
    background: #333;
}

/* General Section Styling */
section {
    margin-bottom: 40px;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

body.dark-mode section {
    background-color: #2a2a2a;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

section h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2em;
}

.latest-news-grid, .category-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* Search Form Styling */
.search-form {
    display: flex;
    align-items: center;
    position: relative;
}

.search-form label {
    display: none;
}

.search-field {
    flex-grow: 1;
    border: 1px solid #ccc;
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.search-field:focus {
    border-color: #e10600;
    outline: none;
}

.search-submit {
    background-color: #e10600;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 25px;
    margin-left: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-submit:hover {
    background-color: #c00500;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    list-style: none;
    padding: 0;
    margin: 5px 0 0 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: none; /* Hidden by default */
}

body.dark-mode .search-results {
    background-color: #2a2a2a;
    border-color: #333;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.search-results li a {
    display: block;
    padding: 10px 15px;
    color: #111;
    text-decoration: none;
}

body.dark-mode .search-results li a {
    color: #f0f2f5;
}

.search-results li a:hover {
    background-color: #f0f0f0;
}

body.dark-mode .search-results li a:hover {
    background-color: #3a3a3a;
}

/* Navigation */
.main-navigation {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-navigation li a {
    padding: 10px 15px;
    text-transform: uppercase;
    font-weight: bold;
    color: var(--color-text-light);
}

.main-navigation li a:hover {
    background-color: var(--color-secondary);
    color: #fff;
    border-radius: 5px;
}

body.dark-mode .main-navigation li a {
    color: var(--color-text-light);
}

body.dark-mode .main-navigation li a:hover {
    background-color: var(--color-secondary);
    color: #fff;
}

/* Mega Menu - Basic Structure (requires JS for full functionality) */
.main-navigation li.menu-item-has-children > a::after {
    content: '\25BC'; /* Down arrow */
    font-size: 0.7em;
    margin-left: 5px;
}

.main-navigation ul ul {
    display: none;
    position: absolute;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    min-width: 200px;
    z-index: 99;
    flex-direction: column;
}

body.dark-mode .main-navigation ul ul {
    background-color: #2a2a2a;
}

.main-navigation ul ul li a {
    padding: 10px 15px;
    white-space: nowrap;
}

.main-navigation li:hover > ul {
    display: flex;
}

/* Responsive Navigation (Hamburger Menu) */
.menu-toggle {
    display: none; /* Hidden by default on desktop */
}

@media (max-width: 768px) {
    .main-navigation ul {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: #fff;
        position: absolute;
        top: 100%;
        left: 0;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    body.dark-mode .main-navigation ul {
        background-color: #2a2a2a;
    }

    .main-navigation ul.toggled-on {
        display: flex;
    }

    .main-navigation li {
        border-bottom: 1px solid #eee;
    }

    body.dark-mode .main-navigation li {
        border-bottom-color: #333;
    }

    .main-navigation li:last-child {
        border-bottom: none;
    }

    .menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.2em;
        cursor: pointer;
        padding: 10px;
        color: #111;
    }

    body.dark-mode .menu-toggle {
        color: #f0f2f5;
    }

    .site-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 20px;
    }

    .site-branding {
        flex-grow: 1;
    }

    .search-form {
        order: 3;
        width: 100%;
        margin-top: 10px;
    }
}

