/*
Theme Name: Gameslore
Theme URI: 
Author: Senior WP Developer
Author URI: 
Description: Ein maßgeschneidertes, extrem schlankes und professionelles WordPress-Theme für einen modernen Gaming-Blog. Minimalistisch, performant und voll kompatibel.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gameslore
*/

/* ==========================================================================
   1. CSS Variables & Theming
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Montserrat:ital,wght@0,400;0,700;1,700&display=swap');

:root {
	--bg-color: #f8fafc;
	--surface-color: #ffffff;
	--text-main: #0f172a;
	--text-muted: #64748b;
	--accent-color: #f53b57;
	--accent-hover: #d22841;
	--accent-gradient: linear-gradient(130deg, #f53b57 0%, #ad2aaf 80%);
	--accent-secondary: #f8d92f;
	--border-color: #e2e8f0;
	--shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
	--radius: 8px;
	--font-headings: 'Montserrat', sans-serif;
	--font-body: 'Lato', sans-serif;
}

[data-theme="dark"] {
	--bg-color: #06060a; 
	--surface-color: #1a1d1e;
	--text-main: #f8fafc;
	--text-muted: #94a3b8;
	--accent-color: #f53b57;
	--accent-hover: #ff5b73;
	--border-color: #272727;
	--shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   2. Reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; padding: 0; font-family: var(--font-body); background-color: var(--bg-color); color: var(--text-main); line-height: 1.66; font-size: 16px; transition: background-color 0.3s ease, color 0.3s ease; }
h1, h2, h3, h4, h5, h6 { margin-top: 0; margin-bottom: 1rem; font-family: var(--font-headings); font-weight: 700; line-height: 1.2; color: var(--text-main); text-transform: uppercase; }
a { color: var(--accent-color); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; border-radius: var(--radius); }

/* ==========================================================================
   3. Header & Navigation (Fixed Dropdowns)
   ========================================================================== */
.site { display: flex; flex-direction: column; min-height: 100vh; }
.site-header { background-color: var(--surface-color); border-bottom: 4px solid var(--accent-color); padding: 1rem 0; position: relative; z-index: 100;}
.header-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 1.5rem; }
.site-branding { flex-shrink: 0; }
.custom-logo-link { display: block; }
.custom-logo { height: 80px; width: auto; max-width: 100%; object-fit: contain; border-radius: 0; }

.dark-logo { display: none; }
[data-theme="dark"] .dark-logo { display: block; }
[data-theme="dark"] .light-logo { display: none; }

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.main-navigation {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    position: relative;
    order: 3;
}

/* Echter, schlanker Kippschalter für Dark Mode */
.theme-toggle {
    background: #e5e7eb;
    border: none;
    border-radius: 30px;
    width: 44px;
    height: 24px;
    position: relative;
    cursor: pointer;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease;
    outline: none;
    padding: 0;
    margin-left: 0.5rem;
}
.theme-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 2;
}
[data-theme="dark"] .theme-toggle {
    background: var(--accent-color);
}
[data-theme="dark"] .theme-toggle::after {
    transform: translateX(20px);
}
/* Icons verstecken für einen cleanen Schalter-Look */
.theme-toggle .sun-icon, .theme-toggle .moon-icon { display: none; }

/* Hamburger Icon Styles */
.menu-toggle {
    display: block;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}
.hamburger-box {
    width: 24px;
    height: 20px;
    display: inline-block;
    position: relative;
}
.hamburger-inner {
    display: block;
    top: 50%;
    margin-top: -1px;
}
.hamburger-inner, .hamburger-inner::before, .hamburger-inner::after {
    width: 24px;
    height: 2px;
    background-color: var(--text-main);
    border-radius: 2px;
    position: absolute;
    transition: transform 0.2s ease, background-color 0.2s ease;
}
.hamburger-inner::before, .hamburger-inner::after { content: ""; display: block; }
.hamburger-inner::before { top: -8px; }
.hamburger-inner::after { bottom: -8px; }

/* Hamburger Animation X */
.menu-toggle.is-active .hamburger-inner { background-color: transparent; }
.menu-toggle.is-active .hamburger-inner::before { transform: translate3d(0, 8px, 0) rotate(45deg); }
.menu-toggle.is-active .hamburger-inner::after { transform: translate3d(0, -8px, 0) rotate(-45deg); }

/* Mobile Menu Styles */
.main-navigation ul {
    display: none; /* Versteckt auf Mobile bis Toggle aktiv */
    flex-direction: column;
    width: 100%;
    background-color: var(--surface-color);
    padding: 1rem 0;
    margin: 0;
    list-style: none;
}
.main-navigation.toggled ul { display: flex; }
.main-navigation li { margin: 0 0 1rem 0; }
.main-navigation a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: color 0.2s ease;
}
.main-navigation a:hover { color: var(--accent-color); }

.main-navigation a {
    display: block;
    padding: 0.5rem 0;
    color: var(--text-main);
    font-weight: 700;
    text-transform: uppercase;
    font-family: var(--font-headings);
    letter-spacing: 0.09em;
    font-size: 14px;
}
.main-navigation a:hover { color: var(--accent-color); }

/* Sub-Menus (Dropdowns) Mobile Default */
.main-navigation ul ul {
    display: none;
    position: relative; /* WICHTIG: Kein absolute auf Mobile! */
    background-color: transparent;
    padding-left: 1.5rem;
    margin-top: 0.5rem;
    box-shadow: none;
    z-index: 99999;
    border-radius: 0;
    width: 100%;
}

.main-navigation ul li:hover > ul,
.main-navigation ul li.focus > ul {
    display: block;
}
.main-navigation .sub-menu li { width: 100%; }
.main-navigation .sub-menu a {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 400;
}

.theme-toggle { background: none; border: none; cursor: pointer; padding: 0.5rem; color: var(--text-main); border-radius: 50%; }
.theme-toggle:hover { background-color: var(--border-color); }

/* ==========================================================================
   4. Magazine Front Page Layout (Zeen Style)
   ========================================================================== */
.site-main { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 3rem 1.5rem; }

.magazine-layout { display: flex; flex-direction: column; gap: 4rem; }

/* Hero Section */
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; height: auto; }
.hero-item { position: relative; border-radius: var(--radius); overflow: hidden; background-color: var(--border-color); }
.hero-link { display: block; width: 100%; height: 100%; min-height: 250px; }
.hero-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.hero-item:hover img { transform: scale(1.05); }

.hero-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%; padding: 2rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
    color: #fff; display: flex; flex-direction: column; justify-content: flex-end;
}
.hero-cat, .grid-cat {
    background-color: var(--accent-color); color: #fff; font-family: var(--font-headings); font-size: 0.75rem;
    font-weight: 700; text-transform: uppercase; padding: 0.25rem 0.75rem; border-radius: 4px;
    display: inline-block; align-self: flex-start; margin-bottom: 0.5rem;
}
.hero-title { color: #fff; margin-bottom: 0.5rem; font-size: 1.5rem; }
.hero-meta { font-size: 0.85rem; color: #ddd; }
.hero-meta .posted-on { color: var(--accent-secondary); font-family: var(--font-headings); font-weight: 700; }

.section-title { border-bottom: 2px solid var(--accent-color); padding-bottom: 0.5rem; margin-bottom: 2rem; display: inline-block; }

/* Grid */
.post-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.grid-item { background-color: var(--surface-color); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); transition: transform 0.2s ease; }
.grid-item:hover { transform: translateY(-4px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
.grid-item .post-thumbnail { margin: -1.5rem -1.5rem 1.5rem -1.5rem; }
.grid-item .post-thumbnail img { width: 100%; height: 200px; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; }
.grid-item .entry-title { font-size: 1.25rem; }
.grid-item .entry-summary { color: var(--text-muted); font-size: 0.95rem; }

/* ==========================================================================
   4.5 Sidebar & Layout
   ========================================================================== */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

.sidebar .widget {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.sidebar .widget-title {
    font-size: 1.25rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

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

.sidebar ul li {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}
.sidebar ul li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* ==========================================================================
   5. Single Posts
   ========================================================================== */
.entry-header { margin-bottom: 2rem; }
.entry-title { font-size: clamp(1.75rem, 5vw, 3rem); font-weight: 800; text-transform: none; }
.entry-meta { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.5rem; font-family: var(--font-headings); font-weight: 700; text-transform: uppercase; }
.entry-meta .posted-on { color: var(--accent-secondary); }
.entry-content { font-size: 1.125rem; }
.entry-content p { margin-bottom: 1.5rem; }
.entry-content img { width: 100%; height: auto; border-radius: var(--radius); margin-bottom: 1.5rem; }
.entry-content blockquote {
    border-left: 4px solid var(--accent-color); padding-left: 1.5rem; margin-left: 0;
    font-size: 1.25rem; font-style: italic; color: var(--text-main);
    background: rgba(245, 59, 87, 0.05); padding: 1rem 1.5rem; border-radius: 0 var(--radius) var(--radius) 0;
}

button, .button, input[type="submit"] {
    background-image: var(--accent-gradient); color: #fff; border: none; padding: 0.75rem 1.5rem;
    font-family: var(--font-headings); font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.09em; border-radius: 4px; cursor: pointer; transition: opacity 0.2s ease;
}
button:hover, .button:hover, input[type="submit"]:hover { opacity: 0.9; color: #fff; }

/* ==========================================================================
   6. Footer
   ========================================================================== */
.site-footer { background-color: var(--surface-color); border-top: 1px solid var(--border-color); padding: 4rem 1.5rem 2rem; color: var(--text-muted); font-size: 0.95rem; }
.footer-inner { display: grid; grid-template-columns: 1fr; gap: 3rem; max-width: 1440px; margin: 0 auto; }
.footer-column .custom-logo-link { display: inline-block; margin-bottom: 1rem; }
.footer-column .custom-logo { max-height: 60px; height: auto; }
.footer-title { font-size: 1.2rem; color: var(--text-main); margin-bottom: 1.5rem; border-bottom: 2px solid var(--accent-color); padding-bottom: 0.5rem; display: inline-block; }
.footer-menu { list-style: none; padding: 0; margin: 0; }
.footer-menu li { margin-bottom: 0.75rem; }
.footer-menu a { color: var(--text-muted); font-weight: bold; }
.footer-menu a:hover { color: var(--accent-color); padding-left: 0.25rem; transition: padding 0.2s ease, color 0.2s ease; }

/* ==========================================================================
   7. Magazin-Features & Suche
   ========================================================================== */
#reading-progress { position: fixed; top: 0; left: 0; width: 0; height: 4px; background: var(--accent-color); z-index: 9999; transition: width 0.1s ease; }
.widget-area { position: sticky; top: 2rem; }

/* Search Overlay */
.search-toggle {
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s ease;
}
.search-toggle:hover { color: var(--accent-color); }

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.search-overlay.is-active {
    opacity: 1;
    visibility: visible;
}
.search-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: transparent;
    border: none;
    font-size: 4rem;
    color: var(--text-main) !important; /* Erzwingt Schwarz in Light Mode, Weiß in Dark Mode */
    cursor: pointer;
    transition: transform 0.2s ease;
}
.search-close:hover {
    transform: scale(1.1) rotate(90deg);
}
.search-overlay-content {
    width: 100%;
    max-width: 800px;
    padding: 0 2rem;
}
.search-form {
    display: flex;
    border-bottom: 3px solid var(--text-main);
    padding-bottom: 0.5rem;
}
.search-field {
    width: 100%;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-main);
    padding: 1rem 0;
    outline: none;
}
.search-field::placeholder { color: var(--text-muted); }

/* Das native kleine X zum Löschen des Textes anpassen */
input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    height: 24px;
    width: 24px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>');
    background-size: contain;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}
input[type="search"]::-webkit-search-cancel-button:hover { opacity: 1; }
[data-theme="dark"] input[type="search"]::-webkit-search-cancel-button {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>');
}

.search-submit {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
    cursor: pointer;
    padding: 0 1rem;
}
/* Live Search Results */
.live-search-results { margin-top: 2rem; text-align: left; }
.search-loading, .search-no-results, .search-error { font-size: 1.2rem; color: var(--text-muted); }
.live-search-list { list-style: none; padding: 0; margin: 0; }
.live-search-list li { margin-bottom: 1rem; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; }
.live-search-list a { font-size: 1.5rem; color: var(--text-main); text-decoration: none; transition: color 0.2s ease; }
.live-search-list a:hover { color: var(--accent-color); }

@media (min-width: 768px) {
    .search-field { font-size: 3.5rem; }
}

/* ==========================================================================
   8. Media Queries
   ========================================================================== */
@media (min-width: 768px) {
    .site-header { padding: 1rem 3rem; }
    
    .header-controls { order: 3; }
    .menu-toggle { display: none; }
    
    .main-navigation { width: auto; margin: 0 auto 0 2rem; flex-direction: row; align-items: center; order: 2; }
    .main-navigation ul { display: flex; flex-direction: row; padding: 0; background-color: transparent; }
    .main-navigation.toggled ul { display: flex; }
    .main-navigation li { margin: 0 1.5rem 0 0; }
    
    /* Desktop Dropdowns */
    .main-navigation ul ul {
        position: absolute;
        top: 100%;
        left: 0;
        background-color: var(--surface-color);
        min-width: 220px;
        box-shadow: 0 10px 25px rgba(0,0,0,0.1);
        padding: 0.5rem 0;
        margin-top: 0;
        border-radius: var(--radius);
    }
    .main-navigation ul ul li { margin: 0; }
    .main-navigation ul ul a { padding: 0.5rem 1.5rem; }
    
    .post-grid { grid-template-columns: repeat(2, 1fr); }
    .site-main { padding: 4rem 3rem; }
    .footer-inner { grid-template-columns: 2fr 1fr 1fr; }
    .entry-title { font-size: 3rem; }
}

@media (min-width: 992px) {
    .hero-grid { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; height: 450px; }
    .hero-main { grid-row: 1 / 3; }
    .hero-main .hero-title { font-size: 2.5rem; }
    .layout-with-sidebar { grid-template-columns: 3fr 1fr; align-items: start; }
}

/* ==========================================================================
   8. Micro-Animations & Interactivity
   ========================================================================== */
.fade-up-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.fade-up-element.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-item img, .grid-item img {
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-item:hover img, .grid-item:hover img {
    transform: scale(1.03);
}

@media (min-width: 1024px) {
    .post-grid { grid-template-columns: repeat(3, 1fr); }
}
